diff --git a/bin/gollum b/bin/gollum index a3aa6bc1..ba416a87 100755 --- a/bin/gollum +++ b/bin/gollum @@ -105,12 +105,6 @@ MSG opts.on("--no-edit", "Disable the feature of editing pages.") do wiki_options[:allow_editing] = false end - opts.on("--live-preview", "Enable the live preview feature in page editor.") do - wiki_options[:live_preview] = true - end - opts.on("--no-live-preview", "Disable the live preview feature in page editor.") do - wiki_options[:live_preview] = false - end opts.on("--allow-uploads [MODE]", [:dir, :page], "Enable file uploads.", "If set to 'dir', Gollum will store all uploads in the '/uploads/' directory.", "If set to 'page', Gollum will store each upload at the currently edited page.") do |mode| diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 7a951d43..95d51eb3 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -160,18 +160,10 @@ module Precious wiki = wikip.wiki @allow_uploads = wiki.allow_uploads if page = wikip.page - if wiki.live_preview && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent) - live_preview_url = '/livepreview/?page=' + encodeURIComponent(@name) - if @path - live_preview_url << '&path=' + encodeURIComponent(@path) - end - redirect to(live_preview_url) - else @page = page @page.version = wiki.repo.log(wiki.ref, @page.path).first @content = page.text_data mustache :edit - end else redirect to("/create/#{encodeURIComponent(@name)}") end @@ -394,12 +386,6 @@ module Precious mustache :page end - get '/livepreview/' do - wiki = wiki_new - @mathjax = wiki.mathjax - mustache :livepreview, { :layout => false } - end - get '/history/*' do @page = wiki_page(params[:splat].first).page @page_num = [params[:page].to_i, 1].max diff --git a/lib/gollum/public/gollum/livepreview/css/custom.css b/lib/gollum/public/gollum/livepreview/css/custom.css deleted file mode 100644 index 0bcb1358..00000000 --- a/lib/gollum/public/gollum/livepreview/css/custom.css +++ /dev/null @@ -1,132 +0,0 @@ -body { - overflow: hidden; -} - -#editor .ace_sb { - overflow-y: auto !important; -} - -#darkness { - visibility: hidden; - position: absolute; - left: 0px; - top: 0px; - background-color: black; - opacity: 0.8; - z-index: 1001; /* must be > 1000 to overlay ace gutter */ -} - -#commenttoolpanel { - visibility: hidden; - z-index: 1002; /* > 1001 to not be hidden by darkness */ -} - -#comment, #editor { - margin: 0; - padding: 0; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - /* Set font size of both ace editors. */ - font-size: 16px; -} - -/* - Must set ace-line to preserve whitespace in empty lines. - Ace editor sets the height inline. The static highlight ext does not. -
-*/ -#previewframe #contentframe .ace-github .ace_editor.ace_scroller.ace_text-layer .ace_line { - height: 15px; -} - -/* Set comment to have a higher z-index -so editor doesn't display in the background. */ - -#comment { - visibility: hidden; - z-index: 1003; /* > 1002 to not be hidden by toolpanel */ -} - -#contentframe { - margin: 0 auto; - overflow: visible; - width: 90%; -} - -#previewframe { - margin: 0; - padding: 0; - position: absolute; - overflow: auto; - top: 0; - bottom: 0; - left: 10px; - right: 0; -} - -.editor_bg { - position: fixed; - top: 0; - margin: 0; - padding: 0; - background: black; - width: 50%; - height: 100%; - z-index: -2; -} - -.toolpanel_bg { - position: fixed; - background: #666; - top: 0; - height: 30px; - width: 100%; - padding: 5px 0; - margin: 0; - z-index: -1; -} - -/* -- Start from notepag.es -- */ -.toolpanel { - position: fixed; - background: #666; - top: 0; - height: 30px; - width: 50%; - vertical-align: middle; - padding: 5px 0; - margin: 0; - text-align: center; -} - -.toolpanel.edit a.edit { - opacity: 0.4; - /* Make it appear as a link even though save - doesn't have a href attribute. */ - cursor: pointer; - display: inline-block; -} - -.toolpanel a { - color: white; - text-decoration: none; - margin: 0 5px; - display: none; - padding: 4px; - font-family: sans-serif; -} - -.toolpanel a img { - vertical-align: middle; - margin-left: 5px; - margin: 0; - padding: 0; -} - -a img { - border: none; -} -/* -- End from notepag.es -- */ diff --git a/lib/gollum/public/gollum/livepreview/images/cancel_24.png b/lib/gollum/public/gollum/livepreview/images/cancel_24.png deleted file mode 100644 index 98fd3024..00000000 Binary files a/lib/gollum/public/gollum/livepreview/images/cancel_24.png and /dev/null differ diff --git a/lib/gollum/public/gollum/livepreview/images/globe_24.png b/lib/gollum/public/gollum/livepreview/images/globe_24.png deleted file mode 100644 index 8c6ce860..00000000 Binary files a/lib/gollum/public/gollum/livepreview/images/globe_24.png and /dev/null differ diff --git a/lib/gollum/public/gollum/livepreview/images/lr_24.png b/lib/gollum/public/gollum/livepreview/images/lr_24.png deleted file mode 100644 index 67adce93..00000000 Binary files a/lib/gollum/public/gollum/livepreview/images/lr_24.png and /dev/null differ diff --git a/lib/gollum/public/gollum/livepreview/images/save_24.png b/lib/gollum/public/gollum/livepreview/images/save_24.png deleted file mode 100644 index daae94fc..00000000 Binary files a/lib/gollum/public/gollum/livepreview/images/save_24.png and /dev/null differ diff --git a/lib/gollum/public/gollum/livepreview/images/savecomment_24.png b/lib/gollum/public/gollum/livepreview/images/savecomment_24.png deleted file mode 100644 index 38d7d41a..00000000 Binary files a/lib/gollum/public/gollum/livepreview/images/savecomment_24.png and /dev/null differ diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js deleted file mode 100644 index 6c8a6126..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js +++ /dev/null @@ -1,129 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/** - * The main class required to set up an Ace instance in the browser. - * - * @class Ace - **/ - -define(function(require, exports, module) { -"use strict"; - -require("./lib/fixoldbrowsers"); - -var dom = require("./lib/dom"); -var event = require("./lib/event"); - -var Editor = require("./editor").Editor; -var EditSession = require("./edit_session").EditSession; -var UndoManager = require("./undomanager").UndoManager; -var Renderer = require("./virtual_renderer").VirtualRenderer; - -// The following require()s are for inclusion in the built ace file -require("./worker/worker_client"); -require("./keyboard/hash_handler"); -require("./placeholder"); -require("./multi_select"); -require("./mode/folding/fold_mode"); -require("./theme/textmate"); -require("./ext/error_marker"); - -exports.config = require("./config"); - -/** - * Provides access to require in packed noconflict mode - * @param {String} moduleName - * @returns {Object} - * - **/ -exports.require = require; - -/** - * Embeds the Ace editor into the DOM, at the element provided by `el`. - * @param {String | DOMElement} el Either the id of an element, or the element itself - * - **/ -exports.edit = function(el) { - if (typeof(el) == "string") { - var _id = el; - el = document.getElementById(_id); - if (!el) - throw new Error("ace.edit can't find div #" + _id); - } - - if (el && el.env && el.env.editor instanceof Editor) - return el.env.editor; - - var value = ""; - if (el && /input|textarea/i.test(el.tagName)) { - var oldNode = el; - value = oldNode.value; - el = dom.createElement("pre"); - oldNode.parentNode.replaceChild(el, oldNode); - } else { - value = dom.getInnerText(el); - el.innerHTML = ''; - } - - var doc = exports.createEditSession(value); - - var editor = new Editor(new Renderer(el)); - editor.setSession(doc); - - var env = { - document: doc, - editor: editor, - onResize: editor.resize.bind(editor, null) - }; - if (oldNode) env.textarea = oldNode; - event.addListener(window, "resize", env.onResize); - editor.on("destroy", function() { - event.removeListener(window, "resize", env.onResize); - env.editor.container.env = null; // prevent memory leak on old ie - }); - editor.container.env = editor.env = env; - return editor; -}; - -/** - * Creates a new [[EditSession]], and returns the associated [[Document]]. - * @param {Document | String} text {:textParam} - * @param {TextMode} mode {:modeParam} - * - **/ -exports.createEditSession = function(text, mode) { - var doc = new EditSession(text, mode); - doc.setUndoManager(new UndoManager()); - return doc; -} -exports.EditSession = EditSession; -exports.UndoManager = UndoManager; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js deleted file mode 100644 index 9f5e159d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js +++ /dev/null @@ -1,245 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -/** - * - * Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated. - * - * @class Anchor - **/ - -/** - * Creates a new `Anchor` and associates it with a document. - * - * @param {Document} doc The document to associate with the anchor - * @param {Number} row The starting row position - * @param {Number} column The starting column position - * - * @constructor - **/ - -var Anchor = exports.Anchor = function(doc, row, column) { - this.$onChange = this.onChange.bind(this); - this.attach(doc); - - if (typeof column == "undefined") - this.setPosition(row.row, row.column); - else - this.setPosition(row, column); -}; - -(function() { - - oop.implement(this, EventEmitter); - - /** - * Returns an object identifying the `row` and `column` position of the current anchor. - * @returns {Object} - **/ - this.getPosition = function() { - return this.$clipPositionToDocument(this.row, this.column); - }; - - /** - * - * Returns the current document. - * @returns {Document} - **/ - this.getDocument = function() { - return this.document; - }; - - /** - * experimental: allows anchor to stick to the next on the left - */ - this.$insertRight = false; - /** - * Fires whenever the anchor position changes. - * - * Both of these objects have a `row` and `column` property corresponding to the position. - * - * Events that can trigger this function include [[Anchor.setPosition `setPosition()`]]. - * - * @event change - * @param {Object} e An object containing information about the anchor position. It has two properties: - * - `old`: An object describing the old Anchor position - * - `value`: An object describing the new Anchor position - * - **/ - 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; - var start = range.start; - var end = range.end; - - if (delta.action === "insertText") { - if (start.row === row && start.column <= column) { - if (start.column === column && this.$insertRight) { - // do nothing - } else if (start.row === end.row) { - column += end.column - start.column; - } else { - column -= start.column; - row += end.row - start.row; - } - } else if (start.row !== end.row && start.row < row) { - row += end.row - start.row; - } - } else if (delta.action === "insertLines") { - if (start.row === row && column === 0 && this.$insertRight) { - // do nothing - } - else if (start.row <= row) { - row += end.row - start.row; - } - } else if (delta.action === "removeText") { - if (start.row === row && start.column < column) { - if (end.column >= column) - column = start.column; - else - column = Math.max(0, column - (end.column - start.column)); - - } else if (start.row !== end.row && start.row < row) { - if (end.row === row) - column = Math.max(0, column - end.column) + start.column; - row -= (end.row - start.row); - } else if (end.row === row) { - row -= end.row - start.row; - column = Math.max(0, column - end.column) + start.column; - } - } else if (delta.action == "removeLines") { - if (start.row <= row) { - if (end.row <= row) - row -= end.row - start.row; - else { - row = start.row; - column = 0; - } - } - } - - this.setPosition(row, column, true); - }; - - /** - * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. - * @param {Number} row The row index to move the anchor to - * @param {Number} column The column index to move the anchor to - * @param {Boolean} noClip Identifies if you want the position to be clipped - * - **/ - 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._signal("change", { - old: old, - value: pos - }); - }; - - /** - * When called, the `"change"` event listener is removed. - * - **/ - this.detach = function() { - this.document.removeEventListener("change", this.$onChange); - }; - this.attach = function(doc) { - this.document = doc || this.document; - this.document.on("change", this.$onChange); - }; - - /** - * Clips the anchor position to the specified row and column. - * @param {Number} row The row index to clip the anchor to - * @param {Number} column The column index to clip the anchor to - * - **/ - 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); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js deleted file mode 100644 index b5c62941..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +++ /dev/null @@ -1,223 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var Document = require("./document").Document; -var Anchor = require("./anchor").Anchor; -var Range = require("./range").Range; -var assert = require("./test/assertions"); - -module.exports = { - - "test create anchor" : function() { - var doc = new Document("juhu"); - var anchor = new Anchor(doc, 0, 0); - - assert.position(anchor.getPosition(), 0, 0); - assert.equal(anchor.getDocument(), doc); - }, - - "test insert text in same row before cursor should move anchor column": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.insert({row: 1, column: 1}, "123"); - assert.position(anchor.getPosition(), 1, 7); - }, - - "test insert text at anchor should not move anchor when insertRight is true": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - anchor.$insertRight = true; - - doc.insert({row: 1, column: 4}, "123"); - assert.position(anchor.getPosition(), 1, 4); - }, - - "test insert lines before cursor should move anchor row": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.insertLines(1, ["123", "456"]); - assert.position(anchor.getPosition(), 3, 4); - }, - - "test insert lines at anchor position should move anchor down": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 0); - - doc.insertLines(1, ["line"]); - assert.position(anchor.getPosition(), 2, 0); - }, - - "test insert lines at anchor position should not move anchor down when insertRight is true and column is 0": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 0); - anchor.$insertRight = true; - - doc.insertLines(1, ["line"]); - assert.position(anchor.getPosition(), 1, 0); - }, - - "test insert lines at anchor row should move anchor down when column > 0": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 2); - anchor.$insertRight = true; - - doc.insertLines(1, ["line"]); - assert.position(anchor.getPosition(), 2, 2); - }, - - "test insert new line before cursor should move anchor column": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.insertNewLine({row: 0, column: 0}); - assert.position(anchor.getPosition(), 2, 4); - }, - - "test insert new line in anchor line before anchor should move anchor column and row": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.insertNewLine({row: 1, column: 2}); - assert.position(anchor.getPosition(), 2, 2); - }, - - "test delete text in anchor line before anchor should move anchor column": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.remove(new Range(1, 1, 1, 3)); - assert.position(anchor.getPosition(), 1, 2); - }, - - "test remove range which contains the anchor should move the anchor to the start of the range": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 0, 3); - - doc.remove(new Range(0, 1, 1, 3)); - assert.position(anchor.getPosition(), 0, 1); - }, - - "test delete character before the anchor should have no effect": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.remove(new Range(1, 4, 1, 5)); - assert.position(anchor.getPosition(), 1, 4); - }, - - "test delete lines in anchor line before anchor should move anchor row": function() { - var doc = new Document("juhu\n1\n2\nkinners"); - var anchor = new Anchor(doc, 3, 4); - - doc.removeLines(1, 2); - assert.position(anchor.getPosition(), 1, 4); - }, - - "test remove new line before the cursor": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.removeNewLine(0); - assert.position(anchor.getPosition(), 0, 8); - }, - - "test delete range which contains the anchor should move anchor to the end of the range": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - - doc.remove(new Range(0, 2, 1, 2)); - assert.position(anchor.getPosition(), 0, 4); - }, - - "test delete line which contains the anchor should move anchor to the end of the range": function() { - var doc = new Document("juhu\nkinners\n123"); - var anchor = new Anchor(doc, 1, 5); - - doc.removeLines(1, 1); - assert.position(anchor.getPosition(), 1, 0); - }, - - "test remove after the anchor should have no effect": function() { - var doc = new Document("juhu\nkinners\n123"); - var anchor = new Anchor(doc, 1, 2); - - doc.remove(new Range(1, 4, 2, 2)); - assert.position(anchor.getPosition(), 1, 2); - }, - - "test anchor changes triggered by document changes should emit change event": function(next) { - var doc = new Document("juhu\nkinners\n123"); - var anchor = new Anchor(doc, 1, 5); - - anchor.on("change", function(e) { - assert.position(anchor.getPosition(), 0, 0); - next(); - }); - - doc.remove(new Range(0, 0, 2, 1)); - }, - - "test only fire change event if position changes": function() { - var doc = new Document("juhu\nkinners\n123"); - var anchor = new Anchor(doc, 1, 5); - - anchor.on("change", function(e) { - assert.fail(); - }); - - doc.remove(new Range(2, 0, 2, 1)); - }, - - "test insert/remove lines at the end of the document": function() { - var doc = new Document("juhu\nkinners\n123"); - var anchor = new Anchor(doc, 2, 4); - - doc.removeLines(0, 3); - assert.position(anchor.getPosition(), 0, 0); - doc.insertLines(0, ["a", "b", "c"]); - assert.position(anchor.getPosition(), 3, 0); - assert.equal(doc.getValue(), "a\nb\nc\n"); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete.js deleted file mode 100644 index 460a62e6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete.js +++ /dev/null @@ -1,497 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var HashHandler = require("./keyboard/hash_handler").HashHandler; -var AcePopup = require("./autocomplete/popup").AcePopup; -var util = require("./autocomplete/util"); -var event = require("./lib/event"); -var lang = require("./lib/lang"); -var dom = require("./lib/dom"); -var snippetManager = require("./snippets").snippetManager; - -var Autocomplete = function() { - this.autoInsert = false; - this.autoSelect = true; - this.exactMatch = false; - this.gatherCompletionsId = 0; - this.keyboardHandler = new HashHandler(); - this.keyboardHandler.bindKeys(this.commands); - - this.blurListener = this.blurListener.bind(this); - this.changeListener = this.changeListener.bind(this); - this.mousedownListener = this.mousedownListener.bind(this); - this.mousewheelListener = this.mousewheelListener.bind(this); - - this.changeTimer = lang.delayedCall(function() { - this.updateCompletions(true); - }.bind(this)); - - this.tooltipTimer = lang.delayedCall(this.updateDocTooltip.bind(this), 50); -}; - -(function() { - - this.$init = function() { - this.popup = new AcePopup(document.body || document.documentElement); - this.popup.on("click", function(e) { - this.insertMatch(); - e.stop(); - }.bind(this)); - this.popup.focus = this.editor.focus.bind(this.editor); - this.popup.on("show", this.tooltipTimer.bind(null, null)); - this.popup.on("select", this.tooltipTimer.bind(null, null)); - this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null)); - return this.popup; - }; - - this.getPopup = function() { - return this.popup || this.$init(); - }; - - this.openPopup = function(editor, prefix, keepPopupPosition) { - if (!this.popup) - this.$init(); - - this.popup.setData(this.completions.filtered); - - editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - - var renderer = editor.renderer; - this.popup.setRow(this.autoSelect ? 0 : -1); - if (!keepPopupPosition) { - this.popup.setTheme(editor.getTheme()); - this.popup.setFontSize(editor.getFontSize()); - - var lineHeight = renderer.layerConfig.lineHeight; - - var pos = renderer.$cursorLayer.getPixelPosition(this.base, true); - pos.left -= this.popup.getTextLeftOffset(); - - var rect = editor.container.getBoundingClientRect(); - pos.top += rect.top - renderer.layerConfig.offset; - pos.left += rect.left - editor.renderer.scrollLeft; - pos.left += renderer.$gutterLayer.gutterWidth; - - this.popup.show(pos, lineHeight); - } else if (keepPopupPosition && !prefix) { - this.detach(); - } - }; - - this.detach = function() { - this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); - this.editor.off("changeSelection", this.changeListener); - this.editor.off("blur", this.blurListener); - this.editor.off("mousedown", this.mousedownListener); - this.editor.off("mousewheel", this.mousewheelListener); - this.changeTimer.cancel(); - this.hideDocTooltip(); - - this.gatherCompletionsId += 1; - if (this.popup && this.popup.isOpen) - this.popup.hide(); - - if (this.base) - this.base.detach(); - this.activated = false; - this.completions = this.base = null; - }; - - this.changeListener = function(e) { - var cursor = this.editor.selection.lead; - if (cursor.row != this.base.row || cursor.column < this.base.column) { - this.detach(); - } - if (this.activated) - this.changeTimer.schedule(); - else - this.detach(); - }; - - this.blurListener = function(e) { - // we have to check if activeElement is a child of popup because - // on IE preventDefault doesn't stop scrollbar from being focussed - var el = document.activeElement; - var text = this.editor.textInput.getElement() - if (el != text && el.parentNode != this.popup.container - && el != this.tooltipNode && e.relatedTarget != this.tooltipNode - && e.relatedTarget != text - ) { - this.detach(); - } - }; - - this.mousedownListener = function(e) { - this.detach(); - }; - - this.mousewheelListener = function(e) { - this.detach(); - }; - - this.goTo = function(where) { - var row = this.popup.getRow(); - var max = this.popup.session.getLength() - 1; - - switch(where) { - case "up": row = row <= 0 ? max : row - 1; break; - case "down": row = row >= max ? -1 : row + 1; break; - case "start": row = 0; break; - case "end": row = max; break; - } - - this.popup.setRow(row); - }; - - this.insertMatch = function(data) { - if (!data) - data = this.popup.getData(this.popup.getRow()); - if (!data) - return false; - - if (data.completer && data.completer.insertMatch) { - data.completer.insertMatch(this.editor, data); - } else { - if (this.completions.filterText) { - var ranges = this.editor.selection.getAllRanges(); - for (var i = 0, range; range = ranges[i]; i++) { - range.start.column -= this.completions.filterText.length; - this.editor.session.remove(range); - } - } - if (data.snippet) - snippetManager.insertSnippet(this.editor, data.snippet); - else - this.editor.execCommand("insertstring", data.value || data); - } - this.detach(); - }; - - - this.commands = { - "Up": function(editor) { editor.completer.goTo("up"); }, - "Down": function(editor) { editor.completer.goTo("down"); }, - "Ctrl-Up|Ctrl-Home": function(editor) { editor.completer.goTo("start"); }, - "Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); }, - - "Esc": function(editor) { editor.completer.detach(); }, - "Space": function(editor) { editor.completer.detach(); editor.insert(" ");}, - "Return": function(editor) { return editor.completer.insertMatch(); }, - "Shift-Return": function(editor) { editor.completer.insertMatch(true); }, - "Tab": function(editor) { - var result = editor.completer.insertMatch(); - if (!result && !editor.tabstopManager) - editor.completer.goTo("down"); - else - return result; - }, - - "PageUp": function(editor) { editor.completer.popup.gotoPageUp(); }, - "PageDown": function(editor) { editor.completer.popup.gotoPageDown(); } - }; - - this.gatherCompletions = function(editor, callback) { - var session = editor.getSession(); - var pos = editor.getCursorPosition(); - - var line = session.getLine(pos.row); - var prefix = util.retrievePrecedingIdentifier(line, pos.column); - - this.base = session.doc.createAnchor(pos.row, pos.column - prefix.length); - this.base.$insertRight = true; - - var matches = []; - var total = editor.completers.length; - editor.completers.forEach(function(completer, i) { - completer.getCompletions(editor, session, pos, prefix, function(err, results) { - if (!err) - matches = matches.concat(results); - // Fetch prefix again, because they may have changed by now - var pos = editor.getCursorPosition(); - var line = session.getLine(pos.row); - callback(null, { - prefix: util.retrievePrecedingIdentifier(line, pos.column, results[0] && results[0].identifierRegex), - matches: matches, - finished: (--total === 0) - }); - }); - }); - return true; - }; - - this.showPopup = function(editor) { - if (this.editor) - this.detach(); - - this.activated = true; - - this.editor = editor; - if (editor.completer != this) { - if (editor.completer) - editor.completer.detach(); - editor.completer = this; - } - - editor.on("changeSelection", this.changeListener); - editor.on("blur", this.blurListener); - editor.on("mousedown", this.mousedownListener); - editor.on("mousewheel", this.mousewheelListener); - - this.updateCompletions(); - }; - - this.updateCompletions = function(keepPopupPosition) { - if (keepPopupPosition && this.base && this.completions) { - var pos = this.editor.getCursorPosition(); - var prefix = this.editor.session.getTextRange({start: this.base, end: pos}); - if (prefix == this.completions.filterText) - return; - this.completions.setFilter(prefix); - if (!this.completions.filtered.length) - return this.detach(); - if (this.completions.filtered.length == 1 - && this.completions.filtered[0].value == prefix - && !this.completions.filtered[0].snippet) - return this.detach(); - this.openPopup(this.editor, prefix, keepPopupPosition); - return; - } - - // Save current gatherCompletions session, session is close when a match is insert - var _id = this.gatherCompletionsId; - this.gatherCompletions(this.editor, function(err, results) { - // Only detach if result gathering is finished - var detachIfFinished = function() { - if (!results.finished) return; - return this.detach(); - }.bind(this); - - var prefix = results.prefix; - var matches = results && results.matches; - - if (!matches || !matches.length) - return detachIfFinished(); - - // Wrong prefix or wrong session -> ignore - if (prefix.indexOf(results.prefix) !== 0 || _id != this.gatherCompletionsId) - return; - - this.completions = new FilteredList(matches); - - if (this.exactMatch) - this.completions.exactMatch = true; - - this.completions.setFilter(prefix); - var filtered = this.completions.filtered; - - // No results - if (!filtered.length) - return detachIfFinished(); - - // One result equals to the prefix - if (filtered.length == 1 && filtered[0].value == prefix && !filtered[0].snippet) - return detachIfFinished(); - - // Autoinsert if one result - if (this.autoInsert && filtered.length == 1 && results.finished) - return this.insertMatch(filtered[0]); - - this.openPopup(this.editor, prefix, keepPopupPosition); - }.bind(this)); - }; - - this.cancelContextMenu = function() { - this.editor.$mouseHandler.cancelContextMenu(); - }; - - this.updateDocTooltip = function() { - var popup = this.popup; - var all = popup.data; - var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]); - var doc = null; - if (!selected || !this.editor || !this.popup.isOpen) - return this.hideDocTooltip(); - this.editor.completers.some(function(completer) { - if (completer.getDocTooltip) - doc = completer.getDocTooltip(selected); - return doc; - }); - if (!doc) - doc = selected; - - if (typeof doc == "string") - doc = {docText: doc} - if (!doc || !(doc.docHTML || doc.docText)) - return this.hideDocTooltip(); - this.showDocTooltip(doc); - }; - - this.showDocTooltip = function(item) { - if (!this.tooltipNode) { - this.tooltipNode = dom.createElement("div"); - this.tooltipNode.className = "ace_tooltip ace_doc-tooltip"; - this.tooltipNode.style.margin = 0; - this.tooltipNode.style.pointerEvents = "auto"; - this.tooltipNode.tabIndex = -1; - this.tooltipNode.onblur = this.blurListener.bind(this); - } - - var tooltipNode = this.tooltipNode; - if (item.docHTML) { - tooltipNode.innerHTML = item.docHTML; - } else if (item.docText) { - tooltipNode.textContent = item.docText; - } - - if (!tooltipNode.parentNode) - document.body.appendChild(tooltipNode); - var popup = this.popup; - var rect = popup.container.getBoundingClientRect(); - tooltipNode.style.top = popup.container.style.top; - tooltipNode.style.bottom = popup.container.style.bottom; - - if (window.innerWidth - rect.right < 320) { - tooltipNode.style.right = window.innerWidth - rect.left + "px"; - tooltipNode.style.left = ""; - } else { - tooltipNode.style.left = (rect.right + 1) + "px"; - tooltipNode.style.right = ""; - } - tooltipNode.style.display = "block"; - }; - - this.hideDocTooltip = function() { - this.tooltipTimer.cancel(); - if (!this.tooltipNode) return; - var el = this.tooltipNode; - if (!this.editor.isFocused() && document.activeElement == el) - this.editor.focus(); - this.tooltipNode = null; - if (el.parentNode) - el.parentNode.removeChild(el); - }; - -}).call(Autocomplete.prototype); - -Autocomplete.startCommand = { - name: "startAutocomplete", - exec: function(editor) { - if (!editor.completer) - editor.completer = new Autocomplete(); - editor.completer.autoInsert = false; - editor.completer.autoSelect = true; - editor.completer.showPopup(editor); - // prevent ctrl-space opening context menu on firefox on mac - editor.completer.cancelContextMenu(); - }, - bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" -}; - -var FilteredList = function(array, filterText, mutateData) { - this.all = array; - this.filtered = array; - this.filterText = filterText || ""; - this.exactMatch = false; -}; -(function(){ - this.setFilter = function(str) { - if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0) - var matches = this.filtered; - else - var matches = this.all; - - this.filterText = str; - matches = this.filterCompletions(matches, this.filterText); - matches = matches.sort(function(a, b) { - return b.exactMatch - a.exactMatch || b.score - a.score; - }); - - // make unique - var prev = null; - matches = matches.filter(function(item){ - var caption = item.snippet || item.caption || item.value; - if (caption === prev) return false; - prev = caption; - return true; - }); - - this.filtered = matches; - }; - this.filterCompletions = function(items, needle) { - var results = []; - var upper = needle.toUpperCase(); - var lower = needle.toLowerCase(); - loop: for (var i = 0, item; item = items[i]; i++) { - var caption = item.value || item.caption || item.snippet; - if (!caption) continue; - var lastIndex = -1; - var matchMask = 0; - var penalty = 0; - var index, distance; - - if (this.exactMatch) { - if (needle !== caption.substr(0, needle.length)) - continue loop; - }else{ - // caption char iteration is faster in Chrome but slower in Firefox, so lets use indexOf - for (var j = 0; j < needle.length; j++) { - // TODO add penalty on case mismatch - var i1 = caption.indexOf(lower[j], lastIndex + 1); - var i2 = caption.indexOf(upper[j], lastIndex + 1); - index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2; - if (index < 0) - continue loop; - distance = index - lastIndex - 1; - if (distance > 0) { - // first char mismatch should be more sensitive - if (lastIndex === -1) - penalty += 10; - penalty += distance; - } - matchMask = matchMask | (1 << index); - lastIndex = index; - } - } - item.matchMask = matchMask; - item.exactMatch = penalty ? 0 : 1; - item.score = (item.score || 0) - penalty; - results.push(item); - } - return results; - }; -}).call(FilteredList.prototype); - -exports.Autocomplete = Autocomplete; -exports.FilteredList = FilteredList; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/popup.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/popup.js deleted file mode 100644 index 862a1c5e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/popup.js +++ /dev/null @@ -1,341 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("../edit_session").EditSession; -var Renderer = require("../virtual_renderer").VirtualRenderer; -var Editor = require("../editor").Editor; -var Range = require("../range").Range; -var event = require("../lib/event"); -var lang = require("../lib/lang"); -var dom = require("../lib/dom"); - -var $singleLineEditor = function(el) { - var renderer = new Renderer(el); - - renderer.$maxLines = 4; - - var editor = new Editor(renderer); - - editor.setHighlightActiveLine(false); - editor.setShowPrintMargin(false); - editor.renderer.setShowGutter(false); - editor.renderer.setHighlightGutterLine(false); - - editor.$mouseHandler.$focusWaitTimout = 0; - editor.$highlightTagPending = true; - - return editor; -}; - -var AcePopup = function(parentNode) { - var el = dom.createElement("div"); - var popup = new $singleLineEditor(el); - - if (parentNode) - parentNode.appendChild(el); - el.style.display = "none"; - popup.renderer.content.style.cursor = "default"; - popup.renderer.setStyle("ace_autocomplete"); - - popup.setOption("displayIndentGuides", false); - popup.setOption("dragDelay", 150); - - var noop = function(){}; - - popup.focus = noop; - popup.$isFocused = true; - - popup.renderer.$cursorLayer.restartTimer = noop; - popup.renderer.$cursorLayer.element.style.opacity = 0; - - popup.renderer.$maxLines = 8; - popup.renderer.$keepTextAreaAtCursor = false; - - popup.setHighlightActiveLine(false); - // set default highlight color - popup.session.highlight(""); - popup.session.$searchHighlight.clazz = "ace_highlight-marker"; - - popup.on("mousedown", function(e) { - var pos = e.getDocumentPosition(); - popup.selection.moveToPosition(pos); - selectionMarker.start.row = selectionMarker.end.row = pos.row; - e.stop(); - }); - - var lastMouseEvent; - var hoverMarker = new Range(-1,0,-1,Infinity); - var selectionMarker = new Range(-1,0,-1,Infinity); - selectionMarker.id = popup.session.addMarker(selectionMarker, "ace_active-line", "fullLine"); - popup.setSelectOnHover = function(val) { - if (!val) { - hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine"); - } else if (hoverMarker.id) { - popup.session.removeMarker(hoverMarker.id); - hoverMarker.id = null; - } - }; - popup.setSelectOnHover(false); - popup.on("mousemove", function(e) { - if (!lastMouseEvent) { - lastMouseEvent = e; - return; - } - if (lastMouseEvent.x == e.x && lastMouseEvent.y == e.y) { - return; - } - lastMouseEvent = e; - lastMouseEvent.scrollTop = popup.renderer.scrollTop; - var row = lastMouseEvent.getDocumentPosition().row; - if (hoverMarker.start.row != row) { - if (!hoverMarker.id) - popup.setRow(row); - setHoverMarker(row); - } - }); - popup.renderer.on("beforeRender", function() { - if (lastMouseEvent && hoverMarker.start.row != -1) { - lastMouseEvent.$pos = null; - var row = lastMouseEvent.getDocumentPosition().row; - if (!hoverMarker.id) - popup.setRow(row); - setHoverMarker(row, true); - } - }); - popup.renderer.on("afterRender", function() { - var row = popup.getRow(); - var t = popup.renderer.$textLayer; - var selected = t.element.childNodes[row - t.config.firstRow]; - if (selected == t.selectedNode) - return; - if (t.selectedNode) - dom.removeCssClass(t.selectedNode, "ace_selected"); - t.selectedNode = selected; - if (selected) - dom.addCssClass(selected, "ace_selected"); - }); - var hideHoverMarker = function() { setHoverMarker(-1) }; - var setHoverMarker = function(row, suppressRedraw) { - if (row !== hoverMarker.start.row) { - hoverMarker.start.row = hoverMarker.end.row = row; - if (!suppressRedraw) - popup.session._emit("changeBackMarker"); - popup._emit("changeHoverMarker"); - } - }; - popup.getHoveredRow = function() { - return hoverMarker.start.row; - }; - - event.addListener(popup.container, "mouseout", hideHoverMarker); - popup.on("hide", hideHoverMarker); - popup.on("changeSelection", hideHoverMarker); - - popup.session.doc.getLength = function() { - return popup.data.length; - }; - popup.session.doc.getLine = function(i) { - var data = popup.data[i]; - if (typeof data == "string") - return data; - return (data && data.value) || ""; - }; - - var bgTokenizer = popup.session.bgTokenizer; - bgTokenizer.$tokenizeRow = function(row) { - var data = popup.data[row]; - var tokens = []; - if (!data) - return tokens; - if (typeof data == "string") - data = {value: data}; - if (!data.caption) - data.caption = data.value || data.name; - - var last = -1; - var flag, c; - for (var i = 0; i < data.caption.length; i++) { - c = data.caption[i]; - flag = data.matchMask & (1 << i) ? 1 : 0; - if (last !== flag) { - tokens.push({type: data.className || "" + ( flag ? "completion-highlight" : ""), value: c}); - last = flag; - } else { - tokens[tokens.length - 1].value += c; - } - } - - if (data.meta) { - var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth; - if (data.meta.length + data.caption.length < maxW - 2) - tokens.push({type: "rightAlignedText", value: data.meta}); - } - return tokens; - }; - bgTokenizer.$updateOnChange = noop; - bgTokenizer.start = noop; - - popup.session.$computeWidth = function() { - return this.screenWidth = 0; - }; - - popup.$blockScrolling = Infinity; - - // public - popup.isOpen = false; - popup.isTopdown = false; - - popup.data = []; - popup.setData = function(list) { - popup.data = list || []; - popup.setValue(lang.stringRepeat("\n", list.length), -1); - popup.setRow(0); - }; - popup.getData = function(row) { - return popup.data[row]; - }; - - popup.getRow = function() { - return selectionMarker.start.row; - }; - popup.setRow = function(line) { - line = Math.max(-1, Math.min(this.data.length, line)); - if (selectionMarker.start.row != line) { - popup.selection.clearSelection(); - selectionMarker.start.row = selectionMarker.end.row = line || 0; - popup.session._emit("changeBackMarker"); - popup.moveCursorTo(line || 0, 0); - if (popup.isOpen) - popup._signal("select"); - } - }; - - popup.on("changeSelection", function() { - if (popup.isOpen) - popup.setRow(popup.selection.lead.row); - popup.renderer.scrollCursorIntoView(); - }); - - popup.hide = function() { - this.container.style.display = "none"; - this._signal("hide"); - popup.isOpen = false; - }; - popup.show = function(pos, lineHeight, topdownOnly) { - var el = this.container; - var screenHeight = window.innerHeight; - var screenWidth = window.innerWidth; - var renderer = this.renderer; - // var maxLines = Math.min(renderer.$maxLines, this.session.getLength()); - var maxH = renderer.$maxLines * lineHeight * 1.4; - var top = pos.top + this.$borderSize; - if (top + maxH > screenHeight - lineHeight && !topdownOnly) { - el.style.top = ""; - el.style.bottom = screenHeight - top + "px"; - popup.isTopdown = false; - } else { - top += lineHeight; - el.style.top = top + "px"; - el.style.bottom = ""; - popup.isTopdown = true; - } - - el.style.display = ""; - this.renderer.$textLayer.checkForSizeChanges(); - - var left = pos.left; - if (left + el.offsetWidth > screenWidth) - left = screenWidth - el.offsetWidth; - - el.style.left = left + "px"; - - this._signal("show"); - lastMouseEvent = null; - popup.isOpen = true; - }; - - popup.getTextLeftOffset = function() { - return this.$borderSize + this.renderer.$padding + this.$imageSize; - }; - - popup.$imageSize = 0; - popup.$borderSize = 1; - - return popup; -}; - -dom.importCssString("\ -.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\ - background-color: #CAD6FA;\ - z-index: 1;\ -}\ -.ace_editor.ace_autocomplete .ace_line-hover {\ - border: 1px solid #abbffe;\ - margin-top: -1px;\ - background: rgba(233,233,253,0.4);\ -}\ -.ace_editor.ace_autocomplete .ace_line-hover {\ - position: absolute;\ - z-index: 2;\ -}\ -.ace_editor.ace_autocomplete .ace_scroller {\ - background: none;\ - border: none;\ - box-shadow: none;\ -}\ -.ace_rightAlignedText {\ - color: gray;\ - display: inline-block;\ - position: absolute;\ - right: 4px;\ - text-align: right;\ - z-index: -1;\ -}\ -.ace_editor.ace_autocomplete .ace_completion-highlight{\ - color: #000;\ - text-shadow: 0 0 0.01em;\ -}\ -.ace_editor.ace_autocomplete {\ - width: 280px;\ - z-index: 200000;\ - background: #fbfbfb;\ - color: #444;\ - border: 1px lightgray solid;\ - position: fixed;\ - box-shadow: 2px 3px 5px rgba(0,0,0,.2);\ - line-height: 1.4;\ -}"); - -exports.AcePopup = AcePopup; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/text_completer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/text_completer.js deleted file mode 100644 index 17a4bdad..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/text_completer.js +++ /dev/null @@ -1,78 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - var Range = require("../range").Range; - - var splitRegex = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/; - - function getWordIndex(doc, pos) { - var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos)); - return textBefore.split(splitRegex).length - 1; - } - - /** - * Does a distance analysis of the word `prefix` at position `pos` in `doc`. - * @return Map - */ - function wordDistance(doc, pos) { - var prefixPos = getWordIndex(doc, pos); - var words = doc.getValue().split(splitRegex); - var wordScores = Object.create(null); - - var currentWord = words[prefixPos]; - - words.forEach(function(word, idx) { - if (!word || word === currentWord) return; - - var distance = Math.abs(prefixPos - idx); - var score = words.length - distance; - if (wordScores[word]) { - wordScores[word] = Math.max(score, wordScores[word]); - } else { - wordScores[word] = score; - } - }); - return wordScores; - } - - exports.getCompletions = function(editor, session, pos, prefix, callback) { - var wordScore = wordDistance(session, pos, prefix); - var wordList = Object.keys(wordScore); - callback(null, wordList.map(function(word) { - return { - caption: word, - value: word, - score: wordScore[word], - meta: "local" - }; - })); - }; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/util.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/util.js deleted file mode 100644 index 767b983e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/util.js +++ /dev/null @@ -1,74 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -exports.parForEach = function(array, fn, callback) { - var completed = 0; - var arLength = array.length; - if (arLength === 0) - callback(); - for (var i = 0; i < arLength; i++) { - fn(array[i], function(result, err) { - completed++; - if (completed === arLength) - callback(result, err); - }); - } -}; - -var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/; - -exports.retrievePrecedingIdentifier = function(text, pos, regex) { - regex = regex || ID_REGEX; - var buf = []; - for (var i = pos-1; i >= 0; i--) { - if (regex.test(text[i])) - buf.push(text[i]); - else - break; - } - return buf.reverse().join(""); -}; - -exports.retrieveFollowingIdentifier = function(text, pos, regex) { - regex = regex || ID_REGEX; - var buf = []; - for (var i = pos; i < text.length; i++) { - if (regex.test(text[i])) - buf.push(text[i]); - else - break; - } - return buf; -}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js deleted file mode 100644 index da8008bd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +++ /dev/null @@ -1,250 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - - -/** - * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. - * - * If a certain row is changed, everything below that row is re-tokenized. - * - * @class BackgroundTokenizer - **/ - -/** - * Creates a new `BackgroundTokenizer` object. - * @param {Tokenizer} tokenizer The tokenizer to use - * @param {Editor} editor The editor to associate with - * - * @constructor - **/ - -var BackgroundTokenizer = function(tokenizer, editor) { - this.running = false; - this.lines = []; - this.states = []; - this.currentLine = 0; - this.tokenizer = tokenizer; - - var self = this; - - this.$worker = function() { - if (!self.running) { return; } - - var workerStart = new Date(); - var currentLine = self.currentLine; - var endLine = -1; - var doc = self.doc; - - while (self.lines[currentLine]) - currentLine++; - - var startLine = currentLine; - - var len = doc.getLength(); - var processedLines = 0; - self.running = false; - while (currentLine < len) { - self.$tokenizeRow(currentLine); - endLine = currentLine; - do { - currentLine++; - } while (self.lines[currentLine]); - - // only check every 5 lines - processedLines ++; - if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) { - self.running = setTimeout(self.$worker, 20); - break; - } - } - self.currentLine = currentLine; - - if (startLine <= endLine) - self.fireUpdateEvent(startLine, endLine); - }; -}; - -(function(){ - - oop.implement(this, EventEmitter); - - /** - * Sets a new tokenizer for this object. - * - * @param {Tokenizer} tokenizer The new tokenizer to use - * - **/ - this.setTokenizer = function(tokenizer) { - this.tokenizer = tokenizer; - this.lines = []; - this.states = []; - - this.start(0); - }; - - /** - * Sets a new document to associate with this object. - * @param {Document} doc The new document to associate with - **/ - this.setDocument = function(doc) { - this.doc = doc; - this.lines = []; - this.states = []; - - this.stop(); - }; - - /** - * Fires whenever the background tokeniziers between a range of rows are going to be updated. - * - * @event update - * @param {Object} e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. - * - **/ - /** - * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated. - * @param {Number} firstRow The starting row region - * @param {Number} lastRow The final row region - * - **/ - this.fireUpdateEvent = function(firstRow, lastRow) { - var data = { - first: firstRow, - last: lastRow - }; - this._signal("update", {data: data}); - }; - - /** - * Starts tokenizing at the row indicated. - * - * @param {Number} startRow The row to start at - * - **/ - 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.states.splice(this.currentLine, this.states.length); - - this.stop(); - // pretty long delay to prevent the tokenizer from interfering with the user - this.running = setTimeout(this.$worker, 700); - }; - - this.scheduleStart = function() { - if (!this.running) - this.running = setTimeout(this.$worker, 700); - } - - this.$updateOnChange = function(delta) { - var range = delta.range; - var startRow = range.start.row; - var len = range.end.row - startRow; - - if (len === 0) { - this.lines[startRow] = null; - } else if (delta.action == "removeText" || delta.action == "removeLines") { - this.lines.splice(startRow, len + 1, null); - this.states.splice(startRow, len + 1, null); - } else { - var args = Array(len + 1); - args.unshift(startRow, 1); - this.lines.splice.apply(this.lines, args); - this.states.splice.apply(this.states, args); - } - - this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength()); - - this.stop(); - }; - - /** - * Stops tokenizing. - * - **/ - this.stop = function() { - if (this.running) - clearTimeout(this.running); - this.running = false; - }; - - /** - * Gives list of tokens of the row. (tokens are cached) - * - * @param {Number} row The row to get tokens at - * - * - * - **/ - this.getTokens = function(row) { - return this.lines[row] || this.$tokenizeRow(row); - }; - - /** - * [Returns the state of tokenization at the end of a row.]{: #BackgroundTokenizer.getState} - * - * @param {Number} row The row to get state at - **/ - this.getState = function(row) { - if (this.currentLine == row) - this.$tokenizeRow(row); - return this.states[row] || "start"; - }; - - this.$tokenizeRow = function(row) { - var line = this.doc.getLine(row); - var state = this.states[row - 1]; - - var data = this.tokenizer.getLineTokens(line, state, row); - - if (this.states[row] + "" !== data.state + "") { - this.states[row] = data.state; - this.lines[row + 1] = null; - if (this.currentLine > row + 1) - this.currentLine = row + 1; - } else if (this.currentLine == row) { - this.currentLine = row + 1; - } - - return this.lines[row] = data.tokens; - }; - -}).call(BackgroundTokenizer.prototype); - -exports.BackgroundTokenizer = BackgroundTokenizer; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js deleted file mode 100644 index 7a4cc78c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +++ /dev/null @@ -1,85 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./edit_session").EditSession; -var JavaScriptMode = require("./mode/javascript").Mode; -var Range = require("./range").Range; -var assert = require("./test/assertions"); - -function forceTokenize(session){ - for (var i = 0, l = session.getLength(); i < l; i++) - session.getTokens(i) -} - -function testStates(session, states) { - for (var i = 0, l = session.getLength(); i < l; i++) - assert.equal(session.bgTokenizer.states[i], states[i]) - assert.ok(l == states.length) -} - -module.exports = { - - "test background tokenizer update on session change" : function() { - var doc = new EditSession([ - "/*", - "*/", - "var juhu" - ]); - doc.setMode("./mode/javascript") - - forceTokenize(doc) - testStates(doc, ["comment_regex_allowed", "start", "no_regex"]) - - doc.remove(new Range(0,2,1,2)) - testStates(doc, [null, "no_regex"]) - - forceTokenize(doc) - testStates(doc, ["comment_regex_allowed", "comment_regex_allowed"]) - - doc.insert({row:0, column:2}, "\n*/") - testStates(doc, [undefined, undefined, "comment_regex_allowed"]) - - forceTokenize(doc) - testStates(doc, ["comment_regex_allowed", "start", "no_regex"]) - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js deleted file mode 100644 index df30ef9b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +++ /dev/null @@ -1,118 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler; -var EventEmitter = require("../lib/event_emitter").EventEmitter; - -/** - * @class CommandManager - * - **/ - -/** - * new CommandManager(platform, commands) - * @param {String} platform Identifier for the platform; must be either `"mac"` or `"win"` - * @param {Array} commands A list of commands - * - **/ - -var CommandManager = function(platform, commands) { - MultiHashHandler.call(this, commands, platform); - this.byName = this.commands; - this.setDefaultHandler("exec", function(e) { - return e.command.exec(e.editor, e.args || {}); - }); -}; - -oop.inherits(CommandManager, MultiHashHandler); - -(function() { - - oop.implement(this, EventEmitter); - - this.exec = function(command, editor, args) { - if (Array.isArray(command)) { - for (var i = command.length; i--; ) { - if (this.exec(command[i], editor, args)) return true; - } - return false; - } - - if (typeof command === "string") - command = this.commands[command]; - - if (!command) - return false; - - if (editor && editor.$readOnly && !command.readOnly) - return false; - - var e = {editor: editor, command: command, args: args}; - e.returnValue = this._emit("exec", e); - this._signal("afterExec", e); - - return e.returnValue === false ? false : true; - }; - - this.toggleRecording = function(editor) { - if (this.$inReplay) - return; - - editor && editor._emit("changeStatus"); - if (this.recording) { - this.macro.pop(); - this.removeEventListener("exec", this.$addCommandToMacro); - - if (!this.macro.length) - this.macro = this.oldMacro; - - return this.recording = false; - } - if (!this.$addCommandToMacro) { - this.$addCommandToMacro = function(e) { - this.macro.push([e.command, e.args]); - }.bind(this); - } - - this.oldMacro = this.macro; - this.macro = []; - this.on("exec", this.$addCommandToMacro); - return this.recording = true; - }; - - this.replay = function(editor) { - if (this.$inReplay || !this.macro) - return; - - if (this.recording) - return this.toggleRecording(editor); - - try { - this.$inReplay = true; - this.macro.forEach(function(x) { - if (typeof x == "string") - this.exec(x, editor); - else - this.exec(x[0], editor, x[1]); - }, this); - } finally { - this.$inReplay = false; - } - }; - - this.trimMacro = function(m) { - return m.map(function(x){ - if (typeof x[0] != "string") - x[0] = x[0].name; - if (!x[1]) - x = x[0]; - return x; - }); - }; - -}).call(CommandManager.prototype); - -exports.CommandManager = CommandManager; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js deleted file mode 100644 index 902600be..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +++ /dev/null @@ -1,199 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var CommandManager = require("./command_manager").CommandManager; -var keys = require("../lib/keys"); -var assert = require("../test/assertions"); - -module.exports = { - - setUp: function() { - this.command = { - name: "gotoline", - bindKey: { - mac: "Command-L", - win: "Ctrl-L" - }, - called: false, - exec: function(editor) { this.called = true; } - }; - - this.cm = new CommandManager("mac", [this.command]); - }, - - "test: register command": function() { - this.cm.exec("gotoline"); - assert.ok(this.command.called); - }, - - "test: mac hotkeys": function() { - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "l"); - assert.equal(command, this.command); - - var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "l"); - assert.equal(command, undefined); - }, - - "test: win hotkeys": function() { - var cm = new CommandManager("win", [this.command]); - - var command = cm.findKeyCommand(keys.KEY_MODS.command, "l"); - assert.equal(command, undefined); - - var command = cm.findKeyCommand(keys.KEY_MODS.ctrl, "l"); - assert.equal(command, this.command); - }, - - "test: remove command by object": function() { - this.cm.removeCommand(this.command); - - this.cm.exec("gotoline"); - assert.ok(!this.command.called); - - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "l"); - assert.equal(command, null); - }, - - "test: remove command by name": function() { - this.cm.removeCommand("gotoline"); - - this.cm.exec("gotoline"); - assert.ok(!this.command.called); - - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "l"); - assert.equal(command, null); - }, - - "test: adding a new command with the same name as an existing one should remove the old one first": function() { - var command = { - name: "gotoline", - bindKey: { - mac: "Command-L", - win: "Ctrl-L" - }, - called: false, - exec: function(editor) { this.called = true; } - }; - this.cm.addCommand(command); - - this.cm.exec("gotoline"); - assert.ok(command.called); - assert.ok(!this.command.called); - - assert.equal(this.cm.findKeyCommand(keys.KEY_MODS.command, "l"), command); - }, - - "test: adding commands and recording a macro": function() { - var called = ""; - this.cm.addCommands({ - togglerecording: function(editor) { - editor.cm.toggleRecording(editor); - }, - replay: function(editor) { - editor.cm.replay(); - }, - cm1: function(editor, arg) { - called += "1" + (arg || ""); - }, - cm2: function(editor) { - called += "2"; - } - }); - - - var statusUpdateEmitted = false; - this._emit = function() {statusUpdateEmitted = true}; - - this.cm.exec("togglerecording", this); - assert.ok(this.cm.recording); - assert.ok(statusUpdateEmitted); - - this.cm.exec("cm1", this, "-"); - this.cm.exec("cm2"); - this.cm.exec("replay", this); - assert.ok(!this.cm.recording); - assert.equal(called, "1-2"); - - called = ""; - this.cm.exec("replay", this); - assert.equal(called, "1-2"); - }, - - "test: bindkeys": function() { - this.cm.bindKeys({ - "Ctrl-L|Command-C": "cm1", - "Ctrl-R": "cm2" - }); - - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "c"); - assert.equal(command, "cm1"); - - var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "r"); - assert.equal(command, "cm2"); - - this.cm.bindKeys({ - "Ctrl-R": null - }); - - var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "r"); - assert.equal(command, null); - }, - - "test: binding keys without modifiers": function() { - this.cm.bindKeys({ - "R": "cm1", - "Shift-r": "cm2", - "Return": "cm4", - "Enter": "cm3" - }); - - var command = this.cm.findKeyCommand(-1, "r"); - assert.equal(command, "cm1"); - - var command = this.cm.findKeyCommand(-1, "R"); - assert.equal(command, "cm2"); - - var command = this.cm.findKeyCommand(0, "return"); - assert.equal(command + "", ["cm4", "cm3"] + ""); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js deleted file mode 100644 index c5d34aae..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +++ /dev/null @@ -1,721 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var lang = require("../lib/lang"); -var config = require("../config"); -var Range = require("../range").Range; - -function bindKey(win, mac) { - return {win: win, mac: mac}; -} - -/* - multiSelectAction: "forEach"|"forEachLine"|function|undefined, - scrollIntoView: true|"cursor"|"center"|"selectionPart" -*/ -exports.commands = [{ - name: "showSettingsMenu", - bindKey: bindKey("Ctrl-,", "Command-,"), - exec: function(editor) { - config.loadModule("ace/ext/settings_menu", function(module) { - module.init(editor); - editor.showSettingsMenu(); - }); - }, - readOnly: true -}, { - name: "goToNextError", - bindKey: bindKey("Alt-E", "Ctrl-E"), - exec: function(editor) { - config.loadModule("ace/ext/error_marker", function(module) { - module.showErrorMarker(editor, 1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { - name: "goToPreviousError", - bindKey: bindKey("Alt-Shift-E", "Ctrl-Shift-E"), - exec: function(editor) { - config.loadModule("ace/ext/error_marker", function(module) { - module.showErrorMarker(editor, -1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { - name: "selectall", - bindKey: bindKey("Ctrl-A", "Command-A"), - exec: function(editor) { editor.selectAll(); }, - readOnly: true -}, { - name: "centerselection", - bindKey: bindKey(null, "Ctrl-L"), - exec: function(editor) { editor.centerSelection(); }, - readOnly: true -}, { - name: "gotoline", - bindKey: bindKey("Ctrl-L", "Command-L"), - exec: function(editor) { - var line = parseInt(prompt("Enter line number:"), 10); - if (!isNaN(line)) { - editor.gotoLine(line); - } - }, - readOnly: true -}, { - name: "fold", - bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), - exec: function(editor) { editor.session.toggleFold(false); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "unfold", - bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"), - exec: function(editor) { editor.session.toggleFold(true); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleFoldWidget", - bindKey: bindKey("F2", "F2"), - exec: function(editor) { editor.session.toggleFoldWidget(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleParentFoldWidget", - bindKey: bindKey("Alt-F2", "Alt-F2"), - exec: function(editor) { editor.session.toggleFoldWidget(true); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "foldall", - bindKey: bindKey("Ctrl-Alt-0", "Ctrl-Command-Option-0"), - exec: function(editor) { editor.session.foldAll(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "foldOther", - bindKey: bindKey("Alt-0", "Command-Option-0"), - exec: function(editor) { - editor.session.foldAll(); - editor.session.unfold(editor.selection.getAllRanges()); - }, - scrollIntoView: "center", - readOnly: true -}, { - name: "unfoldall", - bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"), - exec: function(editor) { editor.session.unfold(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "findnext", - bindKey: bindKey("Ctrl-K", "Command-G"), - exec: function(editor) { editor.findNext(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "findprevious", - bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), - exec: function(editor) { editor.findPrevious(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "selectOrFindNext", - bindKey: bindKey("Alt-K", "Ctrl-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findNext(); - }, - readOnly: true -}, { - name: "selectOrFindPrevious", - bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findPrevious(); - }, - readOnly: true -}, { - name: "find", - bindKey: bindKey("Ctrl-F", "Command-F"), - exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor)}); - }, - readOnly: true -}, { - name: "overwrite", - bindKey: "Insert", - exec: function(editor) { editor.toggleOverwrite(); }, - readOnly: true -}, { - name: "selecttostart", - bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"), - exec: function(editor) { editor.getSelection().selectFileStart(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "gotostart", - bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), - exec: function(editor) { editor.navigateFileStart(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "selectup", - bindKey: bindKey("Shift-Up", "Shift-Up"), - exec: function(editor) { editor.getSelection().selectUp(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "golineup", - bindKey: bindKey("Up", "Up|Ctrl-P"), - exec: function(editor, args) { editor.navigateUp(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttoend", - bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"), - exec: function(editor) { editor.getSelection().selectFileEnd(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "gotoend", - bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), - exec: function(editor) { editor.navigateFileEnd(); }, - multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" -}, { - name: "selectdown", - bindKey: bindKey("Shift-Down", "Shift-Down"), - exec: function(editor) { editor.getSelection().selectDown(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "golinedown", - bindKey: bindKey("Down", "Down|Ctrl-N"), - exec: function(editor, args) { editor.navigateDown(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectwordleft", - bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), - exec: function(editor) { editor.getSelection().selectWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotowordleft", - bindKey: bindKey("Ctrl-Left", "Option-Left"), - exec: function(editor) { editor.navigateWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttolinestart", - bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"), - exec: function(editor) { editor.getSelection().selectLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotolinestart", - bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), - exec: function(editor) { editor.navigateLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectleft", - bindKey: bindKey("Shift-Left", "Shift-Left"), - exec: function(editor) { editor.getSelection().selectLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotoleft", - bindKey: bindKey("Left", "Left|Ctrl-B"), - exec: function(editor, args) { editor.navigateLeft(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectwordright", - bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), - exec: function(editor) { editor.getSelection().selectWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotowordright", - bindKey: bindKey("Ctrl-Right", "Option-Right"), - exec: function(editor) { editor.navigateWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selecttolineend", - bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"), - exec: function(editor) { editor.getSelection().selectLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotolineend", - bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), - exec: function(editor) { editor.navigateLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectright", - bindKey: bindKey("Shift-Right", "Shift-Right"), - exec: function(editor) { editor.getSelection().selectRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "gotoright", - bindKey: bindKey("Right", "Right|Ctrl-F"), - exec: function(editor, args) { editor.navigateRight(args.times); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectpagedown", - bindKey: "Shift-PageDown", - exec: function(editor) { editor.selectPageDown(); }, - readOnly: true -}, { - name: "pagedown", - bindKey: bindKey(null, "Option-PageDown"), - exec: function(editor) { editor.scrollPageDown(); }, - readOnly: true -}, { - name: "gotopagedown", - bindKey: bindKey("PageDown", "PageDown|Ctrl-V"), - exec: function(editor) { editor.gotoPageDown(); }, - readOnly: true -}, { - name: "selectpageup", - bindKey: "Shift-PageUp", - exec: function(editor) { editor.selectPageUp(); }, - readOnly: true -}, { - name: "pageup", - bindKey: bindKey(null, "Option-PageUp"), - exec: function(editor) { editor.scrollPageUp(); }, - readOnly: true -}, { - name: "gotopageup", - bindKey: "PageUp", - exec: function(editor) { editor.gotoPageUp(); }, - readOnly: true -}, { - name: "scrollup", - bindKey: bindKey("Ctrl-Up", null), - exec: function(e) { e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight); }, - readOnly: true -}, { - name: "scrolldown", - bindKey: bindKey("Ctrl-Down", null), - exec: function(e) { e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight); }, - readOnly: true -}, { - name: "selectlinestart", - bindKey: "Shift-Home", - exec: function(editor) { editor.getSelection().selectLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "selectlineend", - bindKey: "Shift-End", - exec: function(editor) { editor.getSelection().selectLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "togglerecording", - bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"), - exec: function(editor) { editor.commands.toggleRecording(editor); }, - readOnly: true -}, { - name: "replaymacro", - bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"), - exec: function(editor) { editor.commands.replay(editor); }, - readOnly: true -}, { - name: "jumptomatching", - bindKey: bindKey("Ctrl-P", "Ctrl-P"), - exec: function(editor) { editor.jumpToMatching(); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", - readOnly: true -}, { - name: "selecttomatching", - bindKey: bindKey("Ctrl-Shift-P", "Ctrl-Shift-P"), - exec: function(editor) { editor.jumpToMatching(true); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", - readOnly: true -}, { - name: "expandToMatching", - bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"), - exec: function(editor) { editor.jumpToMatching(true, true); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", - readOnly: true -}, { - name: "passKeysToBrowser", - bindKey: bindKey("null", "null"), - exec: function() {}, - passEvent: true, - readOnly: true -}, - -// commands disabled in readOnly mode -{ - name: "cut", - exec: function(editor) { - var range = editor.getSelectionRange(); - editor._emit("cut", range); - - if (!editor.selection.isEmpty()) { - editor.session.remove(range); - editor.clearSelection(); - } - }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "removeline", - bindKey: bindKey("Ctrl-D", "Command-D"), - exec: function(editor) { editor.removeLines(); }, - scrollIntoView: "cursor", - multiSelectAction: "forEachLine" -}, { - name: "duplicateSelection", - bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), - exec: function(editor) { editor.duplicateSelection(); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "sortlines", - bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), - exec: function(editor) { editor.sortLines(); }, - scrollIntoView: "selection", - multiSelectAction: "forEachLine" -}, { - name: "togglecomment", - bindKey: bindKey("Ctrl-/", "Command-/"), - exec: function(editor) { editor.toggleCommentLines(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "toggleBlockComment", - bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), - exec: function(editor) { editor.toggleBlockComment(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "modifyNumberUp", - bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), - exec: function(editor) { editor.modifyNumber(1); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "modifyNumberDown", - bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), - exec: function(editor) { editor.modifyNumber(-1); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "replace", - bindKey: bindKey("Ctrl-H", "Command-Option-F"), - exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true)}); - } -}, { - name: "undo", - bindKey: bindKey("Ctrl-Z", "Command-Z"), - exec: function(editor) { editor.undo(); } -}, { - name: "redo", - bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"), - exec: function(editor) { editor.redo(); } -}, { - name: "copylinesup", - bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), - exec: function(editor) { editor.copyLinesUp(); }, - scrollIntoView: "cursor" -}, { - name: "movelinesup", - bindKey: bindKey("Alt-Up", "Option-Up"), - exec: function(editor) { editor.moveLinesUp(); }, - scrollIntoView: "cursor" -}, { - name: "copylinesdown", - bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), - exec: function(editor) { editor.copyLinesDown(); }, - scrollIntoView: "cursor" -}, { - name: "movelinesdown", - bindKey: bindKey("Alt-Down", "Option-Down"), - exec: function(editor) { editor.moveLinesDown(); }, - scrollIntoView: "cursor" -}, { - name: "del", - bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), - exec: function(editor) { editor.remove("right"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "backspace", - bindKey: bindKey( - "Shift-Backspace|Backspace", - "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H" - ), - exec: function(editor) { editor.remove("left"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "cut_or_delete", - bindKey: bindKey("Shift-Delete", null), - exec: function(editor) { - if (editor.selection.isEmpty()) { - editor.remove("left"); - } else { - return false; - } - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolinestart", - bindKey: bindKey("Alt-Backspace", "Command-Backspace"), - exec: function(editor) { editor.removeToLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removetolineend", - bindKey: bindKey("Alt-Delete", "Ctrl-K"), - exec: function(editor) { editor.removeToLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removewordleft", - bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), - exec: function(editor) { editor.removeWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "removewordright", - bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), - exec: function(editor) { editor.removeWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "outdent", - bindKey: bindKey("Shift-Tab", "Shift-Tab"), - exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "indent", - bindKey: bindKey("Tab", "Tab"), - exec: function(editor) { editor.indent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "blockoutdent", - bindKey: bindKey("Ctrl-[", "Ctrl-["), - exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "blockindent", - bindKey: bindKey("Ctrl-]", "Ctrl-]"), - exec: function(editor) { editor.blockIndent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "insertstring", - exec: function(editor, str) { editor.insert(str); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "inserttext", - exec: function(editor, args) { - editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "splitline", - bindKey: bindKey(null, "Ctrl-O"), - exec: function(editor) { editor.splitLine(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "transposeletters", - bindKey: bindKey("Ctrl-T", "Ctrl-T"), - exec: function(editor) { editor.transposeLetters(); }, - multiSelectAction: function(editor) {editor.transposeSelections(1); }, - scrollIntoView: "cursor" -}, { - name: "touppercase", - bindKey: bindKey("Ctrl-U", "Ctrl-U"), - exec: function(editor) { editor.toUpperCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "tolowercase", - bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), - exec: function(editor) { editor.toLowerCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "expandtoline", - bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"), - exec: function(editor) { - var range = editor.selection.getRange(); - - range.start.column = range.end.column = 0; - range.end.row++; - editor.selection.setRange(range, false); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "joinlines", - bindKey: bindKey(null, null), - exec: function(editor) { - var isBackwards = editor.selection.isBackwards(); - var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor(); - var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead(); - var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length; - var selectedText = editor.session.doc.getTextRange(editor.selection.getRange()); - var selectedCount = selectedText.replace(/\n\s*/, " ").length; - var insertLine = editor.session.doc.getLine(selectionStart.row); - - for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) { - var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i))); - if (curLine.length !== 0) { - curLine = " " + curLine; - } - insertLine += curLine; - } - - if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) { - // Don't insert a newline at the end of the document - insertLine += editor.session.doc.getNewLineCharacter(); - } - - editor.clearSelection(); - editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine); - - if (selectedCount > 0) { - // Select the text that was previously selected - editor.selection.moveCursorTo(selectionStart.row, selectionStart.column); - editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount); - } else { - // If the joined line had something in it, start the cursor at that something - firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol; - editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol); - } - }, - multiSelectAction: "forEach", - readOnly: true -}, { - name: "invertSelection", - bindKey: bindKey(null, null), - exec: function(editor) { - var endRow = editor.session.doc.getLength() - 1; - var endCol = editor.session.doc.getLine(endRow).length; - var ranges = editor.selection.rangeList.ranges; - var newRanges = []; - - // If multiple selections don't exist, rangeList will return 0 so replace with single range - if (ranges.length < 1) { - ranges = [editor.selection.getRange()]; - } - - for (var i = 0; i < ranges.length; i++) { - if (i == (ranges.length - 1)) { - // The last selection must connect to the end of the document, unless it already does - if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) { - newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol)); - } - } - - if (i === 0) { - // The first selection must connect to the start of the document, unless it already does - if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) { - newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column)); - } - } else { - newRanges.push(new Range(ranges[i-1].end.row, ranges[i-1].end.column, ranges[i].start.row, ranges[i].start.column)); - } - } - - editor.exitMultiSelectMode(); - editor.clearSelection(); - - for(var i = 0; i < newRanges.length; i++) { - editor.selection.addRange(newRanges[i], false); - } - }, - readOnly: true, - scrollIntoView: "none" -}]; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/incremental_search_commands.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/incremental_search_commands.js deleted file mode 100644 index a0a0fe5f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/incremental_search_commands.js +++ /dev/null @@ -1,232 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var config = require("../config"); -var oop = require("../lib/oop"); -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var occurStartCommand = require("./occur_commands").occurStartCommand; - -// These commands can be installed in a normal key handler to start iSearch: -exports.iSearchStartCommands = [{ - name: "iSearch", - bindKey: {win: "Ctrl-F", mac: "Command-F"}, - exec: function(editor, options) { - config.loadModule(["core", "ace/incremental_search"], function(e) { - var iSearch = e.iSearch = e.iSearch || new e.IncrementalSearch(); - iSearch.activate(editor, options.backwards); - if (options.jumpToFirstMatch) iSearch.next(options); - }); - }, - readOnly: true -}, { - name: "iSearchBackwards", - exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {backwards: true}); }, - readOnly: true -}, { - name: "iSearchAndGo", - bindKey: {win: "Ctrl-K", mac: "Command-G"}, - exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {jumpToFirstMatch: true, useCurrentOrPrevSearch: true}); }, - readOnly: true -}, { - name: "iSearchBackwardsAndGo", - bindKey: {win: "Ctrl-Shift-K", mac: "Command-Shift-G"}, - exec: function(editor) { editor.execCommand('iSearch', {jumpToFirstMatch: true, backwards: true, useCurrentOrPrevSearch: true}); }, - readOnly: true -}]; - -// These commands are only available when incremental search mode is active: -exports.iSearchCommands = [{ - name: "restartSearch", - bindKey: {win: "Ctrl-F", mac: "Command-F"}, - exec: function(iSearch) { - iSearch.cancelSearch(true); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "searchForward", - bindKey: {win: "Ctrl-S|Ctrl-K", mac: "Ctrl-S|Command-G"}, - exec: function(iSearch, options) { - options.useCurrentOrPrevSearch = true; - iSearch.next(options); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "searchBackward", - bindKey: {win: "Ctrl-R|Ctrl-Shift-K", mac: "Ctrl-R|Command-Shift-G"}, - exec: function(iSearch, options) { - options.useCurrentOrPrevSearch = true; - options.backwards = true; - iSearch.next(options); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "extendSearchTerm", - exec: function(iSearch, string) { - iSearch.addString(string); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "extendSearchTermSpace", - bindKey: "space", - exec: function(iSearch) { iSearch.addString(' '); }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "shrinkSearchTerm", - bindKey: "backspace", - exec: function(iSearch) { - iSearch.removeChar(); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'confirmSearch', - bindKey: 'return', - exec: function(iSearch) { iSearch.deactivate(); }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'cancelSearch', - bindKey: 'esc|Ctrl-G', - exec: function(iSearch) { iSearch.deactivate(true); }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'occurisearch', - bindKey: 'Ctrl-O', - exec: function(iSearch) { - var options = oop.mixin({}, iSearch.$options); - iSearch.deactivate(); - occurStartCommand.exec(iSearch.$editor, options); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "yankNextWord", - bindKey: "Ctrl-w", - exec: function(iSearch) { - var ed = iSearch.$editor, - range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorWordRight(); }), - string = ed.session.getTextRange(range); - iSearch.addString(string); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: "yankNextChar", - bindKey: "Ctrl-Alt-y", - exec: function(iSearch) { - var ed = iSearch.$editor, - range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorRight(); }), - string = ed.session.getTextRange(range); - iSearch.addString(string); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'recenterTopBottom', - bindKey: 'Ctrl-l', - exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'selectAllMatches', - bindKey: 'Ctrl-space', - exec: function(iSearch) { - var ed = iSearch.$editor, - hl = ed.session.$isearchHighlight, - ranges = hl && hl.cache ? hl.cache - .reduce(function(ranges, ea) { - return ranges.concat(ea ? ea : []); }, []) : []; - iSearch.deactivate(false); - ranges.forEach(ed.selection.addRange.bind(ed.selection)); - }, - readOnly: true, - isIncrementalSearchCommand: true -}, { - name: 'searchAsRegExp', - bindKey: 'Alt-r', - exec: function(iSearch) { - iSearch.convertNeedleToRegExp(); - }, - readOnly: true, - isIncrementalSearchCommand: true -}]; - -function IncrementalSearchKeyboardHandler(iSearch) { - this.$iSearch = iSearch; -} - -oop.inherits(IncrementalSearchKeyboardHandler, HashHandler); - -;(function() { - - this.attach = function(editor) { - var iSearch = this.$iSearch; - HashHandler.call(this, exports.iSearchCommands, editor.commands.platform); - this.$commandExecHandler = editor.commands.addEventListener('exec', function(e) { - if (!e.command.isIncrementalSearchCommand) return undefined; - e.stopPropagation(); - e.preventDefault(); - return e.command.exec(iSearch, e.args || {}); - }); - } - - this.detach = function(editor) { - if (!this.$commandExecHandler) return; - editor.commands.removeEventListener('exec', this.$commandExecHandler); - delete this.$commandExecHandler; - } - - var handleKeyboard$super = this.handleKeyboard; - this.handleKeyboard = function(data, hashId, key, keyCode) { - if (((hashId === 1/*ctrl*/ || hashId === 8/*command*/) && key === 'v') - || (hashId === 1/*ctrl*/ && key === 'y')) return null; - var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); - if (cmd.command) { return cmd; } - if (hashId == -1) { - var extendCmd = this.commands.extendSearchTerm; - if (extendCmd) { return {command: extendCmd, args: key}; } - } - return {command: "null", passEvent: hashId == 0 || hashId == 4}; - } - -}).call(IncrementalSearchKeyboardHandler.prototype); - - -exports.IncrementalSearchKeyboardHandler = IncrementalSearchKeyboardHandler; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js deleted file mode 100644 index ba6392bc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +++ /dev/null @@ -1,113 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -// commands to enter multiselect mode -exports.defaultCommands = [{ - name: "addCursorAbove", - exec: function(editor) { editor.selectMoreLines(-1); }, - bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "addCursorBelow", - exec: function(editor) { editor.selectMoreLines(1); }, - bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "addCursorAboveSkipCurrent", - exec: function(editor) { editor.selectMoreLines(-1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "addCursorBelowSkipCurrent", - exec: function(editor) { editor.selectMoreLines(1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "selectMoreBefore", - exec: function(editor) { editor.selectMore(-1); }, - bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "selectMoreAfter", - exec: function(editor) { editor.selectMore(1); }, - bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "selectNextBefore", - exec: function(editor) { editor.selectMore(-1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "selectNextAfter", - exec: function(editor) { editor.selectMore(1, true); }, - bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"}, - scrollIntoView: "cursor", - readonly: true -}, { - name: "splitIntoLines", - exec: function(editor) { editor.multiSelect.splitIntoLines(); }, - bindKey: {win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L"}, - readonly: true -}, { - name: "alignCursors", - exec: function(editor) { editor.alignCursors(); }, - bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"}, - scrollIntoView: "cursor" -}, { - name: "findAll", - exec: function(editor) { editor.findAll(); }, - bindKey: {win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G"}, - scrollIntoView: "cursor", - readonly: true -}]; - -// commands active only in multiselect mode -exports.multiSelectCommands = [{ - name: "singleSelection", - bindKey: "esc", - exec: function(editor) { editor.exitMultiSelectMode(); }, - scrollIntoView: "cursor", - readonly: true, - isAvailable: function(editor) {return editor && editor.inMultiSelectMode} -}]; - -var HashHandler = require("../keyboard/hash_handler").HashHandler; -exports.keyboardHandler = new HashHandler(exports.multiSelectCommands); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/occur_commands.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/occur_commands.js deleted file mode 100644 index b45fbf61..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/occur_commands.js +++ /dev/null @@ -1,110 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var config = require("../config"), - Occur = require("../occur").Occur; - -// These commands can be installed in a normal command handler to start occur: -var occurStartCommand = { - name: "occur", - exec: function(editor, options) { - var alreadyInOccur = !!editor.session.$occur; - var occurSessionActive = new Occur().enter(editor, options); - if (occurSessionActive && !alreadyInOccur) - OccurKeyboardHandler.installIn(editor); - }, - readOnly: true -}; - -var occurCommands = [{ - name: "occurexit", - bindKey: 'esc|Ctrl-G', - exec: function(editor) { - var occur = editor.session.$occur; - if (!occur) return; - occur.exit(editor, {}); - if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); - }, - readOnly: true -}, { - name: "occuraccept", - bindKey: 'enter', - exec: function(editor) { - var occur = editor.session.$occur; - if (!occur) return; - occur.exit(editor, {translatePosition: true}); - if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); - }, - readOnly: true -}]; - -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var oop = require("../lib/oop"); - - -function OccurKeyboardHandler() {} - -oop.inherits(OccurKeyboardHandler, HashHandler); - -;(function() { - - this.isOccurHandler = true; - - this.attach = function(editor) { - HashHandler.call(this, occurCommands, editor.commands.platform); - this.$editor = editor; - } - - var handleKeyboard$super = this.handleKeyboard; - this.handleKeyboard = function(data, hashId, key, keyCode) { - var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); - return (cmd && cmd.command) ? cmd : undefined; - } - -}).call(OccurKeyboardHandler.prototype); - -OccurKeyboardHandler.installIn = function(editor) { - var handler = new this(); - editor.keyBinding.addKeyboardHandler(handler); - editor.commands.addCommands(occurCommands); -} - -OccurKeyboardHandler.uninstallFrom = function(editor) { - editor.commands.removeCommands(occurCommands); - var handler = editor.getKeyboardHandler(); - if (handler.isOccurHandler) - editor.keyBinding.removeKeyboardHandler(handler); -} - -exports.occurStartCommand = occurStartCommand; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js deleted file mode 100644 index 34bf50fd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js +++ /dev/null @@ -1,202 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"no use strict"; - -var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var net = require("./lib/net"); -var AppConfig = require("./lib/app_config").AppConfig; - -module.exports = exports = new AppConfig(); - -var global = (function() { - return this; -})(); - -var options = { - packaged: false, - workerPath: null, - modePath: null, - themePath: null, - basePath: "", - suffix: ".js", - $moduleUrls: {} -}; - -exports.get = function(key) { - if (!options.hasOwnProperty(key)) - throw new Error("Unknown config key: " + key); - - return options[key]; -}; - -exports.set = function(key, value) { - if (!options.hasOwnProperty(key)) - throw new Error("Unknown config key: " + key); - - options[key] = value; -}; - -exports.all = function() { - return lang.copyObject(options); -}; - -// module loading -exports.moduleUrl = function(name, component) { - if (options.$moduleUrls[name]) - return options.$moduleUrls[name]; - - var parts = name.split("/"); - component = component || parts[parts.length - 2] || ""; - - // todo make this configurable or get rid of '-' - var sep = component == "snippets" ? "/" : "-"; - var base = parts[parts.length - 1]; - if (component == "worker" && sep == "-") { - var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); - base = base.replace(re, ""); - } - - if ((!base || base == component) && parts.length > 1) - base = parts[parts.length - 2]; - var path = options[component + "Path"]; - if (path == null) { - path = options.basePath; - } else if (sep == "/") { - component = sep = ""; - } - if (path && path.slice(-1) != "/") - path += "/"; - return path + component + sep + base + this.get("suffix"); -}; - -exports.setModuleUrl = function(name, subst) { - return options.$moduleUrls[name] = subst; -}; - -exports.$loading = {}; -exports.loadModule = function(moduleName, onLoad) { - var module, moduleType; - if (Array.isArray(moduleName)) { - moduleType = moduleName[0]; - moduleName = moduleName[1]; - } - - try { - module = require(moduleName); - } catch (e) {} - // require(moduleName) can return empty object if called after require([moduleName], callback) - if (module && !exports.$loading[moduleName]) - return onLoad && onLoad(module); - - if (!exports.$loading[moduleName]) - exports.$loading[moduleName] = []; - - exports.$loading[moduleName].push(onLoad); - - if (exports.$loading[moduleName].length > 1) - return; - - var afterLoad = function() { - require([moduleName], function(module) { - exports._emit("load.module", {name: moduleName, module: module}); - var listeners = exports.$loading[moduleName]; - exports.$loading[moduleName] = null; - listeners.forEach(function(onLoad) { - onLoad && onLoad(module); - }); - }); - }; - - if (!exports.get("packaged")) - return afterLoad(); - net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); -}; - -// initialization -function init(packaged) { - options.packaged = packaged || require.packaged || module.packaged || (global.define && define.packaged); - - if (!global.document) - return ""; - - var scriptOptions = {}; - var scriptUrl = ""; - - // Use currentScript.ownerDocument in case this file was loaded from imported document. (HTML Imports) - var currentScript = (document.currentScript || document._currentScript ); // native or polyfill - var currentDocument = currentScript && currentScript.ownerDocument || document; - - var scripts = currentDocument.getElementsByTagName("script"); - for (var i=0; i .ace_gutter-cell { - padding-right: 13px; -} - -.ace_fold-widget { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - - margin: 0 -12px 0 1px; - display: none; - width: 11px; - vertical-align: top; - - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg=="); - background-repeat: no-repeat; - background-position: center; - - border-radius: 3px; - - border: 1px solid transparent; - cursor: pointer; -} - -.ace_folding-enabled .ace_fold-widget { - display: inline-block; -} - -.ace_fold-widget.ace_end { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg=="); -} - -.ace_fold-widget.ace_closed { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA=="); -} - -.ace_fold-widget:hover { - border: 1px solid rgba(0, 0, 0, 0.3); - background-color: rgba(255, 255, 255, 0.2); - box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); -} - -.ace_fold-widget:active { - border: 1px solid rgba(0, 0, 0, 0.4); - background-color: rgba(0, 0, 0, 0.05); - box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); -} -/** - * Dark version for fold widgets - */ -.ace_dark .ace_fold-widget { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC"); -} -.ace_dark .ace_fold-widget.ace_end { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg=="); -} -.ace_dark .ace_fold-widget.ace_closed { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg=="); -} -.ace_dark .ace_fold-widget:hover { - box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); - background-color: rgba(255, 255, 255, 0.1); -} -.ace_dark .ace_fold-widget:active { - box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); -} - -.ace_fold-widget.ace_invalid { - background-color: #FFB4B4; - border-color: #DE5555; -} - -.ace_fade-fold-widgets .ace_fold-widget { - -webkit-transition: opacity 0.4s ease 0.05s; - transition: opacity 0.4s ease 0.05s; - opacity: 0; -} - -.ace_fade-fold-widgets:hover .ace_fold-widget { - -webkit-transition: opacity 0.05s ease 0.05s; - transition: opacity 0.05s ease 0.05s; - opacity:1; -} - -.ace_underline { - text-decoration: underline; -} - -.ace_bold { - font-weight: bold; -} - -.ace_nobold .ace_bold { - font-weight: normal; -} - -.ace_italic { - font-style: italic; -} - - -.ace_error-marker { - background-color: rgba(255, 0, 0,0.2); - position: absolute; - z-index: 9; -} - -.ace_highlight-marker { - background-color: rgba(255, 255, 0,0.2); - position: absolute; - z-index: 8; -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png deleted file mode 100644 index 535e8192..00000000 Binary files a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png and /dev/null differ diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js deleted file mode 100644 index 10a36eb2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js +++ /dev/null @@ -1,645 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var Range = require("./range").Range; -var Anchor = require("./anchor").Anchor; - -/** - * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. - * - * At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. - * - * @class Document - **/ - - /** - * - * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty. - * @param {String | Array} text The starting text - * @constructor - **/ - -var Document = function(text) { - this.$lines = []; - - // 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. - if (text.length === 0) { - this.$lines = [""]; - } else if (Array.isArray(text)) { - this._insertLines(0, text); - } else { - this.insert({row: 0, column:0}, text); - } -}; - -(function() { - - oop.implement(this, EventEmitter); - - /** - * Replaces all the lines in the current `Document` with the value of `text`. - * - * @param {String} text The text to use - **/ - 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); - }; - - /** - * Returns all the lines in the document as a single string, joined by the new line character. - **/ - this.getValue = function() { - return this.getAllLines().join(this.getNewLineCharacter()); - }; - - /** - * Creates a new `Anchor` to define a floating point in the document. - * @param {Number} row The row number to use - * @param {Number} column The column number to use - * - **/ - this.createAnchor = function(row, column) { - return new Anchor(this, row, column); - }; - - /** - * Splits a string of text on any newline (`\n`) or carriage-return ('\r') characters. - * - * @method $split - * @param {String} text The text to work with - * @returns {String} A String array, with each index containing a piece of the original `text` string. - * - **/ - - // 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); - this.$autoNewLine = match ? match[1] : "\n"; - this._signal("changeNewLineMode"); - }; - - /** - * Returns the newline character that's being used, depending on the value of `newLineMode`. - * @returns {String} If `newLineMode == windows`, `\r\n` is returned. - * If `newLineMode == unix`, `\n` is returned. - * If `newLineMode == auto`, the value of `autoNewLine` is returned. - * - **/ - this.getNewLineCharacter = function() { - switch (this.$newLineMode) { - case "windows": - return "\r\n"; - case "unix": - return "\n"; - default: - return this.$autoNewLine || "\n"; - } - }; - - this.$autoNewLine = ""; - this.$newLineMode = "auto"; - /** - * [Sets the new line mode.]{: #Document.setNewLineMode.desc} - * @param {String} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} - * - **/ - this.setNewLineMode = function(newLineMode) { - if (this.$newLineMode === newLineMode) - return; - - this.$newLineMode = newLineMode; - this._signal("changeNewLineMode"); - }; - - /** - * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} - * @returns {String} - **/ - this.getNewLineMode = function() { - return this.$newLineMode; - }; - - /** - * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). - * @param {String} text The text to check - * - **/ - this.isNewLine = function(text) { - return (text == "\r\n" || text == "\r" || text == "\n"); - }; - - /** - * Returns a verbatim copy of the given line as it is in the document - * @param {Number} row The row index to retrieve - * - **/ - this.getLine = function(row) { - return this.$lines[row] || ""; - }; - - /** - * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. - * @param {Number} firstRow The first row index to retrieve - * @param {Number} lastRow The final row index to retrieve - * - **/ - this.getLines = function(firstRow, lastRow) { - return this.$lines.slice(firstRow, lastRow + 1); - }; - - /** - * Returns all lines in the document as string array. - **/ - this.getAllLines = function() { - return this.getLines(0, this.getLength()); - }; - - /** - * Returns the number of rows in the document. - **/ - this.getLength = function() { - return this.$lines.length; - }; - - /** - * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} - * @param {Range} range The range to work with - * - * @returns {String} - **/ - this.getTextRange = function(range) { - if (range.start.row == range.end.row) { - return this.getLine(range.start.row) - .substring(range.start.column, range.end.column); - } - var lines = this.getLines(range.start.row, range.end.row); - lines[0] = (lines[0] || "").substring(range.start.column); - var l = lines.length - 1; - if (range.end.row - range.start.row == l) - lines[l] = lines[l].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; - } else if (position.row < 0) - position.row = 0; - return position; - }; - - /** - * Inserts a block of `text` at the indicated `position`. - * @param {Object} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` - * @param {String} text A chunk of text to insert - * @returns {Object} The position ({row, column}) of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - * - **/ - this.insert = function(position, text) { - if (!text || text.length === 0) - return position; - - position = this.$clipPosition(position); - - // only detect new lines if the document has no line break yet - 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; - }; - - /** - * Fires whenever the document changes. - * - * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available: - * - * * `"insertLines"` (emitted by [[Document.insertLines]]) - * * `range`: the [[Range]] of the change within the document - * * `lines`: the lines in the document that are changing - * * `"insertText"` (emitted by [[Document.insertNewLine]]) - * * `range`: the [[Range]] of the change within the document - * * `text`: the text that's being added - * * `"removeLines"` (emitted by [[Document.insertLines]]) - * * `range`: the [[Range]] of the change within the document - * * `lines`: the lines in the document that were removed - * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]]) - * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]]) - * * `range`: the [[Range]] of the change within the document - * * `text`: the text that's being removed - * - * @event change - * @param {Object} e Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties. - * - **/ - /** - * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. - * @param {Number} row The index of the row to insert at - * @param {Array} lines An array of strings - * @returns {Object} Contains the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * If `lines` is empty, this function returns an object containing the current row, and column, like this: - * ``` - * {row: row, column: 0} - * ``` - * - **/ - this.insertLines = function(row, lines) { - if (row >= this.getLength()) - return this.insert({row: row, column: 0}, "\n" + lines.join("\n")); - return this._insertLines(Math.max(row, 0), lines); - }; - this._insertLines = function(row, lines) { - if (lines.length == 0) - return {row: row, column: 0}; - - // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF) - // to circumvent that we have to break huge inserts into smaller chunks here - while (lines.length > 0xF000) { - var end = this._insertLines(row, lines.slice(0, 0xF000)); - lines = lines.slice(0xF000); - row = end.row; - } - - 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._signal("change", { data: delta }); - return range.end; - }; - - /** - * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. - * @param {Object} position The position to insert at - * @returns {Object} Returns an object containing the final row and column, like this:
- * ``` - * {row: endRow, column: 0} - * ``` - * - **/ - 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._signal("change", { data: delta }); - - return end; - }; - - /** - * Inserts `text` into the `position` at the current row. This method also triggers the `'change'` event. - * @param {Object} position The position to insert at; it's an object that looks like `{ row: row, column: column}` - * @param {String} text A chunk of text - * @returns {Object} Returns an object containing the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * - **/ - 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._signal("change", { data: delta }); - - return end; - }; - - /** - * Removes the `range` from the document. - * @param {Range} range A specified Range to remove - * @returns {Object} Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. - * - **/ - this.remove = function(range) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - // 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; - }; - - /** - * Removes the specified columns from the `row`. This method also triggers the `'change'` event. - * @param {Number} row The row to remove from - * @param {Number} startColumn The column to start removing at - * @param {Number} endColumn The column to stop removing at - * @returns {Object} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
If `startColumn` is equal to `endColumn`, this function returns nothing. - * - **/ - 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._signal("change", { data: delta }); - return range.start; - }; - - /** - * Removes a range of full lines. This method also triggers the `'change'` event. - * @param {Number} firstRow The first row to be removed - * @param {Number} lastRow The last row to be removed - * @returns {[String]} Returns all the removed lines. - * - **/ - this.removeLines = function(firstRow, lastRow) { - if (firstRow < 0 || lastRow >= this.getLength()) - return this.remove(new Range(firstRow, 0, lastRow + 1, 0)); - return this._removeLines(firstRow, lastRow); - }; - - 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._signal("change", { data: delta }); - return removed; - }; - - /** - * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. - * @param {Number} row The row to check - * - **/ - 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._signal("change", { data: delta }); - }; - - /** - * Replaces a range in the document with the new `text`. - * @param {Range} range A specified Range to replace - * @param {String} text The new text to use as a replacement - * @returns {Object} Returns an object containing the final row and column, like this: - * {row: endRow, column: 0} - * If the text and range are empty, this function returns an object containing the current `range.start` value. - * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. - * - **/ - this.replace = function(range, text) { - if (!(range instanceof Range)) - range = Range.fromPoints(range.start, range.end); - 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; - }; - - /** - * Applies all the changes previously accumulated. These can be either `'insertText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. - **/ - 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); - } - }; - - /** - * Converts an index position in a document to a `{row, column}` object. - * - * Index refers to the "absolute position" of a character in the document. For example: - * - * ```javascript - * var x = 0; // 10 characters, plus one for newline - * var y = -1; - * ``` - * - * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. - * - * @param {Number} index An index to convert - * @param {Number} startRow=0 The row from which to start the conversion - * @returns {Object} A `{row, column}` object of the `index` position - */ - this.indexToPosition = function(index, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - for (var i = startRow || 0, l = lines.length; i < l; i++) { - index -= lines[i].length + newlineLength; - if (index < 0) - return {row: i, column: index + lines[i].length + newlineLength}; - } - return {row: l-1, column: lines[l-1].length}; - }; - - /** - * Converts the `{row, column}` position in a document to the character's index. - * - * Index refers to the "absolute position" of a character in the document. For example: - * - * ```javascript - * var x = 0; // 10 characters, plus one for newline - * var y = -1; - * ``` - * - * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. - * - * @param {Object} pos The `{row, column}` to convert - * @param {Number} startRow=0 The row from which to start the conversion - * @returns {Number} The index position in the document - */ - this.positionToIndex = function(pos, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - var index = 0; - var row = Math.min(pos.row, lines.length); - for (var i = startRow || 0; i < row; ++i) - index += lines[i].length + newlineLength; - - return index + pos.column; - }; - -}).call(Document.prototype); - -exports.Document = Document; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document_test.js deleted file mode 100644 index 5c324db0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document_test.js +++ /dev/null @@ -1,306 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("./test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var Document = require("./document").Document; -var Range = require("./range").Range; -var assert = require("./test/assertions"); - -module.exports = { - - "test: insert text in line" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insert({row: 0, column: 1}, "juhu"); - assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["12", "34"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n")); - }, - - "test: insert new line" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insertNewLine({row: 0, column: 1}); - assert.equal(doc.getValue(), ["1", "2", "34"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["12", "34"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["1", "2", "34"].join("\n")); - }, - - "test: insert lines at the beginning" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insertLines(0, ["aa", "bb"]); - assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["12", "34"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n")); - }, - - "test: insert lines at the end" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insertLines(2, ["aa", "bb"]); - assert.equal(doc.getValue(), ["12", "34", "aa", "bb"].join("\n")); - }, - - "test: insert lines in the middle" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insertLines(1, ["aa", "bb"]); - assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["12", "34"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n")); - }, - - "test: insert multi line string at the start" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insert({row: 0, column: 0}, "aa\nbb\ncc"); - assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["12", "34"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n")); - }, - - "test: insert multi line string at the end" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insert({row: 2, column: 0}, "aa\nbb\ncc"); - assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["12", "34"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n")); - }, - - "test: insert multi line string in the middle" : function() { - var doc = new Document(["12", "34"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.insert({row: 0, column: 1}, "aa\nbb\ncc"); - assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["12", "34"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n")); - }, - - "test: delete in line" : function() { - var doc = new Document(["1234", "5678"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.remove(new Range(0, 1, 0, 3)); - assert.equal(doc.getValue(), ["14", "5678"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["1234", "5678"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["14", "5678"].join("\n")); - }, - - "test: delete new line" : function() { - var doc = new Document(["1234", "5678"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.remove(new Range(0, 4, 1, 0)); - assert.equal(doc.getValue(), ["12345678"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["1234", "5678"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["12345678"].join("\n")); - }, - - "test: delete multi line range line" : function() { - var doc = new Document(["1234", "5678", "abcd"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.remove(new Range(0, 2, 2, 2)); - assert.equal(doc.getValue(), ["12cd"].join("\n")); - - var d = deltas.concat(); - doc.revertDeltas(d); - assert.equal(doc.getValue(), ["1234", "5678", "abcd"].join("\n")); - - doc.applyDeltas(d); - assert.equal(doc.getValue(), ["12cd"].join("\n")); - }, - - "test: delete full lines" : function() { - var doc = new Document(["1234", "5678", "abcd"]); - - var deltas = []; - doc.on("change", function(e) { deltas.push(e.data); }); - - doc.remove(new Range(1, 0, 3, 0)); - assert.equal(doc.getValue(), ["1234", ""].join("\n")); - }, - - "test: remove lines should return the removed lines" : function() { - var doc = new Document(["1234", "5678", "abcd"]); - - var removed = doc.removeLines(1, 2); - assert.equal(removed.join("\n"), ["5678", "abcd"].join("\n")); - }, - - "test: should handle unix style new lines" : function() { - var doc = new Document(["1", "2", "3"]); - assert.equal(doc.getValue(), ["1", "2", "3"].join("\n")); - }, - - "test: should handle windows style new lines" : function() { - var doc = new Document(["1", "2", "3"].join("\r\n")); - - doc.setNewLineMode("unix"); - assert.equal(doc.getValue(), ["1", "2", "3"].join("\n")); - }, - - "test: set new line mode to 'windows' should use '\\r\\n' as new lines": function() { - var doc = new Document(["1", "2", "3"].join("\n")); - doc.setNewLineMode("windows"); - assert.equal(doc.getValue(), ["1", "2", "3"].join("\r\n")); - }, - - "test: set new line mode to 'unix' should use '\\n' as new lines": function() { - var doc = new Document(["1", "2", "3"].join("\r\n")); - - doc.setNewLineMode("unix"); - assert.equal(doc.getValue(), ["1", "2", "3"].join("\n")); - }, - - "test: set new line mode to 'auto' should detect the incoming nl type": function() { - var doc = new Document(["1", "2", "3"].join("\n")); - - doc.setNewLineMode("auto"); - assert.equal(doc.getValue(), ["1", "2", "3"].join("\n")); - - var doc = new Document(["1", "2", "3"].join("\r\n")); - - doc.setNewLineMode("auto"); - assert.equal(doc.getValue(), ["1", "2", "3"].join("\r\n")); - - doc.replace(new Range(0, 0, 2, 1), ["4", "5", "6"].join("\n")); - assert.equal(["4", "5", "6"].join("\n"), doc.getValue()); - }, - - "test: set value": function() { - var doc = new Document("1"); - assert.equal("1", doc.getValue()); - - doc.setValue(doc.getValue()); - assert.equal("1", doc.getValue()); - - var doc = new Document("1\n2"); - assert.equal("1\n2", doc.getValue()); - - doc.setValue(doc.getValue()); - assert.equal("1\n2", doc.getValue()); - }, - - "test: empty document has to contain one line": function() { - var doc = new Document(""); - assert.equal(doc.$lines.length, 1); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js deleted file mode 100644 index b11ff05c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +++ /dev/null @@ -1,2551 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var config = require("./config"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var Selection = require("./selection").Selection; -var TextMode = require("./mode/text").Mode; -var Range = require("./range").Range; -var Document = require("./document").Document; -var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer; -var SearchHighlight = require("./search_highlight").SearchHighlight; - -/** - * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. - * - * `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. - * @class EditSession - **/ - -//{ events -/** - * - * Emitted when the document changes. - * @event change - * @param {Object} e An object containing a `delta` of information about the change. - **/ -/** - * Emitted when the tab size changes, via [[EditSession.setTabSize]]. - * - * @event changeTabSize - **/ -/** - * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. - * - * @event changeOverwrite - **/ -/** - * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. - * - * @event changeBreakpoint - **/ -/** - * Emitted when a front marker changes. - * - * @event changeFrontMarker - **/ -/** - * Emitted when a back marker changes. - * - * @event changeBackMarker - **/ -/** - * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. - * - * @event changeAnnotation - **/ -/** - * Emitted when a background tokenizer asynchronously processes new rows. - * @event tokenizerUpdate - * - * @param {Object} e An object containing one property, `"data"`, that contains information about the changing rows - * - **/ -/** - * Emitted when the current mode changes. - * - * @event changeMode - * - **/ -/** - * Emitted when the wrap mode changes. - * - * @event changeWrapMode - * - **/ -/** - * Emitted when the wrapping limit changes. - * - * @event changeWrapLimit - * - **/ -/** - * Emitted when a code fold is added or removed. - * - * @event changeFold - * - **/ - /** - * Emitted when the scroll top changes. - * @event changeScrollTop - * - * @param {Number} scrollTop The new scroll top value - **/ -/** - * Emitted when the scroll left changes. - * @event changeScrollLeft - * - * @param {Number} scrollLeft The new scroll left value - **/ -//} - -/** - * - * Sets up a new `EditSession` and associates it with the given `Document` and `TextMode`. - * @param {Document | String} text [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} - * @param {TextMode} mode [The inital language mode to use for the document]{: #modeParam} - * - * @constructor - **/ - -var EditSession = function(text, mode) { - this.$breakpoints = []; - this.$decorations = []; - this.$frontMarkers = {}; - this.$backMarkers = {}; - this.$markerId = 1; - this.$undoSelect = true; - - this.$foldData = []; - this.$foldData.toString = function() { - return this.join("\n"); - } - this.on("changeFold", this.onChangeFold.bind(this)); - this.$onChange = this.onChange.bind(this); - - if (typeof text != "object" || !text.getLine) - text = new Document(text); - - this.setDocument(text); - this.selection = new Selection(this); - - config.resetOptions(this); - this.setMode(mode); - config._signal("session", this); -}; - - -(function() { - - oop.implement(this, EventEmitter); - - /** - * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. - * - * @param {Document} doc The new `Document` to use - * - **/ - this.setDocument = function(doc) { - if (this.doc) - this.doc.removeListener("change", this.$onChange); - - this.doc = doc; - doc.on("change", this.$onChange); - - if (this.bgTokenizer) - this.bgTokenizer.setDocument(this.getDocument()); - - this.resetCaches(); - }; - - /** - * Returns the `Document` associated with this session. - * @return {Document} - **/ - this.getDocument = function() { - return this.doc; - }; - - /** - * @param {Number} row The row to work with - * - **/ - this.$resetRowCache = function(docRow) { - if (!docRow) { - this.$docRowCache = []; - this.$screenRowCache = []; - return; - } - var l = this.$docRowCache.length; - var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1; - if (l > i) { - this.$docRowCache.splice(i, l); - this.$screenRowCache.splice(i, l); - } - }; - - this.$getRowCacheIndex = function(cacheArray, val) { - var low = 0; - var hi = cacheArray.length - 1; - - while (low <= hi) { - var mid = (low + hi) >> 1; - var c = cacheArray[mid]; - - if (val > c) - low = mid + 1; - else if (val < c) - hi = mid - 1; - else - return mid; - } - - return low -1; - }; - - this.resetCaches = function() { - this.$modified = true; - this.$wrapData = []; - this.$rowLengthCache = []; - this.$resetRowCache(0); - if (this.bgTokenizer) - this.bgTokenizer.start(0); - }; - - 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 && this.bgTokenizer.$updateOnChange(delta); - this._signal("change", e); - }; - - /** - * Sets the session text. - * @param {String} text The new text to place - * - **/ - this.setValue = function(text) { - this.doc.setValue(text); - this.selection.moveTo(0, 0); - - this.$resetRowCache(0); - this.$deltas = []; - this.$deltasDoc = []; - this.$deltasFold = []; - this.setUndoManager(this.$undoManager); - this.getUndoManager().reset(); - }; - - /** - * Returns the current [[Document `Document`]] as a string. - * @method toString - * @returns {String} - * @alias EditSession.getValue - * - **/ - - /** - * Returns the current [[Document `Document`]] as a string. - * @method getValue - * @returns {String} - * @alias EditSession.toString - **/ - this.getValue = - this.toString = function() { - return this.doc.getValue(); - }; - - /** - * Returns the string of the current selection. - **/ - this.getSelection = function() { - return this.selection; - }; - - /** - * {:BackgroundTokenizer.getState} - * @param {Number} row The row to start at - * - * @related BackgroundTokenizer.getState - **/ - this.getState = function(row) { - return this.bgTokenizer.getState(row); - }; - - /** - * Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows. - * @param {Number} row The row to start at - * - * - * - **/ - this.getTokens = function(row) { - return this.bgTokenizer.getTokens(row); - }; - - /** - * Returns an object indicating the token at the current row. The object has two properties: `index` and `start`. - * @param {Number} row The row number to retrieve from - * @param {Number} column The column number to retrieve from - * - * - **/ - this.getTokenAt = function(row, column) { - var tokens = this.bgTokenizer.getTokens(row); - 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; - }; - - /** - * Sets the undo manager. - * @param {UndoManager} undoManager The new undo manager - * - * - **/ - this.setUndoManager = function(undoManager) { - this.$undoManager = undoManager; - 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], - merge: self.mergeUndoDeltas - }); - } - self.mergeUndoDeltas = false; - self.$deltas = []; - }; - this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); - } - }; - - /** - * starts a new group in undo history - **/ - this.markUndoGroup = function() { - if (this.$syncInformUndoManager) - this.$syncInformUndoManager(); - }; - - this.$defaultUndoManager = { - undo: function() {}, - redo: function() {}, - reset: function() {} - }; - - /** - * Returns the current undo manager. - **/ - this.getUndoManager = function() { - return this.$undoManager || this.$defaultUndoManager; - }; - - /** - * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`. - **/ - this.getTabString = function() { - if (this.getUseSoftTabs()) { - return lang.stringRepeat(" ", this.getTabSize()); - } else { - return "\t"; - } - }; - - /** - /** - * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). - * @param {Boolean} useSoftTabs Value indicating whether or not to use soft tabs - **/ - this.setUseSoftTabs = function(val) { - this.setOption("useSoftTabs", val); - }; - /** - * Returns `true` if soft tabs are being used, `false` otherwise. - * @returns {Boolean} - **/ - this.getUseSoftTabs = function() { - // todo might need more general way for changing settings from mode, but this is ok for now - return this.$useSoftTabs && !this.$mode.$indentWithTabs; - }; - /** - * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. - * @param {Number} tabSize The new tab size - **/ - this.setTabSize = function(tabSize) { - this.setOption("tabSize", tabSize); - }; - /** - * Returns the current tab size. - **/ - this.getTabSize = function() { - return this.$tabSize; - }; - - /** - * Returns `true` if the character at the position is a soft tab. - * @param {Object} position The position to check - * - * - **/ - this.isTabStop = function(position) { - return this.$useSoftTabs && (position.column % this.$tabSize === 0); - }; - - this.$overwrite = false; - /** - * Pass in `true` to enable overwrites in your session, or `false` to disable. - * - * If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. - * - * @param {Boolean} overwrite Defines wheter or not to set overwrites - * - * - **/ - this.setOverwrite = function(overwrite) { - this.setOption("overwrite", overwrite); - }; - - /** - * Returns `true` if overwrites are enabled; `false` otherwise. - **/ - this.getOverwrite = function() { - return this.$overwrite; - }; - - /** - * Sets the value of overwrite to the opposite of whatever it currently is. - **/ - this.toggleOverwrite = function() { - this.setOverwrite(!this.$overwrite); - }; - - /** - * Adds `className` to the `row`, to be used for CSS stylings and whatnot. - * @param {Number} row The row number - * @param {String} className The class to add - * - * - **/ - this.addGutterDecoration = function(row, className) { - if (!this.$decorations[row]) - this.$decorations[row] = ""; - this.$decorations[row] += " " + className; - this._signal("changeBreakpoint", {}); - }; - - /** - * Removes `className` from the `row`. - * @param {Number} row The row number - * @param {String} className The class to add - * - * - **/ - this.removeGutterDecoration = function(row, className) { - this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); - this._signal("changeBreakpoint", {}); - }; - - /** - * Returns an array of numbers, indicating which rows have breakpoints. - * @returns {[Number]} - **/ - this.getBreakpoints = function() { - return this.$breakpoints; - }; - - /** - * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. - * @param {Array} rows An array of row indices - * - * - * - **/ - 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); - - if (inToken) - var re = this.tokenRe; - else if (/^\s+$/.test(line.slice(column-1, column+1))) - var re = /\s/; - else - var re = 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); - }; - - /** - * Gets the range of a word, including its right whitespace. - * @param {Number} row The row number to start from - * @param {Number} column The column number to start from - * - * @return {Range} - **/ - this.getAWordRange = function(row, column) { - var wordRange = this.getWordRange(row, column); - var line = this.getLine(wordRange.end.row); - - while (line.charAt(wordRange.end.column).match(/[ \t]/)) { - wordRange.end.column += 1; - } - return wordRange; - }; - - /** - * {:Document.setNewLineMode.desc} - * @param {String} newLineMode {:Document.setNewLineMode.param} - * - * - * @related Document.setNewLineMode - **/ - this.setNewLineMode = function(newLineMode) { - this.doc.setNewLineMode(newLineMode); - }; - - /** - * - * Returns the current new line mode. - * @returns {String} - * @related Document.getNewLineMode - **/ - this.getNewLineMode = function() { - return this.doc.getNewLineMode(); - }; - - /** - * Identifies if you want to use a worker for the `EditSession`. - * @param {Boolean} useWorker Set to `true` to use a worker - * - **/ - this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); }; - - /** - * Returns `true` if workers are being used. - **/ - this.getUseWorker = function() { return this.$useWorker; }; - - /** - * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. - **/ - this.onReloadTokenizer = function(e) { - var rows = e.data; - this.bgTokenizer.start(rows.first); - this._signal("tokenizerUpdate", e); - }; - - this.$modes = {}; - - /** - * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. - * @param {TextMode} mode Set a new text mode - * @param {cb} optional callback - * - **/ - this.$mode = null; - this.$modeId = null; - this.setMode = function(mode, cb) { - if (mode && typeof mode === "object") { - if (mode.getTokenizer) - return this.$onChangeMode(mode); - var options = mode; - var path = options.path; - } else { - path = mode || "ace/mode/text"; - } - - // this is needed if ace isn't on require path (e.g tests in node) - if (!this.$modes["ace/mode/text"]) - this.$modes["ace/mode/text"] = new TextMode(); - - if (this.$modes[path] && !options) { - this.$onChangeMode(this.$modes[path]); - cb && cb(); - return; - } - // load on demand - this.$modeId = path; - config.loadModule(["mode", path], function(m) { - if (this.$modeId !== path) - return cb && cb(); - if (this.$modes[path] && !options) { - this.$onChangeMode(this.$modes[path]); - } else if (m && m.Mode) { - m = new m.Mode(options); - if (!options) { - this.$modes[path] = m; - m.$id = path; - } - this.$onChangeMode(m); - } - cb && cb(); - }.bind(this)); - - // set mode to text until loading is finished - if (!this.$mode) - this.$onChangeMode(this.$modes["ace/mode/text"], true); - }; - - this.$onChangeMode = function(mode, $isPlaceholder) { - if (!$isPlaceholder) - this.$modeId = mode.$id; - 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._signal("tokenizerUpdate", e); - }); - } else { - this.bgTokenizer.setTokenizer(tokenizer); - } - - this.bgTokenizer.setDocument(this.getDocument()); - - this.tokenRe = mode.tokenRe; - this.nonTokenRe = mode.nonTokenRe; - - - if (!$isPlaceholder) { - // experimental method, used by c9 findiniles - if (mode.attachToSession) - mode.attachToSession(this); - this.$options.wrapMethod.set.call(this, this.$wrapMethod); - this.$setFolding(mode.foldingRules); - this.bgTokenizer.start(0); - this._emit("changeMode"); - } - }; - - this.$stopWorker = function() { - if (this.$worker) { - this.$worker.terminate(); - this.$worker = null; - } - }; - - this.$startWorker = function() { - try { - this.$worker = this.$mode.createWorker(this); - } catch (e) { - config.warn("Could not load worker", e); - this.$worker = null; - } - }; - - /** - * Returns the current text mode. - * @returns {TextMode} The current text mode - **/ - this.getMode = function() { - return this.$mode; - }; - - this.$scrollTop = 0; - /** - * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. - * @param {Number} scrollTop The new scroll top value - * - **/ - this.setScrollTop = function(scrollTop) { - // TODO: should we force integer lineheight instead? scrollTop = Math.round(scrollTop); - if (this.$scrollTop === scrollTop || isNaN(scrollTop)) - return; - - this.$scrollTop = scrollTop; - this._signal("changeScrollTop", scrollTop); - }; - - /** - * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - * @returns {Number} - **/ - this.getScrollTop = function() { - return this.$scrollTop; - }; - - this.$scrollLeft = 0; - /** - * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} - **/ - this.setScrollLeft = function(scrollLeft) { - // scrollLeft = Math.round(scrollLeft); - if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft)) - return; - - this.$scrollLeft = scrollLeft; - this._signal("changeScrollLeft", scrollLeft); - }; - - /** - * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - * @returns {Number} - **/ - this.getScrollLeft = function() { - return this.$scrollLeft; - }; - - /** - * Returns the width of the screen. - * @returns {Number} - **/ - this.getScreenWidth = function() { - this.$computeWidth(); - if (this.lineWidgets) - return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth); - return this.screenWidth; - }; - - this.getLineWidgetMaxWidth = function() { - if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth; - var width = 0; - this.lineWidgets.forEach(function(w) { - if (w && w.screenWidth > width) - width = w.screenWidth; - }); - return this.lineWidgetWidth = width; - }; - - this.$computeWidth = function(force) { - if (this.$modified || force) { - this.$modified = false; - - if (this.$useWrapMode) - return this.screenWidth = this.$wrapLimit; - - var lines = this.doc.getAllLines(); - var cache = this.$rowLengthCache; - var longestScreenLine = 0; - var foldIndex = 0; - var foldLine = this.$foldData[foldIndex]; - var foldStart = foldLine ? foldLine.start.row : Infinity; - var len = lines.length; - - for (var i = 0; i < len; i++) { - if (i > foldStart) { - i = foldLine.end.row + 1; - if (i >= len) - break; - foldLine = this.$foldData[foldIndex++]; - foldStart = foldLine ? foldLine.start.row : Infinity; - } - - if (cache[i] == null) - cache[i] = this.$getStringScreenWidth(lines[i])[0]; - - if (cache[i] > longestScreenLine) - longestScreenLine = cache[i]; - } - this.screenWidth = longestScreenLine; - } - }; - - /** - * Returns a verbatim copy of the given line as it is in the document - * @param {Number} row The row to retrieve from - * - * - * @returns {String} - * - **/ - this.getLine = function(row) { - return this.doc.getLine(row); - }; - - /** - * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. - * @param {Number} firstRow The first row index to retrieve - * @param {Number} lastRow The final row index to retrieve - * - * @returns {[String]} - * - **/ - this.getLines = function(firstRow, lastRow) { - return this.doc.getLines(firstRow, lastRow); - }; - - /** - * Returns the number of rows in the document. - * @returns {Number} - **/ - this.getLength = function() { - return this.doc.getLength(); - }; - - /** - * {:Document.getTextRange.desc} - * @param {Range} range The range to work with - * - * @returns {String} - **/ - this.getTextRange = function(range) { - return this.doc.getTextRange(range || this.selection.getRange()); - }; - - /** - * Inserts a block of `text` and the indicated `position`. - * @param {Object} position The position {row, column} to start inserting at - * @param {String} text A chunk of text to insert - * @returns {Object} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - * - * - **/ - this.insert = function(position, text) { - return this.doc.insert(position, text); - }; - - /** - * Removes the `range` from the document. - * @param {Range} range A specified Range to remove - * @returns {Object} The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. - * - * @related Document.remove - * - **/ - this.remove = function(range) { - return this.doc.remove(range); - }; - - /** - * Reverts previous changes to your document. - * @param {Array} deltas An array of previous changes - * @param {Boolean} dontSelect [If `true`, doesn't select the range of where the change occured]{: #dontSelect} - * - * - * @returns {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--) { - var 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 && - this.$undoSelect && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }; - - /** - * Re-implements a previously undone change to your document. - * @param {Array} deltas An array of previous changes - * @param {Boolean} dontSelect {:dontSelect} - * - * - * @returns {Range} - **/ - this.redoChanges = function(deltas, dontSelect) { - if (!deltas.length) - return; - - this.$fromUndo = true; - var lastUndoRange = null; - for (var i = 0; i < deltas.length; i++) { - var delta = deltas[i]; - if (delta.group == "doc") { - this.doc.applyDeltas(delta.deltas); - lastUndoRange = - this.$getUndoSelection(delta.deltas, false, lastUndoRange); - } - } - this.$fromUndo = false; - lastUndoRange && - this.$undoSelect && - !dontSelect && - this.selection.setSelectionRange(lastUndoRange); - return lastUndoRange; - }; - - /** - * Enables or disables highlighting of the range where an undo occured. - * @param {Boolean} enable If `true`, selects the range of the reinserted change - * - **/ - this.setUndoSelect = function(enable) { - this.$undoSelect = enable; - }; - - 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 = Range.fromPoints(delta.range.start, delta.range.end); - 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) { - if (Range.comparePoints(lastUndoRange.start, range.start) === 0) { - lastUndoRange.start.column += range.end.column - range.start.column; - lastUndoRange.end.column += range.end.column - range.start.column; - } - - var cmp = lastUndoRange.compareRange(range); - if (cmp == 1) { - range.setStart(lastUndoRange.start); - } else if (cmp == -1) { - range.setEnd(lastUndoRange.end); - } - } - - return range; - }; - - /** - * Replaces a range in the document with the new `text`. - * - * @param {Range} range A specified Range to replace - * @param {String} text The new text to use as a replacement - * @returns {Object} An object containing the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * If the text and range are empty, this function returns an object containing the current `range.start` value. - * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value. - * - * - * - * @related Document.replace - * - * - **/ - this.replace = function(range, text) { - return this.doc.replace(range, text); - }; - - /** - * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: - * ```json - * { row: newRowLocation, column: newColumnLocation } - * ``` - * @param {Range} fromRange The range of text you want moved within the document - * @param {Object} toPosition The location (row and column) where you want to move the text to - * @returns {Range} The new range where the text was moved to. - * - * - * - **/ - this.moveText = function(fromRange, toPosition, copy) { - var text = this.getTextRange(fromRange); - var folds = this.getFoldsInRange(fromRange); - - var toRange = Range.fromPoints(toPosition, toPosition); - if (!copy) { - this.remove(fromRange); - var rowDiff = fromRange.start.row - fromRange.end.row; - var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column; - if (collDiff) { - if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column) - toRange.start.column += collDiff; - if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column) - toRange.end.column += collDiff; - } - if (rowDiff && toRange.start.row >= fromRange.end.row) { - toRange.start.row += rowDiff; - toRange.end.row += rowDiff; - } - } - - toRange.end = this.insert(toRange.start, text); - if (folds.length) { - var oldStart = fromRange.start; - var newStart = toRange.start; - var rowDiff = newStart.row - oldStart.row; - var collDiff = newStart.column - oldStart.column; - this.addFolds(folds.map(function(x) { - x = x.clone(); - if (x.start.row == oldStart.row) - x.start.column += collDiff; - if (x.end.row == oldStart.row) - x.end.column += collDiff; - x.start.row += rowDiff; - x.end.row += rowDiff; - return x; - })); - } - - return toRange; - }; - - /** - * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. - * - * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. - * @param {Number} startRow Starting row - * @param {Number} endRow Ending row - * @param {String} indentString The indent token - * - * - **/ - 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); - }; - - /** - * Outdents all the rows defined by the `start` and `end` properties of `range`. - * @param {Range} range A range of rows - * - * - **/ - 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.$moveLines = function(firstRow, lastRow, dir) { - firstRow = this.getRowFoldStart(firstRow); - lastRow = this.getRowFoldEnd(lastRow); - if (dir < 0) { - var row = this.getRowFoldStart(firstRow + dir); - if (row < 0) return 0; - var diff = row-firstRow; - } else if (dir > 0) { - var row = this.getRowFoldEnd(lastRow + dir); - if (row > this.doc.getLength()-1) return 0; - var diff = row-lastRow; - } else { - firstRow = this.$clipRowToDocument(firstRow); - lastRow = this.$clipRowToDocument(lastRow); - var diff = lastRow - firstRow + 1; - } - - var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE); - var folds = this.getFoldsInRange(range).map(function(x){ - x = x.clone(); - x.start.row += diff; - x.end.row += diff; - return x; - }); - - var lines = dir == 0 - ? this.doc.getLines(firstRow, lastRow) - : this.doc.removeLines(firstRow, lastRow); - this.doc.insertLines(firstRow+diff, lines); - folds.length && this.addFolds(folds); - return diff; - }; - /** - * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. - * @param {Number} firstRow The starting row to move up - * @param {Number} lastRow The final row to move up - * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. - * - * @related Document.insertLines - * - **/ - this.moveLinesUp = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, -1); - }; - - /** - * Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`. - * @param {Number} firstRow The starting row to move down - * @param {Number} lastRow The final row to move down - * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. - * - * @related Document.insertLines - **/ - this.moveLinesDown = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, 1); - }; - - /** - * Duplicates all the text between `firstRow` and `lastRow`. - * @param {Number} firstRow The starting row to duplicate - * @param {Number} lastRow The final row to duplicate - * @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. - * - * - **/ - this.duplicateLines = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, 0); - }; - - - this.$clipRowToDocument = function(row) { - return Math.max(0, Math.min(row, this.doc.getLength()-1)); - }; - - this.$clipColumnToRow = function(row, column) { - if (column < 0) - return 0; - return Math.min(this.doc.getLine(row).length, column); - }; - - - 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 - }; - }; - - this.$clipRangeToDocument = function(range) { - if (range.start.row < 0) { - range.start.row = 0; - range.start.column = 0; - } else { - range.start.column = this.$clipColumnToRow( - range.start.row, - range.start.column - ); - } - - var len = this.doc.getLength() - 1; - if (range.end.row > len) { - range.end.row = len; - range.end.column = this.doc.getLine(len).length; - } else { - range.end.column = this.$clipColumnToRow( - range.end.row, - range.end.column - ); - } - return range; - }; - - // WRAPMODE - this.$wrapLimit = 80; - this.$useWrapMode = false; - this.$wrapLimitRange = { - min : null, - max : null - }; - - /** - * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. - * @param {Boolean} useWrapMode Enable (or disable) wrap mode - * - * - **/ - 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 = Array(len); - this.$updateWrapData(0, len - 1); - } - - this._signal("changeWrapMode"); - } - }; - - /** - * Returns `true` if wrap mode is being used; `false` otherwise. - * @returns {Boolean} - **/ - 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. - /** - * Sets the boundaries of wrap. Either value can be `null` to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for `min` or `max` are different, this method also emits the `'changeWrapMode'` event. - * @param {Number} min The minimum wrap value (the left side wrap) - * @param {Number} max The maximum wrap value (the right side wrap) - * - * - **/ - this.setWrapLimitRange = function(min, max) { - if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { - this.$wrapLimitRange = { - min: min, - max: max - }; - this.$modified = true; - // This will force a recalculation of the wrap limit - this._signal("changeWrapMode"); - } - }; - - /** - * This should generally only be called by the renderer when a resize is detected. - * @param {Number} desiredLimit The new wrap limit - * @returns {Boolean} - * - * @private - **/ - this.adjustWrapLimit = function(desiredLimit, $printMargin) { - var limits = this.$wrapLimitRange; - if (limits.max < 0) - limits = {min: $printMargin, max: $printMargin}; - var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max); - if (wrapLimit != this.$wrapLimit && wrapLimit > 1) { - this.$wrapLimit = wrapLimit; - this.$modified = true; - if (this.$useWrapMode) { - this.$updateWrapData(0, this.getLength() - 1); - this.$resetRowCache(0); - this._signal("changeWrapLimit"); - } - return true; - } - return false; - }; - - this.$constrainWrapLimit = function(wrapLimit, min, max) { - if (min) - wrapLimit = Math.max(min, wrapLimit); - - if (max) - wrapLimit = Math.min(max, wrapLimit); - - return wrapLimit; - }; - - /** - * Returns the value of wrap limit. - * @returns {Number} The wrap limit. - **/ - this.getWrapLimit = function() { - return this.$wrapLimit; - }; - - /** - * Sets the line length for soft wrap in the editor. Lines will break - * at a minimum of the given length minus 20 chars and at a maximum - * of the given number of chars. - * @param {number} limit The maximum line length in chars, for soft wrapping lines. - */ - this.setWrapLimit = function (limit) { - this.setWrapLimitRange(limit, limit); - }; - - /** - * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: - * - * { min: wrapLimitRange_min, max: wrapLimitRange_max } - * - * @returns {Object} - **/ - 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; - var lastRow = e.data.range.end.row; - var start = e.data.range.start; - var 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; - } - - this.$updating = true; - if (len != 0) { - if (action.indexOf("remove") != -1) { - this[useWrapMode ? "$wrapData" : "$rowLengthCache"].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 = Array(len); - args.unshift(firstRow, 0); - var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache - arr.splice.apply(arr, 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); - if (foldLine) { - 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. - 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!"); - } - this.$updating = false; - - if (useWrapMode) - this.$updateWrapData(firstRow, lastRow); - else - this.$updateRowLengthCache(firstRow, lastRow); - - return removedFolds; - }; - - this.$updateRowLengthCache = function(firstRow, lastRow, b) { - this.$rowLengthCache[firstRow] = null; - this.$rowLengthCache[lastRow] = null; - }; - - 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, foldLine); - if (!foldLine) { - tokens = this.$getDisplayTokens(lines[row]); - wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); - row ++; - } else { - tokens = []; - foldLine.walk(function(placeholder, row, column, lastColumn) { - var walkTokens; - if (placeholder != null) { - 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 - ); - - wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); - row = foldLine.end.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) { - if (tokens.length == 0) { - return []; - } - - var splits = []; - var displayLength = tokens.length; - var lastSplit = 0, lastDocSplit = 0; - - var isCode = this.$wrapAsCode; - - 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() { - len -= 1; - }). - // Get all the CHAR_EXT/multipleWidth characters. - replace(/2/g, function() { - 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 - 1] >= SPACE && tokens[split] >= SPACE) { - /* disabled see https://github.com/ajaxorg/ace/issues/1186 - // 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 - (isCode ? 10 : wrapLimit-(wrapLimit>>2)), lastSplit - 1); - while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; - } - if (isCode) { - while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; - } - while (split > minSplit && tokens[split] == PUNCTUATION) { - split --; - } - } else { - while (split > minSplit && tokens[split] < SPACE) { - 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. - if (tokens[split] == CHAR_EXT) - split--; - addSplit(split); - } - return splits; - }; - - /** - * Given a string, returns an array of the display characters, including tabs and spaces. - * @param {String} str The string to check - * @param {Number} offset The value to start at - * - * - **/ - 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 string `str` on the screen while assuming that the string starts at the first column on the screen. - * @param {String} str The string to calculate the screen width of - * @param {Number} maxScreenColumn - * @param {Number} screenColumn - * @returns {[Number]} Returns an `int[]` array with two elements:
- * The first position indicates the number of columns for `str` on screen.
- * The second value contains the position of the document column that this function read until. - * - **/ - this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { - if (maxScreenColumn == 0) - return [0, 0]; - if (maxScreenColumn == null) - maxScreenColumn = Infinity; - 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]; - }; - - this.lineWidgets = null; - /** - * Returns number of screenrows in a wrapped line. - * @param {Number} row The row number to check - * - * @returns {Number} - **/ - this.getRowLength = function(row) { - if (this.lineWidgets) - var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0 - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1 + h; - } else { - return this.$wrapData[row].length + 1 + h; - } - }; - this.getRowLineCount = function(row) { - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1; - } else { - return this.$wrapData[row].length + 1; - } - }; - - /** - * Returns the position (on screen) for the last character in the provided screen row. - * @param {Number} screenRow The screen row to check - * @returns {Number} - * - * @related EditSession.documentToScreenColumn - **/ - this.getScreenLastRowColumn = function(screenRow) { - var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); - return this.documentToScreenColumn(pos.row, pos.column); - }; - - /** - * For the given document row and column, this returns the column position of the last screen row. - * @param {Number} docRow - * - * @param {Number} docColumn - **/ - this.getDocumentLastRowColumn = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.getScreenLastRowColumn(screenRow); - }; - - /** - * For the given document row and column, this returns the document position of the last row. - * @param {Number} docRow - * @param {Number} docColumn - * - * - **/ - this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { - var screenRow = this.documentToScreenRow(docRow, docColumn); - return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); - }; - - /** - * For the given row, this returns the split data. - * @returns {String} - **/ - this.getRowSplitData = function(row) { - if (!this.$useWrapMode) { - return undefined; - } else { - return this.$wrapData[row]; - } - }; - - /** - * The distance to the next tab stop at the specified screen column. - * @param {Number} screenColumn The screen column to check - * - * - * @returns {Number} - **/ - 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; - }; - - /** - * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} - * @param {Number} screenRow The screen row to check - * @param {Number} screenColumn The screen column to check - * @returns {Object} The object returned has two properties: `row` and `column`. - * - * - * @related EditSession.documentToScreenPosition - * - **/ - this.screenToDocumentPosition = function(screenRow, screenColumn) { - if (screenRow < 0) - return {row: 0, column: 0}; - - var line; - var docRow = 0; - var docColumn = 0; - var column; - var row = 0; - var rowLength = 0; - - var rowCache = this.$screenRowCache; - var i = this.$getRowCacheIndex(rowCache, screenRow); - var l = rowCache.length; - if (l && i >= 0) { - var row = rowCache[i]; - var docRow = this.$docRowCache[i]; - var doCache = screenRow > rowCache[l - 1]; - } else { - var doCache = !l; - } - - 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 > 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) { - this.$docRowCache.push(docRow); - this.$screenRowCache.push(row); - } - } - - if (foldLine && foldLine.start.row <= docRow) { - line = this.getFoldDisplayLine(foldLine); - docRow = foldLine.start.row; - } else if (row + rowLength <= screenRow || docRow > maxRow) { - // clip at the end of the document - return { - row: maxRow, - column: this.getLine(maxRow).length - }; - } else { - line = this.getLine(docRow); - foldLine = null; - } - - if (this.$useWrapMode) { - var splits = this.$wrapData[docRow]; - if (splits) { - var splitIndex = Math.floor(screenRow - row); - column = splits[splitIndex]; - if(splitIndex > 0 && splits.length) { - docColumn = splits[splitIndex - 1] || splits[splits.length - 1]; - line = line.substring(docColumn); - } - } - } - - docColumn += this.$getStringScreenWidth(line, screenColumn)[1]; - - // We remove one character at the end so that the docColumn - // position returned is not associated to the next row on the screen. - if (this.$useWrapMode && docColumn >= column) - docColumn = column - 1; - - if (foldLine) - return foldLine.idxToPosition(docColumn); - - return {row: docRow, column: docColumn}; - }; - - /** - * Converts document coordinates to screen coordinates. {:conversionConsiderations} - * @param {Number} docRow The document row to check - * @param {Number} docColumn The document column to check - * @returns {Object} The object returned by this method has two properties: `row` and `column`. - * - * - * @related EditSession.screenToDocumentPosition - * - **/ - 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 screenRow = 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.$docRowCache; - var i = this.$getRowCacheIndex(rowCache, docRow); - var l = rowCache.length; - if (l && i >= 0) { - var row = rowCache[i]; - var screenRow = this.$screenRowCache[i]; - var doCache = docRow > rowCache[l - 1]; - } else { - var doCache = !l; - } - - 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) { - this.$docRowCache.push(row); - this.$screenRowCache.push(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 = this.$wrapData[foldStartRow]; - if (wrapRow) { - 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] - }; - }; - - /** - * For the given document row and column, returns the screen column. - * @param {Number} row - * @param {Number} docColumn - * @returns {Number} - * - **/ - this.documentToScreenColumn = function(row, docColumn) { - return this.documentToScreenPosition(row, docColumn).column; - }; - - /** - * For the given document row and column, returns the screen row. - * @param {Number} docRow - * @param {Number} docColumn - * - * - **/ - this.documentToScreenRow = function(docRow, docColumn) { - return this.documentToScreenPosition(docRow, docColumn).row; - }; - - /** - * Returns the length of the screen. - * @returns {Number} - **/ - this.getScreenLength = function() { - var screenRows = 0; - var fold = null; - if (!this.$useWrapMode) { - screenRows = this.getLength(); - - // Remove the folded lines again. - var foldData = this.$foldData; - for (var i = 0; i < foldData.length; i++) { - fold = foldData[i]; - screenRows -= fold.end.row - fold.start.row; - } - } else { - var lastRow = this.$wrapData.length; - var row = 0, i = 0; - var fold = this.$foldData[i++]; - var foldStart = fold ? fold.start.row :Infinity; - - while (row < lastRow) { - var splits = this.$wrapData[row]; - screenRows += splits ? splits.length + 1 : 1; - row ++; - if (row > foldStart) { - row = fold.end.row+1; - fold = this.$foldData[i++]; - foldStart = fold ?fold.start.row :Infinity; - } - } - } - - // todo - if (this.lineWidgets) - screenRows += this.$getWidgetScreenLength(); - - return screenRows; - }; - - /** - * @private - * - */ - this.$setFontMetrics = function(fm) { - // todo - }; - - this.destroy = function() { - if (this.bgTokenizer) { - this.bgTokenizer.setDocument(null); - this.bgTokenizer = null; - } - this.$stopWorker(); - }; - - // 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("./edit_session/folding").Folding.call(EditSession.prototype); -require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); - - -config.defineOptions(EditSession.prototype, "session", { - wrap: { - set: function(value) { - if (!value || value == "off") - value = false; - else if (value == "free") - value = true; - else if (value == "printMargin") - value = -1; - else if (typeof value == "string") - value = parseInt(value, 10) || false; - - if (this.$wrap == value) - return; - if (!value) { - this.setUseWrapMode(false); - } else { - var col = typeof value == "number" ? value : null; - this.setWrapLimitRange(col, col); - this.setUseWrapMode(true); - } - this.$wrap = value; - }, - get: function() { - if (this.getUseWrapMode()) { - if (this.$wrap == -1) - return "printMargin"; - if (!this.getWrapLimitRange().min) - return "free"; - return this.$wrap; - } - return "off"; - }, - handlesSet: true - }, - wrapMethod: { - // code|text|auto - set: function(val) { - val = val == "auto" - ? this.$mode.type != "text" - : val != "text"; - if (val != this.$wrapAsCode) { - this.$wrapAsCode = val; - if (this.$useWrapMode) { - this.$modified = true; - this.$resetRowCache(0); - this.$updateWrapData(0, this.getLength() - 1); - } - } - }, - initialValue: "auto" - }, - firstLineNumber: { - set: function() {this._signal("changeBreakpoint");}, - initialValue: 1 - }, - useWorker: { - set: function(useWorker) { - this.$useWorker = useWorker; - - this.$stopWorker(); - if (useWorker) - this.$startWorker(); - }, - initialValue: true - }, - useSoftTabs: {initialValue: true}, - tabSize: { - set: function(tabSize) { - if (isNaN(tabSize) || this.$tabSize === tabSize) return; - - this.$modified = true; - this.$rowLengthCache = []; - this.$tabSize = tabSize; - this._signal("changeTabSize"); - }, - initialValue: 4, - handlesSet: true - }, - overwrite: { - set: function(val) {this._signal("changeOverwrite");}, - initialValue: false - }, - newLineMode: { - set: function(val) {this.doc.setNewLineMode(val)}, - get: function() {return this.doc.getNewLineMode()}, - handlesSet: true - }, - mode: { - set: function(val) { this.setMode(val) }, - get: function() { return this.$modeId } - } -}); - -exports.EditSession = EditSession; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js deleted file mode 100644 index 064ee3dc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +++ /dev/null @@ -1,221 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var TokenIterator = require("../token_iterator").TokenIterator; -var Range = require("../range").Range; - - -function BracketMatch() { - - this.findMatchingBracket = function(position, chr) { - if (position.column == 0) return null; - - var charBeforeCursor = chr || 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.getBracketRange = function(pos) { - var line = this.getLine(pos.row); - var before = true, range; - - var chr = line.charAt(pos.column-1); - var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); - if (!match) { - chr = line.charAt(pos.column); - pos = {row: pos.row, column: pos.column + 1}; - match = chr && chr.match(/([\(\[\{])|([\)\]\}])/); - before = false; - } - if (!match) - return null; - - if (match[1]) { - var bracketPos = this.$findClosingBracket(match[1], pos); - if (!bracketPos) - return null; - range = Range.fromPoints(pos, bracketPos); - if (!before) { - range.end.column++; - range.start.column--; - } - range.cursor = range.end; - } else { - var bracketPos = this.$findOpeningBracket(match[2], pos); - if (!bracketPos) - return null; - range = Range.fromPoints(bracketPos, pos); - if (!before) { - range.start.column++; - range.end.column--; - } - range.cursor = range.start; - } - - return range; - }; - - this.$brackets = { - ")": "(", - "(": ")", - "]": "[", - "[": "]", - "{": "}", - "}": "{" - }; - - this.$findOpeningBracket = function(bracket, position, typeRe) { - var openBracket = this.$brackets[bracket]; - var depth = 1; - - var iterator = new TokenIterator(this, position.row, position.column); - var token = iterator.getCurrentToken(); - if (!token) - token = iterator.stepForward(); - if (!token) - return; - - if (!typeRe){ - typeRe = new RegExp( - "(\\.?" + - token.type.replace(".", "\\.").replace("rparen", ".paren") - .replace(/\b(?:end|start|begin)\b/, "") - + ")+" - ); - } - - // 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 chr = value.charAt(valueIndex); - if (chr == openBracket) { - depth -= 1; - if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; - } - } - else if (chr == 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, typeRe) { - var closingBracket = this.$brackets[bracket]; - var depth = 1; - - var iterator = new TokenIterator(this, position.row, position.column); - var token = iterator.getCurrentToken(); - if (!token) - token = iterator.stepForward(); - if (!token) - return; - - if (!typeRe){ - typeRe = new RegExp( - "(\\.?" + - token.type.replace(".", "\\.").replace("lparen", ".paren") - .replace(/\b(?:end|start|begin)\b/, "") - + ")+" - ); - } - - // 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 chr = value.charAt(valueIndex); - if (chr == closingBracket) { - depth -= 1; - if (depth == 0) { - return {row: iterator.getCurrentTokenRow(), - column: valueIndex + iterator.getCurrentTokenColumn()}; - } - } - else if (chr == 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; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js deleted file mode 100644 index 232101bd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +++ /dev/null @@ -1,140 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Range = require("../range").Range; -var RangeList = require("../range_list").RangeList; -var oop = require("../lib/oop") -/* - * 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 = this.ranges = []; -}; - -oop.inherits(Fold, RangeList); - -(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()); - }); - fold.collapseChildren = this.collapseChildren; - return fold; - }; - - this.addSubFold = function(fold) { - if (this.range.isEqual(fold)) - return; - - if (!this.range.containsRange(fold)) - throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); - - // transform fold to local coordinates - consumeRange(fold, this.start); - - var row = fold.start.row, column = fold.start.column; - for (var i = 0, cmp = -1; i < this.subFolds.length; i++) { - cmp = this.subFolds[i].range.compare(row, column); - if (cmp != 1) - break; - } - var afterStart = this.subFolds[i]; - - if (cmp == 0) - return afterStart.addSubFold(fold); - - // cmp == -1 - var row = fold.range.end.row, column = fold.range.end.column; - for (var j = i, cmp = -1; j < this.subFolds.length; j++) { - cmp = this.subFolds[j].range.compare(row, column); - if (cmp != 1) - break; - } - var afterEnd = this.subFolds[j]; - - if (cmp == 0) - throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); - - var consumedFolds = this.subFolds.splice(i, j - i, fold); - fold.setFoldLine(this.foldLine); - - return fold; - }; - - this.restoreRange = function(range) { - return restoreRange(range, this.start); - }; - -}).call(Fold.prototype); - -function consumePoint(point, anchor) { - point.row -= anchor.row; - if (point.row == 0) - point.column -= anchor.column; -} -function consumeRange(range, anchor) { - consumePoint(range.start, anchor); - consumePoint(range.end, anchor); -} -function restorePoint(point, anchor) { - if (point.row == 0) - point.column += anchor.column; - point.row += anchor.row; -} -function restoreRange(range, anchor) { - restorePoint(range.start, anchor); - restorePoint(range.end, anchor); -} - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js deleted file mode 100644 index 9d73154d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +++ /dev/null @@ -1,269 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Range = require("../range").Range; - -/* - * If 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 new Error("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 new Error("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, - cmp, 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]; - - cmp = fold.range.compareStart(endRow, endColumn); - // This fold is after the endRow/Column. - if (cmp == -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 (cmp == 0), then end here. - if (stop || cmp === 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) - { - //throwing here breaks whole editor - //TODO: properly handle this - window.console && window.console.log(row, column, fold); - } 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 pos = this.getNextFoldTo(row, column); - - if (!pos || pos.kind == "inside") - return null; - - var fold = pos.fold; - var folds = this.folds; - var foldData = this.foldData; - - 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; - - 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; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js deleted file mode 100644 index a86c27ce..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +++ /dev/null @@ -1,859 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Range = require("../range").Range; -var FoldLine = require("./fold_line").FoldLine; -var Fold = require("./fold").Fold; -var TokenIterator = require("../token_iterator").TokenIterator; - -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) { - 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); - } - } - start.column -= 1; - end.column += 1; - - return foundFolds; - }; - - this.getFoldsInRangeList = function(ranges) { - if (Array.isArray(ranges)) { - var folds = []; - ranges.forEach(function(range) { - folds = folds.concat(this.getFoldsInRange(range)); - }, this); - } else { - var folds = this.getFoldsInRange(ranges); - } - return folds; - } - - /* - * Returns all folds in the document - */ - this.getAllFolds = function() { - var folds = []; - var foldLines = this.$foldData; - - for (var i = 0; i < foldLines.length; i++) - for (var j = 0; j < foldLines[i].folds.length; j++) - folds.push(foldLines[i].folds[j]); - - return folds; - }; - - /* - * 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) { - foldLine = foldLine || this.getFoldLine(row); - if (!foldLine) - return null; - - var lastFold = { - end: { column: 0 } - }; - // TODO: Refactor to use getNextFoldTo function. - var str, fold; - for (var i = 0; i < foldLine.folds.length; i++) { - fold = foldLine.folds[i]; - var cmp = fold.range.compareEnd(row, column); - if (cmp == -1) { - 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; - 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; - var fold; - - if (placeholder instanceof Fold) - fold = placeholder; - else { - fold = new Fold(range, placeholder); - fold.collapseChildren = range.collapseChildren; - } - this.$clipRangeToDocument(fold.range); - - var startRow = fold.start.row; - var startColumn = fold.start.column; - var endRow = fold.end.row; - var endColumn = fold.end.column; - - // --- Some checking --- - if (!(startRow < endRow || - startRow == endRow && startColumn <= endColumn - 2)) - throw new Error("The range has to be at least 2 characters width"); - - var startFold = this.getFoldAt(startRow, startColumn, 1); - var endFold = this.getFoldAt(endRow, endColumn, -1); - if (startFold && endFold == startFold) - return startFold.addSubFold(fold); - - if (startFold && !startFold.range.isStart(startRow, startColumn)) - this.removeFold(startFold); - - if (endFold && !endFold.range.isEnd(endRow, endColumn)) - this.removeFold(endFold); - - // 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. - folds.forEach(function(subFold) { - fold.addSubFold(subFold); - }); - } - - 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. - var 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); - else - this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row); - - // Notify that fold data has changed. - this.$modified = true; - this._emit("changeFold", { data: fold, action: "add" }); - - 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; - var 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. newFoldLine is the second part - { - var newFoldLine = foldLine.split(fold.start.row, fold.start.column); - folds = newFoldLine.folds; - folds.shift(); - newFoldLine.start.row = folds[0].start.row; - newFoldLine.start.column = folds[0].start.column; - } - - if (!this.$updating) { - if (this.$useWrapMode) - this.$updateWrapData(startRow, endRow); - else - this.$updateRowLengthCache(startRow, endRow); - } - - // Notify that fold data has changed. - this.$modified = true; - this._emit("changeFold", { data: fold, action: "remove" }); - }; - - 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(subFold) { - fold.restoreRange(subFold); - this.addFold(subFold); - }, this); - if (fold.collapseChildren > 0) { - this.foldAll(fold.start.row+1, fold.end.row, fold.collapseChildren-1); - } - fold.subFolds = []; - }; - - this.expandFolds = function(folds) { - folds.forEach(function(fold) { - this.expandFold(fold); - }, this); - }; - - this.unfold = function(location, expandInner) { - var range, folds; - if (location == null) { - range = new Range(0, 0, this.getLength(), 0); - expandInner = true; - } else if (typeof location == "number") - range = new Range(location, 0, location, this.getLine(location).length); - else if ("row" in location) - range = Range.fromPoints(location, location); - else - range = location; - - folds = this.getFoldsInRangeList(range); - if (expandInner) { - this.removeFolds(folds); - } else { - var subFolds = folds; - // TODO: might be better to remove and add folds in one go instead of using - // expandFolds several times. - while (subFolds.length) { - this.expandFolds(subFolds); - subFolds = this.getFoldsInRangeList(range); - } - } - if (folds.length) - return folds; - }; - - /* - * 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.getRowFoldStart = function(docRow, startFoldRow) { - var foldLine = this.getFoldLine(docRow, startFoldRow); - return foldLine ? foldLine.start.row : docRow; - }; - - this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { - if (startRow == null) - startRow = foldLine.start.row; - if (startColumn == null) - startColumn = 0; - if (endRow == null) - endRow = foldLine.end.row; - if (endColumn == null) - endColumn = this.getLine(endRow).length; - - - // Build the textline using the FoldLine walker. - var doc = this.doc; - var textLine = ""; - - foldLine.walk(function(placeholder, row, column, lastColumn) { - if (row < startRow) - return; - if (row == startRow) { - if (column < startColumn) - return; - lastColumn = Math.max(startColumn, lastColumn); - } - - if (placeholder != null) { - textLine += placeholder; - } else { - textLine += doc.getLine(row).substring(lastColumn, column); - } - }, 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 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(); - var fold; - var bracketPos; - - if (range.isEmpty()) { - var cursor = range.start; - fold = this.getFoldAt(cursor.row, cursor.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 { - range = this.getCommentFoldRange(cursor.row, cursor.column) || range; - } - } 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); - }; - - this.getCommentFoldRange = function(row, column, dir) { - var iterator = new TokenIterator(this, row, column); - var token = iterator.getCurrentToken(); - if (token && /^comment|string/.test(token.type)) { - var range = new Range(); - var re = new RegExp(token.type.replace(/\..*/, "\\.")); - if (dir != 1) { - do { - token = iterator.stepBackward(); - } while(token && re.test(token.type)); - iterator.stepForward(); - } - - range.start.row = iterator.getCurrentTokenRow(); - range.start.column = iterator.getCurrentTokenColumn() + 2; - - iterator = new TokenIterator(this, row, column); - - if (dir != -1) { - do { - token = iterator.stepForward(); - } while(token && re.test(token.type)); - token = iterator.stepBackward(); - } else - token = iterator.getCurrentToken(); - - range.end.row = iterator.getCurrentTokenRow(); - range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 2; - return range; - } - }; - - this.foldAll = function(startRow, endRow, depth) { - if (depth == undefined) - depth = 100000; // JSON.stringify doesn't hanle Infinity - var foldWidgets = this.foldWidgets; - if (!foldWidgets) - return; // mode doesn't support folding - endRow = endRow || this.getLength(); - startRow = startRow || 0; - for (var row = startRow; row < endRow; row++) { - if (foldWidgets[row] == null) - foldWidgets[row] = this.getFoldWidget(row); - if (foldWidgets[row] != "start") - continue; - - var range = this.getFoldWidgetRange(row); - // sometimes range can be incompatible with existing fold - // TODO change addFold to return null istead of throwing - if (range && range.isMultiLine() - && range.end.row <= endRow - && range.start.row >= startRow - ) { - row = range.end.row; - try { - // addFold can change the range - var fold = this.addFold("...", range); - if (fold) - fold.collapseChildren = depth; - } catch(e) {} - } - } - }; - - // structured folding - this.$foldStyles = { - "manual": 1, - "markbegin": 1, - "markbeginend": 1 - }; - this.$foldStyle = "markbegin"; - this.setFoldStyle = function(style) { - if (!this.$foldStyles[style]) - throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]"); - - if (this.$foldStyle == style) - return; - - this.$foldStyle = style; - - if (style == "manual") - this.unfold(); - - // reset folding - var mode = this.$foldMode; - this.$setFolding(null); - this.$setFolding(mode); - }; - - this.$setFolding = function(foldMode) { - if (this.$foldMode == foldMode) - return; - - this.$foldMode = foldMode; - - this.off('change', this.$updateFoldWidgets); - this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); - this._emit("changeAnnotation"); - - if (!foldMode || this.$foldStyle == "manual") { - this.foldWidgets = null; - return; - } - - this.foldWidgets = []; - this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle); - this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle); - - this.$updateFoldWidgets = this.updateFoldWidgets.bind(this); - this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this); - this.on('change', this.$updateFoldWidgets); - this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); - }; - - this.getParentFoldRangeData = function (row, ignoreCurrent) { - var fw = this.foldWidgets; - if (!fw || (ignoreCurrent && fw[row])) - return {}; - - var i = row - 1, firstRange; - while (i >= 0) { - var c = fw[i]; - if (c == null) - c = fw[i] = this.getFoldWidget(i); - - if (c == "start") { - var range = this.getFoldWidgetRange(i); - if (!firstRange) - firstRange = range; - if (range && range.end.row >= row) - break; - } - i--; - } - - return { - range: i !== -1 && range, - firstRange: firstRange - }; - } - - this.onFoldWidgetClick = function(row, e) { - e = e.domEvent; - var options = { - children: e.shiftKey, - all: e.ctrlKey || e.metaKey, - siblings: e.altKey - }; - - var range = this.$toggleFoldWidget(row, options); - if (!range) { - var el = (e.target || e.srcElement) - if (el && /ace_fold-widget/.test(el.className)) - el.className += " ace_invalid"; - } - }; - - this.$toggleFoldWidget = function(row, options) { - if (!this.getFoldWidget) - return; - var type = this.getFoldWidget(row); - var line = this.getLine(row); - - var dir = type === "end" ? -1 : 1; - var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir); - - if (fold) { - if (options.children || options.all) - this.removeFold(fold); - else - this.expandFold(fold); - return; - } - - var range = this.getFoldWidgetRange(row, true); - // sometimes singleline folds can be missed by the code above - if (range && !range.isMultiLine()) { - fold = this.getFoldAt(range.start.row, range.start.column, 1); - if (fold && range.isEqual(fold.range)) { - this.removeFold(fold); - return; - } - } - - if (options.siblings) { - var data = this.getParentFoldRangeData(row); - if (data.range) { - var startRow = data.range.start.row + 1; - var endRow = data.range.end.row; - } - this.foldAll(startRow, endRow, options.all ? 10000 : 0); - } else if (options.children) { - endRow = range ? range.end.row : this.getLength(); - this.foldAll(row + 1, range.end.row, options.all ? 10000 : 0); - } else if (range) { - if (options.all) - range.collapseChildren = 10000; - this.addFold("...", range); - } - - return range; - }; - - - - this.toggleFoldWidget = function(toggleParent) { - var row = this.selection.getCursor().row; - row = this.getRowFoldStart(row); - var range = this.$toggleFoldWidget(row, {}); - - if (range) - return; - // handle toggleParent - var data = this.getParentFoldRangeData(row, true); - range = data.range || data.firstRange; - - if (range) { - row = range.start.row; - var fold = this.getFoldAt(row, this.getLine(row).length, 1); - - if (fold) { - this.removeFold(fold); - } else { - this.addFold("...", range); - } - } - }; - - this.updateFoldWidgets = function(e) { - var delta = e.data; - var range = delta.range; - var firstRow = range.start.row; - var len = range.end.row - firstRow; - - if (len === 0) { - this.foldWidgets[firstRow] = null; - } else if (delta.action == "removeText" || delta.action == "removeLines") { - this.foldWidgets.splice(firstRow, len + 1, null); - } else { - var args = Array(len + 1); - args.unshift(firstRow, 1); - this.foldWidgets.splice.apply(this.foldWidgets, args); - } - }; - this.tokenizerUpdateFoldWidgets = function(e) { - var rows = e.data; - if (rows.first != rows.last) { - if (this.foldWidgets.length > rows.first) - this.foldWidgets.splice(rows.first, this.foldWidgets.length); - } - } -} - -exports.Folding = Folding; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js deleted file mode 100644 index 87cc9567..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +++ /dev/null @@ -1,1075 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("./test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var lang = require("./lib/lang"); -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var UndoManager = require("./undomanager").UndoManager; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var Range = require("./range").Range; -var assert = require("./test/assertions"); -var JavaScriptMode = require("./mode/javascript").Mode; - -function createFoldTestSession() { - var lines = [ - "function foo(items) {", - " for (var i=0; i>", [1, 2], 1); - - // Test wrapping for punctuation in - EditSession.prototype.$wrapAsCode = false; - computeAndAssert("ab cde, Juhu kinners", [3, 8, 13, 19], 6); - }, - - "test get longest line" : function() { - var session = new EditSession(["12"]); - session.setTabSize(4); - assert.equal(session.getScreenWidth(), 2); - - session.doc.insertNewLine({row: 0, column: Infinity}); - session.doc.insertLines(1, ["123"]); - assert.equal(session.getScreenWidth(), 3); - - session.doc.insertNewLine({row: 0, column: Infinity}); - session.doc.insertLines(1, ["\t\t"]); - - assert.equal(session.getScreenWidth(), 8); - - session.setTabSize(2); - assert.equal(session.getScreenWidth(), 4); - }, - - "test getDisplayString": function() { - var session = new EditSession(["12"]); - session.setTabSize(4); - - assert.equal(session.$getDisplayTokens("\t").length, 4); - assert.equal(session.$getDisplayTokens("abc").length, 3); - assert.equal(session.$getDisplayTokens("abc\t").length, 4); - }, - - "test issue 83": function() { - var session = new EditSession(""); - var editor = new Editor(new MockRenderer(), session); - var document = session.getDocument(); - - session.setUseWrapMode(true); - - document.insertLines(0, ["a", "b"]); - document.insertLines(2, ["c", "d"]); - document.removeLines(1, 2); - }, - - "test wrapMode init has to create wrapData array": function() { - var session = new EditSession("foo bar\nfoo bar"); - var editor = new Editor(new MockRenderer(), session); - var document = session.getDocument(); - - session.setUseWrapMode(true); - session.setWrapLimitRange(3, 3); - session.adjustWrapLimit(80); - - // Test if wrapData is there and was computed. - assert.equal(session.$wrapData.length, 2); - assert.equal(session.$wrapData[0].length, 1); - assert.equal(session.$wrapData[1].length, 1); - }, - - "test first line blank with wrap": function() { - var session = new EditSession("\nfoo"); - session.setUseWrapMode(true); - assert.equal(session.doc.getValue(), ["", "foo"].join("\n")); - }, - - "test first line blank with wrap 2" : function() { - var session = new EditSession(""); - session.setUseWrapMode(true); - session.setValue("\nfoo"); - - assert.equal(session.doc.getValue(), ["", "foo"].join("\n")); - }, - - "test fold getFoldDisplayLine": function() { - var session = createFoldTestSession(); - function assertDisplayLine(foldLine, str) { - var line = session.getLine(foldLine.end.row); - var displayLine = - session.getFoldDisplayLine(foldLine, foldLine.end.row, line.length); - assert.equal(displayLine, str); - } - - assertDisplayLine(session.$foldData[0], "function foo(args...) {") - assertDisplayLine(session.$foldData[1], " for (vfoo...ert(items[bar...\"juhu\");"); - }, - - "test foldLine idxToPosition": function() { - var session = createFoldTestSession(); - - function assertIdx2Pos(foldLineIdx, idx, row, column) { - var foldLine = session.$foldData[foldLineIdx]; - assert.position(foldLine.idxToPosition(idx), row, column); - } - -// "function foo(items) {", -// " for (var i=0; iThe cursor in this paragraph text will be offset by 1 row.

", - "

Everything after this will be offset as well due to the folds in the row before too.

" - ].join("\n")); - session.addFold('...', new Range(0, 8, 0, 42)); - session.addFold('...', new Range(1, 8, 1, 42)); - session.addFold('...', new Range(3, 7, 3, 51)); - session.setOption("wrap", 40); - session.remove(new Range(0,0, 2, 5)); - // needed because adjustWrapLimit is called async from renderer - session.adjustWrapLimit(80); - - assert.equal(session.$wrapData + "", [[], [], [40, 76]] + ""); - }, - - "test add fold": function() { - var session = createFoldTestSession(); - var fold; - - function tryAddFold(placeholder, range, shouldFail) { - var fail = false; - try { - fold = session.addFold(placeholder, range); - } catch (e) { - fail = true; - } - if (fail != shouldFail) { - throw new Error("Expected to get an exception"); - } - } - - tryAddFold("foo", new Range(0, 13, 0, 17), false); - tryAddFold("foo", new Range(0, 14, 0, 18), true); - tryAddFold("foo", new Range(0, 13, 0, 18), false); - assert.equal(session.$foldData[0].folds.length, 1); - - tryAddFold("f", new Range(0, 13, 0, 18), false); - tryAddFold("foo", new Range(0, 18, 0, 21), false); - assert.equal(session.$foldData[0].folds.length, 2); - session.removeFold(fold); - - tryAddFold("foo", new Range(0, 18, 0, 22), false); - tryAddFold("foo", new Range(0, 18, 0, 19), true); - tryAddFold("foo", new Range(0, 22, 1, 10), false); - }, - - "test add subfolds": function() { - var session = createFoldTestSession(); - var fold, oldFold; - var foldData = session.$foldData; - - oldFold = foldData[0].folds[0]; - - fold = session.addFold("fold0", new Range(0, 10, 0, 21)); - assert.equal(foldData[0].folds.length, 1); - assert.equal(fold.subFolds.length, 1); - assert.equal(fold.subFolds[0], oldFold); - - session.expandFold(fold); - assert.equal(foldData[0].folds.length, 1); - assert.equal(foldData[0].folds[0], oldFold); - assert.equal(fold.subFolds.length, 0); - - fold = session.addFold("fold0", new Range(0, 13, 2, 10)); - assert.equal(foldData.length, 1); - assert.equal(fold.subFolds.length, 2); - assert.equal(fold.subFolds[0], oldFold); - - session.expandFold(fold); - assert.equal(foldData.length, 2); - assert.equal(foldData[0].folds.length, 1); - assert.equal(foldData[0].folds[0], oldFold); - assert.equal(fold.subFolds.length, 0); - - session.unfold(null, true); - fold = session.addFold("fold0", new Range(0, 0, 0, 21)); - session.addFold("fold0", new Range(0, 1, 0, 5)); - session.addFold("fold0", new Range(0, 6, 0, 8)); - assert.equal(fold.subFolds.length, 2); - }, - - "test row cache": function() { - var session = createFoldTestSession(); - - session.screenToDocumentPosition(2,3); - assertArray(session.$docRowCache, [1,3]); - assertArray(session.$screenRowCache, [1,2]); - - session.screenToDocumentPosition(5,3); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session.screenToDocumentPosition(0,3); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - var pos = session.screenToDocumentPosition(0,0); - assert.equal(pos.row, 0); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session.screenToDocumentPosition(1,0); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session.$resetRowCache(); - assertArray(session.$docRowCache, []); - assertArray(session.$screenRowCache, []); - - session.screenToDocumentPosition(1,3); - assertArray(session.$docRowCache, [1]); - assertArray(session.$screenRowCache, [1]); - - session.screenToDocumentPosition(5,3); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session = new EditSession(new Array(30).join("\n")); - session.documentToScreenPosition(2,0); - session.documentToScreenPosition(2,0); - assertArray(session.$docRowCache, [1,2]); - assertArray(session.$screenRowCache, [1,2]); - }, - - "test annotations": function() { - var session = new EditSession([]), - annotation = {row: 0, type: 'info', text: "This is a test."}; - - session.clearAnnotations(); - assertArray(session.getAnnotations(), []); - session.setAnnotations([annotation]); - assertArray(session.getAnnotations(), [annotation]); - }, - - "test: mode loading" : function(next) { - if (!require.undef) { - console.log("Skipping test: This test only runs in the browser"); - next(); - return; - } - var session = new EditSession([]); - session.setMode("ace/mode/javascript"); - assert.equal(session.$modeid, "ace/mode/javascript"); - session.on("changeMode", function() { - assert.equal(session.$modeid, "ace/mode/javascript"); - }); - session.setMode("ace/mode/sh", function(mode) { - assert.ok(!mode); - }); - setTimeout(function() { - session.setMode("ace/mode/javascript", function(mode) { - session.setMode("ace/mode/javascript"); - assert.equal(session.$modeid, "ace/mode/javascript"); - next(); - }); - }, 0); - } -}; -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js deleted file mode 100644 index 4f1c2739..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js +++ /dev/null @@ -1,2693 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -require("./lib/fixoldbrowsers"); - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var lang = require("./lib/lang"); -var useragent = require("./lib/useragent"); -var TextInput = require("./keyboard/textinput").TextInput; -var MouseHandler = require("./mouse/mouse_handler").MouseHandler; -var FoldHandler = require("./mouse/fold_handler").FoldHandler; -var KeyBinding = require("./keyboard/keybinding").KeyBinding; -var EditSession = require("./edit_session").EditSession; -var Search = require("./search").Search; -var Range = require("./range").Range; -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var CommandManager = require("./commands/command_manager").CommandManager; -var defaultCommands = require("./commands/default_commands").commands; -var config = require("./config"); -var TokenIterator = require("./token_iterator").TokenIterator; - -/** - * The main entry point into the Ace functionality. - * - * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen. - * - * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. - * @class Editor - **/ - -/** - * Creates a new `Editor` object. - * - * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything - * @param {EditSession} session The `EditSession` to refer to - * - * - * @constructor - **/ -var Editor = function(renderer, session) { - var container = renderer.getContainerElement(); - this.container = container; - this.renderer = renderer; - - this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands); - this.textInput = new TextInput(renderer.getTextAreaContainer(), this); - this.renderer.textarea = this.textInput.getElement(); - this.keyBinding = new KeyBinding(this); - - // TODO detect touch event support - this.$mouseHandler = new MouseHandler(this); - new FoldHandler(this); - - this.$blockScrolling = 0; - this.$search = new Search().set({ - wrap: true - }); - - this.$historyTracker = this.$historyTracker.bind(this); - this.commands.on("exec", this.$historyTracker); - - this.$initOperationListeners(); - - this._$emitInputEvent = lang.delayedCall(function() { - this._signal("input", {}); - if (this.session && this.session.bgTokenizer) - this.session.bgTokenizer.scheduleStart(); - }.bind(this)); - - this.on("change", function(_, _self) { - _self._$emitInputEvent.schedule(31); - }); - - this.setSession(session || new EditSession("")); - config.resetOptions(this); - config._signal("editor", this); -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.$initOperationListeners = function() { - function last(a) {return a[a.length - 1]} - - this.selections = []; - this.commands.on("exec", this.startOperation.bind(this), true); - this.commands.on("afterExec", this.endOperation.bind(this), true); - - this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this)); - - this.on("change", function() { - this.curOp || this.startOperation(); - this.curOp.docChanged = true; - }.bind(this), true); - - this.on("changeSelection", function() { - this.curOp || this.startOperation(); - this.curOp.selectionChanged = true; - }.bind(this), true); - }; - - this.curOp = null; - this.prevOp = {}; - this.startOperation = function(commadEvent) { - if (this.curOp) { - if (!commadEvent || this.curOp.command) - return; - this.prevOp = this.curOp; - } - if (!commadEvent) { - this.previousCommand = null; - commadEvent = {}; - } - - this.$opResetTimer.schedule(); - this.curOp = { - command: commadEvent.command || {}, - args: commadEvent.args, - scrollTop: this.renderer.scrollTop - }; - if (this.curOp.command.name) - this.$blockScrolling++; - // this.selections.push(this.selection.toJSON()); - }; - - this.endOperation = function(e) { - if (this.curOp) { - if (e && e.returnValue === false) - return this.curOp = null; - this._signal("beforeEndOperation"); - var command = this.curOp.command; - if (command.name && this.$blockScrolling) - this.$blockScrolling--; - if (command && command.scrollIntoView) { - switch (command.scrollIntoView) { - case "center": - this.renderer.scrollCursorIntoView(null, 0.5); - break; - case "animate": - case "cursor": - this.renderer.scrollCursorIntoView(); - break; - case "selectionPart": - var range = this.selection.getRange(); - var config = this.renderer.layerConfig; - if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) { - this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead); - } - break; - default: - break; - } - if (command.scrollIntoView == "animate") - this.renderer.animateScrolling(this.curOp.scrollTop); - } - - this.prevOp = this.curOp; - this.curOp = null; - } - }; - - // TODO use property on commands instead of this - this.$mergeableCommands = ["backspace", "del", "insertstring"]; - this.$historyTracker = function(e) { - if (!this.$mergeUndoDeltas) - return; - - var prev = this.prevOp; - var mergeableCommands = this.$mergeableCommands; - // previous command was the same - var shouldMerge = prev.command && (e.command.name == prev.command.name); - if (e.command.name == "insertstring") { - var text = e.args; - if (this.mergeNextCommand === undefined) - this.mergeNextCommand = true; - - shouldMerge = shouldMerge - && this.mergeNextCommand // previous command allows to coalesce with - && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type - - this.mergeNextCommand = true; - } else { - shouldMerge = shouldMerge - && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable - } - - if ( - this.$mergeUndoDeltas != "always" - && Date.now() - this.sequenceStartTime > 2000 - ) { - shouldMerge = false; // the sequence is too long - } - - if (shouldMerge) - this.session.mergeUndoDeltas = true; - else if (mergeableCommands.indexOf(e.command.name) !== -1) - this.sequenceStartTime = Date.now(); - }; - - /** - * Sets a new key handler, such as "vim" or "windows". - * @param {String} keyboardHandler The new key handler - * - **/ - this.setKeyboardHandler = function(keyboardHandler, cb) { - if (keyboardHandler && typeof keyboardHandler === "string") { - this.$keybindingId = keyboardHandler; - var _self = this; - config.loadModule(["keybinding", keyboardHandler], function(module) { - if (_self.$keybindingId == keyboardHandler) - _self.keyBinding.setKeyboardHandler(module && module.handler); - cb && cb(); - }); - } else { - this.$keybindingId = null; - this.keyBinding.setKeyboardHandler(keyboardHandler); - cb && cb(); - } - }; - - /** - * Returns the keyboard handler, such as "vim" or "windows". - * - * @returns {String} - * - **/ - this.getKeyboardHandler = function() { - return this.keyBinding.getKeyboardHandler(); - }; - - - /** - * Emitted whenever the [[EditSession]] changes. - * @event changeSession - * @param {Object} e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s. - * - **/ - /** - * Sets a new editsession to use. This method also emits the `'changeSession'` event. - * @param {EditSession} session The new session to use - * - **/ - this.setSession = function(session) { - if (this.session == session) - return; - - var oldSession = this.session; - if (oldSession) { - 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); - this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange); - this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange); - - var selection = this.session.getSelection(); - selection.removeEventListener("changeCursor", this.$onCursorChange); - selection.removeEventListener("changeSelection", this.$onSelectionChange); - } - - this.session = session; - if (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.onChangeTabSize.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.$onScrollTopChange = this.onScrollTopChange.bind(this); - this.session.addEventListener("changeScrollTop", this.$onScrollTopChange); - - this.$onScrollLeftChange = this.onScrollLeftChange.bind(this); - this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange); - - 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.$blockScrolling += 1; - this.onCursorChange(); - this.$blockScrolling -= 1; - - this.onScrollTopChange(); - this.onScrollLeftChange(); - this.onSelectionChange(); - this.onChangeFrontMarker(); - this.onChangeBackMarker(); - this.onChangeBreakpoint(); - this.onChangeAnnotation(); - this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); - this.renderer.updateFull(); - } else { - this.selection = null; - this.renderer.setSession(session); - } - - this._signal("changeSession", { - session: session, - oldSession: oldSession - }); - - oldSession && oldSession._signal("changeEditor", {oldEditor: this}); - session && session._signal("changeEditor", {editor: this}); - }; - - /** - * Returns the current session being used. - * @returns {EditSession} - **/ - this.getSession = function() { - return this.session; - }; - - /** - * Sets the current document to `val`. - * @param {String} val The new value to set for the document - * @param {Number} cursorPos Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end - * - * @returns {String} The current document value - * @related Document.setValue - **/ - this.setValue = function(val, cursorPos) { - this.session.doc.setValue(val); - - if (!cursorPos) - this.selectAll(); - else if (cursorPos == 1) - this.navigateFileEnd(); - else if (cursorPos == -1) - this.navigateFileStart(); - - return val; - }; - - /** - * Returns the current session's content. - * - * @returns {String} - * @related EditSession.getValue - **/ - this.getValue = function() { - return this.session.getValue(); - }; - - /** - * - * Returns the currently highlighted selection. - * @returns {String} The highlighted selection - **/ - this.getSelection = function() { - return this.selection; - }; - - /** - * {:VirtualRenderer.onResize} - * @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed - * - * - * @related VirtualRenderer.onResize - **/ - this.resize = function(force) { - this.renderer.onResize(force); - }; - - /** - * {:VirtualRenderer.setTheme} - * @param {String} theme The path to a theme - * @param {Function} cb optional callback called when theme is loaded - **/ - this.setTheme = function(theme, cb) { - this.renderer.setTheme(theme, cb); - }; - - /** - * {:VirtualRenderer.getTheme} - * - * @returns {String} The set theme - * @related VirtualRenderer.getTheme - **/ - this.getTheme = function() { - return this.renderer.getTheme(); - }; - - /** - * {:VirtualRenderer.setStyle} - * @param {String} style A class name - * - * - * @related VirtualRenderer.setStyle - **/ - this.setStyle = function(style) { - this.renderer.setStyle(style); - }; - - /** - * {:VirtualRenderer.unsetStyle} - * @related VirtualRenderer.unsetStyle - **/ - this.unsetStyle = function(style) { - this.renderer.unsetStyle(style); - }; - - /** - * Gets the current font size of the editor text. - */ - this.getFontSize = function () { - return this.getOption("fontSize") || - dom.computedStyle(this.container, "fontSize"); - }; - - /** - * Set a new font size (in pixels) for the editor text. - * @param {String} size A font size ( _e.g._ "12px") - * - * - **/ - this.setFontSize = function(size) { - this.setOption("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 session = self.session; - if (!session || !session.bgTokenizer) return; - var pos = session.findMatchingBracket(self.getCursorPosition()); - if (pos) { - var range = new Range(pos.row, pos.column, pos.row, pos.column + 1); - } else if (session.$mode.getMatching) { - var range = session.$mode.getMatching(self.session); - } - if (range) - session.$bracketHighlight = session.addMarker(range, "ace_bracket", "text"); - }, 50); - }; - - // todo: move to mode.getMatching - this.$highlightTags = function() { - if (this.$highlightTagPending) - return; - - // perform highlight async to not block the browser during navigation - var self = this; - this.$highlightTagPending = true; - setTimeout(function() { - self.$highlightTagPending = false; - - var session = self.session; - if (!session || !session.bgTokenizer) return; - - var pos = self.getCursorPosition(); - var iterator = new TokenIterator(self.session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - - if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) { - session.removeMarker(session.$tagHighlight); - session.$tagHighlight = null; - return; - } - - if (token.type.indexOf("tag-open") != -1) { - token = iterator.stepForward(); - if (!token) - return; - } - - var tag = token.value; - var depth = 0; - var prevToken = iterator.stepBackward(); - - if (prevToken.value == '<'){ - //find closing tag - do { - prevToken = token; - token = iterator.stepForward(); - - if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { - if (prevToken.value === '<'){ - depth++; - } else if (prevToken.value === '= 0); - } else { - //find opening tag - do { - token = prevToken; - prevToken = iterator.stepBackward(); - - if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { - if (prevToken.value === '<') { - depth++; - } else if (prevToken.value === ' 1)) - highlight = false; - } - - if (session.$highlightLineMarker && !highlight) { - session.removeMarker(session.$highlightLineMarker.id); - session.$highlightLineMarker = null; - } else if (!session.$highlightLineMarker && highlight) { - var range = new Range(highlight.row, highlight.column, highlight.row, Infinity); - range.id = session.addMarker(range, "ace_active-line", "screenLine"); - session.$highlightLineMarker = range; - } else if (highlight) { - session.$highlightLineMarker.start.row = highlight.row; - session.$highlightLineMarker.end.row = highlight.row; - session.$highlightLineMarker.start.column = highlight.column; - session._signal("changeBackMarker"); - } - }; - - this.onSelectionChange = function(e) { - var session = this.session; - - 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(); - } - - var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp(); - this.session.highlight(re); - - this._signal("changeSelection"); - }; - - this.$getSelectionHighLightRegexp = function() { - var session = this.session; - - var selection = this.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 re = this.$search.$assembleRegExp({ - wholeWord: true, - caseSensitive: true, - needle: needle - }); - - return re; - }; - - - this.onChangeFrontMarker = function() { - this.renderer.updateFrontMarkers(); - }; - - this.onChangeBackMarker = function() { - this.renderer.updateBackMarkers(); - }; - - - this.onChangeBreakpoint = function() { - this.renderer.updateBreakpoints(); - }; - - this.onChangeAnnotation = function() { - this.renderer.setAnnotations(this.session.getAnnotations()); - }; - - - this.onChangeMode = function(e) { - this.renderer.updateText(); - this._emit("changeMode", e); - }; - - - 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(); - }; - - - /** - * Returns the string of text currently highlighted. - * @returns {String} - **/ - this.getSelectedText = function() { - return this.session.getTextRange(this.getSelectionRange()); - }; - - /** - * Emitted when text is copied. - * @event copy - * @param {String} text The copied text - * - **/ - /** - * Returns the string of text currently highlighted. - * @returns {String} - * @deprecated Use getSelectedText instead. - **/ - this.getCopyText = function() { - var text = this.getSelectedText(); - this._signal("copy", text); - return text; - }; - - /** - * Called whenever a text "copy" happens. - **/ - this.onCopy = function() { - this.commands.exec("copy", this); - }; - - /** - * Called whenever a text "cut" happens. - **/ - this.onCut = function() { - this.commands.exec("cut", this); - }; - - /** - * Emitted when text is pasted. - * @event paste - * @param {Object} an object which contains one property, `text`, that represents the text to be pasted. Editing this property will alter the text that is pasted. - * - * - **/ - /** - * Called whenever a text "paste" happens. - * @param {String} text The pasted text - * - * - **/ - this.onPaste = function(text) { - // todo this should change when paste becomes a command - if (this.$readOnly) - return; - - var e = {text: text}; - this._signal("paste", e); - text = e.text; - if (!this.inMultiSelectMode || this.inVirtualSelectionMode) { - this.insert(text); - } else { - var lines = text.split(/\r\n|\r|\n/); - var ranges = this.selection.rangeList.ranges; - - if (lines.length > ranges.length || lines.length < 2 || !lines[1]) - return this.commands.exec("insertstring", this, text); - - for (var i = ranges.length; i--;) { - var range = ranges[i]; - if (!range.isEmpty()) - this.session.remove(range); - - this.session.insert(range.start, lines[i]); - } - } - this.renderer.scrollCursorIntoView(); - }; - - this.execCommand = function(command, args) { - return this.commands.exec(command, this, args); - }; - - /** - * Inserts `text` into wherever the cursor is pointing. - * @param {String} text The new text to add - * - **/ - this.insert = function(text, pasted) { - var session = this.session; - var mode = session.getMode(); - var cursor = this.getCursorPosition(); - - if (this.getBehavioursEnabled() && !pasted) { - // Get a transform if the current mode wants one. - var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); - if (transform) { - if (text !== transform.text) { - this.session.mergeUndoDeltas = false; - this.$mergeNextCommand = false; - } - text = transform.text; - - } - } - - if (text == "\t") - text = this.session.getTabString(); - - // remove selected text - if (!this.selection.isEmpty()) { - var range = this.getSelectionRange(); - cursor = this.session.remove(range); - this.clearSelection(); - } - else if (this.session.getOverwrite()) { - var range = new Range.fromPoints(cursor, cursor); - range.end.column += text.length; - this.session.remove(range); - } - - if (text == "\n" || text == "\r\n") { - var line = session.getLine(cursor.row); - if (cursor.column > line.search(/\S|$/)) { - var d = line.substr(cursor.column).search(/\S|$/); - session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d); - } - } - this.clearSelection(); - - var start = cursor.column; - var lineState = session.getState(cursor.row); - var line = session.getLine(cursor.row); - var shouldOutdent = mode.checkOutdent(lineState, line, text); - 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])); - } - } - - if (session.getDocument().isNewLine(text)) { - var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); - - session.insert({row: cursor.row+1, column: 0}, lineIndent); - } - if (shouldOutdent) - mode.autoOutdent(lineState, session, cursor.row); - }; - - this.onTextInput = function(text) { - this.keyBinding.onTextInput(text); - }; - - this.onCommandKey = function(e, hashId, keyCode) { - this.keyBinding.onCommandKey(e, hashId, keyCode); - }; - - /** - * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. - * @param {Boolean} overwrite Defines wheter or not to set overwrites - * - * - * @related EditSession.setOverwrite - **/ - this.setOverwrite = function(overwrite) { - this.session.setOverwrite(overwrite); - }; - - /** - * Returns `true` if overwrites are enabled; `false` otherwise. - * @returns {Boolean} - * @related EditSession.getOverwrite - **/ - this.getOverwrite = function() { - return this.session.getOverwrite(); - }; - - /** - * Sets the value of overwrite to the opposite of whatever it currently is. - * @related EditSession.toggleOverwrite - **/ - this.toggleOverwrite = function() { - this.session.toggleOverwrite(); - }; - - /** - * Sets how fast the mouse scrolling should do. - * @param {Number} speed A value indicating the new speed (in milliseconds) - **/ - this.setScrollSpeed = function(speed) { - this.setOption("scrollSpeed", speed); - }; - - /** - * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). - * @returns {Number} - **/ - this.getScrollSpeed = function() { - return this.getOption("scrollSpeed"); - }; - - /** - * Sets the delay (in milliseconds) of the mouse drag. - * @param {Number} dragDelay A value indicating the new delay - **/ - this.setDragDelay = function(dragDelay) { - this.setOption("dragDelay", dragDelay); - }; - - /** - * Returns the current mouse drag delay. - * @returns {Number} - **/ - this.getDragDelay = function() { - return this.getOption("dragDelay"); - }; - - /** - * Emitted when the selection style changes, via [[Editor.setSelectionStyle]]. - * @event changeSelectionStyle - * @param {Object} data Contains one property, `data`, which indicates the new selection style - **/ - /** - * Draw selection markers spanning whole line, or only over selected text. Default value is "line" - * @param {String} style The new selection style "line"|"text" - * - **/ - this.setSelectionStyle = function(val) { - this.setOption("selectionStyle", val); - }; - - /** - * Returns the current selection style. - * @returns {String} - **/ - this.getSelectionStyle = function() { - return this.getOption("selectionStyle"); - }; - - /** - * Determines whether or not the current line should be highlighted. - * @param {Boolean} shouldHighlight Set to `true` to highlight the current line - **/ - this.setHighlightActiveLine = function(shouldHighlight) { - this.setOption("highlightActiveLine", shouldHighlight); - }; - /** - * Returns `true` if current lines are always highlighted. - * @return {Boolean} - **/ - this.getHighlightActiveLine = function() { - return this.getOption("highlightActiveLine"); - }; - this.setHighlightGutterLine = function(shouldHighlight) { - this.setOption("highlightGutterLine", shouldHighlight); - }; - - this.getHighlightGutterLine = function() { - return this.getOption("highlightGutterLine"); - }; - - /** - * Determines if the currently selected word should be highlighted. - * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word - * - **/ - this.setHighlightSelectedWord = function(shouldHighlight) { - this.setOption("highlightSelectedWord", shouldHighlight); - }; - - /** - * Returns `true` if currently highlighted words are to be highlighted. - * @returns {Boolean} - **/ - this.getHighlightSelectedWord = function() { - return this.$highlightSelectedWord; - }; - - this.setAnimatedScroll = function(shouldAnimate){ - this.renderer.setAnimatedScroll(shouldAnimate); - }; - - this.getAnimatedScroll = function(){ - return this.renderer.getAnimatedScroll(); - }; - - /** - * If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. - * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters - * - **/ - this.setShowInvisibles = function(showInvisibles) { - this.renderer.setShowInvisibles(showInvisibles); - }; - - /** - * Returns `true` if invisible characters are being shown. - * @returns {Boolean} - **/ - this.getShowInvisibles = function() { - return this.renderer.getShowInvisibles(); - }; - - this.setDisplayIndentGuides = function(display) { - this.renderer.setDisplayIndentGuides(display); - }; - - this.getDisplayIndentGuides = function() { - return this.renderer.getDisplayIndentGuides(); - }; - - /** - * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. - * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin - * - **/ - this.setShowPrintMargin = function(showPrintMargin) { - this.renderer.setShowPrintMargin(showPrintMargin); - }; - - /** - * Returns `true` if the print margin is being shown. - * @returns {Boolean} - **/ - this.getShowPrintMargin = function() { - return this.renderer.getShowPrintMargin(); - }; - - /** - * Sets the column defining where the print margin should be. - * @param {Number} showPrintMargin Specifies the new print margin - * - **/ - this.setPrintMarginColumn = function(showPrintMargin) { - this.renderer.setPrintMarginColumn(showPrintMargin); - }; - - /** - * Returns the column number of where the print margin is. - * @returns {Number} - **/ - this.getPrintMarginColumn = function() { - return this.renderer.getPrintMarginColumn(); - }; - - /** - * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change. - * @param {Boolean} readOnly Specifies whether the editor can be modified or not - * - **/ - this.setReadOnly = function(readOnly) { - this.setOption("readOnly", readOnly); - }; - - /** - * Returns `true` if the editor is set to read-only mode. - * @returns {Boolean} - **/ - this.getReadOnly = function() { - return this.getOption("readOnly"); - }; - - /** - * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} - * @param {Boolean} enabled Enables or disables behaviors - * - **/ - this.setBehavioursEnabled = function (enabled) { - this.setOption("behavioursEnabled", enabled); - }; - - /** - * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} - * - * @returns {Boolean} - **/ - this.getBehavioursEnabled = function () { - return this.getOption("behavioursEnabled"); - }; - - /** - * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets - * when such a character is typed in. - * @param {Boolean} enabled Enables or disables wrapping behaviors - * - **/ - this.setWrapBehavioursEnabled = function (enabled) { - this.setOption("wrapBehavioursEnabled", enabled); - }; - - /** - * Returns `true` if the wrapping behaviors are currently enabled. - **/ - this.getWrapBehavioursEnabled = function () { - return this.getOption("wrapBehavioursEnabled"); - }; - - /** - * Indicates whether the fold widgets should be shown or not. - * @param {Boolean} show Specifies whether the fold widgets are shown - **/ - this.setShowFoldWidgets = function(show) { - this.setOption("showFoldWidgets", show); - - }; - /** - * Returns `true` if the fold widgets are shown. - * @return {Boolean} - **/ - this.getShowFoldWidgets = function() { - return this.getOption("showFoldWidgets"); - }; - - this.setFadeFoldWidgets = function(fade) { - this.setOption("fadeFoldWidgets", fade); - }; - - this.getFadeFoldWidgets = function() { - return this.getOption("fadeFoldWidgets"); - }; - - /** - * Removes the current selection or one character. - * @param {String} dir The direction of the deletion to occur, either "left" or "right" - * - **/ - this.remove = function(dir) { - 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 (range.end.column === 0) { - var text = session.getTextRange(range); - if (text[text.length - 1] == "\n") { - var line = session.getLine(range.end.row); - if (/^\s+$/.test(line)) { - range.end.column = line.length; - } - } - } - if (new_range) - range = new_range; - } - - this.session.remove(range); - this.clearSelection(); - }; - - /** - * Removes the word directly to the right of the current selection. - **/ - this.removeWordRight = function() { - if (this.selection.isEmpty()) - this.selection.selectWordRight(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - /** - * Removes the word directly to the left of the current selection. - **/ - this.removeWordLeft = function() { - if (this.selection.isEmpty()) - this.selection.selectWordLeft(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - /** - * Removes all the words to the left of the current selection, until the start of the line. - **/ - this.removeToLineStart = function() { - if (this.selection.isEmpty()) - this.selection.selectLineStart(); - - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - }; - - /** - * Removes all the words to the right of the current selection, until the end of the line. - **/ - this.removeToLineEnd = function() { - 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(); - }; - - /** - * Splits the line at the current selection (by inserting an `'\n'`). - **/ - this.splitLine = function() { - if (!this.selection.isEmpty()) { - this.session.remove(this.getSelectionRange()); - this.clearSelection(); - } - - var cursor = this.getCursorPosition(); - this.insert("\n"); - this.moveCursorToPosition(cursor); - }; - - /** - * Transposes current line. - **/ - this.transposeLetters = function() { - 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); - }; - - /** - * Converts the current selection entirely into lowercase. - **/ - this.toLowerCase = function() { - var originalRange = this.getSelectionRange(); - if (this.selection.isEmpty()) { - this.selection.selectWord(); - } - - var range = this.getSelectionRange(); - var text = this.session.getTextRange(range); - this.session.replace(range, text.toLowerCase()); - this.selection.setSelectionRange(originalRange); - }; - - /** - * Converts the current selection entirely into uppercase. - **/ - this.toUpperCase = function() { - var originalRange = this.getSelectionRange(); - if (this.selection.isEmpty()) { - this.selection.selectWord(); - } - - var range = this.getSelectionRange(); - var text = this.session.getTextRange(range); - this.session.replace(range, text.toUpperCase()); - this.selection.setSelectionRange(originalRange); - }; - - /** - * Inserts an indentation into the current cursor position or indents the selected lines. - * - * @related EditSession.indentRows - **/ - this.indent = function() { - var session = this.session; - var range = this.getSelectionRange(); - - if (range.start.row < range.end.row) { - var rows = this.$getSelectedRows(); - session.indentRows(rows.first, rows.last, "\t"); - return; - } else if (range.start.column < range.end.column) { - var text = session.getTextRange(range); - if (!/^\s+$/.test(text)) { - var rows = this.$getSelectedRows(); - session.indentRows(rows.first, rows.last, "\t"); - return; - } - } - - var line = session.getLine(range.start.row); - var position = range.start; - var size = session.getTabSize(); - var column = session.documentToScreenColumn(position.row, position.column); - - if (this.session.getUseSoftTabs()) { - var count = (size - column % size); - var indentString = lang.stringRepeat(" ", count); - } else { - var count = column % size; - while (line[range.start.column] == " " && count) { - range.start.column--; - count--; - } - this.selection.setSelectionRange(range); - indentString = "\t"; - } - return this.insert(indentString); - }; - - /** - * Indents the current line. - * @related EditSession.indentRows - **/ - this.blockIndent = function() { - var rows = this.$getSelectedRows(); - this.session.indentRows(rows.first, rows.last, "\t"); - }; - - /** - * Outdents the current line. - * @related EditSession.outdentRows - **/ - this.blockOutdent = function() { - var selection = this.session.getSelection(); - this.session.outdentRows(selection.getRange()); - }; - - // TODO: move out of core when we have good mechanism for managing extensions - this.sortLines = function() { - var rows = this.$getSelectedRows(); - var session = this.session; - - var lines = []; - for (i = rows.first; i <= rows.last; i++) - lines.push(session.getLine(i)); - - lines.sort(function(a, b) { - if (a.toLowerCase() < b.toLowerCase()) return -1; - if (a.toLowerCase() > b.toLowerCase()) return 1; - return 0; - }); - - var deleteRange = new Range(0, 0, 0, 0); - for (var i = rows.first; i <= rows.last; i++) { - var line = session.getLine(i); - deleteRange.start.row = i; - deleteRange.end.row = i; - deleteRange.end.column = line.length; - session.replace(deleteRange, lines[i-rows.first]); - } - }; - - /** - * Given the currently selected range, this function either comments all the lines, or uncomments all of them. - **/ - this.toggleCommentLines = function() { - var state = this.session.getState(this.getCursorPosition().row); - var rows = this.$getSelectedRows(); - this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); - }; - - this.toggleBlockComment = function() { - var cursor = this.getCursorPosition(); - var state = this.session.getState(cursor.row); - var range = this.getSelectionRange(); - this.session.getMode().toggleBlockComment(state, this.session, range, cursor); - }; - - /** - * Works like [[EditSession.getTokenAt]], except it returns a number. - * @returns {Number} - **/ - this.getNumberAt = function(row, column) { - var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; - _numberRx.lastIndex = 0; - - var s = this.session.getLine(row); - while (_numberRx.lastIndex < column) { - var m = _numberRx.exec(s); - if(m.index <= column && m.index+m[0].length >= column){ - var number = { - value: m[0], - start: m.index, - end: m.index+m[0].length - }; - return number; - } - } - return null; - }; - - /** - * If the character before the cursor is a number, this functions changes its value by `amount`. - * @param {Number} amount The value to change the numeral by (can be negative to decrease value) - * - **/ - this.modifyNumber = function(amount) { - var row = this.selection.getCursor().row; - var column = this.selection.getCursor().column; - - // get the char before the cursor - var charRange = new Range(row, column-1, row, column); - - var c = this.session.getTextRange(charRange); - // if the char is a digit - if (!isNaN(parseFloat(c)) && isFinite(c)) { - // get the whole number the digit is part of - var nr = this.getNumberAt(row, column); - // if number found - if (nr) { - var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end; - var decimals = nr.start + nr.value.length - fp; - - var t = parseFloat(nr.value); - t *= Math.pow(10, decimals); - - - if(fp !== nr.end && column < fp){ - amount *= Math.pow(10, nr.end - column - 1); - } else { - amount *= Math.pow(10, nr.end - column); - } - - t += amount; - t /= Math.pow(10, decimals); - var nnr = t.toFixed(decimals); - - //update number - var replaceRange = new Range(row, nr.start, row, nr.end); - this.session.replace(replaceRange, nnr); - - //reposition the cursor - this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length)); - - } - } - }; - - /** - * Removes all the lines in the current selection - * @related EditSession.remove - **/ - this.removeLines = function() { - 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.duplicateSelection = function() { - var sel = this.selection; - var doc = this.session; - var range = sel.getRange(); - var reverse = sel.isBackwards(); - if (range.isEmpty()) { - var row = range.start.row; - doc.duplicateLines(row, row); - } else { - var point = reverse ? range.start : range.end; - var endPoint = doc.insert(point, doc.getTextRange(range), false); - range.start = point; - range.end = endPoint; - - sel.setSelectionRange(range, reverse); - } - }; - - /** - * Shifts all the selected lines down one row. - * - * @returns {Number} On success, it returns -1. - * @related EditSession.moveLinesUp - **/ - this.moveLinesDown = function() { - this.$moveLines(1, false); - }; - - /** - * Shifts all the selected lines up one row. - * @returns {Number} On success, it returns -1. - * @related EditSession.moveLinesDown - **/ - this.moveLinesUp = function() { - this.$moveLines(-1, false); - }; - - /** - * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: - * ```json - * { row: newRowLocation, column: newColumnLocation } - * ``` - * @param {Range} fromRange The range of text you want moved within the document - * @param {Object} toPosition The location (row and column) where you want to move the text to - * - * @returns {Range} The new range where the text was moved to. - * @related EditSession.moveText - **/ - this.moveText = function(range, toPosition, copy) { - return this.session.moveText(range, toPosition, copy); - }; - - /** - * Copies all the selected lines up one row. - * @returns {Number} On success, returns 0. - * - **/ - this.copyLinesUp = function() { - this.$moveLines(-1, true); - }; - - /** - * Copies all the selected lines down one row. - * @returns {Number} On success, returns the number of new rows added; in other words, `lastRow - firstRow + 1`. - * @related EditSession.duplicateLines - * - **/ - this.copyLinesDown = function() { - this.$moveLines(1, true); - }; - - /** - * for internal use - * @ignore - * - **/ - this.$moveLines = function(dir, copy) { - var rows, moved; - var selection = this.selection; - if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) { - var range = selection.toOrientedRange(); - rows = this.$getSelectedRows(range); - moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir); - if (copy && dir == -1) moved = 0; - range.moveBy(moved, 0); - selection.fromOrientedRange(range); - } else { - var ranges = selection.rangeList.ranges; - selection.rangeList.detach(this.session); - this.inVirtualSelectionMode = true; - - var diff = 0; - var totalDiff = 0; - var l = ranges.length; - for (var i = 0; i < l; i++) { - var rangeIndex = i; - ranges[i].moveBy(diff, 0); - rows = this.$getSelectedRows(ranges[i]); - var first = rows.first; - var last = rows.last; - while (++i < l) { - if (totalDiff) ranges[i].moveBy(totalDiff, 0); - var subRows = this.$getSelectedRows(ranges[i]); - if (copy && subRows.first != last) - break; - else if (!copy && subRows.first > last + 1) - break; - last = subRows.last; - } - i--; - diff = this.session.$moveLines(first, last, copy ? 0 : dir); - if (copy && dir == -1) rangeIndex = i + 1; - while (rangeIndex <= i) { - ranges[rangeIndex].moveBy(diff, 0); - rangeIndex++; - } - if (!copy) diff = 0; - totalDiff += diff; - } - - selection.fromOrientedRange(selection.ranges[0]); - selection.rangeList.attach(this.session); - this.inVirtualSelectionMode = false; - } - }; - - /** - * Returns an object indicating the currently selected rows. The object looks like this: - * - * ```json - * { first: range.start.row, last: range.end.row } - * ``` - * - * @returns {Object} - **/ - this.$getSelectedRows = function(range) { - range = (range || this.getSelectionRange()).collapseRows(); - - return { - first: this.session.getRowFoldStart(range.start.row), - last: this.session.getRowFoldEnd(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(); - }; - - /** - * {:VirtualRenderer.getFirstVisibleRow} - * - * @returns {Number} - * @related VirtualRenderer.getFirstVisibleRow - **/ - this.getFirstVisibleRow = function() { - return this.renderer.getFirstVisibleRow(); - }; - - /** - * {:VirtualRenderer.getLastVisibleRow} - * - * @returns {Number} - * @related VirtualRenderer.getLastVisibleRow - **/ - this.getLastVisibleRow = function() { - return this.renderer.getLastVisibleRow(); - }; - - /** - * Indicates if the row is currently visible on the screen. - * @param {Number} row The row to check - * - * @returns {Boolean} - **/ - this.isRowVisible = function(row) { - return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); - }; - - /** - * Indicates if the entire row is currently visible on the screen. - * @param {Number} row The row to check - * - * - * @returns {Boolean} - **/ - this.isRowFullyVisible = function(row) { - return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow()); - }; - - /** - * Returns the number of currently visibile rows. - * @returns {Number} - **/ - this.$getVisibleRowCount = function() { - return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; - }; - - this.$moveByPage = function(dir, select) { - var renderer = this.renderer; - var config = this.renderer.layerConfig; - var rows = dir * Math.floor(config.height / config.lineHeight); - - this.$blockScrolling++; - if (select === true) { - this.selection.$moveSelection(function(){ - this.moveCursorBy(rows, 0); - }); - } else if (select === false) { - this.selection.moveCursorBy(rows, 0); - this.selection.clearSelection(); - } - this.$blockScrolling--; - - var scrollTop = renderer.scrollTop; - - renderer.scrollBy(0, rows * config.lineHeight); - if (select != null) - renderer.scrollCursorIntoView(null, 0.5); - - renderer.animateScrolling(scrollTop); - }; - - /** - * Selects the text from the current position of the document until where a "page down" finishes. - **/ - this.selectPageDown = function() { - this.$moveByPage(1, true); - }; - - /** - * Selects the text from the current position of the document until where a "page up" finishes. - **/ - this.selectPageUp = function() { - this.$moveByPage(-1, true); - }; - - /** - * Shifts the document to wherever "page down" is, as well as moving the cursor position. - **/ - this.gotoPageDown = function() { - this.$moveByPage(1, false); - }; - - /** - * Shifts the document to wherever "page up" is, as well as moving the cursor position. - **/ - this.gotoPageUp = function() { - this.$moveByPage(-1, false); - }; - - /** - * Scrolls the document to wherever "page down" is, without changing the cursor position. - **/ - this.scrollPageDown = function() { - this.$moveByPage(1); - }; - - /** - * Scrolls the document to wherever "page up" is, without changing the cursor position. - **/ - this.scrollPageUp = function() { - this.$moveByPage(-1); - }; - - /** - * Moves the editor to the specified row. - * @related VirtualRenderer.scrollToRow - **/ - this.scrollToRow = function(row) { - this.renderer.scrollToRow(row); - }; - - /** - * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to). - * @param {Number} line The line to scroll to - * @param {Boolean} center If `true` - * @param {Boolean} animate If `true` animates scrolling - * @param {Function} callback Function to be called when the animation has finished - * - * - * @related VirtualRenderer.scrollToLine - **/ - this.scrollToLine = function(line, center, animate, callback) { - this.renderer.scrollToLine(line, center, animate, callback); - }; - - /** - * Attempts to center the current selection on the screen. - **/ - this.centerSelection = function() { - var range = this.getSelectionRange(); - var pos = { - row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2), - column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2) - }; - this.renderer.alignCursor(pos, 0.5); - }; - - /** - * Gets the current position of the cursor. - * @returns {Object} An object that looks something like this: - * - * ```json - * { row: currRow, column: currCol } - * ``` - * - * @related Selection.getCursor - **/ - this.getCursorPosition = function() { - return this.selection.getCursor(); - }; - - /** - * Returns the screen position of the cursor. - * @returns {Number} - * @related EditSession.documentToScreenPosition - **/ - this.getCursorPositionScreen = function() { - return this.session.documentToScreenPosition(this.getCursorPosition()); - }; - - /** - * {:Selection.getRange} - * @returns {Range} - * @related Selection.getRange - **/ - this.getSelectionRange = function() { - return this.selection.getRange(); - }; - - - /** - * Selects all the text in editor. - * @related Selection.selectAll - **/ - this.selectAll = function() { - this.$blockScrolling += 1; - this.selection.selectAll(); - this.$blockScrolling -= 1; - }; - - /** - * {:Selection.clearSelection} - * @related Selection.clearSelection - **/ - this.clearSelection = function() { - this.selection.clearSelection(); - }; - - /** - * Moves the cursor to the specified row and column. Note that this does not de-select the current selection. - * @param {Number} row The new row number - * @param {Number} column The new column number - * - * - * @related Selection.moveCursorTo - **/ - this.moveCursorTo = function(row, column) { - this.selection.moveCursorTo(row, column); - }; - - /** - * Moves the cursor to the position indicated by `pos.row` and `pos.column`. - * @param {Object} pos An object with two properties, row and column - * - * - * @related Selection.moveCursorToPosition - **/ - this.moveCursorToPosition = function(pos) { - this.selection.moveCursorToPosition(pos); - }; - - /** - * Moves the cursor's row and column to the next matching bracket or HTML tag. - * - **/ - this.jumpToMatching = function(select, expand) { - var cursor = this.getCursorPosition(); - var iterator = new TokenIterator(this.session, cursor.row, cursor.column); - var prevToken = iterator.getCurrentToken(); - var token = prevToken || iterator.stepForward(); - - if (!token) return; - - //get next closing tag or bracket - var matchType; - var found = false; - var depth = {}; - var i = cursor.column - token.start; - var bracketType; - var brackets = { - ")": "(", - "(": "(", - "]": "[", - "[": "[", - "{": "{", - "}": "{" - }; - - do { - if (token.value.match(/[{}()\[\]]/g)) { - for (; i < token.value.length && !found; i++) { - if (!brackets[token.value[i]]) { - continue; - } - - bracketType = brackets[token.value[i]] + '.' + token.type.replace("rparen", "lparen"); - - if (isNaN(depth[bracketType])) { - depth[bracketType] = 0; - } - - switch (token.value[i]) { - case '(': - case '[': - case '{': - depth[bracketType]++; - break; - case ')': - case ']': - case '}': - depth[bracketType]--; - - if (depth[bracketType] === -1) { - matchType = 'bracket'; - found = true; - } - break; - } - } - } - else if (token && token.type.indexOf('tag-name') !== -1) { - if (isNaN(depth[token.value])) { - depth[token.value] = 0; - } - - if (prevToken.value === '<') { - depth[token.value]++; - } - else if (prevToken.value === '= 0; --i) { - if(this.$tryReplace(ranges[i], replacement)) { - replaced++; - } - } - - this.selection.setSelectionRange(selection); - this.$blockScrolling -= 1; - - return replaced; - }; - - 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; - } - }; - - /** - * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. - * @related Search.getOptions - * @returns {Object} - **/ - this.getLastSearchOptions = function() { - return this.$search.getOptions(); - }; - - /** - * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. - * @param {String} needle The text to search for (optional) - * @param {Object} options An object defining various search properties - * @param {Boolean} animate If `true` animate scrolling - * - * - * @related Search.find - **/ - this.find = function(needle, options, animate) { - if (!options) - options = {}; - - if (typeof needle == "string" || needle instanceof RegExp) - options.needle = needle; - else if (typeof needle == "object") - oop.mixin(options, needle); - - var range = this.selection.getRange(); - if (options.needle == null) { - needle = this.session.getTextRange(range) - || this.$search.$options.needle; - if (!needle) { - range = this.session.getWordRange(range.start.row, range.start.column); - needle = this.session.getTextRange(range); - } - this.$search.set({needle: needle}); - } - - this.$search.set(options); - if (!options.start) - this.$search.set({start: range}); - - var newRange = this.$search.find(this.session); - if (options.preventScroll) - return newRange; - if (newRange) { - this.revealRange(newRange, animate); - return newRange; - } - // clear selection if nothing is found - if (options.backwards) - range.start = range.end; - else - range.end = range.start; - this.selection.setRange(range); - }; - - /** - * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. - * @param {Object} options search options - * @param {Boolean} animate If `true` animate scrolling - * - * - * @related Editor.find - **/ - this.findNext = function(options, animate) { - this.find({skipCurrent: true, backwards: false}, options, animate); - }; - - /** - * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. - * @param {Object} options search options - * @param {Boolean} animate If `true` animate scrolling - * - * - * @related Editor.find - **/ - this.findPrevious = function(options, animate) { - this.find(options, {skipCurrent: true, backwards: true}, animate); - }; - - this.revealRange = function(range, animate) { - this.$blockScrolling += 1; - this.session.unfold(range); - this.selection.setSelectionRange(range); - this.$blockScrolling -= 1; - - var scrollTop = this.renderer.scrollTop; - this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); - if (animate !== false) - this.renderer.animateScrolling(scrollTop); - }; - - /** - * {:UndoManager.undo} - * @related UndoManager.undo - **/ - this.undo = function() { - this.$blockScrolling++; - this.session.getUndoManager().undo(); - this.$blockScrolling--; - this.renderer.scrollCursorIntoView(null, 0.5); - }; - - /** - * {:UndoManager.redo} - * @related UndoManager.redo - **/ - this.redo = function() { - this.$blockScrolling++; - this.session.getUndoManager().redo(); - this.$blockScrolling--; - this.renderer.scrollCursorIntoView(null, 0.5); - }; - - /** - * - * Cleans up the entire editor. - **/ - this.destroy = function() { - this.renderer.destroy(); - this._signal("destroy", this); - if (this.session) { - this.session.destroy(); - } - }; - - /** - * Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element - * @param {Boolean} enable default true - **/ - this.setAutoScrollEditorIntoView = function(enable) { - if (!enable) - return; - var rect; - var self = this; - var shouldScroll = false; - if (!this.$scrollAnchor) - this.$scrollAnchor = document.createElement("div"); - var scrollAnchor = this.$scrollAnchor; - scrollAnchor.style.cssText = "position:absolute"; - this.container.insertBefore(scrollAnchor, this.container.firstChild); - var onChangeSelection = this.on("changeSelection", function() { - shouldScroll = true; - }); - // needed to not trigger sync reflow - var onBeforeRender = this.renderer.on("beforeRender", function() { - if (shouldScroll) - rect = self.renderer.container.getBoundingClientRect(); - }); - var onAfterRender = this.renderer.on("afterRender", function() { - if (shouldScroll && rect && (self.isFocused() - || self.searchBox && self.searchBox.isFocused()) - ) { - var renderer = self.renderer; - var pos = renderer.$cursorLayer.$pixelPos; - var config = renderer.layerConfig; - var top = pos.top - config.offset; - if (pos.top >= 0 && top + rect.top < 0) { - shouldScroll = true; - } else if (pos.top < config.height && - pos.top + rect.top + config.lineHeight > window.innerHeight) { - shouldScroll = false; - } else { - shouldScroll = null; - } - if (shouldScroll != null) { - scrollAnchor.style.top = top + "px"; - scrollAnchor.style.left = pos.left + "px"; - scrollAnchor.style.height = config.lineHeight + "px"; - scrollAnchor.scrollIntoView(shouldScroll); - } - shouldScroll = rect = null; - } - }); - this.setAutoScrollEditorIntoView = function(enable) { - if (enable) - return; - delete this.setAutoScrollEditorIntoView; - this.removeEventListener("changeSelection", onChangeSelection); - this.renderer.removeEventListener("afterRender", onAfterRender); - this.renderer.removeEventListener("beforeRender", onBeforeRender); - }; - }; - - - this.$resetCursorStyle = function() { - var style = this.$cursorStyle || "ace"; - var cursorLayer = this.renderer.$cursorLayer; - if (!cursorLayer) - return; - cursorLayer.setSmoothBlinking(/smooth/.test(style)); - cursorLayer.isBlinking = !this.$readOnly && style != "wide"; - dom.setCssClass(cursorLayer.element, "ace_slim-cursors", /slim/.test(style)); - }; - -}).call(Editor.prototype); - - - -config.defineOptions(Editor.prototype, "editor", { - selectionStyle: { - set: function(style) { - this.onSelectionChange(); - this._signal("changeSelectionStyle", {data: style}); - }, - initialValue: "line" - }, - highlightActiveLine: { - set: function() {this.$updateHighlightActiveLine();}, - initialValue: true - }, - highlightSelectedWord: { - set: function(shouldHighlight) {this.$onSelectionChange();}, - initialValue: true - }, - readOnly: { - set: function(readOnly) { - // disabled to not break vim mode! - // this.textInput.setReadOnly(readOnly); - this.$resetCursorStyle(); - }, - initialValue: false - }, - cursorStyle: { - set: function(val) { this.$resetCursorStyle(); }, - values: ["ace", "slim", "smooth", "wide"], - initialValue: "ace" - }, - mergeUndoDeltas: { - values: [false, true, "always"], - initialValue: true - }, - behavioursEnabled: {initialValue: true}, - wrapBehavioursEnabled: {initialValue: true}, - autoScrollEditorIntoView: { - set: function(val) {this.setAutoScrollEditorIntoView(val)} - }, - - hScrollBarAlwaysVisible: "renderer", - vScrollBarAlwaysVisible: "renderer", - highlightGutterLine: "renderer", - animatedScroll: "renderer", - showInvisibles: "renderer", - showPrintMargin: "renderer", - printMarginColumn: "renderer", - printMargin: "renderer", - fadeFoldWidgets: "renderer", - showFoldWidgets: "renderer", - showLineNumbers: "renderer", - showGutter: "renderer", - displayIndentGuides: "renderer", - fontSize: "renderer", - fontFamily: "renderer", - maxLines: "renderer", - minLines: "renderer", - scrollPastEnd: "renderer", - fixedWidthGutter: "renderer", - theme: "renderer", - - scrollSpeed: "$mouseHandler", - dragDelay: "$mouseHandler", - dragEnabled: "$mouseHandler", - focusTimout: "$mouseHandler", - tooltipFollowsMouse: "$mouseHandler", - - firstLineNumber: "session", - overwrite: "session", - newLineMode: "session", - useWorker: "session", - useSoftTabs: "session", - tabSize: "session", - wrap: "session", - foldStyle: "session", - mode: "session" -}); - -exports.Editor = Editor; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js deleted file mode 100644 index a1fdaad9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +++ /dev/null @@ -1,188 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("./test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var Text = require("./mode/text").Mode; -var JavaScriptMode = require("./mode/javascript").Mode; -var CssMode = require("./mode/css").Mode; -var HtmlMode = require("./mode/html").Mode; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var assert = require("./test/assertions"); - -module.exports = { - - setUp : function(next) { - this.session1 = new EditSession(["abc", "def"]); - this.session2 = new EditSession(["ghi", "jkl"]); - - - this.editor = new Editor(new MockRenderer()); - next(); - }, - - "test: change document" : function() { - this.editor.setSession(this.session1); - assert.equal(this.editor.getSession(), this.session1); - - this.editor.setSession(this.session2); - assert.equal(this.editor.getSession(), this.session2); - }, - - "test: only changes to the new document should have effect" : function() { - var called = false; - this.editor.onDocumentChange = function() { - called = true; - }; - - this.editor.setSession(this.session1); - this.editor.setSession(this.session2); - - this.session1.duplicateLines(0, 0); - assert.notOk(called); - - this.session2.duplicateLines(0, 0); - assert.ok(called); - }, - - "test: should use cursor of new document" : function() { - this.session1.getSelection().moveCursorTo(0, 1); - this.session2.getSelection().moveCursorTo(1, 0); - - this.editor.setSession(this.session1); - assert.position(this.editor.getCursorPosition(), 0, 1); - - this.editor.setSession(this.session2); - assert.position(this.editor.getCursorPosition(), 1, 0); - }, - - "test: only changing the cursor of the new doc should not have an effect" : function() { - this.editor.onCursorChange = function() { - called = true; - }; - - this.editor.setSession(this.session1); - this.editor.setSession(this.session2); - assert.position(this.editor.getCursorPosition(), 0, 0); - - var called = false; - this.session1.getSelection().moveCursorTo(0, 1); - assert.position(this.editor.getCursorPosition(), 0, 0); - assert.notOk(called); - - this.session2.getSelection().moveCursorTo(1, 1); - assert.position(this.editor.getCursorPosition(), 1, 1); - assert.ok(called); - }, - - "test: should use selection of new document" : function() { - this.session1.getSelection().selectTo(0, 1); - this.session2.getSelection().selectTo(1, 0); - - this.editor.setSession(this.session1); - assert.position(this.editor.getSelection().getSelectionLead(), 0, 1); - - this.editor.setSession(this.session2); - assert.position(this.editor.getSelection().getSelectionLead(), 1, 0); - }, - - "test: only changing the selection of the new doc should not have an effect" : function() { - this.editor.onSelectionChange = function() { - called = true; - }; - - this.editor.setSession(this.session1); - this.editor.setSession(this.session2); - assert.position(this.editor.getSelection().getSelectionLead(), 0, 0); - - var called = false; - this.session1.getSelection().selectTo(0, 1); - assert.position(this.editor.getSelection().getSelectionLead(), 0, 0); - assert.notOk(called); - - this.session2.getSelection().selectTo(1, 1); - assert.position(this.editor.getSelection().getSelectionLead(), 1, 1); - assert.ok(called); - }, - - "test: should use mode of new document" : function() { - this.editor.onChangeMode = function() { - called = true; - }; - this.editor.setSession(this.session1); - this.editor.setSession(this.session2); - - var called = false; - this.session1.setMode(new Text()); - assert.notOk(called); - - this.session2.setMode(new JavaScriptMode()); - assert.ok(called); - }, - - "test: should use stop worker of old document" : function(next) { - var self = this; - - // 1. Open an editor and set the session to CssMode - self.editor.setSession(self.session1); - self.session1.setMode(new CssMode()); - - // 2. Add a line or two of valid CSS. - self.session1.setValue("DIV { color: red; }"); - - // 3. Clear the session value. - self.session1.setValue(""); - - // 4. Set the session to HtmlMode - self.session1.setMode(new HtmlMode()); - - // 5. Try to type valid HTML - self.session1.insert({row: 0, column: 0}, ""); - - setTimeout(function() { - assert.equal(Object.keys(self.session1.getAnnotations()).length, 0); - next(); - }, 600); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js deleted file mode 100644 index 13e19c23..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +++ /dev/null @@ -1,223 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("./test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var assert = require("./test/assertions"); - -var lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + - "Mauris at arcu mi, eu lobortis mauris. Quisque ut libero eget " + - "diam congue vehicula. Quisque ut odio ut mi aliquam tincidunt. " + - "Duis lacinia aliquam lorem eget eleifend. Morbi eget felis mi. " + - "Duis quam ligula, consequat vitae convallis volutpat, blandit " + - "nec neque. Nulla facilisi. Etiam suscipit lorem ac justo " + - "sollicitudin tristique. Phasellus ut posuere nunc. Aliquam " + - "scelerisque mollis felis non gravida. Vestibulum lacus sem, " + - "posuere non bibendum id, luctus non dolor. Aenean id metus " + - "lorem, vel dapibus est. Donec gravida feugiat augue nec " + - "accumsan.Lorem ipsum dolor sit amet, consectetur adipiscing " + - "elit. Nulla vulputate, velit vitae tincidunt congue, nunc " + - "augue accumsan velit, eu consequat turpis lectus ac orci. " + - "Pellentesque ornare dolor feugiat dui auctor eu varius nulla " + - "fermentum. Sed aliquam odio at velit lacinia vel fermentum " + - "felis sodales. In dignissim magna eget nunc lobortis non " + - "fringilla nibh ullamcorper. Donec facilisis malesuada elit " + - "at egestas. Etiam bibendum, diam vitae tempor aliquet, dui " + - "libero vehicula odio, eget bibendum mauris velit eu lorem.\n" + - "consectetur"; - -function callHighlighterUpdate(session, firstRow, lastRow) { - var rangeCount = 0; - var mockMarkerLayer = { drawSingleLineMarker: function() {rangeCount++;} } - session.$searchHighlight.update([], mockMarkerLayer, session, { - firstRow: firstRow, - lastRow: lastRow - }); - return rangeCount; -} - -module.exports = { - setUp: function(next) { - this.session = new EditSession(lipsum); - this.editor = new Editor(new MockRenderer(), this.session); - this.selection = this.session.getSelection(); - this.search = this.editor.$search; - next(); - }, - - "test: highlight selected words by default": function() { - assert.equal(this.editor.getHighlightSelectedWord(), true); - }, - - "test: highlight a word": function() { - this.editor.moveCursorTo(0, 9); - this.selection.selectWord(); - - var highlighter = this.editor.session.$searchHighlight; - assert.ok(highlighter != null); - - var range = this.selection.getRange(); - assert.equal(this.session.getTextRange(range), "ipsum"); - assert.equal(highlighter.cache.length, 0); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 2); - }, - - "test: highlight a word and clear highlight": function() { - this.editor.moveCursorTo(0, 8); - this.selection.selectWord(); - - var range = this.selection.getRange(); - assert.equal(this.session.getTextRange(range), "ipsum"); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 2); - - this.session.highlight(""); - assert.equal(this.session.$searchHighlight.cache.length, 0); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 0); - }, - - "test: highlight another word": function() { - this.selection.moveCursorTo(0, 14); - this.selection.selectWord(); - - var range = this.selection.getRange(); - assert.equal(this.session.getTextRange(range), "dolor"); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 4); - }, - - "test: no selection, no highlight": function() { - this.selection.clearSelection(); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 0); - }, - - "test: select a word, no highlight": function() { - this.selection.moveCursorTo(0, 14); - this.selection.selectWord(); - - this.editor.setHighlightSelectedWord(false); - - var range = this.selection.getRange(); - assert.equal(this.session.getTextRange(range), "dolor"); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 0); - }, - - "test: select a word with no matches": function() { - this.editor.setHighlightSelectedWord(true); - - var currentOptions = this.search.getOptions(); - var newOptions = { - wrap: true, - wholeWord: true, - caseSensitive: true, - needle: "Mauris" - }; - this.search.set(newOptions); - - var match = this.search.find(this.session); - assert.notEqual(match, null, "found a match for 'Mauris'"); - - this.search.set(currentOptions); - - this.selection.setSelectionRange(match); - - assert.equal(this.session.getTextRange(match), "Mauris"); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 1); - }, - - "test: partial word selection 1": function() { - this.selection.moveCursorTo(0, 14); - this.selection.selectWord(); - this.selection.selectLeft(); - - var range = this.selection.getRange(); - assert.equal(this.session.getTextRange(range), "dolo"); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 0); - }, - - "test: partial word selection 2": function() { - this.selection.moveCursorTo(0, 13); - this.selection.selectWord(); - this.selection.selectRight(); - - var range = this.selection.getRange(); - assert.equal(this.session.getTextRange(range), "dolor "); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 0); - }, - - "test: partial word selection 3": function() { - this.selection.moveCursorTo(0, 14); - this.selection.selectWord(); - this.selection.selectLeft(); - this.selection.shiftSelection(1); - - var range = this.selection.getRange(); - assert.equal(this.session.getTextRange(range), "olor"); - assert.equal(callHighlighterUpdate(this.session, 0, 0), 0); - }, - - "test: select last word": function() { - this.selection.moveCursorTo(0, 1); - - var currentOptions = this.search.getOptions(); - var newOptions = { - wrap: true, - wholeWord: true, - caseSensitive: true, - backwards: true, - needle: "consectetur" - }; - this.search.set(newOptions); - - var match = this.search.find(this.session); - assert.notEqual(match, null, "found a match for 'consectetur'"); - assert.position(match.start, 1, 0); - - this.search.set(currentOptions); - - this.selection.setSelectionRange(match); - - assert.equal(this.session.getTextRange(match), "consectetur"); - assert.equal(callHighlighterUpdate(this.session, 0, 1), 3); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js deleted file mode 100644 index ab348241..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +++ /dev/null @@ -1,164 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("./test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var assert = require("./test/assertions"); - -module.exports = { - createEditSession : function(rows, cols) { - var line = new Array(cols + 1).join("a"); - var text = new Array(rows).join(line + "\n") + line; - return new EditSession(text); - }, - - "test: navigate to end of file should scroll the last line into view" : function() { - var doc = this.createEditSession(200, 10); - var editor = new Editor(new MockRenderer(), doc); - - editor.navigateFileEnd(); - var cursor = editor.getCursorPosition(); - - assert.ok(editor.getFirstVisibleRow() <= cursor.row); - assert.ok(editor.getLastVisibleRow() >= cursor.row); - }, - - "test: navigate to start of file should scroll the first row into view" : function() { - var doc = this.createEditSession(200, 10); - var editor = new Editor(new MockRenderer(), doc); - - editor.moveCursorTo(editor.getLastVisibleRow() + 20); - editor.navigateFileStart(); - - assert.equal(editor.getFirstVisibleRow(), 0); - }, - - "test: goto hidden line should scroll the line into the middle of the viewport" : function() { - var editor = new Editor(new MockRenderer(), this.createEditSession(200, 5)); - - editor.navigateTo(0, 0); - editor.gotoLine(101); - assert.position(editor.getCursorPosition(), 100, 0); - assert.equal(editor.getFirstVisibleRow(), 89); - - editor.navigateTo(100, 0); - editor.gotoLine(11); - assert.position(editor.getCursorPosition(), 10, 0); - assert.equal(editor.getFirstVisibleRow(), 0); - - editor.navigateTo(100, 0); - editor.gotoLine(6); - assert.position(editor.getCursorPosition(), 5, 0); - assert.equal(0, editor.getFirstVisibleRow(), 0); - - editor.navigateTo(100, 0); - editor.gotoLine(1); - assert.position(editor.getCursorPosition(), 0, 0); - assert.equal(editor.getFirstVisibleRow(), 0); - - editor.navigateTo(0, 0); - editor.gotoLine(191); - assert.position(editor.getCursorPosition(), 190, 0); - assert.equal(editor.getFirstVisibleRow(), 179); - - editor.navigateTo(0, 0); - editor.gotoLine(196); - assert.position(editor.getCursorPosition(), 195, 0); - assert.equal(editor.getFirstVisibleRow(), 180); - }, - - "test: goto visible line should only move the cursor and not scroll": function() { - var editor = new Editor(new MockRenderer(), this.createEditSession(200, 5)); - - editor.navigateTo(0, 0); - editor.gotoLine(12); - assert.position(editor.getCursorPosition(), 11, 0); - assert.equal(editor.getFirstVisibleRow(), 0); - - editor.navigateTo(30, 0); - editor.gotoLine(33); - assert.position(editor.getCursorPosition(), 32, 0); - assert.equal(editor.getFirstVisibleRow(), 30); - }, - - "test: navigate from the end of a long line down to a short line and back should maintain the curser column": function() { - var editor = new Editor(new MockRenderer(), new EditSession(["123456", "1"])); - - editor.navigateTo(0, 6); - assert.position(editor.getCursorPosition(), 0, 6); - - editor.navigateDown(); - assert.position(editor.getCursorPosition(), 1, 1); - - editor.navigateUp(); - assert.position(editor.getCursorPosition(), 0, 6); - }, - - "test: reset desired column on navigate left or right": function() { - var editor = new Editor(new MockRenderer(), new EditSession(["123456", "12"])); - - editor.navigateTo(0, 6); - assert.position(editor.getCursorPosition(), 0, 6); - - editor.navigateDown(); - assert.position(editor.getCursorPosition(), 1, 2); - - editor.navigateLeft(); - assert.position(editor.getCursorPosition(), 1, 1); - - editor.navigateUp(); - assert.position(editor.getCursorPosition(), 0, 1); - }, - - "test: typing text should update the desired column": function() { - var editor = new Editor(new MockRenderer(), new EditSession(["1234", "1234567890"])); - - editor.navigateTo(0, 3); - editor.insert("juhu"); - - editor.navigateDown(); - assert.position(editor.getCursorPosition(), 1, 7); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js deleted file mode 100644 index 77ec34ed..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +++ /dev/null @@ -1,557 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("./test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var JavaScriptMode = require("./mode/javascript").Mode; -var UndoManager = require("./undomanager").UndoManager; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var assert = require("./test/assertions"); -var whitespace = require("./ext/whitespace"); - -module.exports = { - "test: delete line from the middle" : function() { - var session = new EditSession(["a", "b", "c", "d"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 1); - editor.removeLines(); - - assert.equal(session.toString(), "a\nc\nd"); - assert.position(editor.getCursorPosition(), 1, 0); - - editor.removeLines(); - - assert.equal(session.toString(), "a\nd"); - assert.position(editor.getCursorPosition(), 1, 0); - - editor.removeLines(); - - assert.equal(session.toString(), "a"); - assert.position(editor.getCursorPosition(), 0, 1); - - editor.removeLines(); - - assert.equal(session.toString(), ""); - assert.position(editor.getCursorPosition(), 0, 0); - }, - - "test: delete multiple selected lines" : function() { - var session = new EditSession(["a", "b", "c", "d"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 1); - editor.getSelection().selectDown(); - - editor.removeLines(); - assert.equal(session.toString(), "a\nd"); - assert.position(editor.getCursorPosition(), 1, 0); - }, - - "test: delete first line" : function() { - var session = new EditSession(["a", "b", "c"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.removeLines(); - - assert.equal(session.toString(), "b\nc"); - assert.position(editor.getCursorPosition(), 0, 0); - }, - - "test: delete last should also delete the new line of the previous line" : function() { - var session = new EditSession(["a", "b", "c", ""].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(3, 0); - - editor.removeLines(); - assert.equal(session.toString(), "a\nb\nc"); - assert.position(editor.getCursorPosition(), 2, 1); - - editor.removeLines(); - assert.equal(session.toString(), "a\nb"); - assert.position(editor.getCursorPosition(), 1, 1); - }, - - "test: indent block" : function() { - var session = new EditSession(["a12345", "b12345", "c12345"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 3); - editor.getSelection().selectDown(); - - editor.indent(); - - assert.equal(["a12345", " b12345", " c12345"].join("\n"), session.toString()); - - assert.position(editor.getCursorPosition(), 2, 7); - - var range = editor.getSelectionRange(); - assert.position(range.start, 1, 7); - assert.position(range.end, 2, 7); - }, - - "test: indent selected lines" : function() { - var session = new EditSession(["a12345", "b12345", "c12345"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 0); - editor.getSelection().selectDown(); - - editor.indent(); - assert.equal(["a12345", " b12345", "c12345"].join("\n"), session.toString()); - }, - - "test: no auto indent if cursor is before the {" : function() { - var session = new EditSession("{", new JavaScriptMode()); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(0, 0); - editor.onTextInput("\n"); - assert.equal(["", "{"].join("\n"), session.toString()); - }, - - "test: outdent block" : function() { - var session = new EditSession([" a12345", " b12345", " c12345"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(0, 5); - editor.getSelection().selectDown(); - editor.getSelection().selectDown(); - - editor.blockOutdent(); - assert.equal(session.toString(), [" a12345", "b12345", " c12345"].join("\n")); - - assert.position(editor.getCursorPosition(), 2, 1); - - var range = editor.getSelectionRange(); - assert.position(range.start, 0, 1); - assert.position(range.end, 2, 1); - - editor.blockOutdent(); - assert.equal(session.toString(), ["a12345", "b12345", "c12345"].join("\n")); - - var range = editor.getSelectionRange(); - assert.position(range.start, 0, 0); - assert.position(range.end, 2, 0); - }, - - "test: outent without a selection should update cursor" : function() { - var session = new EditSession(" 12"); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(0, 3); - editor.blockOutdent(" "); - - assert.equal(session.toString(), " 12"); - assert.position(editor.getCursorPosition(), 0, 0); - }, - - "test: comment lines should perserve selection" : function() { - var session = new EditSession([" abc", "cde"].join("\n"), new JavaScriptMode()); - var editor = new Editor(new MockRenderer(), session); - whitespace.detectIndentation(session); - - editor.moveCursorTo(0, 2); - editor.getSelection().selectDown(); - editor.toggleCommentLines(); - - assert.equal(["// abc", "// cde"].join("\n"), session.toString()); - - var selection = editor.getSelectionRange(); - assert.position(selection.start, 0, 5); - assert.position(selection.end, 1, 5); - }, - - "test: uncomment lines should perserve selection" : function() { - var session = new EditSession(["// abc", "//cde"].join("\n"), new JavaScriptMode()); - var editor = new Editor(new MockRenderer(), session); - session.setTabSize(2); - - editor.moveCursorTo(0, 1); - editor.getSelection().selectDown(); - editor.getSelection().selectRight(); - editor.getSelection().selectRight(); - - editor.toggleCommentLines(); - - assert.equal([" abc", "cde"].join("\n"), session.toString()); - assert.range(editor.getSelectionRange(), 0, 0, 1, 1); - }, - - "test: toggle comment lines twice should return the original text" : function() { - var session = new EditSession([" abc", "cde", "fg"], new JavaScriptMode()); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(0, 0); - editor.getSelection().selectDown(); - editor.getSelection().selectDown(); - - editor.toggleCommentLines(); - editor.toggleCommentLines(); - - assert.equal([" abc", "cde", "fg"].join("\n"), session.toString()); - }, - - - "test: comment lines - if the selection end is at the line start it should stay there": function() { - //select down - var session = new EditSession(["abc", "cde"].join("\n"), new JavaScriptMode()); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(0, 0); - editor.getSelection().selectDown(); - - editor.toggleCommentLines(); - assert.range(editor.getSelectionRange(), 0, 3, 1, 0); - - // select up - var session = new EditSession(["abc", "cde"].join("\n"), new JavaScriptMode()); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 0); - editor.getSelection().selectUp(); - - editor.toggleCommentLines(); - assert.range(editor.getSelectionRange(), 0, 3, 1, 0); - }, - - "test: move lines down should keep selection on moved lines" : function() { - var session = new EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(0, 1); - editor.getSelection().selectDown(); - - editor.moveLinesDown(); - assert.equal(["33", "11", "22", "44"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 2, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 1, 1); - assert.position(editor.getSelection().getSelectionLead(), 2, 1); - - editor.moveLinesDown(); - assert.equal(["33", "44", "11", "22"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 3, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 2, 1); - assert.position(editor.getSelection().getSelectionLead(), 3, 1); - - // moving again should have no effect - editor.moveLinesDown(); - assert.equal(["33", "44", "11", "22"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 3, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 2, 1); - assert.position(editor.getSelection().getSelectionLead(), 3, 1); - }, - - "test: move lines up should keep selection on moved lines" : function() { - var session = new EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(2, 1); - editor.getSelection().selectDown(); - - editor.moveLinesUp(); - assert.equal(session.toString(), ["11", "33", "44", "22"].join("\n")); - assert.position(editor.getCursorPosition(), 2, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 1, 1); - assert.position(editor.getSelection().getSelectionLead(), 2, 1); - - editor.moveLinesUp(); - assert.equal(session.toString(), ["33", "44", "11", "22"].join("\n")); - assert.position(editor.getCursorPosition(), 1, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 0, 1); - assert.position(editor.getSelection().getSelectionLead(), 1, 1); - }, - - "test: move line without active selection should not move cursor relative to the moved line" : function() { - var session = new EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 1); - editor.clearSelection(); - - editor.moveLinesDown(); - assert.equal(["11", "33", "22", "44"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 2, 1); - - editor.clearSelection(); - - editor.moveLinesUp(); - assert.equal(["11", "22", "33", "44"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 1, 1); - }, - - "test: copy lines down should keep selection" : function() { - var session = new EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 1); - editor.getSelection().selectDown(); - - editor.copyLinesDown(); - assert.equal(["11", "22", "33", "22", "33", "44"].join("\n"), session.toString()); - - assert.position(editor.getCursorPosition(), 4, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 3, 1); - assert.position(editor.getSelection().getSelectionLead(), 4, 1); - }, - - "test: copy lines up should keep selection" : function() { - var session = new EditSession(["11", "22", "33", "44"].join("\n")); - var editor = new Editor(new MockRenderer(), session); - - editor.moveCursorTo(1, 1); - editor.getSelection().selectDown(); - - editor.copyLinesUp(); - assert.equal(["11", "22", "33", "22", "33", "44"].join("\n"), session.toString()); - - assert.position(editor.getCursorPosition(), 2, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 1, 1); - assert.position(editor.getSelection().getSelectionLead(), 2, 1); - }, - - "test: input a tab with soft tab should convert it to spaces" : function() { - var session = new EditSession(""); - var editor = new Editor(new MockRenderer(), session); - - session.setTabSize(2); - session.setUseSoftTabs(true); - - editor.onTextInput("\t"); - assert.equal(session.toString(), " "); - - session.setTabSize(5); - editor.onTextInput("\t"); - assert.equal(session.toString(), " "); - }, - - "test: input tab without soft tabs should keep the tab character" : function() { - var session = new EditSession(""); - var editor = new Editor(new MockRenderer(), session); - - session.setUseSoftTabs(false); - - editor.onTextInput("\t"); - assert.equal(session.toString(), "\t"); - }, - - "test: undo/redo for delete line" : function() { - var session = new EditSession(["111", "222", "333"]); - var undoManager = new UndoManager(); - session.setUndoManager(undoManager); - - var initialText = session.toString(); - var editor = new Editor(new MockRenderer(), session); - - editor.removeLines(); - var step1 = session.toString(); - assert.equal(step1, "222\n333"); - session.$syncInformUndoManager(); - - editor.removeLines(); - var step2 = session.toString(); - assert.equal(step2, "333"); - session.$syncInformUndoManager(); - - editor.removeLines(); - var step3 = session.toString(); - assert.equal(step3, ""); - session.$syncInformUndoManager(); - - undoManager.undo(); - session.$syncInformUndoManager(); - assert.equal(session.toString(), step2); - - undoManager.undo(); - session.$syncInformUndoManager(); - assert.equal(session.toString(), step1); - - undoManager.undo(); - session.$syncInformUndoManager(); - assert.equal(session.toString(), initialText); - - undoManager.undo(); - session.$syncInformUndoManager(); - assert.equal(session.toString(), initialText); - }, - - "test: remove left should remove character left of the cursor" : function() { - var session = new EditSession(["123", "456"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 1); - editor.remove("left"); - assert.equal(session.toString(), "123\n56"); - }, - - "test: remove left should remove line break if cursor is at line start" : function() { - var session = new EditSession(["123", "456"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 0); - editor.remove("left"); - assert.equal(session.toString(), "123456"); - }, - - "test: remove left should remove tabsize spaces if cursor is on a tab stop and preceeded by spaces" : function() { - var session = new EditSession(["123", " 456"]); - session.setUseSoftTabs(true); - session.setTabSize(4); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 8); - editor.remove("left"); - assert.equal(session.toString(), "123\n 456"); - }, - - "test: transpose at line start should be a noop": function() { - var session = new EditSession(["123", "4567", "89"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 0); - editor.transposeLetters(); - - assert.equal(session.getValue(), ["123", "4567", "89"].join("\n")); - }, - - "test: transpose in line should swap the charaters before and after the cursor": function() { - var session = new EditSession(["123", "4567", "89"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 2); - editor.transposeLetters(); - - assert.equal(session.getValue(), ["123", "4657", "89"].join("\n")); - }, - - "test: transpose at line end should swap the last two characters": function() { - var session = new EditSession(["123", "4567", "89"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 4); - editor.transposeLetters(); - - assert.equal(session.getValue(), ["123", "4576", "89"].join("\n")); - }, - - "test: transpose with non empty selection should be a noop": function() { - var session = new EditSession(["123", "4567", "89"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 1); - editor.getSelection().selectRight(); - editor.transposeLetters(); - - assert.equal(session.getValue(), ["123", "4567", "89"].join("\n")); - }, - - "test: transpose should move the cursor behind the last swapped character": function() { - var session = new EditSession(["123", "4567", "89"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 2); - editor.transposeLetters(); - assert.position(editor.getCursorPosition(), 1, 3); - }, - - "test: remove to line end": function() { - var session = new EditSession(["123", "4567", "89"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 2); - editor.removeToLineEnd(); - assert.equal(session.getValue(), ["123", "45", "89"].join("\n")); - }, - - "test: remove to line end at line end should remove the new line": function() { - var session = new EditSession(["123", "4567", "89"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 4); - editor.removeToLineEnd(); - assert.position(editor.getCursorPosition(), 1, 4); - assert.equal(session.getValue(), ["123", "456789"].join("\n")); - }, - - "test: transform selection to uppercase": function() { - var session = new EditSession(["ajax", "dot", "org"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 0); - editor.getSelection().selectLineEnd(); - editor.toUpperCase() - assert.equal(session.getValue(), ["ajax", "DOT", "org"].join("\n")); - }, - - "test: transform word to uppercase": function() { - var session = new EditSession(["ajax", "dot", "org"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 0); - editor.toUpperCase() - assert.equal(session.getValue(), ["ajax", "DOT", "org"].join("\n")); - assert.position(editor.getCursorPosition(), 1, 0); - }, - - "test: transform selection to lowercase": function() { - var session = new EditSession(["AJAX", "DOT", "ORG"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 0); - editor.getSelection().selectLineEnd(); - editor.toLowerCase() - assert.equal(session.getValue(), ["AJAX", "dot", "ORG"].join("\n")); - }, - - "test: transform word to lowercase": function() { - var session = new EditSession(["AJAX", "DOT", "ORG"]); - - var editor = new Editor(new MockRenderer(), session); - editor.moveCursorTo(1, 0); - editor.toLowerCase() - assert.equal(session.getValue(), ["AJAX", "dot", "ORG"].join("\n")); - assert.position(editor.getCursorPosition(), 1, 0); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify.js deleted file mode 100644 index d0fa1799..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify.js +++ /dev/null @@ -1,57 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -// [WIP] - -define(function(require, exports, module) { -"use strict"; -var TokenIterator = require("ace/token_iterator").TokenIterator; - -var phpTransform = require("./beautify/php_rules").transform; - -exports.beautify = function(session) { - var iterator = new TokenIterator(session, 0, 0); - var token = iterator.getCurrentToken(); - - var context = session.$modeId.split("/").pop(); - - var code = phpTransform(iterator, context); - session.doc.setValue(code); -}; - -exports.commands = [{ - name: "beautify", - exec: function(editor) { - exports.beautify(editor.session); - }, - bindKey: "Ctrl-Shift-B" -}] - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify/php_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify/php_rules.js deleted file mode 100644 index 9a5bed36..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify/php_rules.js +++ /dev/null @@ -1,366 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var TokenIterator = require("ace/token_iterator").TokenIterator; -exports.newLines = [{ - type: 'support.php_tag', - value: '' -}, { - type: 'paren.lparen', - value: '{', - indent: true -}, { - type: 'paren.rparen', - breakBefore: true, - value: '}', - indent: false -}, { - type: 'paren.rparen', - breakBefore: true, - value: '})', - indent: false, - dontBreak: true -}, { - type: 'comment' -}, { - type: 'text', - value: ';' -}, { - type: 'text', - value: ':', - context: 'php' -}, { - type: 'keyword', - value: 'case', - indent: true, - dontBreak: true -}, { - type: 'keyword', - value: 'default', - indent: true, - dontBreak: true -}, { - type: 'keyword', - value: 'break', - indent: false, - dontBreak: true -}, { - type: 'punctuation.doctype.end', - value: '>' -}, { - type: 'meta.tag.punctuation.end', - value: '>' -}, { - type: 'meta.tag.punctuation.begin', - value: '<', - blockTag: true, - indent: true, - dontBreak: true -}, { - type: 'meta.tag.punctuation.begin', - value: '' ){ - context = 'php'; - } - else if( token.type == 'support.php_tag' && token.value == '?>' ){ - context = 'html'; - } - //css - else if( token.type == 'meta.tag.name.style' && context != 'css' ){ - context = 'css'; - } - else if( token.type == 'meta.tag.name.style' && context == 'css' ){ - context = 'html'; - } - //js - else if( token.type == 'meta.tag.name.script' && context != 'js' ){ - context = 'js'; - } - else if( token.type == 'meta.tag.name.script' && context == 'js' ){ - context = 'html'; - } - - nextToken = iterator.stepForward(); - - //tag name - if (nextToken && nextToken.type.indexOf('meta.tag.name') == 0) { - nextTag = nextToken.value; - } - - //don't linebreak - if ( lastToken.type == 'support.php_tag' && lastToken.value == '' ) { - dontBreak = false; - } - - //next token - lastTag = tag; - - lastToken = token; - - token = nextToken; - - if (token===null) { - break; - } - } - - return code; -}; - - - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/chromevox.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/chromevox.js deleted file mode 100644 index 9f7a7996..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/chromevox.js +++ /dev/null @@ -1,980 +0,0 @@ -define(function(require, exports, module) { - -/* ChromeVox Ace namespace. */ -var cvoxAce = {}; - -/* Typedefs for Closure compiler. */ -/** - * @typedef {{ - rate: number, - pitch: number, - volume: number, - relativePitch: number, - punctuationEcho: string - }} - */ -/* TODO(peterxiao): Export this typedef through cvox.Api. */ -cvoxAce.SpeechProperty; - -/** - * @typedef {{ - * row: number, - * column: number - * }} - */ -cvoxAce.Cursor; - -/** - * @typedef {{ - type: string, - value: string - }} - } - */ -cvoxAce.Token; - -/** - * These are errors and information that Ace will display in the gutter. - * @typedef {{ - row: number, - column: number, - value: string - }} - } - */ -cvoxAce.Annotation; - -/* Speech Properties. */ -/** - * Speech property for speaking constant tokens. - * @type {cvoxAce.SpeechProperty} - */ -var CONSTANT_PROP = { - 'rate': 0.8, - 'pitch': 0.4, - 'volume': 0.9 -}; - -/** - * Default speech property for speaking tokens. - * @type {cvoxAce.SpeechProperty} - */ -var DEFAULT_PROP = { - 'rate': 1, - 'pitch': 0.5, - 'volume': 0.9 -}; - -/** - * Speech property for speaking entity tokens. - * @type {cvoxAce.SpeechProperty} - */ -var ENTITY_PROP = { - 'rate': 0.8, - 'pitch': 0.8, - 'volume': 0.9 -}; - -/** - * Speech property for speaking keywords. - * @type {cvoxAce.SpeechProperty} - */ -var KEYWORD_PROP = { - 'rate': 0.8, - 'pitch': 0.3, - 'volume': 0.9 -}; - -/** - * Speech property for speaking storage tokens. - * @type {cvoxAce.SpeechProperty} - */ -var STORAGE_PROP = { - 'rate': 0.8, - 'pitch': 0.7, - 'volume': 0.9 -}; - -/** - * Speech property for speaking variable tokens. - * @type {cvoxAce.SpeechProperty} - */ -var VARIABLE_PROP = { - 'rate': 0.8, - 'pitch': 0.8, - 'volume': 0.9 -}; - -/** - * Speech property for speaking deleted text. - * @type {cvoxAce.SpeechProperty} - */ -var DELETED_PROP = { - 'punctuationEcho': 'none', - 'relativePitch': -0.6 -}; - -/* Constants for Earcons. */ -var ERROR_EARCON = 'ALERT_NONMODAL'; -var MODE_SWITCH_EARCON = 'ALERT_MODAL'; -var NO_MATCH_EARCON = 'INVALID_KEYPRESS'; - -/* Constants for vim state. */ -var INSERT_MODE_STATE = 'insertMode'; -var COMMAND_MODE_STATE = 'start'; - -var REPLACE_LIST = [ - { - substr: ';', - newSubstr: ' semicolon ' - }, - { - substr: ':', - newSubstr: ' colon ' - } -]; - -/** - * Context menu commands. - */ -var Command = { - SPEAK_ANNOT: 'annots', - SPEAK_ALL_ANNOTS: 'all_annots', - TOGGLE_LOCATION: 'toggle_location', - SPEAK_MODE: 'mode', - SPEAK_ROW_COL: 'row_col', - TOGGLE_DISPLACEMENT: 'toggle_displacement', - FOCUS_TEXT: 'focus_text' -}; - -/** - * Key prefix for each shortcut. - */ -var KEY_PREFIX = 'CONTROL + SHIFT '; - -/* Globals. */ -cvoxAce.editor = null; -/** - * Last cursor position. - * @type {cvoxAce.Cursor} - */ -var lastCursor = null; - -/** - * Table of annotations. - * @typedef {!Object.>} - */ -var annotTable = {}; - -/** - * Whether to speak character, word, and then line. This allows blind users - * to know the location of the cursor when they change lines. - * @typedef {boolean} - */ -var shouldSpeakRowLocation = false; - -/** - * Whether to speak displacement. - * @typedef {boolean} - */ -var shouldSpeakDisplacement = false; - -/** - * Whether text was changed to cause a cursor change event. - * @typedef {boolean} - */ -var changed = false; - -/** - * Current state vim is in. - */ -var vimState = null; - -/** - * Mapping from key code to shortcut. - */ -var keyCodeToShortcutMap = {}; - -/** - * Mapping from command to shortcut. - */ -var cmdToShortcutMap = {}; - -/** - * Get shortcut string from keyCode. - * @param {number} keyCode Key code of shortcut. - * @return {string} String representation of shortcut. - */ -var getKeyShortcutString = function(keyCode) { - return KEY_PREFIX + String.fromCharCode(keyCode); -}; - -/** - * Return if in vim mode. - * @return {boolean} True if in Vim mode. - */ -var isVimMode = function() { - var keyboardHandler = cvoxAce.editor.keyBinding.getKeyboardHandler(); - return keyboardHandler.$id === 'ace/keyboard/vim'; -}; - -/** - * Gets the current token. - * @param {!cvoxAce.Cursor} cursor Current position of the cursor. - * @return {!cvoxAce.Token} Token at the current position. - */ -var getCurrentToken = function(cursor) { - return cvoxAce.editor.getSession().getTokenAt(cursor.row, cursor.column + 1); -}; - -/** - * Gets the current line the cursor is under. - * @param {!cvoxAce.Cursor} cursor Current cursor position. - */ -var getCurrentLine = function(cursor) { - return cvoxAce.editor.getSession().getLine(cursor.row); -}; - -/** - * Event handler for row changes. When the user changes rows we want to speak - * the line so the user can work on this line. If shouldSpeakRowLocation is on - * then we speak the character, then the row, then the line so the user knows - * where the cursor is. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var onRowChange = function(currCursor) { - /* Notify that this line has an annotation. */ - if (annotTable[currCursor.row]) { - cvox.Api.playEarcon(ERROR_EARCON); - } - if (shouldSpeakRowLocation) { - cvox.Api.stop(); - speakChar(currCursor); - speakTokenQueue(getCurrentToken(currCursor)); - speakLine(currCursor.row, 1); - } else { - speakLine(currCursor.row, 0); - } -}; - -/** - * Returns whether the cursor is at the beginning of a word. A word is - * a grouping of alphanumeric characters including underscores. - * @param {!cvoxAce.Cursor} cursor Current cursor position. - * @return {boolean} Whether there is word. - */ -var isWord = function(cursor) { - var line = getCurrentLine(cursor); - var lineSuffix = line.substr(cursor.column - 1); - if (cursor.column === 0) { - lineSuffix = ' ' + line; - } - /* Use regex to tell if the suffix is at the start of a new word. */ - var firstWordRegExp = /^\W(\w+)/; - var words = firstWordRegExp.exec(lineSuffix); - return words !== null; -}; - -/** - * A mapping of syntax type to speech properties / expanding rules. - */ -var rules = { - 'constant': { - prop: CONSTANT_PROP - }, - 'entity': { - prop: ENTITY_PROP - }, - 'keyword': { - prop: KEYWORD_PROP - }, - 'storage': { - prop: STORAGE_PROP - }, - 'variable': { - prop: VARIABLE_PROP - }, - 'meta': { - prop: DEFAULT_PROP, - replace: [ - { - substr: '', - newSubstr: ' close tag ' - }, - { - substr: '<', - newSubstr: ' tag start ' - }, - { - substr: '>', - newSubstr: ' tag end ' - } - ] - } -}; - -/** - * Default rule to be used. - */ -var DEFAULT_RULE = { - prop: DEFAULT_RULE -}; - -/** - * Expands substrings to how they are read based on the given rules. - * @param {string} value Text to be expanded. - * @param {Array.} replaceRules Rules to determine expansion. - * @return {string} New expanded value. - */ -var expand = function(value, replaceRules) { - var newValue = value; - for (var i = 0; i < replaceRules.length; i++) { - var replaceRule = replaceRules[i]; - var regexp = new RegExp(replaceRule.substr, 'g'); - newValue = newValue.replace(regexp, replaceRule.newSubstr); - } - return newValue; -}; - -/** - * Merges tokens from start inclusive to end exclusive. - * @param {Array.} Tokens to be merged. - * @param {number} start Start index inclusive. - * @param {number} end End index exclusive. - * @return {cvoxAce.Token} Merged token. - */ -var mergeTokens = function(tokens, start, end) { - /* Different type of token found! Merge all previous like tokens. */ - var newToken = {}; - newToken.value = ''; - newToken.type = tokens[start].type; - for (var j = start; j < end; j++) { - newToken.value += tokens[j].value; - } - return newToken; -}; - -/** - * Merges tokens that use the same speech properties. - * @param {Array.} tokens Tokens to be merged. - * @return {Array.} Merged tokens. - */ -var mergeLikeTokens = function(tokens) { - if (tokens.length <= 1) { - return tokens; - } - var newTokens = []; - var lastLikeIndex = 0; - for (var i = 1; i < tokens.length; i++) { - var lastLikeToken = tokens[lastLikeIndex]; - var currToken = tokens[i]; - if (getTokenRule(lastLikeToken) !== getTokenRule(currToken)) { - newTokens.push(mergeTokens(tokens, lastLikeIndex, i)); - lastLikeIndex = i; - } - } - newTokens.push(mergeTokens(tokens, lastLikeIndex, tokens.length)); - return newTokens; -}; - -/** - * Returns if given row is a whitespace row. - * @param {number} row Row. - * @return {boolean} True if row is whitespaces. - */ -var isRowWhiteSpace = function(row) { - var line = cvoxAce.editor.getSession().getLine(row); - var whiteSpaceRegexp = /^\s*$/; - return whiteSpaceRegexp.exec(line) !== null; -}; - -/** - * Speak the line with syntax properties. - * @param {number} row Row to speak. - * @param {number} queue Queue mode to speak. - */ -var speakLine = function(row, queue) { - var tokens = cvoxAce.editor.getSession().getTokens(row); - if (tokens.length === 0 || isRowWhiteSpace(row)) { - cvox.Api.playEarcon('EDITABLE_TEXT'); - return; - } - tokens = mergeLikeTokens(tokens); - var firstToken = tokens[0]; - /* Filter out first token. */ - tokens = tokens.filter(function(token) { - return token !== firstToken; - }); - /* Speak first token separately to flush if queue. */ - speakToken_(firstToken, queue); - /* Speak rest of tokens. */ - tokens.forEach(speakTokenQueue); -}; - -/** - * Speak the token based on the syntax of the token, flushing. - * @param {!cvoxAce.Token} token Token to speak. - * @param {number} queue Queue mode. - */ -var speakTokenFlush = function(token) { - speakToken_(token, 0); -}; - -/** - * Speak the token based on the syntax of the token, queueing. - * @param {!cvoxAce.Token} token Token to speak. - * @param {number} queue Queue mode. - */ -var speakTokenQueue = function(token) { - speakToken_(token, 1); -}; - -/** - * @param {!cvoxAce.Token} token Token to speak. - * Get the token speech property. - */ -var getTokenRule = function(token) { - /* Types are period delimited. In this case, we only syntax speak the outer - * most type of token. */ - if (!token || !token.type) { - return; - } - var split = token.type.split('.'); - if (split.length === 0) { - return; - } - var type = split[0]; - var rule = rules[type]; - if (!rule) { - return DEFAULT_RULE; - } - return rule; -}; - -/** - * Speak the token based on the syntax of the token. - * @private - * @param {!cvoxAce.Token} token Token to speak. - * @param {number} queue Queue mode. - */ -var speakToken_ = function(token, queue) { - var rule = getTokenRule(token); - var value = expand(token.value, REPLACE_LIST); - if (rule.replace) { - value = expand(value, rule.replace); - } - cvox.Api.speak(value, queue, rule.prop); -}; - -/** - * Speaks the character under the cursor. This is queued. - * @param {!cvoxAce.Cursor} cursor Current cursor position. - * @return {string} Character. - */ -var speakChar = function(cursor) { - var line = getCurrentLine(cursor); - cvox.Api.speak(line[cursor.column], 1); -}; - -/** - * Speaks the jump from lastCursor to currCursor. This function assumes the - * jump takes place on the current line. - * @param {!cvoxAce.Cursor} lastCursor Previous cursor position. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var speakDisplacement = function(lastCursor, currCursor) { - var line = getCurrentLine(currCursor); - - /* Get the text that we jumped past. */ - var displace = line.substring(lastCursor.column, currCursor.column); - - /* Speak out loud spaces. */ - displace = displace.replace(/ /g, ' space '); - cvox.Api.speak(displace); -}; - -/** - * Speaks the word if the cursor jumped to a new word or to the beginning - * of the line. Otherwise speak the charactor. - * @param {!cvoxAce.Cursor} lastCursor Previous cursor position. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var speakCharOrWordOrLine = function(lastCursor, currCursor) { - /* Say word only if jump. */ - if (Math.abs(lastCursor.column - currCursor.column) !== 1) { - var currLineLength = getCurrentLine(currCursor).length; - /* Speak line if jumping to beginning or end of line. */ - if (currCursor.column === 0 || currCursor.column === currLineLength) { - speakLine(currCursor.row, 0); - return; - } - if (isWord(currCursor)) { - cvox.Api.stop(); - speakTokenQueue(getCurrentToken(currCursor)); - return; - } - } - speakChar(currCursor); -}; - -/** - * Event handler for column changes. If shouldSpeakDisplacement is on, then - * we just speak displacements in row changes. Otherwise, we either speak - * the character for single character movements, the word when jumping to the - * next word, or the entire line if jumping to beginning or end of the line. - * @param {!cvoxAce.Cursor} lastCursor Previous cursor position. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var onColumnChange = function(lastCursor, currCursor) { - if (!cvoxAce.editor.selection.isEmpty()) { - speakDisplacement(lastCursor, currCursor); - cvox.Api.speak('selected', 1); - } - else if (shouldSpeakDisplacement) { - speakDisplacement(lastCursor, currCursor); - } else { - speakCharOrWordOrLine(lastCursor, currCursor); - } -}; - -/** - * Event handler for cursor changes. Classify cursor changes as either row or - * column changes, then delegate accordingly. - * @param {!Event} evt The event. - */ -var onCursorChange = function(evt) { - /* Do not speak if cursor change was a result of text insertion. We want to - * speak the text that was inserted and not where the cursor lands. */ - if (changed) { - changed = false; - return; - } - var currCursor = cvoxAce.editor.selection.getCursor(); - if (currCursor.row !== lastCursor.row) { - onRowChange(currCursor); - } else { - onColumnChange(lastCursor, currCursor); - } - lastCursor = currCursor; -}; - -/** - * Event handler for selection changes. - * @param {!Event} evt The event. - */ -var onSelectionChange = function(evt) { - /* Assumes that when selection changes to empty, the user has unselected. */ - if (cvoxAce.editor.selection.isEmpty()) { - cvox.Api.speak('unselected'); - } -}; - -/** - * Event handler for source changes. We want auditory feedback for inserting - * and deleting text. - * @param {!Event} evt The event. - */ -var onChange = function(evt) { - var data = evt.data; - switch (data.action) { - case 'removeText': - cvox.Api.speak(data.text, 0, DELETED_PROP); - /* Let the future cursor change event know it's from text change. */ - changed = true; - break; - case 'insertText': - cvox.Api.speak(data.text, 0); - /* Let the future cursor change event know it's from text change. */ - changed = true; - break; - } -}; - -/** - * Returns whether or not the annotation is new. - * @param {!cvoxAce.Annotation} annot Annotation in question. - * @return {boolean} Whether annot is new. - */ -var isNewAnnotation = function(annot) { - var row = annot.row; - var col = annot.column; - return !annotTable[row] || !annotTable[row][col]; -}; - -/** - * Populates the annotation table. - * @param {!Array.} annotations Array of annotations. - */ -var populateAnnotations = function(annotations) { - annotTable = {}; - for (var i = 0; i < annotations.length; i++) { - var annotation = annotations[i]; - var row = annotation.row; - var col = annotation.column; - if (!annotTable[row]) { - annotTable[row] = {}; - } - annotTable[row][col] = annotation; - } -}; - -/** - * Event handler for annotation changes. We want to notify the user when an - * a new annotation appears. - * @param {!Event} evt Event. - */ -var onAnnotationChange = function(evt) { - var annotations = cvoxAce.editor.getSession().getAnnotations(); - var newAnnotations = annotations.filter(isNewAnnotation); - if (newAnnotations.length > 0) { - cvox.Api.playEarcon(ERROR_EARCON); - } - populateAnnotations(annotations); -}; - -/** - * Speak annotation. - * @param {!cvoxAce.Annotation} annot Annotation to speak. - */ -var speakAnnot = function(annot) { - var annotText = annot.type + ' ' + annot.text + ' on ' + - rowColToString(annot.row, annot.column); - annotText = annotText.replace(';', 'semicolon'); - cvox.Api.speak(annotText, 1); -}; - -/** - * Speak annotations in a row. - * @param {number} row Row of annotations to speak. - */ -var speakAnnotsByRow = function(row) { - var annots = annotTable[row]; - for (var col in annots) { - speakAnnot(annots[col]); - } -}; - -/** - * Get a string representation of a row and column. - * @param {boolean} row Zero indexed row. - * @param {boolean} col Zero indexed column. - * @return {string} Row and column to be spoken. - */ -var rowColToString = function(row, col) { - return 'row ' + (row + 1) + ' column ' + (col + 1); -}; - -/** - * Speaks the row and column. - */ -var speakCurrRowAndCol = function() { - cvox.Api.speak(rowColToString(lastCursor.row, lastCursor.column)); -}; - -/** - * Speaks all annotations. - */ -var speakAllAnnots = function() { - for (var row in annotTable) { - speakAnnotsByRow(row); - } -}; - -/** - * Speak the vim mode. If no vim mode, this function does nothing. - */ -var speakMode = function() { - if (!isVimMode()) { - return; - } - switch (cvoxAce.editor.keyBinding.$data.state) { - case INSERT_MODE_STATE: - cvox.Api.speak('Insert mode'); - break; - case COMMAND_MODE_STATE: - cvox.Api.speak('Command mode'); - break; - } -}; - -/** - * Toggle speak location. - */ -var toggleSpeakRowLocation = function() { - shouldSpeakRowLocation = !shouldSpeakRowLocation; - /* Auditory feedback of the change. */ - if (shouldSpeakRowLocation) { - cvox.Api.speak('Speak location on row change enabled.'); - } else { - cvox.Api.speak('Speak location on row change disabled.'); - } -}; - -/** - * Toggle speak displacement. - */ -var toggleSpeakDisplacement = function() { - shouldSpeakDisplacement = !shouldSpeakDisplacement; - /* Auditory feedback of the change. */ - if (shouldSpeakDisplacement) { - cvox.Api.speak('Speak displacement on column changes.'); - } else { - cvox.Api.speak('Speak current character or word on column changes.'); - } -}; - -/** - * Event handler for key down events. Gets the right shortcut from the map, - * and calls the associated function. - * @param {!Event} evt Keyboard event. - */ -var onKeyDown = function(evt) { - if (evt.ctrlKey && evt.shiftKey) { - var shortcut = keyCodeToShortcutMap[evt.keyCode]; - if (shortcut) { - shortcut.func(); - } - } -}; - -/** - * Event handler for status change events. Auditory feedback of changing - * between vim states. - * @param {!Event} evt Change status event. - * @param {!Object} editor Editor state. - */ -var onChangeStatus = function(evt, editor) { - if (!isVimMode()) { - return; - } - var state = editor.keyBinding.$data.state; - if (state === vimState) { - /* State hasn't changed, do nothing. */ - return; - } - switch (state) { - case INSERT_MODE_STATE: - cvox.Api.playEarcon(MODE_SWITCH_EARCON); - /* When in insert mode, we want to speak out keys as feedback. */ - cvox.Api.setKeyEcho(true); - break; - case COMMAND_MODE_STATE: - cvox.Api.playEarcon(MODE_SWITCH_EARCON); - /* When in command mode, we want don't speak out keys because those keys - * are not being inserted in the document. */ - cvox.Api.setKeyEcho(false); - break; - } - vimState = state; -}; - -/** - * Handles context menu events. This is a ChromeVox feature where hitting - * the shortcut ChromeVox + comma will open up a search bar where you can - * type in various commands. All keyboard shortcuts are also commands that - * can be invoked. This handles the event that ChromeVox sends to the page. - * @param {Event} evt Event received. - */ -var contextMenuHandler = function(evt) { - var cmd = evt.detail['customCommand']; - var shortcut = cmdToShortcutMap[cmd]; - if (shortcut) { - shortcut.func(); - /* ChromeVox will bring focus to an element near the cursor instead of the - * text input. */ - cvoxAce.editor.focus(); - } -}; - -/** - * Initialize the ChromeVox context menu. - */ -var initContextMenu = function() { - var ACTIONS = SHORTCUTS.map(function(shortcut) { - return { - desc: shortcut.desc + getKeyShortcutString(shortcut.keyCode), - cmd: shortcut.cmd - }; - }); - - /* Attach ContextMenuActions. */ - var body = document.querySelector('body'); - body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS)); - - /* Listen for ContextMenu events. */ - body.addEventListener('ATCustomEvent', contextMenuHandler, true); -}; - -/** - * Event handler for find events. When there is a match, we want to speak the - * line we are now at. Otherwise, we want to notify the user there was no - * match - * @param {!Event} evt The event. - */ -var onFindSearchbox = function(evt) { - if (evt.match) { - /* There is still a match! Speak the line. */ - speakLine(lastCursor.row, 0); - } else { - /* No match, give auditory feedback! */ - cvox.Api.playEarcon(NO_MATCH_EARCON); - } -}; - -/** - * Focus to text input. - */ -var focus = function() { - cvoxAce.editor.focus(); -}; - -/** - * Shortcut definitions. - */ -var SHORTCUTS = [ - { - /* 1 key. */ - keyCode: 49, - func: function() { - speakAnnotsByRow(lastCursor.row); - }, - cmd: Command.SPEAK_ANNOT, - desc: 'Speak annotations on line' - }, - { - /* 2 key. */ - keyCode: 50, - func: speakAllAnnots, - cmd: Command.SPEAK_ALL_ANNOTS, - desc: 'Speak all annotations' - }, - { - /* 3 key. */ - keyCode: 51, - func: speakMode, - cmd: Command.SPEAK_MODE, - desc: 'Speak Vim mode' - }, - { - /* 4 key. */ - keyCode: 52, - func: toggleSpeakRowLocation, - cmd: Command.TOGGLE_LOCATION, - desc: 'Toggle speak row location' - }, - { - /* 5 key. */ - keyCode: 53, - func: speakCurrRowAndCol, - cmd: Command.SPEAK_ROW_COL, - desc: 'Speak row and column' - }, - { - /* 6 key. */ - keyCode: 54, - func: toggleSpeakDisplacement, - cmd: Command.TOGGLE_DISPLACEMENT, - desc: 'Toggle speak displacement' - }, - { - /* 7 key. */ - keyCode: 55, - func: focus, - cmd: Command.FOCUS_TEXT, - desc: 'Focus text' - } -]; - -/** - * Event handler for focus events. - */ -var onFocus = function() { - cvoxAce.editor = editor; - - /* Set up listeners. */ - editor.getSession().selection.on('changeCursor', onCursorChange); - editor.getSession().selection.on('changeSelection', onSelectionChange); - editor.getSession().on('change', onChange); - editor.getSession().on('changeAnnotation', onAnnotationChange); - editor.on('changeStatus', onChangeStatus); - editor.on('findSearchBox', onFindSearchbox); - editor.container.addEventListener('keydown', onKeyDown); - - lastCursor = editor.selection.getCursor(); -}; - -/** - * Initialize the theme. - * @param {Object} editor Editor to use. - */ -var init = function(editor) { - onFocus(); - - /* Construct maps. */ - SHORTCUTS.forEach(function(shortcut) { - keyCodeToShortcutMap[shortcut.keyCode] = shortcut; - cmdToShortcutMap[shortcut.cmd] = shortcut; - }); - - editor.on('focus', onFocus); - - /* Assume we start in command mode if vim. */ - if (isVimMode()) { - cvox.Api.setKeyEcho(false); - } - initContextMenu(); -}; - -/** - * Returns if cvox exists, and the api exists. - * @return {boolean} Whether not Cvox Api exists. - */ -function cvoxApiExists() { - return (typeof(cvox) !== 'undefined') && cvox && cvox.Api; -} - -/** - * Number of tries for Cvox loading. - * @type {number} - */ -var tries = 0; - -/** - * Max number of tries to watch for Cvox loading. - * @type {number} - */ -var MAX_TRIES = 15; - -/** - * Check for ChromeVox load. - * @param {Object} editor Editor to use. - */ -function watchForCvoxLoad(editor) { - if (cvoxApiExists()) { - init(editor); - } else { - tries++; - if (tries >= MAX_TRIES) { - return; - } - window.setTimeout(watchForCvoxLoad, 500, editor); - } -} - -var Editor = require('../editor').Editor; -require('../config').defineOptions(Editor.prototype, 'editor', { - enableChromevoxEnhancements: { - set: function(val) { - if (val) { - watchForCvoxLoad(this); - } - }, - value: true // turn it on by default or check for window.cvox - } -}); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/elastic_tabstops_lite.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/elastic_tabstops_lite.js deleted file mode 100644 index 9901c5df..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/elastic_tabstops_lite.js +++ /dev/null @@ -1,319 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var ElasticTabstopsLite = function(editor) { - this.$editor = editor; - var self = this; - var changedRows = []; - var recordChanges = false; - this.onAfterExec = function() { - recordChanges = false; - self.processRows(changedRows); - changedRows = []; - }; - this.onExec = function() { - recordChanges = true; - }; - this.onChange = function(e) { - var range = e.data.range - if (recordChanges) { - if (changedRows.indexOf(range.start.row) == -1) - changedRows.push(range.start.row); - if (range.end.row != range.start.row) - changedRows.push(range.end.row); - } - }; -}; - -(function() { - this.processRows = function(rows) { - this.$inChange = true; - var checkedRows = []; - - for (var r = 0, rowCount = rows.length; r < rowCount; r++) { - var row = rows[r]; - - if (checkedRows.indexOf(row) > -1) - continue; - - var cellWidthObj = this.$findCellWidthsForBlock(row); - var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths); - var rowIndex = cellWidthObj.firstRow; - - for (var w = 0, l = cellWidths.length; w < l; w++) { - var widths = cellWidths[w]; - checkedRows.push(rowIndex); - this.$adjustRow(rowIndex, widths); - rowIndex++; - } - } - this.$inChange = false; - }; - - this.$findCellWidthsForBlock = function(row) { - var cellWidths = [], widths; - - // starting row and backward - var rowIter = row; - while (rowIter >= 0) { - widths = this.$cellWidthsForRow(rowIter); - if (widths.length == 0) - break; - - cellWidths.unshift(widths); - rowIter--; - } - var firstRow = rowIter + 1; - - // forward (not including starting row) - rowIter = row; - var numRows = this.$editor.session.getLength(); - - while (rowIter < numRows - 1) { - rowIter++; - - widths = this.$cellWidthsForRow(rowIter); - if (widths.length == 0) - break; - - cellWidths.push(widths); - } - - return { cellWidths: cellWidths, firstRow: firstRow }; - }; - - this.$cellWidthsForRow = function(row) { - var selectionColumns = this.$selectionColumnsForRow(row); - // todo: support multicursor - - var tabs = [-1].concat(this.$tabsForRow(row)); - var widths = tabs.map(function(el) { return 0; } ).slice(1); - var line = this.$editor.session.getLine(row); - - for (var i = 0, len = tabs.length - 1; i < len; i++) { - var leftEdge = tabs[i]+1; - var rightEdge = tabs[i+1]; - - var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge); - var cell = line.substring(leftEdge, rightEdge); - widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge); - } - - return widths; - }; - - this.$selectionColumnsForRow = function(row) { - var selections = [], cursor = this.$editor.getCursorPosition(); - if (this.$editor.session.getSelection().isEmpty()) { - // todo: support multicursor - if (row == cursor.row) - selections.push(cursor.column); - } - - return selections; - }; - - this.$setBlockCellWidthsToMax = function(cellWidths) { - var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth; - var columnInfo = this.$izip_longest(cellWidths); - - for (var c = 0, l = columnInfo.length; c < l; c++) { - var column = columnInfo[c]; - if (!column.push) { - console.error(column); - continue; - } - // add an extra None to the end so that the end of the column automatically - // finishes a block - column.push(NaN); - - for (var r = 0, s = column.length; r < s; r++) { - var width = column[r]; - if (startingNewBlock) { - blockStartRow = r; - maxWidth = 0; - startingNewBlock = false; - } - if (isNaN(width)) { - // block ended - blockEndRow = r; - - for (var j = blockStartRow; j < blockEndRow; j++) { - cellWidths[j][c] = maxWidth; - } - startingNewBlock = true; - } - - maxWidth = Math.max(maxWidth, width); - } - } - - return cellWidths; - }; - - this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) { - var rightmost = 0; - - if (selectionColumns.length) { - var lengths = []; - for (var s = 0, length = selectionColumns.length; s < length; s++) { - if (selectionColumns[s] <= cellRightEdge) - lengths.push(s); - else - lengths.push(0); - } - rightmost = Math.max.apply(Math, lengths); - } - - return rightmost; - }; - - this.$tabsForRow = function(row) { - var rowTabs = [], line = this.$editor.session.getLine(row), - re = /\t/g, match; - - while ((match = re.exec(line)) != null) { - rowTabs.push(match.index); - } - - return rowTabs; - }; - - this.$adjustRow = function(row, widths) { - var rowTabs = this.$tabsForRow(row); - - if (rowTabs.length == 0) - return; - - var bias = 0, location = -1; - - // this always only contains two elements, so we're safe in the loop below - var expandedSet = this.$izip(widths, rowTabs); - - for (var i = 0, l = expandedSet.length; i < l; i++) { - var w = expandedSet[i][0], it = expandedSet[i][1]; - location += 1 + w; - it += bias; - var difference = location - it; - - if (difference == 0) - continue; - - var partialLine = this.$editor.session.getLine(row).substr(0, it ); - var strippedPartialLine = partialLine.replace(/\s*$/g, ""); - var ispaces = partialLine.length - strippedPartialLine.length; - - if (difference > 0) { - // put the spaces after the tab and then delete the tab, so any insertion - // points behave as expected - this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t"); - this.$editor.session.getDocument().removeInLine(row, it, it + 1); - - bias += difference; - } - - if (difference < 0 && ispaces >= -difference) { - this.$editor.session.getDocument().removeInLine(row, it + difference, it); - bias += difference; - } - } - }; - - // the is a (naive) Python port--but works for these purposes - this.$izip_longest = function(iterables) { - if (!iterables[0]) - return []; - var longest = iterables[0].length; - var iterablesLength = iterables.length; - - for (var i = 1; i < iterablesLength; i++) { - var iLength = iterables[i].length; - if (iLength > longest) - longest = iLength; - } - - var expandedSet = []; - - for (var l = 0; l < longest; l++) { - var set = []; - for (var i = 0; i < iterablesLength; i++) { - if (iterables[i][l] === "") - set.push(NaN); - else - set.push(iterables[i][l]); - } - - expandedSet.push(set); - } - - - return expandedSet; - }; - - // an even more (naive) Python port - this.$izip = function(widths, tabs) { - // grab the shorter size - var size = widths.length >= tabs.length ? tabs.length : widths.length; - - var expandedSet = []; - for (var i = 0; i < size; i++) { - var set = [ widths[i], tabs[i] ]; - expandedSet.push(set); - } - return expandedSet; - }; - -}).call(ElasticTabstopsLite.prototype); - -exports.ElasticTabstopsLite = ElasticTabstopsLite; - -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - useElasticTabstops: { - set: function(val) { - if (val) { - if (!this.elasticTabstops) - this.elasticTabstops = new ElasticTabstopsLite(this); - this.commands.on("afterExec", this.elasticTabstops.onAfterExec); - this.commands.on("exec", this.elasticTabstops.onExec); - this.on("change", this.elasticTabstops.onChange); - } else if (this.elasticTabstops) { - this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec); - this.commands.removeListener("exec", this.elasticTabstops.onExec); - this.removeListener("change", this.elasticTabstops.onChange); - } - } - } -}); - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/emmet.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/emmet.js deleted file mode 100644 index ceb155ef..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/emmet.js +++ /dev/null @@ -1,434 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var HashHandler = require("ace/keyboard/hash_handler").HashHandler; -var Editor = require("ace/editor").Editor; -var snippetManager = require("ace/snippets").snippetManager; -var Range = require("ace/range").Range; -var emmet, emmetPath; - -/** - * Implementation of {@link IEmmetEditor} interface for Ace - */ -function AceEmmetEditor() {} - -AceEmmetEditor.prototype = { - setupContext: function(editor) { - this.ace = editor; - this.indentation = editor.session.getTabString(); - if (!emmet) - emmet = window.emmet; - emmet.require("resources").setVariable("indentation", this.indentation); - this.$syntax = null; - this.$syntax = this.getSyntax(); - }, - /** - * Returns character indexes of selected text: object with start - * and end properties. If there's no selection, should return - * object with start and end properties referring - * to current caret position - * @return {Object} - * @example - * var selection = editor.getSelectionRange(); - * alert(selection.start + ', ' + selection.end); - */ - getSelectionRange: function() { - // TODO should start be caret position instead? - var range = this.ace.getSelectionRange(); - var doc = this.ace.session.doc; - return { - start: doc.positionToIndex(range.start), - end: doc.positionToIndex(range.end) - }; - }, - - /** - * Creates selection from start to end character - * indexes. If end is ommited, this method should place caret - * and start index - * @param {Number} start - * @param {Number} [end] - * @example - * editor.createSelection(10, 40); - * - * //move caret to 15th character - * editor.createSelection(15); - */ - createSelection: function(start, end) { - var doc = this.ace.session.doc; - this.ace.selection.setRange({ - start: doc.indexToPosition(start), - end: doc.indexToPosition(end) - }); - }, - - /** - * Returns current line's start and end indexes as object with start - * and end properties - * @return {Object} - * @example - * var range = editor.getCurrentLineRange(); - * alert(range.start + ', ' + range.end); - */ - getCurrentLineRange: function() { - var ace = this.ace; - var row = ace.getCursorPosition().row; - var lineLength = ace.session.getLine(row).length; - var index = ace.session.doc.positionToIndex({row: row, column: 0}); - return { - start: index, - end: index + lineLength - }; - }, - - /** - * Returns current caret position - * @return {Number|null} - */ - getCaretPos: function(){ - var pos = this.ace.getCursorPosition(); - return this.ace.session.doc.positionToIndex(pos); - }, - - /** - * Set new caret position - * @param {Number} index Caret position - */ - setCaretPos: function(index){ - var pos = this.ace.session.doc.indexToPosition(index); - this.ace.selection.moveToPosition(pos); - }, - - /** - * Returns content of current line - * @return {String} - */ - getCurrentLine: function() { - var row = this.ace.getCursorPosition().row; - return this.ace.session.getLine(row); - }, - - /** - * Replace editor's content or it's part (from start to - * end index). If value contains - * caret_placeholder, the editor will put caret into - * this position. If you skip start and end - * arguments, the whole target's content will be replaced with - * value. - * - * If you pass start argument only, - * the value will be placed at start string - * index of current content. - * - * If you pass start and end arguments, - * the corresponding substring of current target's content will be - * replaced with value. - * @param {String} value Content you want to paste - * @param {Number} [start] Start index of editor's content - * @param {Number} [end] End index of editor's content - * @param {Boolean} [noIndent] Do not auto indent value - */ - replaceContent: function(value, start, end, noIndent) { - if (end == null) - end = start == null ? this.getContent().length : start; - if (start == null) - start = 0; - - var editor = this.ace; - var doc = editor.session.doc; - var range = Range.fromPoints(doc.indexToPosition(start), doc.indexToPosition(end)); - editor.session.remove(range); - - range.end = range.start; - //editor.selection.setRange(range); - - value = this.$updateTabstops(value); - snippetManager.insertSnippet(editor, value); - }, - - /** - * Returns editor's content - * @return {String} - */ - getContent: function(){ - return this.ace.getValue(); - }, - - /** - * Returns current editor's syntax mode - * @return {String} - */ - getSyntax: function() { - if (this.$syntax) - return this.$syntax; - var syntax = this.ace.session.$modeId.split("/").pop(); - if (syntax == "html" || syntax == "php") { - var cursor = this.ace.getCursorPosition(); - var state = this.ace.session.getState(cursor.row); - if (typeof state != "string") - state = state[0]; - if (state) { - state = state.split("-"); - if (state.length > 1) - syntax = state[0]; - else if (syntax == "php") - syntax = "html"; - } - } - return syntax; - }, - - /** - * Returns current output profile name (@see emmet#setupProfile) - * @return {String} - */ - getProfileName: function() { - switch(this.getSyntax()) { - case "css": return "css"; - case "xml": - case "xsl": - return "xml"; - case "html": - var profile = emmet.require("resources").getVariable("profile"); - // no forced profile, guess from content html or xhtml? - if (!profile) - profile = this.ace.session.getLines(0,2).join("").search(/]+XHTML/i) != -1 ? "xhtml": "html"; - return profile; - } - return "xhtml"; - }, - - /** - * Ask user to enter something - * @param {String} title Dialog title - * @return {String} Entered data - * @since 0.65 - */ - prompt: function(title) { - return prompt(title); - }, - - /** - * Returns current selection - * @return {String} - * @since 0.65 - */ - getSelection: function() { - return this.ace.session.getTextRange(); - }, - - /** - * Returns current editor's file path - * @return {String} - * @since 0.65 - */ - getFilePath: function() { - return ""; - }, - - // update tabstops: make sure all caret placeholders are unique - // by default, abbreviation parser generates all unlinked (un-mirrored) - // tabstops as ${0}, so we have upgrade all caret tabstops with unique - // positions but make sure that all other tabstops are not linked accidentally - // based on https://github.com/sergeche/emmet-sublime/blob/master/editor.js#L119-L171 - $updateTabstops: function(value) { - var base = 1000; - var zeroBase = 0; - var lastZero = null; - var range = emmet.require('range'); - var ts = emmet.require('tabStops'); - var settings = emmet.require('resources').getVocabulary("user"); - var tabstopOptions = { - tabstop: function(data) { - var group = parseInt(data.group, 10); - var isZero = group === 0; - if (isZero) - group = ++zeroBase; - else - group += base; - - var placeholder = data.placeholder; - if (placeholder) { - // recursively update nested tabstops - placeholder = ts.processText(placeholder, tabstopOptions); - } - - var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}'; - - if (isZero) { - lastZero = range.create(data.start, result); - } - - return result; - }, - escape: function(ch) { - if (ch == '$') return '\\$'; - if (ch == '\\') return '\\\\'; - return ch; - } - }; - - value = ts.processText(value, tabstopOptions); - - if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) { - value += '${0}'; - } else if (lastZero) { - value = emmet.require('utils').replaceSubstring(value, '${0}', lastZero); - } - - return value; - } -}; - - -var keymap = { - expand_abbreviation: {"mac": "ctrl+alt+e", "win": "alt+e"}, - match_pair_outward: {"mac": "ctrl+d", "win": "ctrl+,"}, - match_pair_inward: {"mac": "ctrl+j", "win": "ctrl+shift+0"}, - matching_pair: {"mac": "ctrl+alt+j", "win": "alt+j"}, - next_edit_point: "alt+right", - prev_edit_point: "alt+left", - toggle_comment: {"mac": "command+/", "win": "ctrl+/"}, - split_join_tag: {"mac": "shift+command+'", "win": "shift+ctrl+`"}, - remove_tag: {"mac": "command+'", "win": "shift+ctrl+;"}, - evaluate_math_expression: {"mac": "shift+command+y", "win": "shift+ctrl+y"}, - increment_number_by_1: "ctrl+up", - decrement_number_by_1: "ctrl+down", - increment_number_by_01: "alt+up", - decrement_number_by_01: "alt+down", - increment_number_by_10: {"mac": "alt+command+up", "win": "shift+alt+up"}, - decrement_number_by_10: {"mac": "alt+command+down", "win": "shift+alt+down"}, - select_next_item: {"mac": "shift+command+.", "win": "shift+ctrl+."}, - select_previous_item: {"mac": "shift+command+,", "win": "shift+ctrl+,"}, - reflect_css_value: {"mac": "shift+command+r", "win": "shift+ctrl+r"}, - - encode_decode_data_url: {"mac": "shift+ctrl+d", "win": "ctrl+'"}, - // update_image_size: {"mac": "shift+ctrl+i", "win": "ctrl+u"}, - // expand_as_you_type: "ctrl+alt+enter", - // wrap_as_you_type: {"mac": "shift+ctrl+g", "win": "shift+ctrl+g"}, - expand_abbreviation_with_tab: "Tab", - wrap_with_abbreviation: {"mac": "shift+ctrl+a", "win": "shift+ctrl+a"} -}; - -var editorProxy = new AceEmmetEditor(); -exports.commands = new HashHandler(); -exports.runEmmetCommand = function(editor) { - try { - editorProxy.setupContext(editor); - if (editorProxy.getSyntax() == "php") - return false; - var actions = emmet.require("actions"); - - if (this.action == "expand_abbreviation_with_tab") { - if (!editor.selection.isEmpty()) - return false; - } - - if (this.action == "wrap_with_abbreviation") { - // without setTimeout prompt doesn't work on firefox - return setTimeout(function() { - actions.run("wrap_with_abbreviation", editorProxy); - }, 0); - } - - var pos = editor.selection.lead; - var token = editor.session.getTokenAt(pos.row, pos.column); - if (token && /\btag\b/.test(token.type)) - return false; - - var result = actions.run(this.action, editorProxy); - } catch(e) { - editor._signal("changeStatus", typeof e == "string" ? e : e.message); - console.log(e); - result = false; - } - return result; -}; - -for (var command in keymap) { - exports.commands.addCommand({ - name: "emmet:" + command, - action: command, - bindKey: keymap[command], - exec: exports.runEmmetCommand, - multiSelectAction: "forEach" - }); -} - -exports.updateCommands = function(editor, enabled) { - if (enabled) { - editor.keyBinding.addKeyboardHandler(exports.commands); - } else { - editor.keyBinding.removeKeyboardHandler(exports.commands); - } -}; - -exports.isSupportedMode = function(modeId) { - return modeId && /css|less|scss|sass|stylus|html|php|twig|ejs/.test(modeId); -}; - -var onChangeMode = function(e, target) { - var editor = target; - if (!editor) - return; - var enabled = exports.isSupportedMode(editor.session.$modeId); - if (e.enableEmmet === false) - enabled = false; - if (enabled) { - if (typeof emmetPath == "string") { - require("ace/config").loadModule(emmetPath, function() { - emmetPath = null; - }); - } - } - exports.updateCommands(editor, enabled); -}; - -exports.AceEmmetEditor = AceEmmetEditor; -require("ace/config").defineOptions(Editor.prototype, "editor", { - enableEmmet: { - set: function(val) { - this[val ? "on" : "removeListener"]("changeMode", onChangeMode); - onChangeMode({enableEmmet: !!val}, this); - }, - value: true - } -}); - -exports.setCore = function(e) { - if (typeof e == "string") - emmetPath = e; - else - emmet = e; -}; -}); - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/error_marker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/error_marker.js deleted file mode 100644 index 05d50498..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/error_marker.js +++ /dev/null @@ -1,214 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var LineWidgets = require("../line_widgets").LineWidgets; -var dom = require("../lib/dom"); -var Range = require("../range").Range; - -function binarySearch(array, needle, comparator) { - var first = 0; - var last = array.length - 1; - - while (first <= last) { - var mid = (first + last) >> 1; - var c = comparator(needle, array[mid]); - if (c > 0) - first = mid + 1; - else if (c < 0) - last = mid - 1; - else - return mid; - } - - // Return the nearest lesser index, "-1" means "0, "-2" means "1", etc. - return -(first + 1); -} - -function findAnnotations(session, row, dir) { - var annotations = session.getAnnotations().sort(Range.comparePoints); - if (!annotations.length) - return; - - var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints); - if (i < 0) - i = -i - 1; - - if (i >= annotations.length - 1) - i = dir > 0 ? 0 : annotations.length - 1; - else if (i === 0 && dir < 0) - i = annotations.length - 1; - - var annotation = annotations[i]; - if (!annotation || !dir) - return; - - if (annotation.row === row) { - do { - annotation = annotations[i += dir]; - } while (annotation && annotation.row === row); - if (!annotation) - return annotations.slice(); - } - - - var matched = []; - row = annotation.row; - do { - matched[dir < 0 ? "unshift" : "push"](annotation); - annotation = annotations[i += dir]; - } while (annotation && annotation.row == row); - return matched.length && matched; -} - -exports.showErrorMarker = function(editor, dir) { - var session = editor.session; - if (!session.widgetManager) { - session.widgetManager = new LineWidgets(session); - session.widgetManager.attach(editor); - } - - var pos = editor.getCursorPosition(); - var row = pos.row; - var oldWidget = session.lineWidgets && session.lineWidgets[row]; - if (oldWidget) { - oldWidget.destroy(); - } else { - row -= dir; - } - var annotations = findAnnotations(session, row, dir); - var gutterAnno; - if (annotations) { - var annotation = annotations[0]; - pos.column = (annotation.pos && typeof annotation.column != "number" - ? annotation.pos.sc - : annotation.column) || 0; - pos.row = annotation.row; - gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; - } else if (oldWidget) { - return; - } else { - gutterAnno = { - text: ["Looks good!"], - className: "ace_ok" - }; - } - editor.session.unfold(pos.row); - editor.selection.moveToPosition(pos); - - var w = { - row: pos.row, - fixedWidth: true, - coverGutter: true, - el: dom.createElement("div") - }; - var el = w.el.appendChild(dom.createElement("div")); - var arrow = w.el.appendChild(dom.createElement("div")); - arrow.className = "error_widget_arrow " + gutterAnno.className; - - var left = editor.renderer.$cursorLayer - .getPixelPosition(pos).left; - arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; - - w.el.className = "error_widget_wrapper"; - el.className = "error_widget " + gutterAnno.className; - el.innerHTML = gutterAnno.text.join("
"); - - el.appendChild(dom.createElement("div")); - - var kb = function(_, hashId, keyString) { - if (hashId === 0 && (keyString === "esc" || keyString === "return")) { - w.destroy(); - return {command: "null"}; - } - }; - - w.destroy = function() { - if (editor.$mouseHandler.isMousePressed) - return; - editor.keyBinding.removeKeyboardHandler(kb); - session.widgetManager.removeLineWidget(w); - editor.off("changeSelection", w.destroy); - editor.off("changeSession", w.destroy); - editor.off("mouseup", w.destroy); - editor.off("change", w.destroy); - }; - - editor.keyBinding.addKeyboardHandler(kb); - editor.on("changeSelection", w.destroy); - editor.on("changeSession", w.destroy); - editor.on("mouseup", w.destroy); - editor.on("change", w.destroy); - - editor.session.widgetManager.addLineWidget(w); - - w.el.onmousedown = editor.focus.bind(editor); - - editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight}); -}; - - -dom.importCssString("\ - .error_widget_wrapper {\ - background: inherit;\ - color: inherit;\ - border:none\ - }\ - .error_widget {\ - border-top: solid 2px;\ - border-bottom: solid 2px;\ - margin: 5px 0;\ - padding: 10px 40px;\ - white-space: pre-wrap;\ - }\ - .error_widget.ace_error, .error_widget_arrow.ace_error{\ - border-color: #ff5a5a\ - }\ - .error_widget.ace_warning, .error_widget_arrow.ace_warning{\ - border-color: #F1D817\ - }\ - .error_widget.ace_info, .error_widget_arrow.ace_info{\ - border-color: #5a5a5a\ - }\ - .error_widget.ace_ok, .error_widget_arrow.ace_ok{\ - border-color: #5aaa5a\ - }\ - .error_widget_arrow {\ - position: absolute;\ - border: solid 5px;\ - border-top-color: transparent!important;\ - border-right-color: transparent!important;\ - border-left-color: transparent!important;\ - top: -5px;\ - }\ -", ""); - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/keybinding_menu.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/keybinding_menu.js deleted file mode 100644 index bf8189a5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/keybinding_menu.js +++ /dev/null @@ -1,86 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Show Keyboard Shortcuts - * @fileOverview Show Keyboard Shortcuts
- * Generates a menu which displays the keyboard shortcuts. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { - "use strict"; - var Editor = require("ace/editor").Editor; - /** - * Generates a menu which displays the keyboard shortcuts. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ - function showKeyboardShortcuts (editor) { - // make sure the menu isn't open already. - if(!document.getElementById('kbshortcutmenu')) { - var overlayPage = require('./menu_tools/overlay_page').overlayPage; - var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts; - var kb = getEditorKeybordShortcuts(editor); - var el = document.createElement('div'); - var commands = kb.reduce(function(previous, current) { - return previous + '
' - + current.command + ' : ' - + '' + current.key + '
'; - }, ''); - - el.id = 'kbshortcutmenu'; - el.innerHTML = '

Keyboard Shortcuts

' + commands + ''; - overlayPage(editor, el, '0', '0', '0', null); - } - }; - module.exports.init = function(editor) { - Editor.prototype.showKeyboardShortcuts = function() { - showKeyboardShortcuts(this); - }; - editor.commands.addCommands([{ - name: "showKeyboardShortcuts", - bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"}, - exec: function(editor, line) { - editor.showKeyboardShortcuts(); - } - }]); - }; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/language_tools.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/language_tools.js deleted file mode 100644 index f02390ee..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/language_tools.js +++ /dev/null @@ -1,226 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var snippetManager = require("../snippets").snippetManager; -var Autocomplete = require("../autocomplete").Autocomplete; -var config = require("../config"); -var lang = require("../lib/lang"); -var util = require("../autocomplete/util"); - -var textCompleter = require("../autocomplete/text_completer"); -var keyWordCompleter = { - getCompletions: function(editor, session, pos, prefix, callback) { - if (session.$mode.completer) { - return session.$mode.completer.getCompletions(editor, session, pos, prefix, callback); - } - var state = editor.session.getState(pos.row); - var completions = session.$mode.getCompletions(state, session, pos, prefix); - callback(null, completions); - } -}; - -var snippetCompleter = { - getCompletions: function(editor, session, pos, prefix, callback) { - var snippetMap = snippetManager.snippetMap; - var completions = []; - snippetManager.getActiveScopes(editor).forEach(function(scope) { - var snippets = snippetMap[scope] || []; - for (var i = snippets.length; i--;) { - var s = snippets[i]; - var caption = s.name || s.tabTrigger; - if (!caption) - continue; - completions.push({ - caption: caption, - snippet: s.content, - meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet", - type: "snippet" - }); - } - }, this); - callback(null, completions); - }, - getDocTooltip: function(item) { - if (item.type == "snippet" && !item.docHTML) { - item.docHTML = [ - "", lang.escapeHTML(item.caption), "", "
", - lang.escapeHTML(item.snippet) - ].join(""); - } - } -}; - -var completers = [snippetCompleter, textCompleter, keyWordCompleter]; -// Allows default completers to be removed or replaced with a explict set of completers -// A null argument here will result in an empty completer array, not a null attribute -exports.setCompleters = function(val) { - completers = val || []; -}; -exports.addCompleter = function(completer) { - completers.push(completer); -}; - -// Exports existing completer so that user can construct his own set of completers. -exports.textCompleter = textCompleter; -exports.keyWordCompleter = keyWordCompleter; -exports.snippetCompleter = snippetCompleter; - -var expandSnippet = { - name: "expandSnippet", - exec: function(editor) { - return snippetManager.expandWithTab(editor); - }, - bindKey: "Tab" -}; - -var onChangeMode = function(e, editor) { - loadSnippetsForMode(editor.session.$mode); -}; - -var loadSnippetsForMode = function(mode) { - var id = mode.$id; - if (!snippetManager.files) - snippetManager.files = {}; - loadSnippetFile(id); - if (mode.modes) - mode.modes.forEach(loadSnippetsForMode); -}; - -var loadSnippetFile = function(id) { - if (!id || snippetManager.files[id]) - return; - var snippetFilePath = id.replace("mode", "snippets"); - snippetManager.files[id] = {}; - config.loadModule(snippetFilePath, function(m) { - if (m) { - snippetManager.files[id] = m; - if (!m.snippets && m.snippetText) - m.snippets = snippetManager.parseSnippetFile(m.snippetText); - snippetManager.register(m.snippets || [], m.scope); - if (m.includeScopes) { - snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes; - m.includeScopes.forEach(function(x) { - loadSnippetFile("ace/mode/" + x); - }); - } - } - }); -}; - -function getCompletionPrefix(editor) { - var pos = editor.getCursorPosition(); - var line = editor.session.getLine(pos.row); - var prefix; - // Try to find custom prefixes on the completers - editor.completers.forEach(function(completer) { - if (completer.identifierRegexps) { - completer.identifierRegexps.forEach(function(identifierRegex) { - if (!prefix && identifierRegex) - prefix = util.retrievePrecedingIdentifier(line, pos.column, identifierRegex); - }); - } - }); - return prefix || util.retrievePrecedingIdentifier(line, pos.column); -} - -var doLiveAutocomplete = function(e) { - var editor = e.editor; - var text = e.args || ""; - var hasCompleter = editor.completer && editor.completer.activated; - - // We don't want to autocomplete with no prefix - if (e.command.name === "backspace") { - if (hasCompleter && !getCompletionPrefix(editor)) - editor.completer.detach(); - } - else if (e.command.name === "insertstring") { - var prefix = getCompletionPrefix(editor); - // Only autocomplete if there's a prefix that can be matched - if (prefix && !hasCompleter) { - if (!editor.completer) { - // Create new autocompleter - editor.completer = new Autocomplete(); - } - // Disable autoInsert - editor.completer.autoInsert = false; - editor.completer.showPopup(editor); - } - } -}; - -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - enableBasicAutocompletion: { - set: function(val) { - if (val) { - if (!this.completers) - this.completers = Array.isArray(val)? val: completers; - this.commands.addCommand(Autocomplete.startCommand); - } else { - this.commands.removeCommand(Autocomplete.startCommand); - } - }, - value: false - }, - /** - * Enable live autocomplete. If the value is an array, it is assumed to be an array of completers - * and will use them instead of the default completers. - */ - enableLiveAutocompletion: { - set: function(val) { - if (val) { - if (!this.completers) - this.completers = Array.isArray(val)? val: completers; - // On each change automatically trigger the autocomplete - this.commands.on('afterExec', doLiveAutocomplete); - } else { - this.commands.removeListener('afterExec', doLiveAutocomplete); - } - }, - value: false - }, - enableSnippets: { - set: function(val) { - if (val) { - this.commands.addCommand(expandSnippet); - this.on("changeMode", onChangeMode); - onChangeMode(null, this); - } else { - this.commands.removeCommand(expandSnippet); - this.off("changeMode", onChangeMode); - } - }, - value: false - } -}); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/linking.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/linking.js deleted file mode 100644 index cfd333b2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/linking.js +++ /dev/null @@ -1,78 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var Editor = require("ace/editor").Editor; - -require("../config").defineOptions(Editor.prototype, "editor", { - enableLinking: { - set: function(val) { - if (val) { - this.on("click", onClick); - this.on("mousemove", onMouseMove); - } else { - this.off("click", onClick); - this.off("mousemove", onMouseMove); - } - }, - value: false - } -}) - -function onMouseMove(e) { - var editor = e.editor; - var ctrl = e.getAccelKey(); - - if (ctrl) { - var editor = e.editor; - var docPos = e.getDocumentPosition(); - var session = editor.session; - var token = session.getTokenAt(docPos.row, docPos.column); - - editor._emit("linkHover", {position: docPos, token: token}); - } -} - -function onClick(e) { - var ctrl = e.getAccelKey(); - var button = e.getButton(); - - if (button == 0 && ctrl) { - var editor = e.editor; - var docPos = e.getDocumentPosition(); - var session = editor.session; - var token = session.getTokenAt(docPos.row, docPos.column); - - editor._emit("linkClick", {position: docPos, token: token}); - } -} - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/add_editor_menu_options.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/add_editor_menu_options.js deleted file mode 100644 index eb90e31d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/add_editor_menu_options.js +++ /dev/null @@ -1,109 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Add Editor Menu Options - * @fileOverview Add Editor Menu Options
- * The menu options property needs to be added to the editor - * so that the settings menu can know about options for - * selection elements and track which option is selected. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; - -/** - * The menu options property needs to be added to the editor - * so that the settings menu can know about options for - * selection elements and track which option is selected. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ -module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) { - var modelist = require('../modelist'); - var themelist = require('../themelist'); - editor.menuOptions = { - setNewLineMode: [{ - textContent: "unix", - value: "unix" - }, { - textContent: "windows", - value: "windows" - }, { - textContent: "auto", - value: "auto" - }], - setTheme: [], - setMode: [], - setKeyboardHandler: [{ - textContent: "ace", - value: "" - }, { - textContent: "vim", - value: "ace/keyboard/vim" - }, { - textContent: "emacs", - value: "ace/keyboard/emacs" - }, { - textContent: "textarea", - value: "ace/keyboard/textarea" - }, { - textContent: "sublime", - value: "ace/keyboard/sublime" - }] - }; - - editor.menuOptions.setTheme = themelist.themes.map(function(theme) { - return { - textContent: theme.caption, - value: theme.theme - }; - }); - - editor.menuOptions.setMode = modelist.modes.map(function(mode) { - return { - textContent: mode.name, - value: mode.mode - }; - }); -}; - - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/element_generator.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/element_generator.js deleted file mode 100644 index ec6ba93b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/element_generator.js +++ /dev/null @@ -1,148 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Element Generator - * @fileOverview Element Generator
- * Contains methods for generating elements. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -/** - * Creates a DOM option element - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {object} obj An object containing properties to add to the dom - * element. If one of those properties is named `selected` then it will be - * added as an attribute on the element instead. - */ -module.exports.createOption = function createOption (obj) { - var attribute; - var el = document.createElement('option'); - for(attribute in obj) { - if(obj.hasOwnProperty(attribute)) { - if(attribute === 'selected') { - el.setAttribute(attribute, obj[attribute]); - } else { - el[attribute] = obj[attribute]; - } - } - } - return el; -}; -/** - * Creates a DOM checkbox element. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {string} id The id of the element. - * @param {boolean} checked Whether or not the element is checked. - * @param {string} clss The class of the element. - * @returns {DOMElement} Returns a checkbox element reference. - */ -module.exports.createCheckbox = function createCheckbox (id, checked, clss) { - var el = document.createElement('input'); - el.setAttribute('type', 'checkbox'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('value', checked); - el.setAttribute('class', clss); - if(checked) { - el.setAttribute('checked', 'checked'); - } - return el; -}; -/** - * Creates a DOM text input element. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {string} id The id of the element. - * @param {string} value The default value of the input element. - * @param {string} clss The class of the element. - * @returns {DOMElement} Returns an input element reference. - */ -module.exports.createInput = function createInput (id, value, clss) { - var el = document.createElement('input'); - el.setAttribute('type', 'text'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('value', value); - el.setAttribute('class', clss); - return el; -}; -/** - * Creates a DOM label element. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {string} text The label text. - * @param {string} labelFor The id of the element being labeled. - * @returns {DOMElement} Returns a label element reference. - */ -module.exports.createLabel = function createLabel (text, labelFor) { - var el = document.createElement('label'); - el.setAttribute('for', labelFor); - el.textContent = text; - return el; -}; -/** - * Creates a DOM selection element. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {string} id The id of the element. - * @param {string} values An array of objects suitable for `createOption` - * @param {string} clss The class of the element. - * @returns {DOMElement} Returns a selection element reference. - * @see ace/ext/element_generator.createOption - */ -module.exports.createSelection = function createSelection (id, values, clss) { - var el = document.createElement('select'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('class', clss); - values.forEach(function(item) { - el.appendChild(module.exports.createOption(item)); - }); - return el; -}; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/generate_settings_menu.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/generate_settings_menu.js deleted file mode 100644 index 89931062..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/generate_settings_menu.js +++ /dev/null @@ -1,264 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define*/ - -/** - * Generates the settings menu - * @fileOverview Generates the settings menu. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -var egen = require('./element_generator'); -var addEditorMenuOptions = require('./add_editor_menu_options').addEditorMenuOptions; -var getSetFunctions = require('./get_set_functions').getSetFunctions; - -/** - * Generates an interactive menu with settings useful to end users. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ -module.exports.generateSettingsMenu = function generateSettingsMenu (editor) { - /** - * container for dom elements that will go in the menu. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - var elements = []; - /** - * Sorts the menu entries (elements var) so they'll appear in alphabetical order - * the sort is performed based on the value of the contains property - * of each element. Since this is an `array.sort` the array is sorted - * in place. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - function cleanupElementsList() { - elements.sort(function(a, b) { - var x = a.getAttribute('contains'); - var y = b.getAttribute('contains'); - return x.localeCompare(y); - }); - } - /** - * Wraps all dom elements contained in the elements var with a single - * div. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - function wrapElements() { - var topmenu = document.createElement('div'); - topmenu.setAttribute('id', 'ace_settingsmenu'); - elements.forEach(function(element) { - topmenu.appendChild(element); - }); - - var el = topmenu.appendChild(document.createElement('div')); - var version = "1.1.8"; - el.style.padding = "1em"; - el.textContent = "Ace version " + version; - - return topmenu; - } - /** - * Creates a new menu entry. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {object} obj This is a reference to the object containing the - * set function. It is used to set up event listeners for when the - * menu options change. - * @param {string} clss Maps to the class of the dom element. This is - * the name of the object containing the set function e.g. `editor`, - * `session`, `renderer`. - * @param {string} item This is the set function name. It maps to the - * id of the dom element (check, select, input) and to the "contains" - * attribute of the div holding both the element and its label. - * @param {mixed} val This is the value of the setting. It is mapped to - * the dom element's value, checked, or selected option accordingly. - */ - function createNewEntry(obj, clss, item, val) { - var el; - var div = document.createElement('div'); - div.setAttribute('contains', item); - div.setAttribute('class', 'ace_optionsMenuEntry'); - div.setAttribute('style', 'clear: both;'); - - div.appendChild(egen.createLabel( - item.replace(/^set/, '').replace(/([A-Z])/g, ' $1').trim(), - item - )); - - if (Array.isArray(val)) { - el = egen.createSelection(item, val, clss); - el.addEventListener('change', function(e) { - try{ - editor.menuOptions[e.target.id].forEach(function(x) { - if(x.textContent !== e.target.textContent) { - delete x.selected; - } - }); - obj[e.target.id](e.target.value); - } catch (err) { - throw new Error(err); - } - }); - } else if(typeof val === 'boolean') { - el = egen.createCheckbox(item, val, clss); - el.addEventListener('change', function(e) { - try{ - // renderer['setHighlightGutterLine'](true); - obj[e.target.id](!!e.target.checked); - } catch (err) { - throw new Error(err); - } - }); - } else { - // this aids in giving the ability to specify settings through - // post and get requests. - // /ace_editor.html?setMode=ace/mode/html&setOverwrite=true - el = egen.createInput(item, val, clss); - el.addEventListener('change', function(e) { - try{ - if(e.target.value === 'true') { - obj[e.target.id](true); - } else if(e.target.value === 'false') { - obj[e.target.id](false); - } else { - obj[e.target.id](e.target.value); - } - } catch (err) { - throw new Error(err); - } - }); - } - el.style.cssText = 'float:right;'; - div.appendChild(el); - return div; - } - /** - * Generates selection fields for the menu and populates their options - * using information from `editor.menuOptions` - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {string} item The set function name. - * @param {object} esr A reference to the object having the set function. - * @param {string} clss The name of the object containing the set function. - * @param {string} fn The matching get function's function name. - * @returns {DOMElement} Returns a dom element containing a selection - * element populated with options. The option whose value matches that - * returned from `esr[fn]()` will be selected. - */ - function makeDropdown(item, esr, clss, fn) { - var val = editor.menuOptions[item]; - var currentVal = esr[fn](); - if (typeof currentVal == 'object') - currentVal = currentVal.$id; - val.forEach(function(valuex) { - if (valuex.value === currentVal) - valuex.selected = 'selected'; - }); - return createNewEntry(esr, clss, item, val); - } - /** - * Processes the set functions returned from `getSetFunctions`. First it - * checks for menu options defined in `editor.menuOptions`. If no - * options are specified then it checks whether there is a get function - * (replace set with get) for the setting. When either of those - * conditions are met it will attempt to create a new entry for the - * settings menu and push it into the elements array defined above. - * It can only do so for get functions which return - * strings, numbers, and booleans. A special case is written in for - * `getMode` where it looks at the returned objects `$id` property and - * forwards that through instead. Other special cases could be written - * in but that would get a bit ridiculous. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {object} setObj An item from the array returned by - * `getSetFunctions`. - */ - function handleSet(setObj) { - var item = setObj.functionName; - var esr = setObj.parentObj; - var clss = setObj.parentName; - var val; - var fn = item.replace(/^set/, 'get'); - if(editor.menuOptions[item] !== undefined) { - // has options for select element - elements.push(makeDropdown(item, esr, clss, fn)); - } else if(typeof esr[fn] === 'function') { - // has get function - try { - val = esr[fn](); - if(typeof val === 'object') { - // setMode takes a string, getMode returns an object - // the $id property of that object is the string - // which may be given to setMode... - val = val.$id; - } - // the rest of the get functions return strings, - // booleans, or numbers. - elements.push( - createNewEntry(esr, clss, item, val) - ); - } catch (e) { - // if there are errors it is because the element - // does not belong in the settings menu - } - } - } - addEditorMenuOptions(editor); - // gather the set functions - getSetFunctions(editor).forEach(function(setObj) { - // populate the elements array with good stuff. - handleSet(setObj); - }); - // sort the menu entries in the elements list so people can find - // the settings in alphabetical order. - cleanupElementsList(); - // dump the entries from the elements list and wrap them up in a div - return wrapElements(); -}; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js deleted file mode 100644 index 99e006b0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js +++ /dev/null @@ -1,91 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Get Editor Keyboard Shortcuts - * @fileOverview Get Editor Keyboard Shortcuts
- * Gets a map of keyboard shortcuts to command names for the current platform. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -"use strict"; -var keys = require("../../lib/keys"); - -/** - * Gets a map of keyboard shortcuts to command names for the current platform. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An editor instance. - * @returns {Array} Returns an array of objects representing the keyboard - * shortcuts for the given editor. - * @example - * var getKbShortcuts = require('./get_keyboard_shortcuts'); - * console.log(getKbShortcuts(editor)); - * // [ - * // {'command' : aCommand, 'key' : 'Control-d'}, - * // {'command' : aCommand, 'key' : 'Control-d'} - * // ] - */ -module.exports.getEditorKeybordShortcuts = function(editor) { - var KEY_MODS = keys.KEY_MODS; - var keybindings = []; - var commandMap = {}; - editor.keyBinding.$handlers.forEach(function(handler) { - var ckb = handler.commandKeyBinding; - for (var i in ckb) { - var key = i.replace(/(^|-)\w/g, function(x) { return x.toUpperCase(); }); - var commands = ckb[i]; - if (!Array.isArray(commands)) - commands = [commands]; - commands.forEach(function(command) { - if (typeof command != "string") - command = command.name - if (commandMap[command]) { - commandMap[command].key += "|" + key; - } else { - commandMap[command] = {key: key, command: command}; - keybindings.push(commandMap[command]); - } - }); - } - }); - return keybindings; -}; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_set_functions.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_set_functions.js deleted file mode 100644 index 4cd65508..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_set_functions.js +++ /dev/null @@ -1,141 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true */ -/*global define*/ - -/** - * Get Set Functions - * @fileOverview Get Set Functions
- * Gets various functions for setting settings. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -/** - * Generates a list of set functions for the settings menu. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {object} editor The editor instance - * @return {array} Returns an array of objects. Each object contains the - * following properties: functionName, parentObj, and parentName. The - * function name will be the name of a method beginning with the string - * `set` which was found. The parent object will be a reference to the - * object having the method matching the function name. The parent name - * will be a string representing the identifier of the parent object e.g. - * `editor`, `session`, or `renderer`. - */ -module.exports.getSetFunctions = function getSetFunctions (editor) { - /** - * Output array. Will hold the objects described above. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - var out = []; - /** - * This object provides a map between the objects which will be - * traversed and the parent name which will appear in the output. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - var my = { - 'editor' : editor, - 'session' : editor.session, - 'renderer' : editor.renderer - }; - /** - * This array will hold the set function names which have already been - * found so that they are not added to the output multiple times. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - var opts = []; - /** - * This is a list of set functions which will not appear in the settings - * menu. I don't know what to do with setKeyboardHandler. When I tried - * to use it, it didn't appear to be working. Someone who knows better - * could remove it from this list and add it's options to - * add_editor_menu_options.js - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - var skip = [ - 'setOption', - 'setUndoManager', - 'setDocument', - 'setValue', - 'setBreakpoints', - 'setScrollTop', - 'setScrollLeft', - 'setSelectionStyle', - 'setWrapLimitRange' - ]; - - - /** - * This will search the objects mapped to the `my` variable above. When - * it finds a set function in the object that is not listed in the - * `skip` list or the `opts` list it will push a new object to the - * output array. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - ['renderer', 'session', 'editor'].forEach(function(esra) { - var esr = my[esra]; - var clss = esra; - for(var fn in esr) { - if(skip.indexOf(fn) === -1) { - if(/^set/.test(fn) && opts.indexOf(fn) === -1) { - // found set function - opts.push(fn); - out.push({ - 'functionName' : fn, - 'parentObj' : esr, - 'parentName' : clss - }); - } - } - } - }); - return out; -}; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/overlay_page.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/overlay_page.js deleted file mode 100644 index bf985e29..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/overlay_page.js +++ /dev/null @@ -1,116 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Overlay Page - * @fileOverview Overlay Page
- * Generates an overlay for displaying menus. The overlay is an absolutely - * positioned div. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -var dom = require("../../lib/dom"); -var cssText = require("../../requirejs/text!./settings_menu.css"); -dom.importCssString(cssText); - -/** - * Generates an overlay for displaying menus. The overlay is an absolutely - * positioned div. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {DOMElement} contentElement Any element which may be presented inside - * a div. - * @param {string|number} top absolute position value. - * @param {string|number} right absolute position value. - * @param {string|number} bottom absolute position value. - * @param {string|number} left absolute position value. - */ -module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) { - top = top ? 'top: ' + top + ';' : ''; - bottom = bottom ? 'bottom: ' + bottom + ';' : ''; - right = right ? 'right: ' + right + ';' : ''; - left = left ? 'left: ' + left + ';' : ''; - - var closer = document.createElement('div'); - var contentContainer = document.createElement('div'); - - function documentEscListener(e) { - if (e.keyCode === 27) { - closer.click(); - } - } - - closer.style.cssText = 'margin: 0; padding: 0; ' + - 'position: fixed; top:0; bottom:0; left:0; right:0;' + - 'z-index: 9990; ' + - 'background-color: rgba(0, 0, 0, 0.3);'; - closer.addEventListener('click', function() { - document.removeEventListener('keydown', documentEscListener); - closer.parentNode.removeChild(closer); - editor.focus(); - closer = null; - }); - // click closer if esc key is pressed - document.addEventListener('keydown', documentEscListener); - - contentContainer.style.cssText = top + right + bottom + left; - contentContainer.addEventListener('click', function(e) { - e.stopPropagation(); - }); - - var wrapper = dom.createElement("div"); - wrapper.style.position = "relative"; - - var closeButton = dom.createElement("div"); - closeButton.className = "ace_closeButton"; - closeButton.addEventListener('click', function() { - closer.click(); - }); - - wrapper.appendChild(closeButton); - contentContainer.appendChild(wrapper); - - contentContainer.appendChild(contentElement); - closer.appendChild(contentContainer); - document.body.appendChild(closer); - editor.blur(); -}; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/settings_menu.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/settings_menu.css deleted file mode 100644 index f8b761ce..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/settings_menu.css +++ /dev/null @@ -1,48 +0,0 @@ -#ace_settingsmenu, #kbshortcutmenu { - background-color: #F7F7F7; - color: black; - box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55); - padding: 1em 0.5em 2em 1em; - overflow: auto; - position: absolute; - margin: 0; - bottom: 0; - right: 0; - top: 0; - z-index: 9991; - cursor: default; -} - -.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu { - box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25); - background-color: rgba(255, 255, 255, 0.6); - color: black; -} - -.ace_optionsMenuEntry:hover { - background-color: rgba(100, 100, 100, 0.1); - -webkit-transition: all 0.5s; - transition: all 0.3s -} - -.ace_closeButton { - background: rgba(245, 146, 146, 0.5); - border: 1px solid #F48A8A; - border-radius: 50%; - padding: 7px; - position: absolute; - right: -8px; - top: -8px; - z-index: 1000; -} -.ace_closeButton{ - background: rgba(245, 146, 146, 0.9); -} -.ace_optionsMenuKey { - color: darkslateblue; - font-weight: bold; -} -.ace_optionsMenuCommand { - color: darkcyan; - font-weight: normal; -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/modelist.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/modelist.js deleted file mode 100644 index db2d2f80..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/modelist.js +++ /dev/null @@ -1,195 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var modes = []; -/** - * Suggests a mode based on the file extension present in the given path - * @param {string} path The path to the file - * @returns {object} Returns an object containing information about the - * suggested mode. - */ -function getModeForPath(path) { - var mode = modesByName.text; - var fileName = path.split(/[\/\\]/).pop(); - for (var i = 0; i < modes.length; i++) { - if (modes[i].supportsFile(fileName)) { - mode = modes[i]; - break; - } - } - return mode; -} - -var Mode = function(name, caption, extensions) { - this.name = name; - this.caption = caption; - this.mode = "ace/mode/" + name; - this.extensions = extensions; - if (/\^/.test(extensions)) { - var re = extensions.replace(/\|(\^)?/g, function(a, b){ - return "$|" + (b ? "^" : "^.*\\."); - }) + "$"; - } else { - var re = "^.*\\.(" + extensions + ")$"; - } - - this.extRe = new RegExp(re, "gi"); -}; - -Mode.prototype.supportsFile = function(filename) { - return filename.match(this.extRe); -}; - -// todo firstlinematch -var supportedModes = { - ABAP: ["abap"], - ABC: ["abc"], - ActionScript:["as"], - ADA: ["ada|adb"], - Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], - AsciiDoc: ["asciidoc"], - Assembly_x86:["asm"], - AutoHotKey: ["ahk"], - BatchFile: ["bat|cmd"], - C9Search: ["c9search_results"], - C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"], - Cirru: ["cirru|cr"], - Clojure: ["clj|cljs"], - Cobol: ["CBL|COB"], - coffee: ["coffee|cf|cson|^Cakefile"], - ColdFusion: ["cfm"], - CSharp: ["cs"], - CSS: ["css"], - Curly: ["curly"], - D: ["d|di"], - Dart: ["dart"], - Diff: ["diff|patch"], - Dockerfile: ["^Dockerfile"], - Dot: ["dot"], - Dummy: ["dummy"], - DummySyntax: ["dummy"], - Eiffel: ["e"], - EJS: ["ejs"], - Elixir: ["ex|exs"], - Elm: ["elm"], - Erlang: ["erl|hrl"], - Forth: ["frt|fs|ldr"], - FTL: ["ftl"], - Gcode: ["gcode"], - Gherkin: ["feature"], - Gitignore: ["^.gitignore"], - Glsl: ["glsl|frag|vert"], - golang: ["go"], - Groovy: ["groovy"], - HAML: ["haml"], - Handlebars: ["hbs|handlebars|tpl|mustache"], - Haskell: ["hs"], - haXe: ["hx"], - HTML: ["html|htm|xhtml"], - HTML_Ruby: ["erb|rhtml|html.erb"], - INI: ["ini|conf|cfg|prefs"], - Io: ["io"], - Jack: ["jack"], - Jade: ["jade"], - Java: ["java"], - JavaScript: ["js|jsm"], - JSON: ["json"], - JSONiq: ["jq"], - JSP: ["jsp"], - JSX: ["jsx"], - Julia: ["jl"], - LaTeX: ["tex|latex|ltx|bib"], - LESS: ["less"], - Liquid: ["liquid"], - Lisp: ["lisp"], - LiveScript: ["ls"], - LogiQL: ["logic|lql"], - LSL: ["lsl"], - Lua: ["lua"], - LuaPage: ["lp"], - Lucene: ["lucene"], - Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], - Markdown: ["md|markdown"], - Mask: ["mask"], - MATLAB: ["matlab"], - MEL: ["mel"], - MUSHCode: ["mc|mush"], - MySQL: ["mysql"], - Nix: ["nix"], - ObjectiveC: ["m|mm"], - OCaml: ["ml|mli"], - Pascal: ["pas|p"], - Perl: ["pl|pm"], - pgSQL: ["pgsql"], - PHP: ["php|phtml"], - Powershell: ["ps1"], - Praat: ["praat|praatscript|psc|proc"], - Prolog: ["plg|prolog"], - Properties: ["properties"], - Protobuf: ["proto"], - Python: ["py"], - R: ["r"], - RDoc: ["Rd"], - RHTML: ["Rhtml"], - Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], - Rust: ["rs"], - SASS: ["sass"], - SCAD: ["scad"], - Scala: ["scala"], - Scheme: ["scm|rkt"], - SCSS: ["scss"], - SH: ["sh|bash|^.bashrc"], - SJS: ["sjs"], - Smarty: ["smarty|tpl"], - snippets: ["snippets"], - Soy_Template:["soy"], - Space: ["space"], - SQL: ["sql"], - Stylus: ["styl|stylus"], - SVG: ["svg"], - Tcl: ["tcl"], - Tex: ["tex"], - Text: ["txt"], - Textile: ["textile"], - Toml: ["toml"], - Twig: ["twig"], - Typescript: ["ts|typescript|str"], - Vala: ["vala"], - VBScript: ["vbs|vb"], - Velocity: ["vm"], - Verilog: ["v|vh|sv|svh"], - VHDL: ["vhd|vhdl"], - XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], - XQuery: ["xq"], - YAML: ["yaml|yml"], - // Add the missing mode "Django" to ext-modelist - Django: ["html"] -}; - -var nameOverrides = { - ObjectiveC: "Objective-C", - CSharp: "C#", - golang: "Go", - C_Cpp: "C and C++", - coffee: "CoffeeScript", - HTML_Ruby: "HTML (Ruby)", - FTL: "FreeMarker" -}; -var modesByName = {}; -for (var name in supportedModes) { - var data = supportedModes[name]; - var displayName = (nameOverrides[name] || name).replace(/_/g, " "); - var filename = name.toLowerCase(); - var mode = new Mode(filename, displayName, data[0]); - modesByName[filename] = mode; - modes.push(mode); -} - -module.exports = { - getModeForPath: getModeForPath, - modes: modes, - modesByName: modesByName -}; - -}); - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie.js deleted file mode 100644 index 8b8ce977..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie.js +++ /dev/null @@ -1,114 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var MAX_TOKEN_COUNT = 1000; -var useragent = require("../lib/useragent"); -var TokenizerModule = require("../tokenizer"); - -function patch(obj, name, regexp, replacement) { - eval("obj['" + name + "']=" + obj[name].toString().replace( - regexp, replacement - )); -} - -if (useragent.isIE && useragent.isIE < 10 && window.top.document.compatMode === "BackCompat") - useragent.isOldIE = true; - -if (typeof document != "undefined" && !document.documentElement.querySelector) { - useragent.isOldIE = true; - var qs = function(el, selector) { - if (selector.charAt(0) == ".") { - var classNeme = selector.slice(1); - } else { - var m = selector.match(/(\w+)=(\w+)/); - var attr = m && m[1]; - var attrVal = m && m[2]; - } - for (var i = 0; i < el.all.length; i++) { - var ch = el.all[i]; - if (classNeme) { - if (ch.className.indexOf(classNeme) != -1) - return ch; - } else if (attr) { - if (ch.getAttribute(attr) == attrVal) - return ch; - } - } - }; - var sb = require("./searchbox").SearchBox.prototype; - patch( - sb, "$initElements", - /([^\s=]*).querySelector\((".*?")\)/g, - "qs($1, $2)" - ); -} - -var compliantExecNpcg = /()??/.exec("")[1] === undefined; -if (compliantExecNpcg) - return; -var proto = TokenizerModule.Tokenizer.prototype; -TokenizerModule.Tokenizer_orig = TokenizerModule.Tokenizer; -proto.getLineTokens_orig = proto.getLineTokens; - -patch( - TokenizerModule, "Tokenizer", - "ruleRegExps.push(adjustedregex);\n", - function(m) { - return m + '\ - if (state[i].next && RegExp(adjustedregex).test(""))\n\ - rule._qre = RegExp(adjustedregex, "g");\n\ - '; - } -); -TokenizerModule.Tokenizer.prototype = proto; -patch( - proto, "getLineTokens", - /if \(match\[i \+ 1\] === undefined\)\s*continue;/, - "if (!match[i + 1]) {\n\ - if (value)continue;\n\ - var qre = state[mapping[i]]._qre;\n\ - if (!qre) continue;\n\ - qre.lastIndex = lastIndex;\n\ - if (!qre.exec(line) || qre.lastIndex != lastIndex)\n\ - continue;\n\ - }" -); - -patch( - require("../mode/text").Mode.prototype, "getTokenizer", - /Tokenizer/, - "TokenizerModule.Tokenizer" -); - -useragent.isOldIE = true; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie_test.js deleted file mode 100644 index 98652e14..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie_test.js +++ /dev/null @@ -1,77 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var assert = require("../test/assertions"); - -module.exports = { - "test: getTokenizer() (smoke test)" : function() { - var exec = RegExp.prototype.exec - var brokenExec = function(str) { - var result = exec.call(this, str); - if (result) { - for (var i = result.length; i--;) - if (!result[i]) - result[i] = ""; - } - return result; - } - - try { - // break this to emulate old ie - RegExp.prototype.exec = brokenExec; - require("./old_ie"); - var Tokenizer = require("../tokenizer").Tokenizer; - var JavaScriptHighlightRules = require("../mode/javascript_highlight_rules").JavaScriptHighlightRules; - var tokenizer = new Tokenizer((new JavaScriptHighlightRules).getRules()); - - var tokens = tokenizer.getLineTokens("'juhu'", "start").tokens; - assert.equal("string", tokens[0].type); - } finally { - // restore modified functions - RegExp.prototype.exec = exec; - var module = require("../tokenizer"); - module.Tokenizer = module.Tokenizer_orig; - module.Tokenizer.prototype.getLineTokens = module.Tokenizer.prototype.getLineTokens_orig; - } - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.css deleted file mode 100644 index 5de8d847..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.css +++ /dev/null @@ -1,153 +0,0 @@ - - -/* ------------------------------------------------------------------------------------------ - * Editor Search Form - * --------------------------------------------------------------------------------------- */ - .ace_search { - background-color: #ddd; - border: 1px solid #cbcbcb; - border-top: 0 none; - max-width: 325px; - overflow: hidden; - margin: 0; - padding: 4px; - padding-right: 6px; - padding-bottom: 0; - position: absolute; - top: 0px; - z-index: 99; - white-space: normal; -} -.ace_search.left { - border-left: 0 none; - border-radius: 0px 0px 5px 0px; - left: 0; -} -.ace_search.right { - border-radius: 0px 0px 0px 5px; - border-right: 0 none; - right: 0; -} - -.ace_search_form, .ace_replace_form { - border-radius: 3px; - border: 1px solid #cbcbcb; - float: left; - margin-bottom: 4px; - overflow: hidden; -} -.ace_search_form.ace_nomatch { - outline: 1px solid red; -} - -.ace_search_field { - background-color: white; - border-right: 1px solid #cbcbcb; - border: 0 none; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - float: left; - height: 22px; - outline: 0; - padding: 0 7px; - width: 214px; - margin: 0; -} -.ace_searchbtn, -.ace_replacebtn { - background: #fff; - border: 0 none; - border-left: 1px solid #dcdcdc; - cursor: pointer; - float: left; - height: 22px; - margin: 0; - padding: 0; - position: relative; -} -.ace_searchbtn:last-child, -.ace_replacebtn:last-child { - border-top-right-radius: 3px; - border-bottom-right-radius: 3px; -} -.ace_searchbtn:disabled { - background: none; - cursor: default; -} -.ace_searchbtn { - background-position: 50% 50%; - background-repeat: no-repeat; - width: 27px; -} -.ace_searchbtn.prev { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); -} -.ace_searchbtn.next { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); -} -.ace_searchbtn_close { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0; - border-radius: 50%; - border: 0 none; - color: #656565; - cursor: pointer; - float: right; - font: 16px/16px Arial; - height: 14px; - margin: 5px 1px 9px 5px; - padding: 0; - text-align: center; - width: 14px; -} -.ace_searchbtn_close:hover { - background-color: #656565; - background-position: 50% 100%; - color: white; -} -.ace_replacebtn.prev { - width: 54px -} -.ace_replacebtn.next { - width: 27px -} - -.ace_button { - margin-left: 2px; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -o-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - opacity: 0.7; - border: 1px solid rgba(100,100,100,0.23); - padding: 1px; - -moz-box-sizing: border-box; - box-sizing: border-box; - color: black; -} - -.ace_button:hover { - background-color: #eee; - opacity:1; -} -.ace_button:active { - background-color: #ddd; -} - -.ace_button.checked { - border-color: #3399ff; - opacity:1; -} - -.ace_search_options{ - margin-bottom: 3px; - text-align: right; - -webkit-user-select: none; - -moz-user-select: none; - -o-user-select: none; - -ms-user-select: none; - user-select: none; -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.js deleted file mode 100644 index b316aa75..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.js +++ /dev/null @@ -1,308 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var event = require("../lib/event"); -var searchboxCss = require("../requirejs/text!./searchbox.css"); -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var keyUtil = require("../lib/keys"); - -dom.importCssString(searchboxCss, "ace_searchbox"); - -var html = ''.replace(/>\s+/g, ">"); - -var SearchBox = function(editor, range, showReplaceForm) { - var div = dom.createElement("div"); - div.innerHTML = html; - this.element = div.firstChild; - - this.$init(); - this.setEditor(editor); -}; - -(function() { - this.setEditor = function(editor) { - editor.searchBox = this; - editor.container.appendChild(this.element); - this.editor = editor; - }; - - this.$initElements = function(sb) { - this.searchBox = sb.querySelector(".ace_search_form"); - this.replaceBox = sb.querySelector(".ace_replace_form"); - this.searchOptions = sb.querySelector(".ace_search_options"); - this.regExpOption = sb.querySelector("[action=toggleRegexpMode]"); - this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]"); - this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]"); - this.searchInput = this.searchBox.querySelector(".ace_search_field"); - this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); - }; - - this.$init = function() { - var sb = this.element; - - this.$initElements(sb); - - var _this = this; - event.addListener(sb, "mousedown", function(e) { - setTimeout(function(){ - _this.activeInput.focus(); - }, 0); - event.stopPropagation(e); - }); - event.addListener(sb, "click", function(e) { - var t = e.target || e.srcElement; - var action = t.getAttribute("action"); - if (action && _this[action]) - _this[action](); - else if (_this.$searchBarKb.commands[action]) - _this.$searchBarKb.commands[action].exec(_this); - event.stopPropagation(e); - }); - - event.addCommandKeyListener(sb, function(e, hashId, keyCode) { - var keyString = keyUtil.keyCodeToString(keyCode); - var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); - if (command && command.exec) { - command.exec(_this); - event.stopEvent(e); - } - }); - - this.$onChange = lang.delayedCall(function() { - _this.find(false, false); - }); - - event.addListener(this.searchInput, "input", function() { - _this.$onChange.schedule(20); - }); - event.addListener(this.searchInput, "focus", function() { - _this.activeInput = _this.searchInput; - _this.searchInput.value && _this.highlight(); - }); - event.addListener(this.replaceInput, "focus", function() { - _this.activeInput = _this.replaceInput; - _this.searchInput.value && _this.highlight(); - }); - }; - - //keybinging outsite of the searchbox - this.$closeSearchBarKb = new HashHandler([{ - bindKey: "Esc", - name: "closeSearchBar", - exec: function(editor) { - editor.searchBox.hide(); - } - }]); - - //keybinging outsite of the searchbox - this.$searchBarKb = new HashHandler(); - this.$searchBarKb.bindKeys({ - "Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(sb) { - var isReplace = sb.isReplace = !sb.isReplace; - sb.replaceBox.style.display = isReplace ? "" : "none"; - sb[isReplace ? "replaceInput" : "searchInput"].focus(); - }, - "Ctrl-G|Command-G": function(sb) { - sb.findNext(); - }, - "Ctrl-Shift-G|Command-Shift-G": function(sb) { - sb.findPrev(); - }, - "esc": function(sb) { - setTimeout(function() { sb.hide();}); - }, - "Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findNext(); - }, - "Shift-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findPrev(); - }, - "Alt-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replaceAll(); - sb.findAll(); - }, - "Tab": function(sb) { - (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); - } - }); - - this.$searchBarKb.addCommands([{ - name: "toggleRegexpMode", - bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, - exec: function(sb) { - sb.regExpOption.checked = !sb.regExpOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleCaseSensitive", - bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, - exec: function(sb) { - sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleWholeWords", - bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, - exec: function(sb) { - sb.wholeWordOption.checked = !sb.wholeWordOption.checked; - sb.$syncOptions(); - } - }]); - - this.$syncOptions = function() { - dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); - dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); - dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); - this.find(false, false); - }; - - this.highlight = function(re) { - this.editor.session.highlight(re || this.editor.$search.$options.re); - this.editor.renderer.updateBackMarkers() - }; - this.find = function(skipCurrent, backwards) { - var range = this.editor.find(this.searchInput.value, { - skipCurrent: skipCurrent, - backwards: backwards, - wrap: true, - regExp: this.regExpOption.checked, - caseSensitive: this.caseSensitiveOption.checked, - wholeWord: this.wholeWordOption.checked - }); - var noMatch = !range && this.searchInput.value; - dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); - this.editor._emit("findSearchBox", { match: !noMatch }); - this.highlight(); - }; - this.findNext = function() { - this.find(true, false); - }; - this.findPrev = function() { - this.find(true, true); - }; - this.findAll = function(){ - var range = this.editor.findAll(this.searchInput.value, { - regExp: this.regExpOption.checked, - caseSensitive: this.caseSensitiveOption.checked, - wholeWord: this.wholeWordOption.checked - }); - var noMatch = !range && this.searchInput.value; - dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); - this.editor._emit("findSearchBox", { match: !noMatch }); - this.highlight(); - this.hide(); - }; - this.replace = function() { - if (!this.editor.getReadOnly()) - this.editor.replace(this.replaceInput.value); - }; - this.replaceAndFindNext = function() { - if (!this.editor.getReadOnly()) { - this.editor.replace(this.replaceInput.value); - this.findNext() - } - }; - this.replaceAll = function() { - if (!this.editor.getReadOnly()) - this.editor.replaceAll(this.replaceInput.value); - }; - - this.hide = function() { - this.element.style.display = "none"; - this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); - this.editor.focus(); - }; - this.show = function(value, isReplace) { - this.element.style.display = ""; - this.replaceBox.style.display = isReplace ? "" : "none"; - - this.isReplace = isReplace; - - if (value) - this.searchInput.value = value; - this.searchInput.focus(); - this.searchInput.select(); - - this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); - }; - - this.isFocused = function() { - var el = document.activeElement; - return el == this.searchInput || el == this.replaceInput; - } -}).call(SearchBox.prototype); - -exports.SearchBox = SearchBox; - -exports.Search = function(editor, isReplace) { - var sb = editor.searchBox || new SearchBox(editor); - sb.show(editor.session.getTextRange(), isReplace); -}; - -}); - - -/* ------------------------------------------------------------------------------------------ - * TODO - * --------------------------------------------------------------------------------------- */ -/* -- move search form to the left if it masks current word -- includ all options that search has. ex: regex -- searchbox.searchbox is not that pretty. we should have just searchbox -- disable prev button if it makes sence -*/ diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/settings_menu.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/settings_menu.js deleted file mode 100644 index 44f6d6ad..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/settings_menu.js +++ /dev/null @@ -1,76 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Show Settings Menu - * @fileOverview Show Settings Menu
- * Displays an interactive settings menu mostly generated on the fly based on - * the current state of the editor. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -"use strict"; -var generateSettingsMenu = require('./menu_tools/generate_settings_menu').generateSettingsMenu; -var overlayPage = require('./menu_tools/overlay_page').overlayPage; -/** - * This displays the settings menu if it is not already being shown. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ -function showSettingsMenu(editor) { - // make sure the menu isn't open already. - var sm = document.getElementById('ace_settingsmenu'); - if (!sm) - overlayPage(editor, generateSettingsMenu(editor), '0', '0', '0'); -} - -/** - * Initializes the settings menu extension. It adds the showSettingsMenu - * method to the given editor object and adds the showSettingsMenu command - * to the editor with appropriate keyboard shortcuts. - * @param {ace.Editor} editor An instance of the Editor. - */ -module.exports.init = function(editor) { - var Editor = require("ace/editor").Editor; - Editor.prototype.showSettingsMenu = function() { - showSettingsMenu(this); - }; -}; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/spellcheck.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/spellcheck.js deleted file mode 100644 index 08bf2189..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/spellcheck.js +++ /dev/null @@ -1,69 +0,0 @@ -define(function(require, exports, module) { -"use strict"; -var event = require("../lib/event"); - -exports.contextMenuHandler = function(e){ - var host = e.target; - var text = host.textInput.getElement(); - if (!host.selection.isEmpty()) - return; - var c = host.getCursorPosition(); - var r = host.session.getWordRange(c.row, c.column); - var w = host.session.getTextRange(r); - - host.session.tokenRe.lastIndex = 0; - if (!host.session.tokenRe.test(w)) - return; - var PLACEHOLDER = "\x01\x01"; - var value = w + " " + PLACEHOLDER; - text.value = value; - text.setSelectionRange(w.length, w.length + 1); - text.setSelectionRange(0, 0); - text.setSelectionRange(0, w.length); - - var afterKeydown = false; - event.addListener(text, "keydown", function onKeydown() { - event.removeListener(text, "keydown", onKeydown); - afterKeydown = true; - }); - - host.textInput.setInputHandler(function(newVal) { - console.log(newVal , value, text.selectionStart, text.selectionEnd) - if (newVal == value) - return ''; - if (newVal.lastIndexOf(value, 0) === 0) - return newVal.slice(value.length); - if (newVal.substr(text.selectionEnd) == value) - return newVal.slice(0, -value.length); - if (newVal.slice(-2) == PLACEHOLDER) { - var val = newVal.slice(0, -2); - if (val.slice(-1) == " ") { - if (afterKeydown) - return val.substring(0, text.selectionEnd); - val = val.slice(0, -1); - host.session.replace(r, val); - return ""; - } - } - - return newVal; - }); -}; -// todo support highlighting with typo.js -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - spellcheck: { - set: function(val) { - var text = this.textInput.getElement(); - text.spellcheck = !!val; - if (!val) - this.removeListener("nativecontextmenu", exports.contextMenuHandler); - else - this.on("nativecontextmenu", exports.contextMenuHandler); - }, - value: true - } -}); - -}); - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/split.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/split.js deleted file mode 100644 index 8316562f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/split.js +++ /dev/null @@ -1,40 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -/** - * this is experimental, and subject to change, use at your own risk! - */ -module.exports = require("../split"); - -}); - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css deleted file mode 100644 index cc7da8a6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +++ /dev/null @@ -1,31 +0,0 @@ -.ace_static_highlight { - font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace; - font-size: 12px; -} - -.ace_static_highlight .ace_gutter { - width: 25px !important; - float: left; - text-align: right; - padding: 0 3px 0 0; - margin-right: 3px; - position: static !important; -} - -.ace_static_highlight .ace_line { clear: both; } - -.ace_static_highlight .ace_gutter-cell { - -moz-user-select: -moz-none; - -khtml-user-select: none; - -webkit-user-select: none; - user-select: none; -} - - -.ace_static_highlight .ace_gutter-cell:before { - content: counter(ace_line, decimal); - counter-increment: ace_line; -} -.ace_static_highlight { - counter-reset: ace_line; -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js deleted file mode 100644 index 9116467b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +++ /dev/null @@ -1,190 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("../edit_session").EditSession; -var TextLayer = require("../layer/text").Text; -var baseStyles = require("../requirejs/text!./static.css"); -var config = require("../config"); -var dom = require("../lib/dom"); - - -var highlight = function(el, opts, callback) { - var m = el.className.match(/lang-(\w+)/); - var mode = opts.mode || m && ("ace/mode/" + m[1]); - if (!mode) - return false; - var theme = opts.theme || "ace/theme/textmate"; - - var data = ""; - var nodes = []; - - if (el.firstElementChild) { - var textLen = 0; - for (var i = 0; i < el.childNodes.length; i++) { - var ch = el.childNodes[i]; - if (ch.nodeType == 3) { - textLen += ch.data.length; - data += ch.data; - } else { - nodes.push(textLen, ch); - } - } - } else { - data = dom.getInnerText(el); - if (opts.trim) - data = data.trim(); - } - - highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) { - dom.importCssString(highlighted.css, "ace_highlight"); - el.innerHTML = highlighted.html; - var container = el.firstChild.firstChild; - for (var i = 0; i < nodes.length; i += 2) { - var pos = highlighted.session.doc.indexToPosition(nodes[i]); - var node = nodes[i + 1]; - var lineEl = container.children[pos.row]; - lineEl && lineEl.appendChild(node); - } - callback && callback(); - }); -}; - -/** - * Transforms a given input code snippet into HTML using the given mode - * - * @param {string} input Code snippet - * @param {string|mode} mode String specifying the mode to load such as - * `ace/mode/javascript` or, a mode loaded from `/ace/mode` - * (use 'ServerSideHiglighter.getMode'). - * @param {string|theme} theme String specifying the theme to load such as - * `ace/theme/twilight` or, a theme loaded from `/ace/theme`. - * @param {number} lineStart A number indicating the first line number. Defaults - * to 1. - * @param {boolean} disableGutter Specifies whether or not to disable the gutter. - * `true` disables the gutter, `false` enables the gutter. Defaults to `false`. - * @param {function} callback When specifying the mode or theme as a string, - * this method has no return value and you must specify a callback function. The - * callback will receive the rendered object containing the properties `html` - * and `css`. - * @returns {object} An object containing the properties `html` and `css`. - */ -highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) { - var waiting = 1; - var modeCache = EditSession.prototype.$modes; - - // if either the theme or the mode were specified as objects - // then we need to lazily load them. - if (typeof theme == "string") { - waiting++; - config.loadModule(['theme', theme], function(m) { - theme = m; - --waiting || done(); - }); - } - // allow setting mode options e.h {path: "ace/mode/php", inline:true} - var modeOptions; - if (mode && typeof mode === "object" && !mode.getTokenizer) { - modeOptions = mode; - mode = modeOptions.path; - } - if (typeof mode == "string") { - waiting++; - config.loadModule(['mode', mode], function(m) { - if (!modeCache[mode] || modeOptions) - modeCache[mode] = new m.Mode(modeOptions); - mode = modeCache[mode]; - --waiting || done(); - }); - } - - // loads or passes the specified mode module then calls renderer - function done() { - var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter); - return callback ? callback(result) : result; - } - return --waiting || done(); -}; - -/** - * Transforms a given input code snippet into HTML using the given mode - * @param {string} input Code snippet - * @param {mode} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') - * @param {string} r Code snippet - * @returns {object} An object containing: html, css - */ -highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { - lineStart = parseInt(lineStart || 1, 10); - - var session = new EditSession(""); - session.setUseWorker(false); - session.setMode(mode); - - var textLayer = new TextLayer(document.createElement("div")); - textLayer.setSession(session); - textLayer.config = { - characterWidth: 10, - lineHeight: 20 - }; - - session.setValue(input); - - var stringBuilder = []; - var length = session.getLength(); - - for(var ix = 0; ix < length; ix++) { - stringBuilder.push("
"); - if (!disableGutter) - stringBuilder.push("" + /*(ix + lineStart) + */ ""); - textLayer.$renderLine(stringBuilder, ix, true, false); - stringBuilder.push("\n
"); - } - - // let's prepare the whole html - var html = "
" + - "
" + - stringBuilder.join("") + - "
" + - "
"; - - textLayer.destroy(); - - return { - css: baseStyles + theme.cssText, - html: html, - session: session - }; -}; - -module.exports = highlight; -module.exports.highlight =highlight; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js deleted file mode 100644 index 075cea7b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +++ /dev/null @@ -1,96 +0,0 @@ -if (typeof process !== "undefined") { - require("amd-loader"); - require("../test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var assert = require("assert"); -var highlighter = require("./static_highlight"); -var JavaScriptMode = require("../mode/javascript").Mode; -var TextMode = require("../mode/text").Mode; - -// Execution ORDER: test.setUpSuite, setUp, testFn, tearDown, test.tearDownSuite -module.exports = { - timeout: 10000, - - "test simple snippet": function(next) { - var theme = require("../theme/tomorrow"); - var snippet = [ - "/** this is a function", - "*", - "*/", - "function hello (a, b, c) {", - " console.log(a * b + c + 'sup$');", - "}" - ].join("\n"); - var mode = new JavaScriptMode(); - - var result = highlighter.render(snippet, mode, theme); - assert.equal(result.html, "
" - + "
/**\xa0this\xa0is\xa0a\xa0function\n
" - + "
*\n
" - + "
*/\n
" - + "
function\xa0hello\xa0(a,\xa0b,\xa0c)\xa0{\n
" - + "
\xa0\xa0\xa0\xa0console.log(a\xa0*\xa0b\xa0+\xa0c\xa0+\xa0'sup$');\n
" - + "
}\n
" - + "
"); - assert.ok(!!result.css); - next(); - }, - - "test css from theme is used": function(next) { - var theme = require("../theme/tomorrow"); - var snippet = [ - "/** this is a function", - "*", - "*/", - "function hello (a, b, c) {", - " console.log(a * b + c + 'sup?');", - "}" - ].join("\n"); - var mode = new JavaScriptMode(); - - var result = highlighter.render(snippet, mode, theme); - - assert.ok(result.css.indexOf(theme.cssText) !== -1); - - next(); - }, - - "test theme classname should be in output html": function(next) { - var theme = require("../theme/tomorrow"); - var snippet = [ - "/** this is a function", - "*", - "*/", - "function hello (a, b, c) {", - " console.log(a * b + c + 'sup?');", - "}" - ].join("\n"); - var mode = new JavaScriptMode(); - - var result = highlighter.render(snippet, mode, theme); - assert.equal(!!result.html.match(/
/), true); - - next(); - }, - - "test js string replace specials": function(next) { - var theme = require("../theme/tomorrow"); - var snippet = "$'$1$2$$$&"; - var mode = new TextMode(); - - var result = highlighter.render(snippet, mode, theme); - assert.ok(result.html.indexOf(snippet) != -1); - - next(); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/statusbar.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/statusbar.js deleted file mode 100644 index 5e5b0572..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/statusbar.js +++ /dev/null @@ -1,48 +0,0 @@ -define(function(require, exports, module) { -"use strict"; -/** simple statusbar **/ -var dom = require("ace/lib/dom"); -var lang = require("ace/lib/lang"); - -var StatusBar = function(editor, parentNode) { - this.element = dom.createElement("div"); - this.element.className = "ace_status-indicator"; - this.element.style.cssText = "display: inline-block;"; - parentNode.appendChild(this.element); - - var statusUpdate = lang.delayedCall(function(){ - this.updateStatus(editor) - }.bind(this)); - editor.on("changeStatus", function() { - statusUpdate.schedule(100); - }); - editor.on("changeSelection", function() { - statusUpdate.schedule(100); - }); -}; - -(function(){ - this.updateStatus = function(editor) { - var status = []; - function add(str, separator) { - str && status.push(str, separator || "|"); - } - - add(editor.keyBinding.getStatusText(editor)); - if (editor.commands.recording) - add("REC"); - - var c = editor.selection.lead; - add(c.row + ":" + c.column, " "); - if (!editor.selection.isEmpty()) { - var r = editor.getSelectionRange(); - add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")"); - } - status.pop(); - this.element.textContent = status.join(""); - }; -}).call(StatusBar.prototype); - -exports.StatusBar = StatusBar; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js deleted file mode 100644 index c9972488..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +++ /dev/null @@ -1,521 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var event = require("../lib/event"); -var UA = require("../lib/useragent"); -var net = require("../lib/net"); -var ace = require("../ace"); - -require("../theme/textmate"); - -module.exports = exports = ace; - -/* - * Returns the CSS property of element. - * 1) If the CSS property is on the style object of the element, use it, OR - * 2) Compute the CSS property - * - * If the property can't get computed, is 'auto' or 'intrinsic', the former - * calculated property is used (this can happen in cases where the textarea - * is hidden and has no dimension styles). - */ -var getCSSProperty = function(element, container, property) { - var ret = element.style[property]; - - if (!ret) { - if (window.getComputedStyle) { - ret = window.getComputedStyle(element, '').getPropertyValue(property); - } else { - ret = element.currentStyle[property]; - } - } - - if (!ret || ret == 'auto' || ret == 'intrinsic') { - ret = container.style[property]; - } - return ret; -}; - -function applyStyles(elm, styles) { - for (var style in styles) { - elm.style[style] = styles[style]; - } -} - -function setupContainer(element, getValue) { - if (element.type != 'textarea') { - throw new Error("Textarea required!"); - } - - var parentNode = element.parentNode; - - // This will hold the editor. - var container = document.createElement('div'); - - // To put Ace in the place of the textarea, we have to copy a few of the - // textarea's style attributes to the div container. - // - // The problem is that the properties have to get computed (they might be - // defined by a CSS file on the page - you can't access such rules that - // apply to an element via elm.style). Computed properties are converted to - // pixels although the dimension might be given as percentage. When the - // window resizes, the dimensions defined by percentages changes, so the - // properties have to get recomputed to get the new/true pixels. - var resizeEvent = function() { - var style = 'position:relative;'; - [ - 'margin-top', 'margin-left', 'margin-right', 'margin-bottom' - ].forEach(function(item) { - style += item + ':' + - getCSSProperty(element, container, item) + ';'; - }); - - // Calculating the width/height of the textarea is somewhat tricky. To - // do it right, you have to include the paddings to the sides as well - // (eg. width = width + padding-left, -right). This works well, as - // long as the width of the element is not set or given in pixels. In - // this case and after the textarea is hidden, getCSSProperty(element, - // container, 'width') will still return pixel value. If the element - // has realtiv dimensions (e.g. width='95') - // getCSSProperty(...) will return pixel values only as long as the - // textarea is visible. After it is hidden getCSSProperty will return - // the relative dimensions as they are set on the element (in the case - // of width, 95). - // Making the sum of pixel vaules (e.g. padding) and realtive values - // (e.g. ) is not possible. As such the padding styles are - // ignored. - - // The complete width is the width of the textarea + the padding - // to the left and right. - var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px"); - var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px"); - style += 'height:' + height + ';width:' + width + ';'; - - // Set the display property to 'inline-block'. - style += 'display:inline-block;'; - container.setAttribute('style', style); - }; - event.addListener(window, 'resize', resizeEvent); - - // Call the resizeEvent once, so that the size of the container is - // calculated. - resizeEvent(); - - // Insert the div container after the element. - parentNode.insertBefore(container, element.nextSibling); - - // Override the forms onsubmit function. Set the innerHTML and value - // of the textarea before submitting. - while (parentNode !== document) { - if (parentNode.tagName.toUpperCase() === 'FORM') { - var oldSumit = parentNode.onsubmit; - // Override the onsubmit function of the form. - parentNode.onsubmit = function(evt) { - element.value = getValue(); - // If there is a onsubmit function already, then call - // it with the current context and pass the event. - if (oldSumit) { - oldSumit.call(this, evt); - } - }; - break; - } - parentNode = parentNode.parentNode; - } - return container; -} - -exports.transformTextarea = function(element, options) { - var session; - var container = setupContainer(element, function() { - return session.getValue(); - }); - - // Hide the element. - element.style.display = 'none'; - container.style.background = 'white'; - - // - var editorDiv = document.createElement("div"); - applyStyles(editorDiv, { - top: "0px", - left: "0px", - right: "0px", - bottom: "0px", - border: "1px solid gray", - position: "absolute" - }); - container.appendChild(editorDiv); - - var settingOpener = document.createElement("div"); - applyStyles(settingOpener, { - position: "absolute", - right: "0px", - bottom: "0px", - background: "red", - cursor: "nw-resize", - borderStyle: "solid", - borderWidth: "9px 8px 10px 9px", - width: "2px", - borderColor: "lightblue gray gray lightblue", - zIndex: 101 - }); - - var settingDiv = document.createElement("div"); - var settingDivStyles = { - top: "0px", - left: "20%", - right: "0px", - bottom: "0px", - position: "absolute", - padding: "5px", - zIndex: 100, - color: "white", - display: "none", - overflow: "auto", - fontSize: "14px", - boxShadow: "-5px 2px 3px gray" - }; - if (!UA.isOldIE) { - settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)"; - } else { - settingDivStyles.backgroundColor = "#333"; - } - - applyStyles(settingDiv, settingDivStyles); - container.appendChild(settingDiv); - - options = options || exports.defaultOptions; - // Power up ace on the textarea: - var editor = ace.edit(editorDiv); - session = editor.getSession(); - - session.setValue(element.value || element.innerHTML); - editor.focus(); - - // Add the settingPanel opener to the editor's div. - container.appendChild(settingOpener); - - // Create the API. - setupApi(editor, editorDiv, settingDiv, ace, options, load); - - // Create the setting's panel. - setupSettingPanel(settingDiv, settingOpener, editor); - - var state = ""; - event.addListener(settingOpener, "mousemove", function(e) { - var rect = this.getBoundingClientRect(); - var x = e.clientX - rect.left, y = e.clientY - rect.top; - if (x + y < (rect.width + rect.height)/2) { - this.style.cursor = "pointer"; - state = "toggle"; - } else { - state = "resize"; - this.style.cursor = "nw-resize"; - } - }); - - event.addListener(settingOpener, "mousedown", function(e) { - if (state == "toggle") { - editor.setDisplaySettings(); - return; - } - container.style.zIndex = 100000; - var rect = container.getBoundingClientRect(); - var startX = rect.width + rect.left - e.clientX; - var startY = rect.height + rect.top - e.clientY; - event.capture(settingOpener, function(e) { - container.style.width = e.clientX - rect.left + startX + "px"; - container.style.height = e.clientY - rect.top + startY + "px"; - editor.resize(); - }, function() {}); - }); - - return editor; -}; - -function load(url, module, callback) { - net.loadScript(url, function() { - require([module], callback); - }); -} - -function setupApi(editor, editorDiv, settingDiv, ace, options, loader) { - var session = editor.getSession(); - var renderer = editor.renderer; - loader = loader || load; - - function toBool(value) { - return value === "true" || value == true; - } - - editor.setDisplaySettings = function(display) { - if (display == null) - display = settingDiv.style.display == "none"; - if (display) { - settingDiv.style.display = "block"; - settingDiv.hideButton.focus(); - editor.on("focus", function onFocus() { - editor.removeListener("focus", onFocus); - settingDiv.style.display = "none"; - }); - } else { - editor.focus(); - } - }; - - editor.$setOption = editor.setOption; - editor.$getOption = editor.getOption; - editor.setOption = function(key, value) { - switch (key) { - case "mode": - editor.$setOption("mode", "ace/mode/" + value) - break; - case "theme": - editor.$setOption("theme", "ace/theme/" + value) - break; - case "keybindings": - switch (value) { - case "vim": - editor.setKeyboardHandler("ace/keyboard/vim"); - break; - case "emacs": - editor.setKeyboardHandler("ace/keyboard/emacs"); - break; - default: - editor.setKeyboardHandler(null); - } - break; - - case "softWrap": - case "fontSize": - editor.$setOption(key, value); - break; - - default: - editor.$setOption(key, toBool(value)); - } - }; - - editor.getOption = function(key) { - switch (key) { - case "mode": - return editor.$getOption("mode").substr("ace/mode/".length) - break; - - case "theme": - return editor.$getOption("theme").substr("ace/theme/".length) - break; - - case "keybindings": - var value = editor.getKeyboardHandler() - switch (value && value.$id) { - case "ace/keyboard/vim": - return "vim"; - case "ace/keyboard/emacs": - return "emacs"; - default: - return "ace"; - } - break; - - default: - return editor.$getOption(key); - } - }; - - editor.setOptions(options); - return editor; -} - -function setupSettingPanel(settingDiv, settingOpener, editor) { - var BOOL = null; - - var desc = { - mode: "Mode:", - wrap: "Soft Wrap:", - theme: "Theme:", - fontSize: "Font Size:", - showGutter: "Display Gutter:", - keybindings: "Keyboard", - showPrintMargin: "Show Print Margin:", - useSoftTabs: "Use Soft Tabs:", - showInvisibles: "Show Invisibles" - }; - - var optionValues = { - mode: { - text: "Plain", - javascript: "JavaScript", - xml: "XML", - html: "HTML", - css: "CSS", - scss: "SCSS", - python: "Python", - php: "PHP", - java: "Java", - ruby: "Ruby", - c_cpp: "C/C++", - coffee: "CoffeeScript", - json: "json", - perl: "Perl", - clojure: "Clojure", - ocaml: "OCaml", - csharp: "C#", - haxe: "haXe", - svg: "SVG", - textile: "Textile", - groovy: "Groovy", - liquid: "Liquid", - Scala: "Scala" - }, - theme: { - clouds: "Clouds", - clouds_midnight: "Clouds Midnight", - cobalt: "Cobalt", - crimson_editor: "Crimson Editor", - dawn: "Dawn", - eclipse: "Eclipse", - idle_fingers: "Idle Fingers", - kr_theme: "Kr Theme", - merbivore: "Merbivore", - merbivore_soft: "Merbivore Soft", - mono_industrial: "Mono Industrial", - monokai: "Monokai", - pastel_on_dark: "Pastel On Dark", - solarized_dark: "Solarized Dark", - solarized_light: "Solarized Light", - textmate: "Textmate", - twilight: "Twilight", - vibrant_ink: "Vibrant Ink" - }, - showGutter: BOOL, - fontSize: { - "10px": "10px", - "11px": "11px", - "12px": "12px", - "14px": "14px", - "16px": "16px" - }, - wrap: { - off: "Off", - 40: "40", - 80: "80", - free: "Free" - }, - keybindings: { - ace: "ace", - vim: "vim", - emacs: "emacs" - }, - showPrintMargin: BOOL, - useSoftTabs: BOOL, - showInvisibles: BOOL - }; - - var table = []; - table.push(""); - - function renderOption(builder, option, obj, cValue) { - if (!obj) { - builder.push( - "" - ); - return; - } - builder.push(""); - } - - for (var option in exports.defaultOptions) { - table.push(""); - table.push(""); - } - table.push("
SettingValue
", desc[option], ""); - renderOption(table, option, optionValues[option], editor.getOption(option)); - table.push("
"); - settingDiv.innerHTML = table.join(""); - - var onChange = function(e) { - var select = e.currentTarget; - editor.setOption(select.title, select.value); - }; - var onClick = function(e) { - var cb = e.currentTarget; - editor.setOption(cb.title, cb.checked); - }; - var selects = settingDiv.getElementsByTagName("select"); - for (var i = 0; i < selects.length; i++) - selects[i].onchange = onChange; - var cbs = settingDiv.getElementsByTagName("input"); - for (var i = 0; i < cbs.length; i++) - cbs[i].onclick = onClick; - - - var button = document.createElement("input"); - button.type = "button"; - button.value = "Hide"; - event.addListener(button, "click", function() { - editor.setDisplaySettings(false); - }); - settingDiv.appendChild(button); - settingDiv.hideButton = button; -} - -// Default startup options. -exports.defaultOptions = { - mode: "javascript", - theme: "textmate", - wrap: "off", - fontSize: "12px", - showGutter: "false", - keybindings: "ace", - showPrintMargin: "false", - useSoftTabs: "true", - showInvisibles: "false" -}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/themelist.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/themelist.js deleted file mode 100644 index 8914c776..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/themelist.js +++ /dev/null @@ -1,100 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - -/** - * Generates a list of themes available when ace was built. - * @fileOverview Generates a list of themes available when ace was built. - * @author - * Matthew Christopher Kastor-Inare III
- * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -"use strict"; -require("ace/lib/fixoldbrowsers"); - -var themeData = [ - ["Chrome" ], - ["Clouds" ], - ["Crimson Editor" ], - ["Dawn" ], - ["Dreamweaver" ], - ["Eclipse" ], - ["GitHub" ], - ["Solarized Light"], - ["TextMate" ], - ["Tomorrow" ], - ["XCode" ], - ["Kuroir"], - ["KatzenMilch"], - ["Ambiance" ,"ambiance" , "dark"], - ["Chaos" ,"chaos" , "dark"], - ["Clouds Midnight" ,"clouds_midnight" , "dark"], - ["Cobalt" ,"cobalt" , "dark"], - ["idle Fingers" ,"idle_fingers" , "dark"], - ["krTheme" ,"kr_theme" , "dark"], - ["Merbivore" ,"merbivore" , "dark"], - ["Merbivore Soft" ,"merbivore_soft" , "dark"], - ["Mono Industrial" ,"mono_industrial" , "dark"], - ["Monokai" ,"monokai" , "dark"], - ["Pastel on dark" ,"pastel_on_dark" , "dark"], - ["Solarized Dark" ,"solarized_dark" , "dark"], - ["Terminal" ,"terminal" , "dark"], - ["Tomorrow Night" ,"tomorrow_night" , "dark"], - ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"], - ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"], - ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"], - ["Twilight" ,"twilight" , "dark"], - ["Vibrant Ink" ,"vibrant_ink" , "dark"] -]; - - -exports.themesByName = {}; - -/** - * An array containing information about available themes. - */ -exports.themes = themeData.map(function(data) { - var name = data[1] || data[0].replace(/ /g, "_").toLowerCase(); - var theme = { - caption: data[0], - theme: "ace/theme/" + name, - isDark: data[2] == "dark", - name: name - }; - exports.themesByName[name] = theme; - return theme; -}); - -}); - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace.js deleted file mode 100644 index 27ee223e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace.js +++ /dev/null @@ -1,213 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var lang = require("../lib/lang"); - -// based on http://www.freehackers.org/Indent_Finder -exports.$detectIndentation = function(lines, fallback) { - var stats = []; - var changes = []; - var tabIndents = 0; - var prevSpaces = 0; - var max = Math.min(lines.length, 1000); - for (var i = 0; i < max; i++) { - var line = lines[i]; - // ignore empty and comment lines - if (!/^\s*[^*+\-\s]/.test(line)) - continue; - - if (line[0] == "\t") - tabIndents++; - - var spaces = line.match(/^ */)[0].length; - if (spaces && line[spaces] != "\t") { - var diff = spaces - prevSpaces; - if (diff > 0 && !(prevSpaces%diff) && !(spaces%diff)) - changes[diff] = (changes[diff] || 0) + 1; - - stats[spaces] = (stats[spaces] || 0) + 1; - } - prevSpaces = spaces; - - // ignore lines ending with backslash - while (i < max && line[line.length - 1] == "\\") - line = lines[i++]; - } - - function getScore(indent) { - var score = 0; - for (var i = indent; i < stats.length; i += indent) - score += stats[i] || 0; - return score; - } - - var changesTotal = changes.reduce(function(a,b){return a+b}, 0); - - var first = {score: 0, length: 0}; - var spaceIndents = 0; - for (var i = 1; i < 12; i++) { - var score = getScore(i); - if (i == 1) { - spaceIndents = score; - score = stats[1] ? 0.9 : 0.8; - if (!stats.length) - score = 0 - } else - score /= spaceIndents; - - if (changes[i]) - score += changes[i] / changesTotal; - - if (score > first.score) - first = {score: score, length: i}; - } - - if (first.score && first.score > 1.4) - var tabLength = first.length; - - if (tabIndents > spaceIndents + 1) - return {ch: "\t", length: tabLength}; - - if (spaceIndents > tabIndents + 1) - return {ch: " ", length: tabLength}; -}; - -exports.detectIndentation = function(session) { - var lines = session.getLines(0, 1000); - var indent = exports.$detectIndentation(lines) || {}; - - if (indent.ch) - session.setUseSoftTabs(indent.ch == " "); - - if (indent.length) - session.setTabSize(indent.length); - return indent; -}; - -exports.trimTrailingSpace = function(session, trimEmpty) { - var doc = session.getDocument(); - var lines = doc.getAllLines(); - - var min = trimEmpty ? -1 : 0; - - for (var i = 0, l=lines.length; i < l; i++) { - var line = lines[i]; - var index = line.search(/\s+$/); - - if (index > min) - doc.removeInLine(i, index, line.length); - } -}; - -exports.convertIndentation = function(session, ch, len) { - var oldCh = session.getTabString()[0]; - var oldLen = session.getTabSize(); - if (!len) len = oldLen; - if (!ch) ch = oldCh; - - var tab = ch == "\t" ? ch: lang.stringRepeat(ch, len); - - var doc = session.doc; - var lines = doc.getAllLines(); - - var cache = {}; - var spaceCache = {}; - for (var i = 0, l=lines.length; i < l; i++) { - var line = lines[i]; - var match = line.match(/^\s*/)[0]; - if (match) { - var w = session.$getStringScreenWidth(match)[0]; - var tabCount = Math.floor(w/oldLen); - var reminder = w%oldLen; - var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount)); - toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder)); - - if (toInsert != match) { - doc.removeInLine(i, 0, match.length); - doc.insertInLine({row: i, column: 0}, toInsert); - } - } - } - session.setTabSize(len); - session.setUseSoftTabs(ch == " "); -}; - -exports.$parseStringArg = function(text) { - var indent = {}; - if (/t/.test(text)) - indent.ch = "\t"; - else if (/s/.test(text)) - indent.ch = " "; - var m = text.match(/\d+/); - if (m) - indent.length = parseInt(m[0], 10); - return indent; -}; - -exports.$parseArg = function(arg) { - if (!arg) - return {}; - if (typeof arg == "string") - return exports.$parseStringArg(arg); - if (typeof arg.text == "string") - return exports.$parseStringArg(arg.text); - return arg; -}; - -exports.commands = [{ - name: "detectIndentation", - exec: function(editor) { - exports.detectIndentation(editor.session); - // todo show message? - } -}, { - name: "trimTrailingSpace", - exec: function(editor) { - exports.trimTrailingSpace(editor.session); - } -}, { - name: "convertIndentation", - exec: function(editor, arg) { - var indent = exports.$parseArg(arg); - exports.convertIndentation(editor.session, indent.ch, indent.length); - } -}, { - name: "setIndentation", - exec: function(editor, arg) { - var indent = exports.$parseArg(arg); - indent.length && editor.session.setTabSize(indent.length); - indent.ch && editor.session.setUseSoftTabs(indent.ch == " "); - } -}]; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace_test.js deleted file mode 100644 index be4f360f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace_test.js +++ /dev/null @@ -1,116 +0,0 @@ -if (typeof process !== "undefined") { - require("amd-loader"); - require("../test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var assert = require("assert"); -var EditSession = require("../edit_session").EditSession; -var whitespace = require("./whitespace"); - -// Execution ORDER: test.setUpSuite, setUp, testFn, tearDown, test.tearDownSuite -module.exports = { - timeout: 10000, - - "test tab detection": function(next) { - var s = new EditSession([ - "define({", - "\tfoo:1,", - "\tbar:2,", - "\tbaz:{,", - "\t\tx:3", - "\t}", - "})" - ]); - - var indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, "\t"); - assert.equal(indent.length, undefined); - - s.insert({row: 0, column: 0}, " "); - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, "\t"); - assert.equal(indent.length, 4); - - s.setValue(""); - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.ok(!indent); - - next(); - }, - - "test empty session": function(next) { - var s = new EditSession([ - "define({", - "foo:1,", - "})" - ]); - var indent = whitespace.$detectIndentation(s.doc.$lines); - assert.ok(!indent); - s.insert({row: 1, column: 0}, " x\n "); - - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, " "); - assert.equal(indent.length, 4); - - next(); - }, - - "!test one line": function(next) { - var s = new EditSession([ - "define({", - " foo:1,", - "})" - ]); - var indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, " "); - assert.equal(indent.length, 4); - - next(); - }, - - "test 1 width indents": function(next) { - var s = new EditSession([ - "define({", - " foo:1,", - "})", - "define({", - " bar:1,", - "})", - " t", - " t", - " t", - " t", - " t", - " t", - " t", - " t" - ]); - var indent = whitespace.$detectIndentation(s.doc.$lines); - // assert.equal(indent.ch, " "); - // assert.equal(indent.length, 4); - - s = new EditSession([ - "{", - " foo:1,", - " bar: {", - " baz:2", - " }", - "}" - ]); - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, " "); - assert.equal(indent.length, 1); - - next(); - }, - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search.js deleted file mode 100644 index a64e1857..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search.js +++ /dev/null @@ -1,317 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var Range = require("./range").Range; -var Search = require("./search").Search; -var SearchHighlight = require("./search_highlight").SearchHighlight; -var iSearchCommandModule = require("./commands/incremental_search_commands"); -var ISearchKbd = iSearchCommandModule.IncrementalSearchKeyboardHandler; - -/** - * @class IncrementalSearch - * - * Implements immediate searching while the user is typing. When incremental - * search is activated, keystrokes into the editor will be used for composing - * a search term. Immediately after every keystroke the search is updated: - * - so-far-matching characters are highlighted - * - the cursor is moved to the next match - * - **/ - - -/** - * - * - * Creates a new `IncrementalSearch` object. - * - * @constructor - **/ -function IncrementalSearch() { - this.$options = {wrap: false, skipCurrent: false}; - this.$keyboardHandler = new ISearchKbd(this); -} - -oop.inherits(IncrementalSearch, Search); - -// regexp handling - -function isRegExp(obj) { - return obj instanceof RegExp; -} - -function regExpToObject(re) { - var string = String(re), - start = string.indexOf('/'), - flagStart = string.lastIndexOf('/'); - return { - expression: string.slice(start+1, flagStart), - flags: string.slice(flagStart+1) - } -} - -function stringToRegExp(string, flags) { - try { - return new RegExp(string, flags); - } catch (e) { return string; } -} - -function objectToRegExp(obj) { - return stringToRegExp(obj.expression, obj.flags); -} - -// iSearch class - -;(function() { - - this.activate = function(ed, backwards) { - this.$editor = ed; - this.$startPos = this.$currentPos = ed.getCursorPosition(); - this.$options.needle = ''; - this.$options.backwards = backwards; - ed.keyBinding.addKeyboardHandler(this.$keyboardHandler); - // we need to completely intercept paste, just registering an event handler does not work - this.$originalEditorOnPaste = ed.onPaste; ed.onPaste = this.onPaste.bind(this); - this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this)); - this.selectionFix(ed); - this.statusMessage(true); - } - - this.deactivate = function(reset) { - this.cancelSearch(reset); - var ed = this.$editor; - ed.keyBinding.removeKeyboardHandler(this.$keyboardHandler); - if (this.$mousedownHandler) { - ed.removeEventListener('mousedown', this.$mousedownHandler); - delete this.$mousedownHandler; - } - ed.onPaste = this.$originalEditorOnPaste; - this.message(''); - } - - this.selectionFix = function(editor) { - // Fix selection bug: When clicked inside the editor - // editor.selection.$isEmpty is false even if the mouse click did not - // open a selection. This is interpreted by the move commands to - // extend the selection. To only extend the selection when there is - // one, we clear it here - if (editor.selection.isEmpty() && !editor.session.$emacsMark) { - editor.clearSelection(); - } - } - - this.highlight = function(regexp) { - var sess = this.$editor.session, - hl = sess.$isearchHighlight = sess.$isearchHighlight || sess.addDynamicMarker( - new SearchHighlight(null, "ace_isearch-result", "text")); - hl.setRegexp(regexp); - sess._emit("changeBackMarker"); // force highlight layer redraw - } - - this.cancelSearch = function(reset) { - var e = this.$editor; - this.$prevNeedle = this.$options.needle; - this.$options.needle = ''; - if (reset) { - e.moveCursorToPosition(this.$startPos); - this.$currentPos = this.$startPos; - } else { - e.pushEmacsMark && e.pushEmacsMark(this.$startPos, false); - } - this.highlight(null); - return Range.fromPoints(this.$currentPos, this.$currentPos); - } - - this.highlightAndFindWithNeedle = function(moveToNext, needleUpdateFunc) { - if (!this.$editor) return null; - var options = this.$options; - - // get search term - if (needleUpdateFunc) { - options.needle = needleUpdateFunc.call(this, options.needle || '') || ''; - } - if (options.needle.length === 0) { - this.statusMessage(true); - return this.cancelSearch(true); - }; - - // try to find the next occurence and enable highlighting marker - options.start = this.$currentPos; - var session = this.$editor.session, - found = this.find(session), - shouldSelect = this.$editor.emacsMark ? - !!this.$editor.emacsMark() : !this.$editor.selection.isEmpty(); - if (found) { - if (options.backwards) found = Range.fromPoints(found.end, found.start); - this.$editor.selection.setRange(Range.fromPoints(shouldSelect ? this.$startPos : found.end, found.end)); - if (moveToNext) this.$currentPos = found.end; - // highlight after cursor move, so selection works properly - this.highlight(options.re) - } - - this.statusMessage(found); - - return found; - } - - this.addString = function(s) { - return this.highlightAndFindWithNeedle(false, function(needle) { - if (!isRegExp(needle)) - return needle + s; - var reObj = regExpToObject(needle); - reObj.expression += s; - return objectToRegExp(reObj); - }); - } - - this.removeChar = function(c) { - return this.highlightAndFindWithNeedle(false, function(needle) { - if (!isRegExp(needle)) - return needle.substring(0, needle.length-1); - var reObj = regExpToObject(needle); - reObj.expression = reObj.expression.substring(0, reObj.expression.length-1); - return objectToRegExp(reObj); - }); - } - - this.next = function(options) { - // try to find the next occurence of whatever we have searched for - // earlier. - // options = {[backwards: BOOL], [useCurrentOrPrevSearch: BOOL]} - options = options || {}; - this.$options.backwards = !!options.backwards; - this.$currentPos = this.$editor.getCursorPosition(); - return this.highlightAndFindWithNeedle(true, function(needle) { - return options.useCurrentOrPrevSearch && needle.length === 0 ? - this.$prevNeedle || '' : needle; - }); - } - - this.onMouseDown = function(evt) { - // when mouse interaction happens then we quit incremental search - this.deactivate(); - return true; - } - - this.onPaste = function(text) { - this.addString(text); - } - - this.convertNeedleToRegExp = function() { - return this.highlightAndFindWithNeedle(false, function(needle) { - return isRegExp(needle) ? needle : stringToRegExp(needle, 'ig'); - }); - } - - this.convertNeedleToString = function() { - return this.highlightAndFindWithNeedle(false, function(needle) { - return isRegExp(needle) ? regExpToObject(needle).expression : needle; - }); - } - - this.statusMessage = function(found) { - var options = this.$options, msg = ''; - msg += options.backwards ? 'reverse-' : ''; - msg += 'isearch: ' + options.needle; - msg += found ? '' : ' (not found)'; - this.message(msg); - } - - this.message = function(msg) { - if (this.$editor.showCommandLine) { - this.$editor.showCommandLine(msg); - this.$editor.focus(); - } else { - console.log(msg); - } - } - -}).call(IncrementalSearch.prototype); - - -exports.IncrementalSearch = IncrementalSearch; - - -/** - * - * Config settings for enabling/disabling [[IncrementalSearch `IncrementalSearch`]]. - * - **/ - -var dom = require('./lib/dom'); -dom.importCssString && dom.importCssString("\ -.ace_marker-layer .ace_isearch-result {\ - position: absolute;\ - z-index: 6;\ - -moz-box-sizing: border-box;\ - -webkit-box-sizing: border-box;\ - box-sizing: border-box;\ -}\ -div.ace_isearch-result {\ - border-radius: 4px;\ - background-color: rgba(255, 200, 0, 0.5);\ - box-shadow: 0 0 4px rgb(255, 200, 0);\ -}\ -.ace_dark div.ace_isearch-result {\ - background-color: rgb(100, 110, 160);\ - box-shadow: 0 0 4px rgb(80, 90, 140);\ -}", "incremental-search-highlighting"); - -// support for default keyboard handler -var commands = require("./commands/command_manager"); -(function() { - this.setupIncrementalSearch = function(editor, val) { - if (this.usesIncrementalSearch == val) return; - this.usesIncrementalSearch = val; - var iSearchCommands = iSearchCommandModule.iSearchStartCommands; - var method = val ? 'addCommands' : 'removeCommands'; - this[method](iSearchCommands); - }; -}).call(commands.CommandManager.prototype); - -// incremental search config option -var Editor = require("./editor").Editor; -require("./config").defineOptions(Editor.prototype, "editor", { - useIncrementalSearch: { - set: function(val) { - this.keyBinding.$handlers.forEach(function(handler) { - if (handler.setupIncrementalSearch) { - handler.setupIncrementalSearch(this, val); - } - }); - this._emit('incrementalSearchSettingChanged', {isEnabled: val}); - } - } -}); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search_test.js deleted file mode 100644 index d1303b42..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search_test.js +++ /dev/null @@ -1,213 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var emacs = require('./keyboard/emacs'); -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var Range = require("./range").Range; -var MultiSelect = require("./multi_select").MultiSelect; -var assert = require("./test/assertions"); -var IncrementalSearch = require("./incremental_search").IncrementalSearch; - -require("./multi_select"); - -var editor, iSearch; -function testRanges(str, ranges) { - ranges = ranges || editor.selection.getAllRanges(); - assert.equal(ranges + "", str + ""); -} - -// force "rerender" -function callHighlighterUpdate() { - var session = editor.session, - ranges = [], - mockMarkerLayer = { - drawSingleLineMarker: function(_, markerRanges) { - ranges = ranges.concat(markerRanges); - } - } - session.$isearchHighlight.update([], mockMarkerLayer, session, { - firstRow: 0, lastRow: session.getRowLength()}); - return ranges; -} - -module.exports = { - - name: "ACE incremental_search.js", - - setUp: function() { - var session = new EditSession(["abc123", "xyz124"]); - editor = new Editor(new MockRenderer(), session); - new MultiSelect(editor); - iSearch = new IncrementalSearch(); - }, - - "test: keyboard handler setup" : function() { - iSearch.activate(editor); - assert.equal(editor.getKeyboardHandler(), iSearch.$keyboardHandler); - iSearch.deactivate(); - assert.notEqual(editor.getKeyboardHandler(), iSearch.$keyboardHandler); - }, - - "test: isearch highlight setup" : function() { - var sess = editor.session; - iSearch.activate(editor); - iSearch.highlight('foo'); - var highl = sess.$isearchHighlight.id; - assert.ok(sess.$isearchHighlight, 'session has no isearch highlighter'); - assert.equal(sess.getMarkers()[highl.id], highl.id, 'isearch highlight not in markers'); - iSearch.deactivate(); - iSearch.activate(editor); - iSearch.highlight('bar'); - var highl2 = sess.$isearchHighlight.id; - assert.equal(highl2, highl, 'multiple isearch highlights'); - }, - - "test: find simple text incrementally" : function() { - iSearch.activate(editor); - var range = iSearch.addString('1'), // "1" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/4]", [range], "range"); - testRanges("Range: [0/3] -> [0/4],Range: [1/3] -> [1/4]", highlightRanges, "highlight"); - - range = iSearch.addString('2'); // "12" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - testRanges("Range: [0/3] -> [0/5],Range: [1/3] -> [1/5]", highlightRanges, "highlight"); - - range = iSearch.addString('3'); // "123" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/6]", [range], "range"); - testRanges("Range: [0/3] -> [0/6]", highlightRanges, "highlight"); - - range = iSearch.removeChar(); // "12" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - testRanges("Range: [0/3] -> [0/5],Range: [1/3] -> [1/5]", highlightRanges, "highlight"); - }, - - "test: forward / backward" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - var range = iSearch.next(); - testRanges("Range: [1/3] -> [1/5]", [range], "range"); - - range = iSearch.next(); // nothing to find - testRanges("", [range], "range"); - - range = iSearch.next({backwards: true}); // backwards - testRanges("Range: [1/5] -> [1/3]", [range], "range"); - }, - - "test: cancelSearch" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - var range = iSearch.cancelSearch(true); - testRanges("Range: [0/0] -> [0/0]", [range], "range"); - - iSearch.addString('1'); range = iSearch.addString('2'); - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - }, - - "test: failing search keeps pos" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - var range = iSearch.addString('x'); - testRanges("", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 5); - }, - - "test: backwards search" : function() { - editor.moveCursorTo(1,0); - iSearch.activate(editor, true); - iSearch.addString('1'); var range = iSearch.addString('2');; - testRanges("Range: [0/5] -> [0/3]", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 3); - }, - - "test: forwards then backwards, same result, reoriented range" : function() { - iSearch.activate(editor); - iSearch.addString('1'); var range = iSearch.addString('2');; - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 5); - - range = iSearch.next({backwards: true}); - testRanges("Range: [0/5] -> [0/3]", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 3); - }, - - "test: reuse prev search via option" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2');; - assert.position(editor.getCursorPosition(), 0, 5); - iSearch.deactivate(); - - iSearch.activate(editor); - iSearch.next({backwards: false, useCurrentOrPrevSearch: true}); - assert.position(editor.getCursorPosition(), 1, 5); - }, - - "test: don't extend selection range if selection is empty" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2');; - testRanges("Range: [0/5] -> [0/5]", [editor.getSelectionRange()], "sel range"); - }, - - "test: extend selection range if selection exists" : function() { - iSearch.activate(editor); - editor.selection.selectTo(0, 1); - iSearch.addString('1'); iSearch.addString('2');; - testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range"); - }, - - "test: extend selection in emacs mark mode" : function() { - var emacs = require('./keyboard/emacs'); - editor.keyBinding.addKeyboardHandler(emacs.handler); - emacs.handler.commands.setMark.exec(editor); - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range"); - } - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js deleted file mode 100644 index 945eddf3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +++ /dev/null @@ -1,652 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("../lib/dom"); -require("../incremental_search"); -var iSearchCommandModule = require("../commands/incremental_search_commands"); - - -var screenToTextBlockCoordinates = function(x, y) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var col = Math.floor( - (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth - ); - var row = Math.floor( - (y + this.scrollTop - canvasPos.top) / this.lineHeight - ); - - return this.session.screenToDocumentPosition(row, col); -}; - -var HashHandler = require("./hash_handler").HashHandler; -exports.handler = new HashHandler(); - -exports.handler.isEmacs = true; -exports.handler.$id = "ace/keyboard/emacs"; - -var initialized = false; -var $formerLongWords; -var $formerLineStart; - -exports.handler.attach = function(editor) { - if (!initialized) { - initialized = true; - dom.importCssString('\ - .emacs-mode .ace_cursor{\ - border: 1px rgba(50,250,50,0.8) solid!important;\ - -moz-box-sizing: border-box!important;\ - -webkit-box-sizing: border-box!important;\ - box-sizing: border-box!important;\ - background-color: rgba(0,250,0,0.9);\ - opacity: 0.5;\ - }\ - .emacs-mode .ace_hidden-cursors .ace_cursor{\ - opacity: 1;\ - background-color: transparent;\ - }\ - .emacs-mode .ace_overwrite-cursors .ace_cursor {\ - opacity: 1;\ - background-color: transparent;\ - border-width: 0 0 2px 2px !important;\ - }\ - .emacs-mode .ace_text-layer {\ - z-index: 4\ - }\ - .emacs-mode .ace_cursor-layer {\ - z-index: 2\ - }', 'emacsMode' - ); - } - // in emacs, gotowordleft/right should not count a space as a word.. - $formerLongWords = editor.session.$selectLongWords; - editor.session.$selectLongWords = true; - // CTRL-A should go to actual beginning of line - $formerLineStart = editor.session.$useEmacsStyleLineStart; - editor.session.$useEmacsStyleLineStart = true; - - editor.session.$emacsMark = null; // the active mark - editor.session.$emacsMarkRing = editor.session.$emacsMarkRing || []; - - editor.emacsMark = function() { - return this.session.$emacsMark; - }; - - editor.setEmacsMark = function(p) { - // to deactivate pass in a falsy value - this.session.$emacsMark = p; - }; - - editor.pushEmacsMark = function(p, activate) { - var prevMark = this.session.$emacsMark; - if (prevMark) - this.session.$emacsMarkRing.push(prevMark); - if (!p || activate) this.setEmacsMark(p); - else this.session.$emacsMarkRing.push(p); - }; - - editor.popEmacsMark = function() { - var mark = this.emacsMark(); - if (mark) { this.setEmacsMark(null); return mark; } - return this.session.$emacsMarkRing.pop(); - }; - - editor.getLastEmacsMark = function(p) { - return this.session.$emacsMark || this.session.$emacsMarkRing.slice(-1)[0]; - }; - - editor.emacsMarkForSelection = function(replacement) { - // find the mark in $emacsMarkRing corresponding to the current - // selection - var sel = this.selection, - multiRangeLength = this.multiSelect ? - this.multiSelect.getAllRanges().length : 1, - selIndex = sel.index || 0, - markRing = this.session.$emacsMarkRing, - markIndex = markRing.length - (multiRangeLength - selIndex), - lastMark = markRing[markIndex] || sel.anchor; - if (replacement) { - markRing.splice(markIndex, 1, - "row" in replacement && "column" in replacement ? - replacement : undefined); - } - return lastMark; - } - - editor.on("click", $resetMarkMode); - editor.on("changeSession", $kbSessionChange); - editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates; - editor.setStyle("emacs-mode"); - editor.commands.addCommands(commands); - exports.handler.platform = editor.commands.platform; - editor.$emacsModeHandler = this; - editor.addEventListener('copy', this.onCopy); - editor.addEventListener('paste', this.onPaste); -}; - -exports.handler.detach = function(editor) { - delete editor.renderer.screenToTextCoordinates; - editor.session.$selectLongWords = $formerLongWords; - editor.session.$useEmacsStyleLineStart = $formerLineStart; - editor.removeEventListener("click", $resetMarkMode); - editor.removeEventListener("changeSession", $kbSessionChange); - editor.unsetStyle("emacs-mode"); - editor.commands.removeCommands(commands); - editor.removeEventListener('copy', this.onCopy); - editor.removeEventListener('paste', this.onPaste); - editor.$emacsModeHandler = null; -}; - -var $kbSessionChange = function(e) { - if (e.oldSession) { - e.oldSession.$selectLongWords = $formerLongWords; - e.oldSession.$useEmacsStyleLineStart = $formerLineStart; - } - - $formerLongWords = e.session.$selectLongWords; - e.session.$selectLongWords = true; - $formerLineStart = e.session.$useEmacsStyleLineStart; - e.session.$useEmacsStyleLineStart = true; - - if (!e.session.hasOwnProperty('$emacsMark')) - e.session.$emacsMark = null; - if (!e.session.hasOwnProperty('$emacsMarkRing')) - e.session.$emacsMarkRing = []; -}; - -var $resetMarkMode = function(e) { - e.editor.session.$emacsMark = null; -}; - -var keys = require("../lib/keys").KEY_MODS; -var eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"}; -var combinations = ["C-S-M-CMD", - "S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M", - "M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S", - "CMD", "M", "S", "C"]; -combinations.forEach(function(c) { - var hashId = 0; - c.split("-").forEach(function(c) { - hashId = hashId | keys[eMods[c]]; - }); - eMods[hashId] = c.toLowerCase() + "-"; -}); - -exports.handler.onCopy = function(e, editor) { - if (editor.$handlesEmacsOnCopy) return; - editor.$handlesEmacsOnCopy = true; - exports.handler.commands.killRingSave.exec(editor); - editor.$handlesEmacsOnCopy = false; -}; - -exports.handler.onPaste = function(e, editor) { - editor.pushEmacsMark(editor.getCursorPosition()); -}; - -exports.handler.bindKey = function(key, command) { - if (typeof key == "object") - key = key[this.platform]; - if (!key) - return; - - var ckb = this.commandKeyBinding; - key.split("|").forEach(function(keyPart) { - keyPart = keyPart.toLowerCase(); - ckb[keyPart] = command; - // register all partial key combos as null commands - // to be able to activate key combos with arbitrary length - // Example: if keyPart is "C-c C-l t" then "C-c C-l t" will - // get command assigned and "C-c" and "C-c C-l" will get - // a null command assigned in this.commandKeyBinding. For - // the lookup logic see handleKeyboard() - var keyParts = keyPart.split(" ").slice(0,-1); - keyParts.reduce(function(keyMapKeys, keyPart, i) { - var prefix = keyMapKeys[i-1] ? keyMapKeys[i-1] + ' ' : ''; - return keyMapKeys.concat([prefix + keyPart]); - }, []).forEach(function(keyPart) { - if (!ckb[keyPart]) ckb[keyPart] = "null"; - }); - }, this); -}; - -exports.handler.getStatusText = function(editor, data) { - var str = ""; - if (data.count) - str += data.count; - if (data.keyChain) - str += " " + data.keyChain - return str; -}; - -exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { - // if keyCode == -1 a non-printable key was pressed, such as just - // control. Handling those is currently not supported in this handler - if (keyCode === -1) return undefined; - - var editor = data.editor; - editor._signal("changeStatus"); - // insertstring data.count times - if (hashId == -1) { - editor.pushEmacsMark(); - if (data.count) { - var str = new Array(data.count + 1).join(key); - data.count = null; - return {command: "insertstring", args: str}; - } - } - - var modifier = eMods[hashId]; - - // CTRL + number / universalArgument for setting data.count - if (modifier == "c-" || data.count) { - var count = parseInt(key[key.length - 1]); - if (typeof count === 'number' && !isNaN(count)) { - data.count = Math.max(data.count, 0) || 0; - data.count = 10 * data.count + count; - return {command: "null"}; - } - } - - // this.commandKeyBinding maps key specs like "c-p" (for CTRL + P) to - // command objects, for lookup key needs to include the modifier - if (modifier) key = modifier + key; - - // Key combos like CTRL+X H build up the data.keyChain - if (data.keyChain) key = data.keyChain += " " + key; - - // Key combo prefixes get stored as "null" (String!) in this - // this.commandKeyBinding. When encountered no command is invoked but we - // buld up data.keyChain - var command = this.commandKeyBinding[key]; - data.keyChain = command == "null" ? key : ""; - - // there really is no command - if (!command) return undefined; - - // we pass b/c of key combo or universalArgument - if (command === "null") return {command: "null"}; - - if (command === "universalArgument") { - // if no number pressed emacs repeats action 4 times. - // minus sign is needed to allow next keypress to replace it - data.count = -4; - return {command: "null"}; - } - - // lookup command - // TODO extract special handling of markmode - // TODO special case command.command is really unnecessary, remove - var args; - if (typeof command !== "string") { - args = command.args; - if (command.command) command = command.command; - if (command === "goorselect") { - command = editor.emacsMark() ? args[1] : args[0]; - args = null; - } - } - - if (typeof command === "string") { - if (command === "insertstring" || - command === "splitline" || - command === "togglecomment") { - editor.pushEmacsMark(); - } - command = this.commands[command] || editor.commands.commands[command]; - if (!command) return undefined; - } - - if (!command.readOnly && !command.isYank) - data.lastCommand = null; - - if (!command.readOnly && editor.emacsMark()) - editor.setEmacsMark(null) - - if (data.count) { - var count = data.count; - data.count = 0; - if (!command || !command.handlesCount) { - return { - args: args, - command: { - exec: function(editor, args) { - for (var i = 0; i < count; i++) - command.exec(editor, args); - }, - multiSelectAction: command.multiSelectAction - } - }; - } else { - if (!args) args = {}; - if (typeof args === 'object') args.count = count; - } - } - - return {command: command, args: args}; -}; - -exports.emacsKeys = { - // movement - "Up|C-p" : {command: "goorselect", args: ["golineup","selectup"]}, - "Down|C-n" : {command: "goorselect", args: ["golinedown","selectdown"]}, - "Left|C-b" : {command: "goorselect", args: ["gotoleft","selectleft"]}, - "Right|C-f" : {command: "goorselect", args: ["gotoright","selectright"]}, - "C-Left|M-b" : {command: "goorselect", args: ["gotowordleft","selectwordleft"]}, - "C-Right|M-f" : {command: "goorselect", args: ["gotowordright","selectwordright"]}, - "Home|C-a" : {command: "goorselect", args: ["gotolinestart","selecttolinestart"]}, - "End|C-e" : {command: "goorselect", args: ["gotolineend","selecttolineend"]}, - "C-Home|S-M-,": {command: "goorselect", args: ["gotostart","selecttostart"]}, - "C-End|S-M-." : {command: "goorselect", args: ["gotoend","selecttoend"]}, - - // selection - "S-Up|S-C-p" : "selectup", - "S-Down|S-C-n" : "selectdown", - "S-Left|S-C-b" : "selectleft", - "S-Right|S-C-f" : "selectright", - "S-C-Left|S-M-b" : "selectwordleft", - "S-C-Right|S-M-f" : "selectwordright", - "S-Home|S-C-a" : "selecttolinestart", - "S-End|S-C-e" : "selecttolineend", - "S-C-Home" : "selecttostart", - "S-C-End" : "selecttoend", - - "C-l" : "recenterTopBottom", - "M-s" : "centerselection", - "M-g": "gotoline", - "C-x C-p": "selectall", - - // todo fix these - "C-Down": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, - "C-Up": {command: "goorselect", args: ["gotopageup","selectpageup"]}, - "PageDown|C-v": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, - "PageUp|M-v": {command: "goorselect", args: ["gotopageup","selectpageup"]}, - "S-C-Down": "selectpagedown", - "S-C-Up": "selectpageup", - - "C-s": "iSearch", - "C-r": "iSearchBackwards", - - "M-C-s": "findnext", - "M-C-r": "findprevious", - "S-M-5": "replace", - - // basic editing - "Backspace": "backspace", - "Delete|C-d": "del", - "Return|C-m": {command: "insertstring", args: "\n"}, // "newline" - "C-o": "splitline", - - "M-d|C-Delete": {command: "killWord", args: "right"}, - "C-Backspace|M-Backspace|M-Delete": {command: "killWord", args: "left"}, - "C-k": "killLine", - - "C-y|S-Delete": "yank", - "M-y": "yankRotate", - "C-g": "keyboardQuit", - - "C-w|C-S-W": "killRegion", - "M-w": "killRingSave", - "C-Space": "setMark", - "C-x C-x": "exchangePointAndMark", - - "C-t": "transposeletters", - "M-u": "touppercase", // Doesn't work - "M-l": "tolowercase", - "M-/": "autocomplete", // Doesn't work - "C-u": "universalArgument", - - "M-;": "togglecomment", - - "C-/|C-x u|S-C--|C-z": "undo", - "S-C-/|S-C-x u|C--|S-C-z": "redo", //infinite undo? - // vertical editing - "C-x r": "selectRectangularRegion", - "M-x": {command: "focusCommandLine", args: "M-x "} - // todo - // "C-x C-t" "M-t" "M-c" "F11" "C-M- "M-q" -}; - - -exports.handler.bindKeys(exports.emacsKeys); - -exports.handler.addCommands({ - recenterTopBottom: function(editor) { - var renderer = editor.renderer; - var pos = renderer.$cursorLayer.getPixelPosition(); - var h = renderer.$size.scrollerHeight - renderer.lineHeight; - var scrollTop = renderer.scrollTop; - if (Math.abs(pos.top - scrollTop) < 2) { - scrollTop = pos.top - h; - } else if (Math.abs(pos.top - scrollTop - h * 0.5) < 2) { - scrollTop = pos.top; - } else { - scrollTop = pos.top - h * 0.5; - } - editor.session.setScrollTop(scrollTop); - }, - selectRectangularRegion: function(editor) { - editor.multiSelect.toggleBlockSelection(); - }, - setMark: { - exec: function(editor, args) { - // Sets mark-mode and clears current selection. - // When mark is set, keyboard cursor movement commands become - // selection modification commands. That is, - // "goto" commands become "select" commands. - // Any insertion or mouse click resets mark-mode. - // setMark twice in a row at the same place resets markmode. - // in multi select mode, ea selection is handled individually - - if (args && args.count) { - if (editor.inMultiSelectMode) editor.forEachSelection(moveToMark); - else moveToMark(); - moveToMark(); - return; - } - - var mark = editor.emacsMark(), - ranges = editor.selection.getAllRanges(), - rangePositions = ranges.map(function(r) { return {row: r.start.row, column: r.start.column}; }), - transientMarkModeActive = true, - hasNoSelection = ranges.every(function(range) { return range.isEmpty(); }); - // if transientMarkModeActive then mark behavior is a little - // different. Deactivate the mark when setMark is run with active - // mark - if (transientMarkModeActive && (mark || !hasNoSelection)) { - if (editor.inMultiSelectMode) editor.forEachSelection({exec: editor.clearSelection.bind(editor)}) - else editor.clearSelection(); - if (mark) editor.pushEmacsMark(null); - return; - } - - if (!mark) { - rangePositions.forEach(function(pos) { editor.pushEmacsMark(pos); }); - editor.setEmacsMark(rangePositions[rangePositions.length-1]); - return; - } - - // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - function moveToMark() { - var mark = editor.popEmacsMark(); - mark && editor.moveCursorToPosition(mark); - } - - }, - readOnly: true, - handlesCount: true - }, - exchangePointAndMark: { - exec: function exchangePointAndMark$exec(editor, args) { - var sel = editor.selection; - if (!args.count && !sel.isEmpty()) { // just invert selection - sel.setSelectionRange(sel.getRange(), !sel.isBackwards()); - return; - } - - if (args.count) { // replace mark and point - var pos = {row: sel.lead.row, column: sel.lead.column}; - sel.clearSelection(); - sel.moveCursorToPosition(editor.emacsMarkForSelection(pos)); - } else { // create selection to last mark - sel.selectToPosition(editor.emacsMarkForSelection()); - } - }, - readOnly: true, - handlesCount: true, - multiSelectAction: "forEach" - }, - killWord: { - exec: function(editor, dir) { - editor.clearSelection(); - if (dir == "left") - editor.selection.selectWordLeft(); - else - editor.selection.selectWordRight(); - - var range = editor.getSelectionRange(); - var text = editor.session.getTextRange(range); - exports.killRing.add(text); - - editor.session.remove(range); - editor.clearSelection(); - }, - multiSelectAction: "forEach" - }, - killLine: function(editor) { - editor.pushEmacsMark(null); - var pos = editor.getCursorPosition(); - if (pos.column === 0 && - editor.session.doc.getLine(pos.row).length === 0) { - // If an already empty line is killed, remove - // the line entirely - editor.selection.selectLine(); - } else { - // otherwise just remove from the current cursor position - // to the end (but don't delete the selection if it's before - // the cursor) - editor.clearSelection(); - editor.selection.selectLineEnd(); - } - var range = editor.getSelectionRange(); - var text = editor.session.getTextRange(range); - exports.killRing.add(text); - - editor.session.remove(range); - editor.clearSelection(); - }, - yank: function(editor) { - editor.onPaste(exports.killRing.get() || ''); - editor.keyBinding.$data.lastCommand = "yank"; - }, - yankRotate: function(editor) { - if (editor.keyBinding.$data.lastCommand != "yank") - return; - editor.undo(); - editor.session.$emacsMarkRing.pop(); // also undo recording mark - editor.onPaste(exports.killRing.rotate()); - editor.keyBinding.$data.lastCommand = "yank"; - }, - killRegion: { - exec: function(editor) { - exports.killRing.add(editor.getCopyText()); - editor.commands.byName.cut.exec(editor); - }, - readOnly: true, - multiSelectAction: "forEach" - }, - killRingSave: { - exec: function(editor) { - // copy text and deselect. will save marks for starts of the - // selection(s) - - editor.$handlesEmacsOnCopy = true; - var marks = editor.session.$emacsMarkRing.slice(), - deselectedMarks = []; - exports.killRing.add(editor.getCopyText()); - - setTimeout(function() { - function deselect() { - var sel = editor.selection, range = sel.getRange(), - pos = sel.isBackwards() ? range.end : range.start; - deselectedMarks.push({row: pos.row, column: pos.column}); - sel.clearSelection(); - } - editor.$handlesEmacsOnCopy = false; - if (editor.inMultiSelectMode) editor.forEachSelection({exec: deselect}); - else deselect(); - editor.session.$emacsMarkRing = marks.concat(deselectedMarks.reverse()); - }, 0); - }, - readOnly: true - }, - keyboardQuit: function(editor) { - editor.selection.clearSelection(); - editor.setEmacsMark(null); - editor.keyBinding.$data.count = null; - }, - focusCommandLine: function(editor, arg) { - if (editor.showCommandLine) - editor.showCommandLine(arg); - } -}); - -exports.handler.addCommands(iSearchCommandModule.iSearchStartCommands); - -var commands = exports.handler.commands; -commands.yank.isYank = true; -commands.yankRotate.isYank = true; - -exports.killRing = { - $data: [], - add: function(str) { - str && this.$data.push(str); - if (this.$data.length > 30) - this.$data.shift(); - }, - get: function(n) { - n = n || 1; - return this.$data.slice(this.$data.length-n, this.$data.length).reverse().join('\n'); - }, - pop: function() { - if (this.$data.length > 1) - this.$data.pop(); - return this.get(); - }, - rotate: function() { - this.$data.unshift(this.$data.pop()); - return this.get(); - } -}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs_test.js deleted file mode 100644 index 3ba5efaa..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs_test.js +++ /dev/null @@ -1,151 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -require("../multi_select"); - -var EditSession = require("./../edit_session").EditSession, - Editor = require("./../editor").Editor, - Range = require("./../range").Range, - MockRenderer = require("./../test/mockrenderer").MockRenderer, - emacs = require('./emacs'), - assert = require("./../test/assertions"), - editor, sel; - -function initEditor(docString) { - var doc = new EditSession(docString.split("\n")); - editor = new Editor(new MockRenderer(), doc); - editor.setKeyboardHandler(emacs.handler); - sel = editor.selection; -} - -function print(obj) { - return JSON.stringify(obj, null, 2); -} - -function pluck(arr, what) { - return arr.map(function(ea) { return ea[what]; }); -} - -module.exports = { - - "test: detach removes emacs commands from command manager": function() { - initEditor(''); - assert.ok(!!editor.commands.byName["keyboardQuit"], 'setup error: emacs commands not installed'); - editor.keyBinding.removeKeyboardHandler(editor.getKeyboardHandler()); - assert.ok(!editor.commands.byName["keyboardQuit"], 'emacs commands not removed'); - }, - - "test: keyboardQuit clears selection": function() { - initEditor('foo'); - editor.selectAll(); - editor.execCommand('keyboardQuit'); - assert.ok(editor.selection.isEmpty(), 'selection non-empty'); - }, - - "test: exchangePointAndMark without mark set": function() { - initEditor('foo'); - sel.setRange(Range.fromPoints({row: 0, column: 1}, {row: 0, column: 3})); - editor.execCommand('exchangePointAndMark'); - assert.deepEqual({row: 0, column: 1}, editor.getCursorPosition(), print(editor.getCursorPosition())); - }, - - "test: exchangePointAndMark with mark set": function() { - initEditor('foo'); - editor.pushEmacsMark({row: 0, column: 1}); - editor.pushEmacsMark({row: 0, column: 2}); - editor.execCommand('exchangePointAndMark', {count: 4}); - assert.deepEqual({row: 0, column: 2}, editor.getCursorPosition(), print(editor.getCursorPosition())); - assert.deepEqual([{row: 0, column: 1}, {row: 0, column: 0}], editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing)); - }, - - "test: exchangePointAndMark with selection": function() { - initEditor('foo'); - editor.pushEmacsMark({row: 0, column: 1}); - editor.pushEmacsMark({row: 0, column: 2}); - sel.setRange(Range.fromPoints({row: 0, column: 0}, {row: 0, column: 1}), true); - editor.execCommand('exchangePointAndMark'); - assert.deepEqual({row: 0, column: 1}, editor.getCursorPosition(), print(editor.getCursorPosition())); - assert.deepEqual([{row: 0, column: 1}, {row: 0, column: 2}], editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing)); - }, - - "test: exchangePointAndMark with multi selection": function() { - initEditor('foo\nhello world\n123'); - var ranges = [[{row: 0, column: 0}, {row: 0, column: 3}], - [{row: 1, column: 0}, {row: 1, column: 5}], - [{row: 1, column: 6}, {row: 1, column: 11}]] - ranges.forEach(function(r) { - sel.addRange(Range.fromPoints(r[0], r[1])); - }); - assert.equal("foo\nhello\nworld", editor.getSelectedText()); - editor.execCommand('exchangePointAndMark'); - assert.equal("foo\nhello\nworld", editor.getSelectedText()); - assert.deepEqual(pluck(ranges, 0), pluck(sel.getAllRanges(), 'cursor'), "selections dir not inverted"); - }, - - "test: exchangePointAndMark with multi cursors": function() { - initEditor('foo\nhello world\n123'); - var ranges = [[{row: 0, column: 0}, {row: 0, column: 3}], - [{row: 1, column: 0}, {row: 1, column: 5}], - [{row: 1, column: 6}, {row: 1, column: 11}]]; - // move cursors to the start of each range and set a mark to its end - // without selecting anything - ranges.forEach(function(r) { - editor.pushEmacsMark(r[1]); - sel.addRange(Range.fromPoints(r[0], r[0])); - }); - assert.deepEqual(pluck(ranges, 0), pluck(sel.getAllRanges(), 'cursor'), print(sel.getAllRanges())); - editor.execCommand('exchangePointAndMark'); - assert.deepEqual(pluck(ranges, 1), pluck(sel.getAllRanges(), 'cursor'), "not inverted: " + print(sel.getAllRanges())); - }, - - "test: setMark with multi cursors": function() { - initEditor('foo\nhello world\n123'); - var positions = [{row: 0, column: 0}, - {row: 1, column: 0}, - {row: 1, column: 6}]; - positions.forEach(function(p) { sel.addRange(Range.fromPoints(p,p)); }); - editor.execCommand('setMark'); - assert.deepEqual(positions, editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing)); - } - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js deleted file mode 100644 index 06badccd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +++ /dev/null @@ -1,231 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var keyUtil = require("../lib/keys"); -var useragent = require("../lib/useragent"); -var KEY_MODS = keyUtil.KEY_MODS; - -function HashHandler(config, platform) { - this.platform = platform || (useragent.isMac ? "mac" : "win"); - this.commands = {}; - this.commandKeyBinding = {}; - this.addCommands(config); - this.$singleCommand = true; -} - -function MultiHashHandler(config, platform) { - HashHandler.call(this, config, platform); - this.$singleCommand = false; -} - -MultiHashHandler.prototype = HashHandler.prototype; - -(function() { - - - this.addCommand = function(command) { - if (this.commands[command.name]) - this.removeCommand(command); - - this.commands[command.name] = command; - - if (command.bindKey) - this._buildKeyHash(command); - }; - - this.removeCommand = function(command, keepCommand) { - var name = command && (typeof command === 'string' ? command : command.name); - command = this.commands[name]; - if (!keepCommand) - delete this.commands[name]; - - // exhaustive search is brute force but since removeCommand is - // not a performance critical operation this should be OK - var ckb = this.commandKeyBinding; - for (var keyId in ckb) { - var cmdGroup = ckb[keyId]; - if (cmdGroup == command) { - delete ckb[keyId]; - } else if (Array.isArray(cmdGroup)) { - var i = cmdGroup.indexOf(command); - if (i != -1) { - cmdGroup.splice(i, 1); - if (cmdGroup.length == 1) - ckb[keyId] = cmdGroup[0]; - } - } - } - }; - - this.bindKey = function(key, command, asDefault) { - if (typeof key == "object") - key = key[this.platform]; - if (!key) - return; - if (typeof command == "function") - return this.addCommand({exec: command, bindKey: key, name: command.name || key}); - - key.split("|").forEach(function(keyPart) { - var chain = ""; - if (keyPart.indexOf(" ") != -1) { - var parts = keyPart.split(/\s+/); - keyPart = parts.pop(); - parts.forEach(function(keyPart) { - var binding = this.parseKeys(keyPart); - var id = KEY_MODS[binding.hashId] + binding.key; - chain += (chain ? " " : "") + id; - this._addCommandToBinding(chain, "chainKeys"); - }, this); - chain += " "; - } - var binding = this.parseKeys(keyPart); - var id = KEY_MODS[binding.hashId] + binding.key; - this._addCommandToBinding(chain + id, command, asDefault); - }, this); - }; - - this._addCommandToBinding = function(keyId, command, asDefault) { - var ckb = this.commandKeyBinding, i; - if (!command) { - delete ckb[keyId]; - } else if (!ckb[keyId] || this.$singleCommand) { - ckb[keyId] = command; - } else { - if (!Array.isArray(ckb[keyId])) { - ckb[keyId] = [ckb[keyId]]; - } else if ((i = ckb[keyId].indexOf(command)) != -1) { - ckb[keyId].splice(i, 1); - } - - if (asDefault || command.isDefault) - ckb[keyId].unshift(command); - else - ckb[keyId].push(command); - } - }; - - this.addCommands = function(commands) { - commands && Object.keys(commands).forEach(function(name) { - var command = commands[name]; - if (!command) - return; - - if (typeof command === "string") - return this.bindKey(command, name); - - if (typeof command === "function") - command = { exec: command }; - - if (typeof command !== "object") - return; - - if (!command.name) - command.name = name; - - this.addCommand(command); - }, this); - }; - - this.removeCommands = function(commands) { - Object.keys(commands).forEach(function(name) { - this.removeCommand(commands[name]); - }, this); - }; - - this.bindKeys = function(keyList) { - Object.keys(keyList).forEach(function(key) { - this.bindKey(key, keyList[key]); - }, this); - }; - - this._buildKeyHash = function(command) { - this.bindKey(command.bindKey, command); - }; - - // accepts keys in the form ctrl+Enter or ctrl-Enter - // keys without modifiers or shift only - this.parseKeys = function(keys) { - var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x}); - var key = parts.pop(); - - var keyCode = keyUtil[key]; - if (keyUtil.FUNCTION_KEYS[keyCode]) - key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase(); - else if (!parts.length) - return {key: key, hashId: -1}; - else if (parts.length == 1 && parts[0] == "shift") - return {key: key.toUpperCase(), hashId: -1}; - - var hashId = 0; - for (var i = parts.length; i--;) { - var modifier = keyUtil.KEY_MODS[parts[i]]; - if (modifier == null) { - if (typeof console != "undefined") - console.error("invalid modifier " + parts[i] + " in " + keys); - return false; - } - hashId |= modifier; - } - return {key: key, hashId: hashId}; - }; - - this.findKeyCommand = function findKeyCommand(hashId, keyString) { - var key = KEY_MODS[hashId] + keyString; - return this.commandKeyBinding[key]; - }; - - this.handleKeyboard = function(data, hashId, keyString, keyCode) { - var key = KEY_MODS[hashId] + keyString; - var command = this.commandKeyBinding[key]; - if (data.$keyChain) { - data.$keyChain += " " + key; - command = this.commandKeyBinding[data.$keyChain] || command; - } - - if (command) { - if (command == "chainKeys" || command[command.length - 1] == "chainKeys") { - data.$keyChain = data.$keyChain || key; - return {command: "null"}; - } - } - - if (data.$keyChain && keyCode > 0) - data.$keyChain = ""; - return {command: command}; - }; - -}).call(HashHandler.prototype); - -exports.HashHandler = HashHandler; -exports.MultiHashHandler = MultiHashHandler; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js deleted file mode 100644 index cddf0666..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +++ /dev/null @@ -1,145 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var keyUtil = require("../lib/keys"); -var event = require("../lib/event"); - -var KeyBinding = function(editor) { - this.$editor = editor; - this.$data = {editor: editor}; - this.$handlers = []; - this.setDefaultHandler(editor.commands); -}; - -(function() { - this.setDefaultHandler = function(kb) { - this.removeKeyboardHandler(this.$defaultHandler); - this.$defaultHandler = kb; - this.addKeyboardHandler(kb, 0); - }; - - this.setKeyboardHandler = function(kb) { - var h = this.$handlers; - if (h[h.length - 1] == kb) - return; - - while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler) - this.removeKeyboardHandler(h[h.length - 1]); - - this.addKeyboardHandler(kb, 1); - }; - - this.addKeyboardHandler = function(kb, pos) { - if (!kb) - return; - if (typeof kb == "function" && !kb.handleKeyboard) - kb.handleKeyboard = kb; - var i = this.$handlers.indexOf(kb); - if (i != -1) - this.$handlers.splice(i, 1); - - if (pos == undefined) - this.$handlers.push(kb); - else - this.$handlers.splice(pos, 0, kb); - - if (i == -1 && kb.attach) - kb.attach(this.$editor); - }; - - this.removeKeyboardHandler = function(kb) { - var i = this.$handlers.indexOf(kb); - if (i == -1) - return false; - this.$handlers.splice(i, 1); - kb.detach && kb.detach(this.$editor); - return true; - }; - - this.getKeyboardHandler = function() { - return this.$handlers[this.$handlers.length - 1]; - }; - - this.getStatusText = function() { - var data = this.$data; - var editor = data.editor; - return this.$handlers.map(function(h) { - return h.getStatusText && h.getStatusText(editor, data) || ""; - }).filter(Boolean).join(" "); - }; - - this.$callKeyboardHandlers = function(hashId, keyString, keyCode, e) { - var toExecute; - var success = false; - var commands = this.$editor.commands; - - for (var i = this.$handlers.length; i--;) { - toExecute = this.$handlers[i].handleKeyboard( - this.$data, hashId, keyString, keyCode, e - ); - if (!toExecute || !toExecute.command) - continue; - - // allow keyboardHandler to consume keys - if (toExecute.command == "null") { - success = true; - } else { - success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); - } - // do not stop input events to not break repeating - if (success && e && hashId != -1 && - toExecute.passEvent != true && toExecute.command.passEvent != true - ) { - event.stopEvent(e); - } - if (success) - break; - } - return success; - }; - - this.onCommandKey = function(e, hashId, keyCode) { - var keyString = keyUtil.keyCodeToString(keyCode); - this.$callKeyboardHandlers(hashId, keyString, keyCode, e); - }; - - this.onTextInput = function(text) { - var success = this.$callKeyboardHandlers(-1, text); - if (!success) - this.$editor.commands.exec("insertstring", this.$editor, text); - }; - -}).call(KeyBinding.prototype); - -exports.KeyBinding = KeyBinding; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding_test.js deleted file mode 100644 index 617d99c4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding_test.js +++ /dev/null @@ -1,69 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./../edit_session").EditSession, - Editor = require("./../editor").Editor, - MockRenderer = require("./../test/mockrenderer").MockRenderer, - assert = require("./../test/assertions"), - HashHandler = require('./hash_handler').HashHandler, - keys = require('../lib/keys'), - editor; - -function initEditor(docString) { - var doc = new EditSession(docString.split("\n")); - editor = new Editor(new MockRenderer(), doc); -} - -module.exports = { - - "test: adding a new keyboard handler does not remove the default handler": function() { - initEditor('abc'); - var handler = new HashHandler({'del': 'f1'}); - editor.keyBinding.setKeyboardHandler(handler); - editor.onCommandKey({}, 0, keys['f1']); - assert.equal('bc', editor.getValue(), "binding of new handler"); - editor.onCommandKey({}, 0, keys['delete']); - assert.equal('c', editor.getValue(), "bindings of the old handler should still work"); - } - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js deleted file mode 100644 index 8265bbe1..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +++ /dev/null @@ -1,249 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -// If you're developing a new keymapping and want to get an idea what's going -// on, then enable debugging. -var DEBUG = false; - -function StateHandler(keymapping) { - this.keymapping = this.$buildKeymappingRegex(keymapping); -} - -StateHandler.prototype = { - /* - * Build the RegExp from the keymapping as RegExp can't stored directly - * in the metadata JSON and as the RegExp used to match the keys/buffer - * need to be adapted. - */ - $buildKeymappingRegex: function(keymapping) { - for (var state in keymapping) { - this.$buildBindingsRegex(keymapping[state]); - } - return keymapping; - }, - - $buildBindingsRegex: function(bindings) { - // Escape a given Regex string. - bindings.forEach(function(binding) { - if (binding.key) { - binding.key = new RegExp('^' + binding.key + '$'); - } else if (Array.isArray(binding.regex)) { - if (!('key' in binding)) - binding.key = new RegExp('^' + binding.regex[1] + '$'); - binding.regex = new RegExp(binding.regex.join('') + '$'); - } else if (binding.regex) { - binding.regex = new RegExp(binding.regex + '$'); - } - }); - }, - - $composeBuffer: function(data, hashId, key, e) { - // Initialize the data object. - if (data.state == null || data.buffer == null) { - data.state = "start"; - data.buffer = ""; - } - - var keyArray = []; - if (hashId & 1) keyArray.push("ctrl"); - if (hashId & 8) keyArray.push("command"); - if (hashId & 2) keyArray.push("option"); - if (hashId & 4) keyArray.push("shift"); - if (key) keyArray.push(key); - - var symbolicName = keyArray.join("-"); - var bufferToUse = data.buffer + symbolicName; - - // Don't add the symbolic name to the key buffer if the alt_ key is - // part of the symbolic name. If it starts with alt_, this means - // that the user hit an alt keycombo and there will be a single, - // new character detected after this event, which then will be - // added to the buffer (e.g. alt_j will result in ∆). - // - // We test for 2 and not for & 2 as we only want to exclude the case where - // the option key is pressed alone. - if (hashId != 2) { - data.buffer = bufferToUse; - } - - var bufferObj = { - bufferToUse: bufferToUse, - symbolicName: symbolicName - }; - - if (e) { - bufferObj.keyIdentifier = e.keyIdentifier; - } - - return bufferObj; - }, - - $find: function(data, buffer, symbolicName, hashId, key, keyIdentifier) { - // Holds the command to execute and the args if a command matched. - var result = {}; - - // Loop over all the bindings of the keymap until a match is found. - this.keymapping[data.state].some(function(binding) { - var match; - - // Check if the key matches. - if (binding.key && !binding.key.test(symbolicName)) { - return false; - } - - // Check if the regex matches. - if (binding.regex && !(match = binding.regex.exec(buffer))) { - return false; - } - - // Check if the match function matches. - if (binding.match && !binding.match(buffer, hashId, key, symbolicName, keyIdentifier)) { - return false; - } - - // Check for disallowed matches. - if (binding.disallowMatches) { - for (var i = 0; i < binding.disallowMatches.length; i++) { - if (!!match[binding.disallowMatches[i]]) { - return false; - } - } - } - - // If there is a command to execute, then figure out the - // command and the arguments. - if (binding.exec) { - result.command = binding.exec; - - // Build the arguments. - if (binding.params) { - var value; - result.args = {}; - binding.params.forEach(function(param) { - if (param.match != null && match != null) { - value = match[param.match] || param.defaultValue; - } else { - value = param.defaultValue; - } - - if (param.type === 'number') { - value = parseInt(value); - } - - result.args[param.name] = value; - }); - } - data.buffer = ""; - } - - // Handle the 'then' property. - if (binding.then) { - data.state = binding.then; - data.buffer = ""; - } - - // If no command is set, then execute the "null" fake command. - if (result.command == null) { - result.command = "null"; - } - - if (DEBUG) { - console.log("KeyboardStateMapper#find", binding); - } - return true; - }); - - if (result.command) { - return result; - } else { - data.buffer = ""; - return false; - } - }, - - /* - * This function is called by keyBinding. - */ - handleKeyboard: function(data, hashId, key, keyCode, e) { - if (hashId == -1) - hashId = 0 - // If we pressed any command key but no other key, then ignore the input. - // Otherwise "shift-" is added to the buffer, and later on "shift-g" - // which results in "shift-shift-g" which doesn't make sense. - if (hashId != 0 && (key == "" || key == String.fromCharCode(0))) { - return null; - } - - // Compute the current value of the keyboard input buffer. - var r = this.$composeBuffer(data, hashId, key, e); - var buffer = r.bufferToUse; - var symbolicName = r.symbolicName; - var keyId = r.keyIdentifier; - - r = this.$find(data, buffer, symbolicName, hashId, key, keyId); - if (DEBUG) { - console.log("KeyboardStateMapper#match", buffer, symbolicName, r); - } - - return r; - } -} - -/* - * This is a useful matching function and therefore is defined here so that - * users of KeyboardStateMapper can use it. - * - * @return {Boolean} If no command key (Command|Option|Shift|Ctrl) is pressed, it - * returns true. If the only the Shift key is pressed + a character - * true is returned as well. Otherwise, false is returned. - * Summing up, the function returns true whenever the user typed - * a normal character on the keyboard and no shortcut. - */ -exports.matchCharacterOnly = function(buffer, hashId, key, symbolicName) { - // If no command keys are pressed, then catch the input. - if (hashId == 0) { - return true; - } - // If only the shift key is pressed and a character key, then - // catch that input as well. - else if ((hashId == 4) && key.length == 1) { - return true; - } - // Otherwise, we let the input got through. - else { - return false; - } -}; - -exports.StateHandler = StateHandler; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textarea.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textarea.js deleted file mode 100644 index 470b2940..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textarea.js +++ /dev/null @@ -1,82 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var HashHandler = require("./hash_handler").HashHandler; -exports.handler = new HashHandler(); - -[{ - bindKey: "Shift-Tab|Tab", - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-L", mac: "Cmd-L"}, - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-G", mac: "Cmd-G"}, - command: "gotoline" -}, { - bindKey: {win: "Ctrl-T|Ctrl-Shift-T", mac: "Cmd-T|Cmd-Shift-T"}, - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-G", mac: "Cmd-G"}, - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-G", mac: "Cmd-G"}, - command: "passKeysToBrowser" -}, { - name: "golineup", - bindKey: {win: null, mac: "Ctrl-P"}, -}, { - name: "golinedown", - bindKey: {win: null, mac: "Ctrl-N"}, -}, { - name: "gotoleft", - bindKey: {win: null, mac: "Ctrl-B"}, -}, { - name: "gotoright", - bindKey: {win: null, mac: "Ctrl-F"}, -}, { - name: "gotolineend", - bindKey: {win: null, mac: "Ctrl-E"}, -}, { - name: "gotolinestart", - bindKey: {win: null, mac: "Ctrl-A"}, -} -].forEach(function(k) { - var bindKey = k.bindKey; - if (typeof bindKey == "object") - bindKey = bindKey[exports.handler.platform]; - exports.handler.bindKey(bindKey, k.command); -}); -exports.handler.$id = "ace/keyboard/textarea"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js deleted file mode 100644 index faf73a4a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +++ /dev/null @@ -1,509 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var event = require("../lib/event"); -var useragent = require("../lib/useragent"); -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var BROKEN_SETDATA = useragent.isChrome < 18; -var USE_IE_MIME_TYPE = useragent.isIE; - -var TextInput = function(parentNode, host) { - var text = dom.createElement("textarea"); - text.className = "ace_text-input"; - - if (useragent.isTouchPad) - text.setAttribute("x-palm-disable-auto-cap", true); - - text.setAttribute("wrap", "off"); - text.setAttribute("autocorrect", "off"); - text.setAttribute("autocapitalize", "off"); - text.setAttribute("spellcheck", false); - - text.style.opacity = "0"; - if (useragent.isOldIE) text.style.top = "-100px"; - parentNode.insertBefore(text, parentNode.firstChild); - - var PLACEHOLDER = "\x01\x01"; - - var copied = false; - var pasted = false; - var inComposition = false; - var tempStyle = ''; - var isSelectionEmpty = true; - - // FOCUS - // ie9 throws error if document.activeElement is accessed too soon - try { var isFocused = document.activeElement === text; } catch(e) {} - - event.addListener(text, "blur", function(e) { - host.onBlur(e); - isFocused = false; - }); - event.addListener(text, "focus", function(e) { - isFocused = true; - host.onFocus(e); - resetSelection(); - }); - this.focus = function() { - text.style.position = "fixed"; - text.style.top = "-10000000px"; - text.focus(); - setTimeout(function() { - text.style.position = ""; - }, 0); - }; - this.blur = function() { text.blur(); }; - this.isFocused = function() { - return isFocused; - }; - - // modifying selection of blured textarea can focus it (chrome mac/linux) - var syncSelection = lang.delayedCall(function() { - isFocused && resetSelection(isSelectionEmpty); - }); - var syncValue = lang.delayedCall(function() { - if (!inComposition) { - text.value = PLACEHOLDER; - isFocused && resetSelection(); - } - }); - - function resetSelection(isEmpty) { - if (inComposition) - return; - - // this prevents infinite recursion on safari 8 - // see https://github.com/ajaxorg/ace/issues/2114 - inComposition = true; - - if (inputHandler) { - selectionStart = 0; - selectionEnd = isEmpty ? 0 : text.value.length - 1; - } else { - var selectionStart = isEmpty ? 2 : 1; - var selectionEnd = 2; - } - // on firefox this throws if textarea is hidden - try { - text.setSelectionRange(selectionStart, selectionEnd); - } catch(e){} - - inComposition = false; - } - - function resetValue() { - if (inComposition) - return; - text.value = PLACEHOLDER; - //http://code.google.com/p/chromium/issues/detail?id=76516 - if (useragent.isWebKit) - syncValue.schedule(); - } - - useragent.isWebKit || host.addEventListener('changeSelection', function() { - if (host.selection.isEmpty() != isSelectionEmpty) { - isSelectionEmpty = !isSelectionEmpty; - syncSelection.schedule(); - } - }); - - resetValue(); - if (isFocused) - host.onFocus(); - - - var isAllSelected = function(text) { - return text.selectionStart === 0 && text.selectionEnd === text.value.length; - }; - // IE8 does not support setSelectionRange - if (!text.setSelectionRange && text.createTextRange) { - text.setSelectionRange = function(selectionStart, selectionEnd) { - var range = this.createTextRange(); - range.collapse(true); - range.moveStart('character', selectionStart); - range.moveEnd('character', selectionEnd); - range.select(); - }; - isAllSelected = function(text) { - try { - var range = text.ownerDocument.selection.createRange(); - }catch(e) {} - if (!range || range.parentElement() != text) return false; - return range.text == text.value; - } - } - if (useragent.isOldIE) { - var inPropertyChange = false; - var onPropertyChange = function(e){ - if (inPropertyChange) - return; - var data = text.value; - if (inComposition || !data || data == PLACEHOLDER) - return; - // can happen either after delete or during insert operation - if (e && data == PLACEHOLDER[0]) - return syncProperty.schedule(); - - sendText(data); - // ie8 calls propertychange handlers synchronously! - inPropertyChange = true; - resetValue(); - inPropertyChange = false; - }; - var syncProperty = lang.delayedCall(onPropertyChange); - event.addListener(text, "propertychange", onPropertyChange); - - var keytable = { 13:1, 27:1 }; - event.addListener(text, "keyup", function (e) { - if (inComposition && (!text.value || keytable[e.keyCode])) - setTimeout(onCompositionEnd, 0); - if ((text.value.charCodeAt(0)||0) < 129) { - return syncProperty.call(); - } - inComposition ? onCompositionUpdate() : onCompositionStart(); - }); - // when user presses backspace after focusing the editor - // propertychange isn't called for the next character - event.addListener(text, "keydown", function (e) { - syncProperty.schedule(50); - }); - } - - var onSelect = function(e) { - if (copied) { - copied = false; - } else if (isAllSelected(text)) { - host.selectAll(); - resetSelection(); - } else if (inputHandler) { - resetSelection(host.selection.isEmpty()); - } - }; - - var inputHandler = null; - this.setInputHandler = function(cb) {inputHandler = cb}; - this.getInputHandler = function() {return inputHandler}; - var afterContextMenu = false; - - var sendText = function(data) { - if (inputHandler) { - data = inputHandler(data); - inputHandler = null; - } - if (pasted) { - resetSelection(); - if (data) - host.onPaste(data); - pasted = false; - } else if (data == PLACEHOLDER.charAt(0)) { - if (afterContextMenu) - host.execCommand("del", {source: "ace"}); - else // some versions of android do not fire keydown when pressing backspace - host.execCommand("backspace", {source: "ace"}); - } else { - if (data.substring(0, 2) == PLACEHOLDER) - data = data.substr(2); - else if (data.charAt(0) == PLACEHOLDER.charAt(0)) - data = data.substr(1); - else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) - data = data.slice(0, -1); - // can happen if undo in textarea isn't stopped - if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) - data = data.slice(0, -1); - - if (data) - host.onTextInput(data); - } - if (afterContextMenu) - afterContextMenu = false; - }; - var onInput = function(e) { - // console.log("onInput", inComposition) - if (inComposition) - return; - var data = text.value; - sendText(data); - resetValue(); - }; - - var handleClipboardData = function(e, data) { - var clipboardData = e.clipboardData || window.clipboardData; - if (!clipboardData || BROKEN_SETDATA) - return; - // using "Text" doesn't work on old webkit but ie needs it - // TODO are there other browsers that require "Text"? - var mime = USE_IE_MIME_TYPE ? "Text" : "text/plain"; - if (data) { - // Safari 5 has clipboardData object, but does not handle setData() - return clipboardData.setData(mime, data) !== false; - } else { - return clipboardData.getData(mime); - } - }; - - var doCopy = function(e, isCut) { - var data = host.getCopyText(); - if (!data) - return event.preventDefault(e); - - if (handleClipboardData(e, data)) { - isCut ? host.onCut() : host.onCopy(); - event.preventDefault(e); - } else { - copied = true; - text.value = data; - text.select(); - setTimeout(function(){ - copied = false; - resetValue(); - resetSelection(); - isCut ? host.onCut() : host.onCopy(); - }); - } - }; - - var onCut = function(e) { - doCopy(e, true); - }; - - var onCopy = function(e) { - doCopy(e, false); - }; - - var onPaste = function(e) { - var data = handleClipboardData(e); - if (typeof data == "string") { - if (data) - host.onPaste(data); - if (useragent.isIE) - setTimeout(resetSelection); - event.preventDefault(e); - } - else { - text.value = ""; - pasted = true; - } - }; - - event.addCommandKeyListener(text, host.onCommandKey.bind(host)); - - event.addListener(text, "select", onSelect); - - event.addListener(text, "input", onInput); - - event.addListener(text, "cut", onCut); - event.addListener(text, "copy", onCopy); - event.addListener(text, "paste", onPaste); - - - // Opera has no clipboard events - if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)){ - event.addListener(parentNode, "keydown", function(e) { - if ((useragent.isMac && !e.metaKey) || !e.ctrlKey) - return; - - switch (e.keyCode) { - case 67: - onCopy(e); - break; - case 86: - onPaste(e); - break; - case 88: - onCut(e); - break; - } - }); - } - - - // COMPOSITION - var onCompositionStart = function(e) { - if (inComposition || !host.onCompositionStart || host.$readOnly) - return; - // console.log("onCompositionStart", inComposition) - inComposition = {}; - host.onCompositionStart(); - setTimeout(onCompositionUpdate, 0); - host.on("mousedown", onCompositionEnd); - if (!host.selection.isEmpty()) { - host.insert(""); - host.session.markUndoGroup(); - host.selection.clearSelection(); - } - host.session.markUndoGroup(); - }; - - var onCompositionUpdate = function() { - // console.log("onCompositionUpdate", inComposition && JSON.stringify(text.value)) - if (!inComposition || !host.onCompositionUpdate || host.$readOnly) - return; - var val = text.value.replace(/\x01/g, ""); - if (inComposition.lastValue === val) return; - - host.onCompositionUpdate(val); - if (inComposition.lastValue) - host.undo(); - inComposition.lastValue = val; - if (inComposition.lastValue) { - var r = host.selection.getRange(); - host.insert(inComposition.lastValue); - host.session.markUndoGroup(); - inComposition.range = host.selection.getRange(); - host.selection.setRange(r); - host.selection.clearSelection(); - } - }; - - var onCompositionEnd = function(e) { - if (!host.onCompositionEnd || host.$readOnly) return; - // console.log("onCompositionEnd", inComposition &&inComposition.lastValue) - var c = inComposition; - inComposition = false; - var timer = setTimeout(function() { - timer = null; - var str = text.value.replace(/\x01/g, ""); - // console.log(str, c.lastValue) - if (inComposition) - return; - else if (str == c.lastValue) - resetValue(); - else if (!c.lastValue && str) { - resetValue(); - sendText(str); - } - }); - inputHandler = function compositionInputHandler(str) { - // console.log("onCompositionEnd", str, c.lastValue) - if (timer) - clearTimeout(timer); - str = str.replace(/\x01/g, ""); - if (str == c.lastValue) - return ""; - if (c.lastValue && timer) - host.undo(); - return str; - }; - host.onCompositionEnd(); - host.removeListener("mousedown", onCompositionEnd); - if (e.type == "compositionend" && c.range) { - host.selection.setRange(c.range); - } - }; - - - - var syncComposition = lang.delayedCall(onCompositionUpdate, 50); - - event.addListener(text, "compositionstart", onCompositionStart); - if (useragent.isGecko) { - event.addListener(text, "text", function(){syncComposition.schedule()}); - } else { - event.addListener(text, "keyup", function(){syncComposition.schedule()}); - event.addListener(text, "keydown", function(){syncComposition.schedule()}); - } - event.addListener(text, "compositionend", onCompositionEnd); - - this.getElement = function() { - return text; - }; - - this.setReadOnly = function(readOnly) { - text.readOnly = readOnly; - }; - - this.onContextMenu = function(e) { - afterContextMenu = true; - resetSelection(host.selection.isEmpty()); - host._emit("nativecontextmenu", {target: host, domEvent: e}); - this.moveToMouse(e, true); - }; - - this.moveToMouse = function(e, bringToFront) { - if (!bringToFront && useragent.isOldIE) - return; - if (!tempStyle) - tempStyle = text.style.cssText; - text.style.cssText = (bringToFront ? "z-index:100000;" : "") - + "height:" + text.style.height + ";" - + (useragent.isIE ? "opacity:0.1;" : ""); - - var rect = host.container.getBoundingClientRect(); - var style = dom.computedStyle(host.container); - var top = rect.top + (parseInt(style.borderTopWidth) || 0); - var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); - var maxTop = rect.bottom - top - text.clientHeight -2; - var move = function(e) { - text.style.left = e.clientX - left - 2 + "px"; - text.style.top = Math.min(e.clientY - top - 2, maxTop) + "px"; - }; - move(e); - - if (e.type != "mousedown") - return; - - if (host.renderer.$keepTextAreaAtCursor) - host.renderer.$keepTextAreaAtCursor = null; - - // on windows context menu is opened after mouseup - if (useragent.isWin && !useragent.isOldIE) - event.capture(host.container, move, onContextMenuClose); - }; - - this.onContextMenuClose = onContextMenuClose; - var closeTimeout; - function onContextMenuClose() { - clearTimeout(closeTimeout) - closeTimeout = setTimeout(function () { - if (tempStyle) { - text.style.cssText = tempStyle; - tempStyle = ''; - } - if (host.renderer.$keepTextAreaAtCursor == null) { - host.renderer.$keepTextAreaAtCursor = true; - host.renderer.$moveTextAreaToCursor(); - } - }, useragent.isOldIE ? 200 : 0); - } - - var onContextMenu = function(e) { - host.textInput.onContextMenu(e); - onContextMenuClose(); - }; - event.addListener(host.renderer.scroller, "contextmenu", onContextMenu); - event.addListener(text, "contextmenu", onContextMenu); -}; - -exports.TextInput = TextInput; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js deleted file mode 100644 index a8bba7ec..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +++ /dev/null @@ -1,6016 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Supported keybindings: - * - * Motion: - * h, j, k, l - * gj, gk - * e, E, w, W, b, B, ge, gE - * f, F, t, T - * $, ^, 0, -, +, _ - * gg, G - * % - * ', ` - * - * Operator: - * d, y, c - * dd, yy, cc - * g~, g~g~ - * >, <, >>, << - * - * Operator-Motion: - * x, X, D, Y, C, ~ - * - * Action: - * a, i, s, A, I, S, o, O - * zz, z., z, zt, zb, z- - * J - * u, Ctrl-r - * m - * r - * - * Modes: - * ESC - leave insert mode, visual mode, and clear input state. - * Ctrl-[, Ctrl-c - same as ESC. - * - * Registers: unnamed, -, a-z, A-Z, 0-9 - * (Does not respect the special case for number registers when delete - * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) - * TODO: Implement the remaining registers. - * Marks: a-z, A-Z, and 0-9 - * TODO: Implement the remaining special marks. They have more complex - * behavior. - * - * Events: - * 'vim-mode-change' - raised on the editor anytime the current mode changes, - * Event object: {mode: "visual", subMode: "linewise"} - * - * Code structure: - * 1. Default keymap - * 2. Variable declarations and short basic helpers - * 3. Instance (External API) implementation - * 4. Internal state tracking objects (input state, counter) implementation - * and instanstiation - * 5. Key handler (the main command dispatcher) implementation - * 6. Motion, operator, and action implementations - * 7. Helper functions for the key handler, motions, operators, and actions - * 8. Set up Vim to work as a keymap for CodeMirror. - */ - -define(function(require, exports, module) { - 'use strict'; - - function log() { - var d = ""; - function format(p) { - if (typeof p != "object") - return p + "" - if ("line" in p) { - return p.line + ":" + p.ch - } - if ("anchor" in p) { - return format(p.anchor) + "->" + format(p.head) - } - if (Array.isArray(p)) - return "[" + p.map(function(x) {return format(x)})+"]" - return JSON.stringify(p) - } - for (var i = 0; i < arguments.length; i++) { - var p = arguments[i] - var f = format(p) - d+= f+" " - } - console.log(d) - } - var Range = require("../range").Range; - var EventEmitter = require("../lib/event_emitter").EventEmitter; - var dom = require("../lib/dom"); - var oop = require("../lib/oop"); - var KEYS = require("../lib/keys"); - var event = require("../lib/event"); - var Search = require("../search").Search; - var useragent = require("../lib/useragent"); - var SearchHighlight = require("../search_highlight").SearchHighlight; - var multiSelectCommands = require("../commands/multi_select_commands"); - require("../multi_select"); - - var CodeMirror = function(ace) { - this.ace = ace; - this.state = {}; - this.marks = {}; - this.$uid = 0; - this.onChange = this.onChange.bind(this); - this.onSelectionChange = this.onSelectionChange.bind(this); - this.onBeforeEndOperation = this.onBeforeEndOperation.bind(this); - this.ace.on('change', this.onChange); - this.ace.on('changeSelection', this.onSelectionChange); - this.ace.on('beforeEndOperation', this.onBeforeEndOperation); - }; - CodeMirror.Pos = function(line, ch) { - if (!(this instanceof Pos)) return new Pos(line, ch); - this.line = line; this.ch = ch; - }; - CodeMirror.defineOption = function(name, val, setter) {}; - CodeMirror.commands = { - redo: function(cm) { cm.ace.redo(); }, - undo: function(cm) { cm.ace.undo(); }, - newlineAndIndent: function(cm) { cm.ace.insert("\n"); }, - }; - CodeMirror.keyMap = {}; - CodeMirror.addClass = CodeMirror.rmClass = - CodeMirror.e_stop = function() {}; - CodeMirror.keyName = function(e) { - if (e.key) return e.key; - var key = (KEYS[e.keyCode] || ""); - if (key.length == 1) key = key.toUpperCase(); - key = event.getModifierString(e).replace(/(^|-)\w/g, function(m) { - return m.toUpperCase(); - }) + key; - return key; - }; - CodeMirror.keyMap['default'] = function(key) { - return function(cm) { - var cmd = cm.ace.commands.commandKeyBinding[key.toLowerCase()]; - return cmd && cm.ace.execCommand(cmd) !== false; - }; - }; - CodeMirror.lookupKey = function lookupKey(key, map, handle) { - if (typeof map == "string") - map = CodeMirror.keyMap[map]; - var found = typeof map == "function" ? map(key) : map[key]; - if (found === false) return "nothing"; - if (found === "...") return "multi"; - if (found != null && handle(found)) return "handled"; - - if (map.fallthrough) { - if (!Array.isArray(map.fallthrough)) - return lookupKey(key, map.fallthrough, handle); - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle); - if (result) return result; - } - } - }; - - CodeMirror.signal = function(o, name, e) { return o._signal(name, e) }; - CodeMirror.on = event.addListener; - CodeMirror.off = event.removeListener; -(function() { - oop.implement(CodeMirror.prototype, EventEmitter); - - this.destroy = function() { - this.ace.off('change', this.onChange); - this.ace.off('changeSelection', this.onSelectionChange); - this.ace.off('beforeEndOperation', this.onBeforeEndOperation); - this.removeOverlay(); - }; - this.virtualSelectionMode = function() { - return this.ace.inVirtualSelectionMode && this.ace.selection.index; - }; - this.onChange = function(delta) { - var oldDelta = delta.data; - delta = { - start: oldDelta.range.start, - end: oldDelta.range.end, - action: oldDelta.action, - lines: oldDelta.lines || [oldDelta.text] - };// v1.2 api compatibility - if (delta.action[0] == 'i') { - var change = { text: delta.lines }; - var curOp = this.curOp = this.curOp || {}; - if (!curOp.changeHandlers) - curOp.changeHandlers = this._eventRegistry["change"] && this._eventRegistry["change"].slice(); - if (this.virtualSelectionMode()) return; - if (!curOp.lastChange) { - curOp.lastChange = curOp.change = change; - } else { - curOp.lastChange.next = curOp.lastChange = change; - } - } - this.$updateMarkers(delta); - }; - this.onSelectionChange = function() { - var curOp = this.curOp = this.curOp || {}; - if (!curOp.cursorActivityHandlers) - curOp.cursorActivityHandlers = this._eventRegistry["cursorActivity"] && this._eventRegistry["cursorActivity"].slice(); - this.curOp.cursorActivity = true; - if (this.ace.inMultiSelectMode) { - this.ace.keyBinding.removeKeyboardHandler(multiSelectCommands.keyboardHandler); - } - }; - this.operation = function(fn, force) { - if (!force && this.curOp || force && this.curOp && this.curOp.force) { - return fn(); - } - if (force || !this.ace.curOp) { - if (this.curOp) - this.onBeforeEndOperation(); - } - if (!this.ace.curOp) { - var prevOp = this.ace.prevOp; - this.ace.startOperation({ - command: { name: "vim", scrollIntoView: "cursor" } - }); - } - var curOp = this.curOp = this.curOp || {}; - this.curOp.force = force; - var result = fn(); - if (this.ace.curOp && this.ace.curOp.command.name == "vim") { - this.ace.endOperation(); - if (!curOp.cursorActivity && !curOp.lastChange && prevOp) - this.ace.prevOp = prevOp; - } - if (force || !this.ace.curOp) { - if (this.curOp) - this.onBeforeEndOperation(); - } - return result; - }; - this.onBeforeEndOperation = function() { - var op = this.curOp; - if (op) { - if (op.change) { this.signal("change", op.change, op); } - if (op && op.cursorActivity) { this.signal("cursorActivity", null, op); } - this.curOp = null; - } - }; - - this.signal = function(eventName, e, handlers) { - var listeners = handlers ? handlers[eventName + "Handlers"] - : (this._eventRegistry || {})[eventName]; - if (!listeners) - return; - listeners = listeners.slice(); - for (var i=0; i 0) { - point.row += rowShift; - point.column += point.row == end.row ? colShift : 0; - continue; - } - if (!isInsert && cmp2 <= 0) { - point.row = start.row; - point.column = start.column; - if (cmp2 === 0) - point.bias = 1; - } - } - }; - var Marker = function(cm, id, row, column) { - this.cm = cm; - this.id = id; - this.row = row; - this.column = column; - cm.marks[this.id] = this; - }; - Marker.prototype.clear = function() { delete this.cm.marks[this.id] }; - Marker.prototype.find = function() { return toCmPos(this) }; - this.setBookmark = function(cursor, options) { - var bm = new Marker(this, this.$uid++, cursor.line, cursor.ch); - if (!options || !options.insertLeft) - bm.$insertRight = true; - this.marks[bm.id] = bm; - return bm; - }; - this.moveH = function(increment, unit) { - if (unit == 'char') { - var sel = this.ace.selection; - sel.clearSelection(); - sel.moveCursorBy(0, increment); - } - }; - this.findPosV = function(start, amaount, unit, goalColumn) { - if (unit == 'line') { - var screenPos = this.ace.session.documentToScreenPosition(start.line, start.ch); - if (goalColumn != null) - screenPos.column = goalColumn; - screenPos.row += amaount; - // not what codemirror does but vim mode needs only it - screenPos.row = Math.min(Math.max(0, screenPos.row), this.ace.session.getScreenLength() - 1); - var pos = this.ace.session.screenToDocumentPosition(screenPos.row, screenPos.column); - return toCmPos(pos); - } else { - debugger; - } - }; - this.charCoords = function(pos, mode) { - if (mode == 'div' || !mode) { - var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch); - return {left: sc.column, top: sc.row}; - }if (mode == 'local') { - var renderer = this.ace.renderer; - var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch); - var lh = renderer.layerConfig.lineHeight; - var cw = renderer.layerConfig.characterWidth; - var top = lh * sc.row; - return {left: sc.column * cw, top: top, bottom: top + lh}; - } - }; - this.coordsChar = function(pos, mode) { - var renderer = this.ace.renderer; - if (mode == 'local') { - var row = Math.max(0, Math.floor(pos.top / renderer.lineHeight)); - var col = Math.max(0, Math.floor(pos.left / renderer.characterWidth)); - var ch = renderer.session.screenToDocumentPosition(row, col); - return toCmPos(ch); - } else if (mode == 'div') { - throw "not implemented"; - } - }; - this.getSearchCursor = function(query, pos, caseFold) { - var caseSensitive = false; - var isRegexp = false; - if (query instanceof RegExp && !query.global) { - caseSensitive = !query.ignoreCase; - query = query.source; - isRegexp = true; - } - var search = new Search(); - if (pos.ch == undefined) pos.ch = Number.MAX_VALUE; - var acePos = {row: pos.line, column: pos.ch}; - var cm = this; - var last = null; - return { - findNext: function() { return this.find(false) }, - findPrevious: function() {return this.find(true) }, - find: function(back) { - search.setOptions({ - needle: query, - caseSensitive: caseSensitive, - wrap: false, - backwards: back, - regExp: isRegexp, - start: last || acePos - }); - var range = search.find(cm.ace.session); - if (range && range.isEmpty()) { - if (cm.getLine(range.start.row).length == range.start.column) { - search.$options.start = range; - range = search.find(cm.ace.session); - } - } - last = range; - return last; - }, - from: function() { return last && toCmPos(last.start) }, - to: function() { return last && toCmPos(last.end) }, - replace: function(text) { - if (last) { - last.end = cm.ace.session.doc.replace(last, text); - } - } - }; - }; - this.scrollTo = function(x, y) { - var renderer = this.ace.renderer; - var config = renderer.layerConfig; - var maxHeight = config.maxHeight; - maxHeight -= (renderer.$size.scrollerHeight - renderer.lineHeight) * renderer.$scrollPastEnd; - if (y != null) this.ace.session.setScrollTop(Math.max(0, Math.min(y, maxHeight))); - if (x != null) this.ace.session.setScrollLeft(Math.max(0, Math.min(x, config.width))); - }; - this.scrollInfo = function() { return 0; }; - this.scrollIntoView = function(pos, margin) { - if (pos) - this.ace.renderer.scrollCursorIntoView(toAcePos(pos), null, margin); - }; - this.getLine = function(row) { return this.ace.session.getLine(row) }; - this.getRange = function(s, e) { - return this.ace.session.getTextRange(new Range(s.line, s.ch, e.line, e.ch)); - }; - this.replaceRange = function(text, s, e) { - if (!e) e = s; - return this.ace.session.replace(new Range(s.line, s.ch, e.line, e.ch), text); - }; - this.replaceSelections = function(p) { - var sel = this.ace.selection; - if (this.ace.inVirtualSelectionMode) { - this.ace.session.replace(sel.getRange(), p[0] || ""); - return; - } - sel.inVirtualSelectionMode = true; - var ranges = sel.rangeList.ranges; - if (!ranges.length) ranges = [this.ace.multiSelect.getRange()]; - for (var i = ranges.length; i--;) - this.ace.session.replace(ranges[i], p[i] || ""); - sel.inVirtualSelectionMode = false; - }; - this.getSelection = function() { - return this.ace.getSelectedText(); - }; - this.getSelections = function() { - return this.listSelections().map(function(x) { - return this.getRange(x.anchor, x.head); - }, this); - }; - this.getInputField = function() { - return this.ace.textInput.getElement(); - }; - this.getWrapperElement = function() { - return this.ace.containter; - }; - var optMap = { - indentWithTabs: "useSoftTabs", - indentUnit: "tabSize", - firstLineNumber: "firstLineNumber" - }; - this.setOption = function(name, val) { - this.state[name] = val; - switch (name) { - case 'indentWithTabs': - name = optMap[name]; - val = !val; - break; - default: - name = optMap[name]; - } - if (name) - this.ace.setOption(name, val); - }; - this.getOption = function(name, val) { - var aceOpt = optMap[name]; - if (aceOpt) - val = this.ace.getOption(aceOpt); - switch (name) { - case 'indentWithTabs': - name = optMap[name]; - return !val; - } - return aceOpt ? val : this.state[name]; - }; - this.toggleOverwrite = function(on) { - this.state.overwrite = on; - return this.ace.setOverwrite(on); - }; - this.addOverlay = function(o) { - if (!this.$searchHighlight || !this.$searchHighlight.session) { - var highlight = new SearchHighlight(null, "ace_highlight-marker", "text"); - var marker = this.ace.session.addDynamicMarker(highlight); - highlight.id = marker.id; - highlight.session = this.ace.session; - highlight.destroy = function(o) { - highlight.session.off("change", highlight.updateOnChange); - highlight.session.off("changeEditor", highlight.destroy); - highlight.session.removeMarker(highlight.id); - highlight.session = null; - }; - highlight.updateOnChange = function(delta) { - delta = delta.data.range;// v1.2 api compatibility - var row = delta.start.row; - if (row == delta.end.row) highlight.cache[row] = undefined; - else highlight.cache.splice(row, highlight.cache.length); - }; - highlight.session.on("changeEditor", highlight.destroy); - highlight.session.on("change", highlight.updateOnChange); - } - var re = new RegExp(o.query.source, "gmi"); - this.$searchHighlight = o.highlight = highlight; - this.$searchHighlight.setRegexp(re); - this.ace.renderer.updateBackMarkers(); - }; - this.removeOverlay = function(o) { - if (this.$searchHighlight && this.$searchHighlight.session) { - this.$searchHighlight.destroy(); - } - }; - this.getScrollInfo = function() { - var renderer = this.ace.renderer; - var config = renderer.layerConfig; - return { - left: renderer.scrollLeft, - top: renderer.scrollTop, - height: config.maxHeight, - width: config.width, - clientHeight: config.height, - clientWidth: config.width - }; - }; - this.getValue = function() { - return this.ace.getValue(); - }; - this.setValue = function(v) { - return this.ace.setValue(v); - }; - this.getTokenTypeAt = function(pos) { - var token = this.ace.session.getTokenAt(pos.line, pos.ch); - return token && /comment|string/.test(token.type) ? "string" : ""; - }; - this.findMatchingBracket = function(pos) { - var m = this.ace.session.findMatchingBracket(toAcePos(pos)); - return {to: m && toCmPos(m)}; - }; - this.indentLine = function(line, method) { - if (method === true) - this.ace.session.indentRows(line, line, "\t"); - else if (method === false) - this.ace.session.outdentRows(new Range(line, 0, line, 0)); - }; - this.indexFromPos = function(pos) { - return this.ace.session.doc.positionToIndex(toAcePos(pos)); - }; - this.posFromIndex = function(index) { - return toCmPos(this.ace.session.doc.indexToPosition(index)); - }; - this.focus = function(index) { - return this.ace.focus(); - }; - this.blur = function(index) { - return this.ace.blur(); - }; - this.defaultTextHeight = function(index) { - return this.ace.renderer.layerConfig.lineHeight; - }; - this.scanForBracket = function(pos, dir, _, options) { - var re = options.bracketRegex.source; - if (dir == 1) { - var m = this.ace.session.$findClosingBracket(re.slice(1, 2), toAcePos(pos), /paren|text/); - } else { - var m = this.ace.session.$findOpeningBracket(re.slice(-2, -1), {row: pos.line, column: pos.ch + 1}, /paren|text/); - } - return m && {pos: toCmPos(m)}; - }; - this.refresh = function() { - return this.ace.resize(true); - }; -}).call(CodeMirror.prototype); - function toAcePos(cmPos) { - return {row: cmPos.line, column: cmPos.ch}; - } - function toCmPos(acePos) { - return new Pos(acePos.row, acePos.column); - } - - var StringStream = CodeMirror.StringStream = function(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - }; - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == this.lineStart;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() { - throw "not implemented"; - }, - indentation: function() { - throw "not implemented"; - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } - } - }; - -// todo replace with showCommandLine -CodeMirror.defineExtension = function(name, fn) { - CodeMirror.prototype[name] = fn; -}; -dom.importCssString(".normal-mode .ace_cursor{\ - border: 0!important;\ - background-color: red;\ - opacity: 0.5;\ -}.ace_dialog {\ - position: absolute;\ - left: 0; right: 0;\ - background: white;\ - z-index: 15;\ - padding: .1em .8em;\ - overflow: hidden;\ - color: #333;\ -}\ -.ace_dialog-top {\ - border-bottom: 1px solid #eee;\ - top: 0;\ -}\ -.ace_dialog-bottom {\ - border-top: 1px solid #eee;\ - bottom: 0;\ -}\ -.ace_dialog input {\ - border: none;\ - outline: none;\ - background: transparent;\ - width: 20em;\ - color: inherit;\ - font-family: monospace;\ -}", "vimMode"); -(function() { - function dialogDiv(cm, template, bottom) { - var wrap = cm.ace.container; - var dialog; - dialog = wrap.appendChild(document.createElement("div")); - if (bottom) - dialog.className = "ace_dialog ace_dialog-bottom"; - else - dialog.className = "ace_dialog ace_dialog-top"; - - if (typeof template == "string") { - dialog.innerHTML = template; - } else { // Assuming it's a detached DOM element. - dialog.appendChild(template); - } - return dialog; - } - - function closeNotification(cm, newVal) { - if (cm.state.currentNotificationClose) - cm.state.currentNotificationClose(); - cm.state.currentNotificationClose = newVal; - } - - CodeMirror.defineExtension("openDialog", function(template, callback, options) { - if (this.virtualSelectionMode()) return; - if (!options) options = {}; - - closeNotification(this, null); - - var dialog = dialogDiv(this, template, options.bottom); - var closed = false, me = this; - function close(newVal) { - if (typeof newVal == 'string') { - inp.value = newVal; - } else { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - me.focus(); - - if (options.onClose) options.onClose(dialog); - } - } - - var inp = dialog.getElementsByTagName("input")[0], button; - if (inp) { - if (options.value) { - inp.value = options.value; - inp.select(); - } - - if (options.onInput) - CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);}); - if (options.onKeyUp) - CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);}); - - CodeMirror.on(inp, "keydown", function(e) { - if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; } - if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) { - inp.blur(); - CodeMirror.e_stop(e); - close(); - } - if (e.keyCode == 13) callback(inp.value); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); - - inp.focus(); - } else if (button = dialog.getElementsByTagName("button")[0]) { - CodeMirror.on(button, "click", function() { - close(); - me.focus(); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); - - button.focus(); - } - return close; - }); - - CodeMirror.defineExtension("openNotification", function(template, options) { - if (this.virtualSelectionMode()) return; - closeNotification(this, close); - var dialog = dialogDiv(this, template, options && options.bottom); - var closed = false, doneTimer; - var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000; - - function close() { - if (closed) return; - closed = true; - clearTimeout(doneTimer); - dialog.parentNode.removeChild(dialog); - } - - CodeMirror.on(dialog, 'click', function(e) { - CodeMirror.e_preventDefault(e); - close(); - }); - - if (duration) - doneTimer = setTimeout(close, duration); - - return close; - }); -})(); - - - var defaultKeymap = [ - // Key to key mapping. This goes first to make it possible to override - // existing mappings. - { keys: '', type: 'keyToKey', toKeys: 'h' }, - { keys: '', type: 'keyToKey', toKeys: 'l' }, - { keys: '', type: 'keyToKey', toKeys: 'k' }, - { keys: '', type: 'keyToKey', toKeys: 'j' }, - { keys: '', type: 'keyToKey', toKeys: 'l' }, - { keys: '', type: 'keyToKey', toKeys: 'h', context: 'normal'}, - { keys: '', type: 'keyToKey', toKeys: 'W' }, - { keys: '', type: 'keyToKey', toKeys: 'B', context: 'normal' }, - { keys: '', type: 'keyToKey', toKeys: 'w' }, - { keys: '', type: 'keyToKey', toKeys: 'b', context: 'normal' }, - { keys: '', type: 'keyToKey', toKeys: 'j' }, - { keys: '', type: 'keyToKey', toKeys: 'k' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, - { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, - { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' }, - { keys: 's', type: 'keyToKey', toKeys: 'xi', context: 'visual'}, - { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, - { keys: 'S', type: 'keyToKey', toKeys: 'dcc', context: 'visual' }, - { keys: '', type: 'keyToKey', toKeys: '0' }, - { keys: '', type: 'keyToKey', toKeys: '$' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: 'j^', context: 'normal' }, - // Motions - { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false }}, - { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true }}, - { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true }}, - { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true }}, - { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }}, - { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false }}, - { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false }}, - { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true }}, - { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true }}, - { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true }}, - { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }}, - { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true }}, - { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }}, - { keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true }}, - { keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true }}, - { keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true }}, - { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true }}, - { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }}, - { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: '0', type: 'motion', motion: 'moveToStartOfLine' }, - { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }}, - { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar:true }}, - { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }}, - { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true }}, - { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true }}, - { keys: 'f', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }}, - { keys: 'F', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }}, - { keys: 't', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }}, - { keys: 'T', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }}, - { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }}, - { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }}, - { keys: '\'', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}}, - { keys: '`', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true}}, - { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } }, - { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } }, - { keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } }, - { keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } }, - // the next two aren't motions but must come before more general motion declarations - { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}}, - { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}}, - { keys: ']', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}}, - { keys: '[', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}}, - { keys: '|', type: 'motion', motion: 'moveToColumn'}, - { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'}, - { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'}, - // Operators - { keys: 'd', type: 'operator', operator: 'delete' }, - { keys: 'y', type: 'operator', operator: 'yank' }, - { keys: 'c', type: 'operator', operator: 'change' }, - { keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true }}, - { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }}, - { keys: 'g~', type: 'operator', operator: 'changeCase' }, - { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true }, - { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true }, - { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }}, - { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }}, - // Operator-Motion dual commands - { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }}, - { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }}, - { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'}, - { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'}, - { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' }, - // Actions - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }}, - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }}, - { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' }, - { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' }, - { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' }, - { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' }, - { keys: 'v', type: 'action', action: 'toggleVisualMode' }, - { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }}, - { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, - { keys: 'gv', type: 'action', action: 'reselectLastSelection' }, - { keys: 'J', type: 'action', action: 'joinLines', isEdit: true }, - { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }}, - { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }}, - { keys: 'r', type: 'action', action: 'replace', isEdit: true }, - { keys: '@', type: 'action', action: 'replayMacro' }, - { keys: 'q', type: 'action', action: 'enterMacroRecordMode' }, - // Handle Replace-mode as a special case of insert mode. - { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }}, - { keys: 'u', type: 'action', action: 'undo', context: 'normal' }, - { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true }, - { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true }, - { keys: '', type: 'action', action: 'redo' }, - { keys: 'm', type: 'action', action: 'setMark' }, - { keys: '"', type: 'action', action: 'setRegister' }, - { keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }}, - { keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: 'zt', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }}, - { keys: 'z', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: 'z-', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }}, - { keys: 'zb', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: '.', type: 'action', action: 'repeatLastEdit' }, - { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: true, backtrack: false}}, - { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: false, backtrack: false}}, - // Text object motions - { keys: 'a', type: 'motion', motion: 'textObjectManipulation' }, - { keys: 'i', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }}, - // Search - { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }}, - { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }}, - { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }}, - { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }}, - // Ex command - { keys: ':', type: 'ex' } - ]; - - var Pos = CodeMirror.Pos; - - var Vim = function() { return vimApi; } //{ - function enterVimMode(cm) { - cm.setOption('disableInput', true); - cm.setOption('showCursorWhenSelecting', false); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - cm.on('cursorActivity', onCursorActivity); - maybeInitVimState(cm); - CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm)); - } - - function leaveVimMode(cm) { - cm.setOption('disableInput', false); - cm.off('cursorActivity', onCursorActivity); - CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm)); - cm.state.vim = null; - } - - function detachVimMap(cm, next) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!next || next.attach != attachVimMap) - leaveVimMode(cm, false); - } - function attachVimMap(cm, prev) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!prev || prev.attach != attachVimMap) - enterVimMode(cm); - } - - // Deprecated, simply setting the keymap works again. - CodeMirror.defineOption('vimMode', false, function(cm, val, prev) { - if (val && cm.getOption("keyMap") != "vim") - cm.setOption("keyMap", "vim"); - else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap"))) - cm.setOption("keyMap", "default"); - }); - - function cmKey(key, cm) { - if (!cm) { return undefined; } - var vimKey = cmKeyToVimKey(key); - if (!vimKey) { - return false; - } - var cmd = CodeMirror.Vim.findKey(cm, vimKey); - if (typeof cmd == 'function') { - CodeMirror.signal(cm, 'vim-keypress', vimKey); - } - return cmd; - } - - var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'}; - var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del'}; - function cmKeyToVimKey(key) { - if (key.charAt(0) == '\'') { - // Keypress character binding of format "'a'" - return key.charAt(1); - } - var pieces = key.split('-'); - if (/-$/.test(key)) { - // If the - key was typed, split will result in 2 extra empty strings - // in the array. Replace them with 1 '-'. - pieces.splice(-2, 2, '-'); - } - var lastPiece = pieces[pieces.length - 1]; - if (pieces.length == 1 && pieces[0].length == 1) { - // No-modifier bindings use literal character bindings above. Skip. - return false; - } else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) { - // Ignore Shift+char bindings as they should be handled by literal character. - return false; - } - var hasCharacter = false; - for (var i = 0; i < pieces.length; i++) { - var piece = pieces[i]; - if (piece in modifiers) { pieces[i] = modifiers[piece]; } - else { hasCharacter = true; } - if (piece in specialKeys) { pieces[i] = specialKeys[piece]; } - } - if (!hasCharacter) { - // Vim does not support modifier only keys. - return false; - } - // TODO: Current bindings expect the character to be lower case, but - // it looks like vim key notation uses upper case. - if (isUpperCase(lastPiece)) { - pieces[pieces.length - 1] = lastPiece.toLowerCase(); - } - return '<' + pieces.join('-') + '>'; - } - - function getOnPasteFn(cm) { - var vim = cm.state.vim; - if (!vim.onPasteFn) { - vim.onPasteFn = function() { - if (!vim.insertMode) { - cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); - actions.enterInsertMode(cm, {}, vim); - } - }; - } - return vim.onPasteFn; - } - - var numberRegex = /[\d]/; - var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)]; - function makeKeyRange(start, size) { - var keys = []; - for (var i = start; i < start + size; i++) { - keys.push(String.fromCharCode(i)); - } - return keys; - } - var upperCaseAlphabet = makeKeyRange(65, 26); - var lowerCaseAlphabet = makeKeyRange(97, 26); - var numbers = makeKeyRange(48, 10); - var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']); - var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']); - - function isLine(cm, line) { - return line >= cm.firstLine() && line <= cm.lastLine(); - } - function isLowerCase(k) { - return (/^[a-z]$/).test(k); - } - function isMatchableSymbol(k) { - return '()[]{}'.indexOf(k) != -1; - } - function isNumber(k) { - return numberRegex.test(k); - } - function isUpperCase(k) { - return (/^[A-Z]$/).test(k); - } - function isWhiteSpaceString(k) { - return (/^\s*$/).test(k); - } - function inArray(val, arr) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == val) { - return true; - } - } - return false; - } - - var options = {}; - function defineOption(name, defaultValue, type) { - if (defaultValue === undefined) { throw Error('defaultValue is required'); } - if (!type) { type = 'string'; } - options[name] = { - type: type, - defaultValue: defaultValue - }; - setOption(name, defaultValue); - } - - function setOption(name, value, cm) { - var option = options[name]; - if (!option) { - throw Error('Unknown option: ' + name); - } - if (option.type == 'boolean') { - if (value && value !== true) { - throw Error('Invalid argument: ' + name + '=' + value); - } else if (value !== false) { - // Boolean options are set to true if value is not defined. - value = true; - } - } - option.value = option.type == 'boolean' ? !!value : value; - } - - function getOption(name) { - var option = options[name]; - if (!option) { - throw Error('Unknown option: ' + name); - } - return option.value; - } - - var createCircularJumpList = function() { - var size = 100; - var pointer = -1; - var head = 0; - var tail = 0; - var buffer = new Array(size); - function add(cm, oldCur, newCur) { - var current = pointer % size; - var curMark = buffer[current]; - function useNextSlot(cursor) { - var next = ++pointer % size; - var trashMark = buffer[next]; - if (trashMark) { - trashMark.clear(); - } - buffer[next] = cm.setBookmark(cursor); - } - if (curMark) { - var markPos = curMark.find(); - // avoid recording redundant cursor position - if (markPos && !cursorEqual(markPos, oldCur)) { - useNextSlot(oldCur); - } - } else { - useNextSlot(oldCur); - } - useNextSlot(newCur); - head = pointer; - tail = pointer - size + 1; - if (tail < 0) { - tail = 0; - } - } - function move(cm, offset) { - pointer += offset; - if (pointer > head) { - pointer = head; - } else if (pointer < tail) { - pointer = tail; - } - var mark = buffer[(size + pointer) % size]; - // skip marks that are temporarily removed from text buffer - if (mark && !mark.find()) { - var inc = offset > 0 ? 1 : -1; - var newCur; - var oldCur = cm.getCursor(); - do { - pointer += inc; - mark = buffer[(size + pointer) % size]; - // skip marks that are the same as current position - if (mark && - (newCur = mark.find()) && - !cursorEqual(oldCur, newCur)) { - break; - } - } while (pointer < head && pointer > tail); - } - return mark; - } - return { - cachedCursor: undefined, //used for # and * jumps - add: add, - move: move - }; - }; - - // Returns an object to track the changes associated insert mode. It - // clones the object that is passed in, or creates an empty object one if - // none is provided. - var createInsertModeChanges = function(c) { - if (c) { - // Copy construction - return { - changes: c.changes, - expectCursorActivityForChange: c.expectCursorActivityForChange - }; - } - return { - // Change list - changes: [], - // Set to true on change, false on cursorActivity. - expectCursorActivityForChange: false - }; - }; - - function MacroModeState() { - this.latestRegister = undefined; - this.isPlaying = false; - this.isRecording = false; - this.replaySearchQueries = []; - this.onRecordingDone = undefined; - this.lastInsertModeChanges = createInsertModeChanges(); - } - MacroModeState.prototype = { - exitMacroRecordMode: function() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.onRecordingDone) { - macroModeState.onRecordingDone(); // close dialog - } - macroModeState.onRecordingDone = undefined; - macroModeState.isRecording = false; - }, - enterMacroRecordMode: function(cm, registerName) { - var register = - vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.clear(); - this.latestRegister = registerName; - if (cm.openDialog) { - this.onRecordingDone = cm.openDialog( - '(recording)['+registerName+']', null, {bottom:true}); - } - this.isRecording = true; - } - } - }; - - function maybeInitVimState(cm) { - if (!cm.state.vim) { - // Store instance state in the CodeMirror object. - cm.state.vim = { - inputState: new InputState(), - // Vim's input state that triggered the last edit, used to repeat - // motions and operators with '.'. - lastEditInputState: undefined, - // Vim's action command before the last edit, used to repeat actions - // with '.' and insert mode repeat. - lastEditActionCommand: undefined, - // When using jk for navigation, if you move from a longer line to a - // shorter line, the cursor may clip to the end of the shorter line. - // If j is pressed again and cursor goes to the next line, the - // cursor should go back to its horizontal position on the longer - // line if it can. This is to keep track of the horizontal position. - lastHPos: -1, - // Doing the same with screen-position for gj/gk - lastHSPos: -1, - // The last motion command run. Cleared if a non-motion command gets - // executed in between. - lastMotion: null, - marks: {}, - // Mark for rendering fake cursor for visual mode. - fakeCursor: null, - insertMode: false, - // Repeat count for changes made in insert mode, triggered by key - // sequences like 3,i. Only exists when insertMode is true. - insertModeRepeat: undefined, - visualMode: false, - // If we are in visual line mode. No effect if visualMode is false. - visualLine: false, - visualBlock: false, - lastSelection: null, - lastPastedText: null, - sel: { - } - }; - } - return cm.state.vim; - } - var vimGlobalState; - function resetVimGlobalState() { - vimGlobalState = { - // The current search query. - searchQuery: null, - // Whether we are searching backwards. - searchIsReversed: false, - // Replace part of the last substituted pattern - lastSubstituteReplacePart: undefined, - jumpList: createCircularJumpList(), - macroModeState: new MacroModeState, - // Recording latest f, t, F or T motion command. - lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''}, - registerController: new RegisterController({}), - // search history buffer - searchHistoryController: new HistoryController({}), - // ex Command history buffer - exCommandHistoryController : new HistoryController({}) - }; - for (var optionName in options) { - var option = options[optionName]; - option.value = option.defaultValue; - } - } - - var lastInsertModeKeyTimer; - var vimApi= { - buildKeyMap: function() { - // TODO: Convert keymap into dictionary format for fast lookup. - }, - // Testing hook, though it might be useful to expose the register - // controller anyways. - getRegisterController: function() { - return vimGlobalState.registerController; - }, - // Testing hook. - resetVimGlobalState_: resetVimGlobalState, - - // Testing hook. - getVimGlobalState_: function() { - return vimGlobalState; - }, - - // Testing hook. - maybeInitVimState_: maybeInitVimState, - - InsertModeKey: InsertModeKey, - map: function(lhs, rhs, ctx) { - // Add user defined key bindings. - exCommandDispatcher.map(lhs, rhs, ctx); - }, - unmap: function(lhs, ctx) { - // remove user defined key bindings. - exCommandDispatcher.unmap(lhs, ctx); - }, - setOption: setOption, - getOption: getOption, - defineOption: defineOption, - defineEx: function(name, prefix, func){ - if (name.indexOf(prefix) !== 0) { - throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); - } - exCommands[name]=func; - exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'}; - }, - handleKey: function (cm, key, origin) { - var command = this.findKey(cm, key, origin); - if (typeof command === 'function') { - return command(); - } - }, - /** - * This is the outermost function called by CodeMirror, after keys have - * been mapped to their Vim equivalents. - * - * Finds a command based on the key (and cached keys if there is a - * multi-key sequence). Returns `undefined` if no key is matched, a noop - * function if a partial match is found (multi-key), and a function to - * execute the bound command if a a key is matched. The function always - * returns true. - */ - findKey: function(cm, key, origin) { - var vim = maybeInitVimState(cm); - function handleMacroRecording() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - if (key == 'q') { - macroModeState.exitMacroRecordMode(); - clearInputState(cm); - return true; - } - if (origin != 'mapping') { - logKey(macroModeState, key); - } - } - } - function handleEsc() { - if (key == '') { - // Clear input state and get back to normal mode. - clearInputState(cm); - if (vim.visualMode) { - exitVisualMode(cm); - } else if (vim.insertMode) { - exitInsertMode(cm); - } - return true; - } - } - function doKeyToKey(keys) { - // TODO: prevent infinite recursion. - var match; - while (keys) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(keys); - key = match[0]; - keys = keys.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'mapping'); - } - } - - function handleKeyInsertMode() { - if (handleEsc()) { return true; } - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - var keysAreChars = key.length == 1; - var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - // Need to check all key substrings in insert mode. - while (keys.length > 1 && match.type != 'full') { - var keys = vim.inputState.keyBuffer = keys.slice(1); - var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - if (thisMatch.type != 'none') { match = thisMatch; } - } - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - lastInsertModeKeyTimer = window.setTimeout( - function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } }, - getOption('insertModeEscKeysTimeout')); - return !keysAreChars; - } - - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - if (keysAreChars) { - var here = cm.getCursor(); - cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); - } - clearInputState(cm); - return match.command; - } - - function handleKeyNonInsertMode() { - if (handleMacroRecording() || handleEsc()) { return true; }; - - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - if (/^[1-9]\d*$/.test(keys)) { return true; } - - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (!keysMatcher) { clearInputState(cm); return false; } - var context = vim.visualMode ? 'visual' : - 'normal'; - var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context); - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { return true; } - - vim.inputState.keyBuffer = ''; - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (keysMatcher[1] && keysMatcher[1] != '0') { - vim.inputState.pushRepeatDigit(keysMatcher[1]); - } - return match.command; - } - - var command; - if (vim.insertMode) { command = handleKeyInsertMode(); } - else { command = handleKeyNonInsertMode(); } - if (command === false) { - return undefined; - } else if (command === true) { - // TODO: Look into using CodeMirror's multi-key handling. - // Return no-op since we are caching the key. Counts as handled, but - // don't want act on it just yet. - return function() {}; - } else { - return function() { - return cm.operation(function() { - cm.curOp.isVimOp = true; - try { - if (command.type == 'keyToKey') { - doKeyToKey(command.toKeys); - } else { - commandDispatcher.processCommand(cm, vim, command); - } - } catch (e) { - // clear VIM state in case it's in a bad state. - cm.state.vim = undefined; - maybeInitVimState(cm); - console['log'](e); - throw e; - } - return true; - }); - }; - } - }, - handleEx: function(cm, input) { - exCommandDispatcher.processCommand(cm, input); - } - }; - - // Represents the current input state. - function InputState() { - this.prefixRepeat = []; - this.motionRepeat = []; - - this.operator = null; - this.operatorArgs = null; - this.motion = null; - this.motionArgs = null; - this.keyBuffer = []; // For matching multi-key commands. - this.registerName = null; // Defaults to the unnamed register. - } - InputState.prototype.pushRepeatDigit = function(n) { - if (!this.operator) { - this.prefixRepeat = this.prefixRepeat.concat(n); - } else { - this.motionRepeat = this.motionRepeat.concat(n); - } - }; - InputState.prototype.getRepeat = function() { - var repeat = 0; - if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) { - repeat = 1; - if (this.prefixRepeat.length > 0) { - repeat *= parseInt(this.prefixRepeat.join(''), 10); - } - if (this.motionRepeat.length > 0) { - repeat *= parseInt(this.motionRepeat.join(''), 10); - } - } - return repeat; - }; - - function clearInputState(cm, reason) { - cm.state.vim.inputState = new InputState(); - CodeMirror.signal(cm, 'vim-command-done', reason); - } - - /* - * Register stores information about copy and paste registers. Besides - * text, a register must store whether it is linewise (i.e., when it is - * pasted, should it insert itself into a new line, or should the text be - * inserted at the cursor position.) - */ - function Register(text, linewise, blockwise) { - this.clear(); - this.keyBuffer = [text || '']; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - } - Register.prototype = { - setText: function(text, linewise, blockwise) { - this.keyBuffer = [text || '']; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - }, - pushText: function(text, linewise) { - // if this register has ever been set to linewise, use linewise. - if (linewise) { - if (!this.linewise) { - this.keyBuffer.push('\n'); - } - this.linewise = true; - } - this.keyBuffer.push(text); - }, - pushInsertModeChanges: function(changes) { - this.insertModeChanges.push(createInsertModeChanges(changes)); - }, - pushSearchQuery: function(query) { - this.searchQueries.push(query); - }, - clear: function() { - this.keyBuffer = []; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = false; - }, - toString: function() { - return this.keyBuffer.join(''); - } - }; - - /* - * vim registers allow you to keep many independent copy and paste buffers. - * See http://usevim.com/2012/04/13/registers/ for an introduction. - * - * RegisterController keeps the state of all the registers. An initial - * state may be passed in. The unnamed register '"' will always be - * overridden. - */ - function RegisterController(registers) { - this.registers = registers; - this.unnamedRegister = registers['"'] = new Register(); - registers['.'] = new Register(); - registers[':'] = new Register(); - registers['/'] = new Register(); - } - RegisterController.prototype = { - pushText: function(registerName, operator, text, linewise, blockwise) { - if (linewise && text.charAt(0) == '\n') { - text = text.slice(1) + '\n'; - } - if (linewise && text.charAt(text.length - 1) !== '\n'){ - text += '\n'; - } - // Lowercase and uppercase registers refer to the same register. - // Uppercase just means append. - var register = this.isValidRegister(registerName) ? - this.getRegister(registerName) : null; - // if no register/an invalid register was specified, things go to the - // default registers - if (!register) { - switch (operator) { - case 'yank': - // The 0 register contains the text from the most recent yank. - this.registers['0'] = new Register(text, linewise, blockwise); - break; - case 'delete': - case 'change': - if (text.indexOf('\n') == -1) { - // Delete less than 1 line. Update the small delete register. - this.registers['-'] = new Register(text, linewise); - } else { - // Shift down the contents of the numbered registers and put the - // deleted text into register 1. - this.shiftNumericRegisters_(); - this.registers['1'] = new Register(text, linewise); - } - break; - } - // Make sure the unnamed register is set to what just happened - this.unnamedRegister.setText(text, linewise, blockwise); - return; - } - - // If we've gotten to this point, we've actually specified a register - var append = isUpperCase(registerName); - if (append) { - register.pushText(text, linewise); - } else { - register.setText(text, linewise, blockwise); - } - // The unnamed register always has the same value as the last used - // register. - this.unnamedRegister.setText(register.toString(), linewise); - }, - // Gets the register named @name. If one of @name doesn't already exist, - // create it. If @name is invalid, return the unnamedRegister. - getRegister: function(name) { - if (!this.isValidRegister(name)) { - return this.unnamedRegister; - } - name = name.toLowerCase(); - if (!this.registers[name]) { - this.registers[name] = new Register(); - } - return this.registers[name]; - }, - isValidRegister: function(name) { - return name && inArray(name, validRegisters); - }, - shiftNumericRegisters_: function() { - for (var i = 9; i >= 2; i--) { - this.registers[i] = this.getRegister('' + (i - 1)); - } - } - }; - function HistoryController() { - this.historyBuffer = []; - this.iterator; - this.initialPrefix = null; - } - HistoryController.prototype = { - // the input argument here acts a user entered prefix for a small time - // until we start autocompletion in which case it is the autocompleted. - nextMatch: function (input, up) { - var historyBuffer = this.historyBuffer; - var dir = up ? -1 : 1; - if (this.initialPrefix === null) this.initialPrefix = input; - for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) { - var element = historyBuffer[i]; - for (var j = 0; j <= element.length; j++) { - if (this.initialPrefix == element.substring(0, j)) { - this.iterator = i; - return element; - } - } - } - // should return the user input in case we reach the end of buffer. - if (i >= historyBuffer.length) { - this.iterator = historyBuffer.length; - return this.initialPrefix; - } - // return the last autocompleted query or exCommand as it is. - if (i < 0 ) return input; - }, - pushInput: function(input) { - var index = this.historyBuffer.indexOf(input); - if (index > -1) this.historyBuffer.splice(index, 1); - if (input.length) this.historyBuffer.push(input); - }, - reset: function() { - this.initialPrefix = null; - this.iterator = this.historyBuffer.length; - } - }; - var commandDispatcher = { - matchCommand: function(keys, keyMap, inputState, context) { - var matches = commandMatches(keys, keyMap, context, inputState); - if (!matches.full && !matches.partial) { - return {type: 'none'}; - } else if (!matches.full && matches.partial) { - return {type: 'partial'}; - } - - var bestMatch; - for (var i = 0; i < matches.full.length; i++) { - var match = matches.full[i]; - if (!bestMatch) { - bestMatch = match; - } - } - if (bestMatch.keys.slice(-11) == '') { - inputState.selectedCharacter = lastChar(keys); - } - return {type: 'full', command: bestMatch}; - }, - processCommand: function(cm, vim, command) { - vim.inputState.repeatOverride = command.repeatOverride; - switch (command.type) { - case 'motion': - this.processMotion(cm, vim, command); - break; - case 'operator': - this.processOperator(cm, vim, command); - break; - case 'operatorMotion': - this.processOperatorMotion(cm, vim, command); - break; - case 'action': - this.processAction(cm, vim, command); - break; - case 'search': - this.processSearch(cm, vim, command); - clearInputState(cm); - break; - case 'ex': - case 'keyToEx': - this.processEx(cm, vim, command); - clearInputState(cm); - break; - default: - break; - } - }, - processMotion: function(cm, vim, command) { - vim.inputState.motion = command.motion; - vim.inputState.motionArgs = copyArgs(command.motionArgs); - this.evalInput(cm, vim); - }, - processOperator: function(cm, vim, command) { - var inputState = vim.inputState; - if (inputState.operator) { - if (inputState.operator == command.operator) { - // Typing an operator twice like 'dd' makes the operator operate - // linewise - inputState.motion = 'expandToLine'; - inputState.motionArgs = { linewise: true }; - this.evalInput(cm, vim); - return; - } else { - // 2 different operators in a row doesn't make sense. - clearInputState(cm); - } - } - inputState.operator = command.operator; - inputState.operatorArgs = copyArgs(command.operatorArgs); - if (vim.visualMode) { - // Operating on a selection in visual mode. We don't need a motion. - this.evalInput(cm, vim); - } - }, - processOperatorMotion: function(cm, vim, command) { - var visualMode = vim.visualMode; - var operatorMotionArgs = copyArgs(command.operatorMotionArgs); - if (operatorMotionArgs) { - // Operator motions may have special behavior in visual mode. - if (visualMode && operatorMotionArgs.visualLine) { - vim.visualLine = true; - } - } - this.processOperator(cm, vim, command); - if (!visualMode) { - this.processMotion(cm, vim, command); - } - }, - processAction: function(cm, vim, command) { - var inputState = vim.inputState; - var repeat = inputState.getRepeat(); - var repeatIsExplicit = !!repeat; - var actionArgs = copyArgs(command.actionArgs) || {}; - if (inputState.selectedCharacter) { - actionArgs.selectedCharacter = inputState.selectedCharacter; - } - // Actions may or may not have motions and operators. Do these first. - if (command.operator) { - this.processOperator(cm, vim, command); - } - if (command.motion) { - this.processMotion(cm, vim, command); - } - if (command.motion || command.operator) { - this.evalInput(cm, vim); - } - actionArgs.repeat = repeat || 1; - actionArgs.repeatIsExplicit = repeatIsExplicit; - actionArgs.registerName = inputState.registerName; - clearInputState(cm); - vim.lastMotion = null; - if (command.isEdit) { - this.recordLastEdit(vim, inputState, command); - } - actions[command.action](cm, actionArgs, vim); - }, - processSearch: function(cm, vim, command) { - if (!cm.getSearchCursor) { - // Search depends on SearchCursor. - return; - } - var forward = command.searchArgs.forward; - var wholeWordOnly = command.searchArgs.wholeWordOnly; - getSearchState(cm).setReversed(!forward); - var promptPrefix = (forward) ? '/' : '?'; - var originalQuery = getSearchState(cm).getQuery(); - var originalScrollPos = cm.getScrollInfo(); - function handleQuery(query, ignoreCase, smartCase) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - try { - updateSearchQuery(cm, query, ignoreCase, smartCase); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + query); - return; - } - commandDispatcher.processMotion(cm, vim, { - type: 'motion', - motion: 'findNext', - motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist } - }); - } - function onPromptClose(query) { - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - handleQuery(query, true /** ignoreCase */, true /** smartCase */); - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - logSearchQuery(macroModeState, query); - } - } - function onPromptKeyUp(e, query, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - query = vimGlobalState.searchHistoryController.nextMatch(query, up) || ''; - close(query); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.searchHistoryController.reset(); - } - var parsedQuery; - try { - parsedQuery = updateSearchQuery(cm, query, - true /** ignoreCase */, true /** smartCase */); - } catch (e) { - // Swallow bad regexes for incremental search. - } - if (parsedQuery) { - cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30); - } else { - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - } - } - function onPromptKeyDown(e, query, close) { - var keyName = CodeMirror.keyName(e); - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - updateSearchQuery(cm, originalQuery); - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - CodeMirror.e_stop(e); - close(); - cm.focus(); - } - } - switch (command.searchArgs.querySrc) { - case 'prompt': - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { - var query = macroModeState.replaySearchQueries.shift(); - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - } else { - showPrompt(cm, { - onClose: onPromptClose, - prefix: promptPrefix, - desc: searchPromptDesc, - onKeyUp: onPromptKeyUp, - onKeyDown: onPromptKeyDown - }); - } - break; - case 'wordUnderCursor': - var word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - true /** noSymbol */); - var isKeyword = true; - if (!word) { - word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - false /** noSymbol */); - isKeyword = false; - } - if (!word) { - return; - } - var query = cm.getLine(word.start.line).substring(word.start.ch, - word.end.ch); - if (isKeyword && wholeWordOnly) { - query = '\\b' + query + '\\b'; - } else { - query = escapeRegex(query); - } - - // cachedCursor is used to save the old position of the cursor - // when * or # causes vim to seek for the nearest word and shift - // the cursor before entering the motion. - vimGlobalState.jumpList.cachedCursor = cm.getCursor(); - cm.setCursor(word.start); - - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - break; - } - }, - processEx: function(cm, vim, command) { - function onPromptClose(input) { - // Give the prompt some time to close so that if processCommand shows - // an error, the elements don't overlap. - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - exCommandDispatcher.processCommand(cm, input); - } - function onPromptKeyDown(e, input, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') { - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - CodeMirror.e_stop(e); - close(); - cm.focus(); - } - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; - close(input); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.exCommandHistoryController.reset(); - } - } - if (command.type == 'keyToEx') { - // Handle user defined Ex to Ex mappings - exCommandDispatcher.processCommand(cm, command.exArgs.input); - } else { - if (vim.visualMode) { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>', - onKeyDown: onPromptKeyDown}); - } else { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', - onKeyDown: onPromptKeyDown}); - } - } - }, - evalInput: function(cm, vim) { - // If the motion comand is set, execute both the operator and motion. - // Otherwise return. - var inputState = vim.inputState; - var motion = inputState.motion; - var motionArgs = inputState.motionArgs || {}; - var operator = inputState.operator; - var operatorArgs = inputState.operatorArgs || {}; - var registerName = inputState.registerName; - var sel = vim.sel; - // TODO: Make sure cm and vim selections are identical outside visual mode. - var origHead = copyCursor(vim.visualMode ? sel.head: cm.getCursor('head')); - var origAnchor = copyCursor(vim.visualMode ? sel.anchor : cm.getCursor('anchor')); - var oldHead = copyCursor(origHead); - var oldAnchor = copyCursor(origAnchor); - var newHead, newAnchor; - var repeat; - if (operator) { - this.recordLastEdit(vim, inputState); - } - if (inputState.repeatOverride !== undefined) { - // If repeatOverride is specified, that takes precedence over the - // input state's repeat. Used by Ex mode and can be user defined. - repeat = inputState.repeatOverride; - } else { - repeat = inputState.getRepeat(); - } - if (repeat > 0 && motionArgs.explicitRepeat) { - motionArgs.repeatIsExplicit = true; - } else if (motionArgs.noRepeat || - (!motionArgs.explicitRepeat && repeat === 0)) { - repeat = 1; - motionArgs.repeatIsExplicit = false; - } - if (inputState.selectedCharacter) { - // If there is a character input, stick it in all of the arg arrays. - motionArgs.selectedCharacter = operatorArgs.selectedCharacter = - inputState.selectedCharacter; - } - motionArgs.repeat = repeat; - clearInputState(cm); - if (motion) { - var motionResult = motions[motion](cm, origHead, motionArgs, vim); - vim.lastMotion = motions[motion]; - if (!motionResult) { - return; - } - if (motionArgs.toJumplist) { - var jumpList = vimGlobalState.jumpList; - // if the current motion is # or *, use cachedCursor - var cachedCursor = jumpList.cachedCursor; - if (cachedCursor) { - recordJumpPosition(cm, cachedCursor, motionResult); - delete jumpList.cachedCursor; - } else { - recordJumpPosition(cm, origHead, motionResult); - } - } - if (motionResult instanceof Array) { - newAnchor = motionResult[0]; - newHead = motionResult[1]; - } else { - newHead = motionResult; - } - // TODO: Handle null returns from motion commands better. - if (!newHead) { - newHead = copyCursor(origHead); - } - if (vim.visualMode) { - if (!(vim.visualBlock && newHead.ch === Infinity)) { - newHead = clipCursorToContent(cm, newHead, vim.visualBlock); - } - if (newAnchor) { - newAnchor = clipCursorToContent(cm, newAnchor, true); - } - newAnchor = newAnchor || oldAnchor; - sel.anchor = newAnchor; - sel.head = newHead; - updateCmSelection(cm); - updateMark(cm, vim, '<', - cursorIsBefore(newAnchor, newHead) ? newAnchor - : newHead); - updateMark(cm, vim, '>', - cursorIsBefore(newAnchor, newHead) ? newHead - : newAnchor); - } else if (!operator) { - newHead = clipCursorToContent(cm, newHead); - cm.setCursor(newHead.line, newHead.ch); - } - } - if (operator) { - if (operatorArgs.lastSel) { - // Replaying a visual mode operation - newAnchor = oldAnchor; - var lastSel = operatorArgs.lastSel; - var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line); - var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch); - if (lastSel.visualLine) { - // Linewise Visual mode: The same number of lines. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } else if (lastSel.visualBlock) { - // Blockwise Visual mode: The same number of lines and columns. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset); - } else if (lastSel.head.line == lastSel.anchor.line) { - // Normal Visual mode within one line: The same number of characters. - newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset); - } else { - // Normal Visual mode with several lines: The same number of lines, in the - // last line the same number of characters as in the last line the last time. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } - vim.visualMode = true; - vim.visualLine = lastSel.visualLine; - vim.visualBlock = lastSel.visualBlock; - sel = vim.sel = { - anchor: newAnchor, - head: newHead - }; - updateCmSelection(cm); - } else if (vim.visualMode) { - operatorArgs.lastSel = { - anchor: copyCursor(sel.anchor), - head: copyCursor(sel.head), - visualBlock: vim.visualBlock, - visualLine: vim.visualLine - }; - } - var curStart, curEnd, linewise, mode; - var cmSel; - if (vim.visualMode) { - // Init visual op - curStart = cursorMin(sel.head, sel.anchor); - curEnd = cursorMax(sel.head, sel.anchor); - linewise = vim.visualLine || operatorArgs.linewise; - mode = vim.visualBlock ? 'block' : - linewise ? 'line' : - 'char'; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode); - if (linewise) { - var ranges = cmSel.ranges; - if (mode == 'block') { - // Linewise operators in visual block mode extend to end of line - for (var i = 0; i < ranges.length; i++) { - ranges[i].head.ch = lineLength(cm, ranges[i].head.line); - } - } else if (mode == 'line') { - ranges[0].head = Pos(ranges[0].head.line + 1, 0); - } - } - } else { - // Init motion op - curStart = copyCursor(newAnchor || oldAnchor); - curEnd = copyCursor(newHead || oldHead); - if (cursorIsBefore(curEnd, curStart)) { - var tmp = curStart; - curStart = curEnd; - curEnd = tmp; - } - linewise = motionArgs.linewise || operatorArgs.linewise; - if (linewise) { - // Expand selection to entire line. - expandSelectionToLine(cm, curStart, curEnd); - } else if (motionArgs.forward) { - // Clip to trailing newlines only if the motion goes forward. - clipToLine(cm, curStart, curEnd); - } - mode = 'char'; - var exclusive = !motionArgs.inclusive || linewise; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode, exclusive); - } - cm.setSelections(cmSel.ranges, cmSel.primary); - vim.lastMotion = null; - operatorArgs.repeat = repeat; // For indent in visual mode. - operatorArgs.registerName = registerName; - // Keep track of linewise as it affects how paste and change behave. - operatorArgs.linewise = linewise; - var operatorMoveTo = operators[operator]( - cm, operatorArgs, cmSel.ranges, oldAnchor, newHead); - if (vim.visualMode) { - exitVisualMode(cm); - } - if (operatorMoveTo) { - cm.setCursor(operatorMoveTo); - } - } - }, - recordLastEdit: function(vim, inputState, actionCommand) { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - vim.lastEditInputState = inputState; - vim.lastEditActionCommand = actionCommand; - macroModeState.lastInsertModeChanges.changes = []; - macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false; - } - }; - - /** - * typedef {Object{line:number,ch:number}} Cursor An object containing the - * position of the cursor. - */ - // All of the functions below return Cursor objects. - var motions = { - moveToTopLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).top + motionArgs.repeat -1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToMiddleLine: function(cm) { - var range = getUserVisibleLines(cm); - var line = Math.floor((range.top + range.bottom) * 0.5); - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToBottomLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - expandToLine: function(_cm, head, motionArgs) { - // Expands forward to end of line, and then to next line if repeat is - // >1. Does not handle backward motion! - var cur = head; - return Pos(cur.line + motionArgs.repeat - 1, Infinity); - }, - findNext: function(cm, _head, motionArgs) { - var state = getSearchState(cm); - var query = state.getQuery(); - if (!query) { - return; - } - var prev = !motionArgs.forward; - // If search is initiated with ? instead of /, negate direction. - prev = (state.isReversed()) ? !prev : prev; - highlightSearchMatches(cm, query); - return findNext(cm, prev/** prev */, query, motionArgs.repeat); - }, - goToMark: function(cm, _head, motionArgs, vim) { - var mark = vim.marks[motionArgs.selectedCharacter]; - if (mark) { - var pos = mark.find(); - return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos; - } - return null; - }, - moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) { - if (vim.visualBlock && motionArgs.sameLine) { - var sel = vim.sel; - return [ - clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)), - clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch)) - ]; - } else { - return ([vim.sel.head, vim.sel.anchor]); - } - }, - jumpToMark: function(cm, head, motionArgs, vim) { - var best = head; - for (var i = 0; i < motionArgs.repeat; i++) { - var cursor = best; - for (var key in vim.marks) { - if (!isLowerCase(key)) { - continue; - } - var mark = vim.marks[key].find(); - var isWrongDirection = (motionArgs.forward) ? - cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark); - - if (isWrongDirection) { - continue; - } - if (motionArgs.linewise && (mark.line == cursor.line)) { - continue; - } - - var equal = cursorEqual(cursor, best); - var between = (motionArgs.forward) ? - cursorIsBetween(cursor, mark, best) : - cursorIsBetween(best, mark, cursor); - - if (equal || between) { - best = mark; - } - } - } - - if (motionArgs.linewise) { - // Vim places the cursor on the first non-whitespace character of - // the line if there is one, else it places the cursor at the end - // of the line, regardless of whether a mark was found. - best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line))); - } - return best; - }, - moveByCharacters: function(_cm, head, motionArgs) { - var cur = head; - var repeat = motionArgs.repeat; - var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat; - return Pos(cur.line, ch); - }, - moveByLines: function(cm, head, motionArgs, vim) { - var cur = head; - var endCh = cur.ch; - // Depending what our last motion was, we may want to do different - // things. If our last motion was moving vertically, we want to - // preserve the HPos from our last horizontal move. If our last motion - // was going to the end of a line, moving vertically we should go to - // the end of the line, etc. - switch (vim.lastMotion) { - case this.moveByLines: - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveToColumn: - case this.moveToEol: - endCh = vim.lastHPos; - break; - default: - vim.lastHPos = endCh; - } - var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0); - var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat; - var first = cm.firstLine(); - var last = cm.lastLine(); - // Vim cancels linewise motions that start on an edge and move beyond - // that edge. It does not cancel motions that do not start on an edge. - if ((line < first && cur.line == first) || - (line > last && cur.line == last)) { - return; - } - if (motionArgs.toFirstChar){ - endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); - vim.lastHPos = endCh; - } - vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left; - return Pos(line, endCh); - }, - moveByDisplayLines: function(cm, head, motionArgs, vim) { - var cur = head; - switch (vim.lastMotion) { - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveByLines: - case this.moveToColumn: - case this.moveToEol: - break; - default: - vim.lastHSPos = cm.charCoords(cur,'div').left; - } - var repeat = motionArgs.repeat; - var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos); - if (res.hitSide) { - if (motionArgs.forward) { - var lastCharCoords = cm.charCoords(res, 'div'); - var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos }; - var res = cm.coordsChar(goalCoords, 'div'); - } else { - var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div'); - resCoords.left = vim.lastHSPos; - res = cm.coordsChar(resCoords, 'div'); - } - } - vim.lastHPos = res.ch; - return res; - }, - moveByPage: function(cm, head, motionArgs) { - // CodeMirror only exposes functions that move the cursor page down, so - // doing this bad hack to move the cursor and move it back. evalInput - // will move the cursor to where it should be in the end. - var curStart = head; - var repeat = motionArgs.repeat; - return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page'); - }, - moveByParagraph: function(cm, head, motionArgs) { - var dir = motionArgs.forward ? 1 : -1; - return findParagraph(cm, head, motionArgs.repeat, dir); - }, - moveByScroll: function(cm, head, motionArgs, vim) { - var scrollbox = cm.getScrollInfo(); - var curEnd = null; - var repeat = motionArgs.repeat; - if (!repeat) { - repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight()); - } - var orig = cm.charCoords(head, 'local'); - motionArgs.repeat = repeat; - var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim); - if (!curEnd) { - return null; - } - var dest = cm.charCoords(curEnd, 'local'); - cm.scrollTo(null, scrollbox.top + dest.top - orig.top); - return curEnd; - }, - moveByWords: function(cm, head, motionArgs) { - return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, - !!motionArgs.wordEnd, !!motionArgs.bigWord); - }, - moveTillCharacter: function(cm, _head, motionArgs) { - var repeat = motionArgs.repeat; - var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter); - var increment = motionArgs.forward ? -1 : 1; - recordLastCharacterSearch(increment, motionArgs); - if (!curEnd) return null; - curEnd.ch += increment; - return curEnd; - }, - moveToCharacter: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - recordLastCharacterSearch(0, motionArgs); - return moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToSymbol: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - return findSymbol(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToColumn: function(cm, head, motionArgs, vim) { - var repeat = motionArgs.repeat; - // repeat is equivalent to which column we want to move to! - vim.lastHPos = repeat - 1; - vim.lastHSPos = cm.charCoords(head,'div').left; - return moveToColumn(cm, repeat); - }, - moveToEol: function(cm, head, motionArgs, vim) { - var cur = head; - vim.lastHPos = Infinity; - var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity); - var end=cm.clipPos(retval); - end.ch--; - vim.lastHSPos = cm.charCoords(end,'div').left; - return retval; - }, - moveToFirstNonWhiteSpaceCharacter: function(cm, head) { - // Go to the start of the line where the text begins, or the end for - // whitespace-only lines - var cursor = head; - return Pos(cursor.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line))); - }, - moveToMatchedSymbol: function(cm, head) { - var cursor = head; - var line = cursor.line; - var ch = cursor.ch; - var lineText = cm.getLine(line); - var symbol; - do { - symbol = lineText.charAt(ch++); - if (symbol && isMatchableSymbol(symbol)) { - var style = cm.getTokenTypeAt(Pos(line, ch)); - if (style !== "string" && style !== "comment") { - break; - } - } - } while (symbol); - if (symbol) { - var matched = cm.findMatchingBracket(Pos(line, ch)); - return matched.to; - } else { - return cursor; - } - }, - moveToStartOfLine: function(_cm, head) { - return Pos(head.line, 0); - }, - moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) { - var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine(); - if (motionArgs.repeatIsExplicit) { - lineNum = motionArgs.repeat - cm.getOption('firstLineNumber'); - } - return Pos(lineNum, - findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum))); - }, - textObjectManipulation: function(cm, head, motionArgs, vim) { - // TODO: lots of possible exceptions that can be thrown here. Try da( - // outside of a () block. - - // TODO: adding <> >< to this map doesn't work, presumably because - // they're operators - var mirroredPairs = {'(': ')', ')': '(', - '{': '}', '}': '{', - '[': ']', ']': '['}; - var selfPaired = {'\'': true, '"': true}; - - var character = motionArgs.selectedCharacter; - // 'b' refers to '()' block. - // 'B' refers to '{}' block. - if (character == 'b') { - character = '('; - } else if (character == 'B') { - character = '{'; - } - - // Inclusive is the difference between a and i - // TODO: Instead of using the additional text object map to perform text - // object operations, merge the map into the defaultKeyMap and use - // motionArgs to define behavior. Define separate entries for 'aw', - // 'iw', 'a[', 'i[', etc. - var inclusive = !motionArgs.textObjectInner; - - var tmp; - if (mirroredPairs[character]) { - tmp = selectCompanionObject(cm, head, character, inclusive); - } else if (selfPaired[character]) { - tmp = findBeginningAndEnd(cm, head, character, inclusive); - } else if (character === 'W') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - true /** bigWord */); - } else if (character === 'w') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - false /** bigWord */); - } else if (character === 'p') { - tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive); - motionArgs.linewise = true; - if (vim.visualMode) { - if (!vim.visualLine) { vim.visualLine = true; } - } else { - var operatorArgs = vim.inputState.operatorArgs; - if (operatorArgs) { operatorArgs.linewise = true; } - tmp.end.line--; - } - } else { - // No text object defined for this, don't move. - return null; - } - - if (!cm.state.vim.visualMode) { - return [tmp.start, tmp.end]; - } else { - return expandSelection(cm, tmp.start, tmp.end); - } - }, - - repeatLastCharacterSearch: function(cm, head, motionArgs) { - var lastSearch = vimGlobalState.lastChararacterSearch; - var repeat = motionArgs.repeat; - var forward = motionArgs.forward === lastSearch.forward; - var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1); - cm.moveH(-increment, 'char'); - motionArgs.inclusive = forward ? true : false; - var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter); - if (!curEnd) { - cm.moveH(increment, 'char'); - return head; - } - curEnd.ch += increment; - return curEnd; - } - }; - - function fillArray(val, times) { - var arr = []; - for (var i = 0; i < times; i++) { - arr.push(val); - } - return arr; - } - /** - * An operator acts on a text selection. It receives the list of selections - * as input. The corresponding CodeMirror selection is guaranteed to - * match the input selection. - */ - var operators = { - change: function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock; - if (!vim.visualMode) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - text = cm.getRange(anchor, head); - if (!isWhiteSpaceString(text)) { - // Exclude trailing whitespace if the range is not all whitespace. - var match = (/\s+$/).exec(text); - if (match) { - head = offsetCursor(head, 0, - match[0].length); - text = text.slice(0, - match[0].length); - } - } - var wasLastLine = head.line - 1 == cm.lastLine(); - cm.replaceRange('', anchor, head); - if (args.linewise && !wasLastLine) { - // Push the next line back down, if there is a next line. - CodeMirror.commands.newlineAndIndent(cm); - // null ch so setCursor moves to end of line. - anchor.ch = null; - } - finalHead = anchor; - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = cursorMin(ranges[0].head, ranges[0].anchor); - } - vimGlobalState.registerController.pushText( - args.registerName, 'change', text, - args.linewise, ranges.length > 1); - actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim); - }, - // delete is a javascript keyword. - 'delete': function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - if (!vim.visualBlock) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - if (args.linewise && - head.line != cm.firstLine() && - anchor.line == cm.lastLine() && - anchor.line == head.line - 1) { - // Special case for dd on last line (and first line). - if (anchor.line == cm.firstLine()) { - anchor.ch = 0; - } else { - anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1)); - } - } - text = cm.getRange(anchor, head); - cm.replaceRange('', anchor, head); - finalHead = anchor; - if (args.linewise) { - finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor); - } - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = ranges[0].anchor; - } - vimGlobalState.registerController.pushText( - args.registerName, 'delete', text, - args.linewise, vim.visualBlock); - return finalHead; - }, - indent: function(cm, args, ranges) { - var vim = cm.state.vim; - var startLine = ranges[0].anchor.line; - var endLine = vim.visualBlock ? - ranges[ranges.length - 1].anchor.line : - ranges[0].head.line; - // In visual mode, n> shifts the selection right n times, instead of - // shifting n lines right once. - var repeat = (vim.visualMode) ? args.repeat : 1; - if (args.linewise) { - // The only way to delete a newline is to delete until the start of - // the next line, so in linewise mode evalInput will include the next - // line. We don't want this in indent, so we go back a line. - endLine--; - } - for (var i = startLine; i <= endLine; i++) { - for (var j = 0; j < repeat; j++) { - cm.indentLine(i, args.indentRight); - } - } - return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor); - }, - changeCase: function(cm, args, ranges, oldAnchor, newHead) { - var selections = cm.getSelections(); - var swapped = []; - var toLower = args.toLower; - for (var j = 0; j < selections.length; j++) { - var toSwap = selections[j]; - var text = ''; - if (toLower === true) { - text = toSwap.toLowerCase(); - } else if (toLower === false) { - text = toSwap.toUpperCase(); - } else { - for (var i = 0; i < toSwap.length; i++) { - var character = toSwap.charAt(i); - text += isUpperCase(character) ? character.toLowerCase() : - character.toUpperCase(); - } - } - swapped.push(text); - } - cm.replaceSelections(swapped); - if (args.shouldMoveCursor){ - return newHead; - } else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) { - return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor); - } else if (args.linewise){ - return oldAnchor; - } else { - return cursorMin(ranges[0].anchor, ranges[0].head); - } - }, - yank: function(cm, args, ranges, oldAnchor) { - var vim = cm.state.vim; - var text = cm.getSelection(); - var endPos = vim.visualMode - ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor) - : oldAnchor; - vimGlobalState.registerController.pushText( - args.registerName, 'yank', - text, args.linewise, vim.visualBlock); - return endPos; - } - }; - - var actions = { - jumpListWalk: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat; - var forward = actionArgs.forward; - var jumpList = vimGlobalState.jumpList; - - var mark = jumpList.move(cm, forward ? repeat : -repeat); - var markPos = mark ? mark.find() : undefined; - markPos = markPos ? markPos : cm.getCursor(); - cm.setCursor(markPos); - }, - scroll: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat || 1; - var lineHeight = cm.defaultTextHeight(); - var top = cm.getScrollInfo().top; - var delta = lineHeight * repeat; - var newPos = actionArgs.forward ? top + delta : top - delta; - var cursor = copyCursor(cm.getCursor()); - var cursorCoords = cm.charCoords(cursor, 'local'); - if (actionArgs.forward) { - if (newPos > cursorCoords.top) { - cursor.line += (newPos - cursorCoords.top) / lineHeight; - cursor.line = Math.ceil(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo(null, cursorCoords.top); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } else { - var newBottom = newPos + cm.getScrollInfo().clientHeight; - if (newBottom < cursorCoords.bottom) { - cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight; - cursor.line = Math.floor(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo( - null, cursorCoords.bottom - cm.getScrollInfo().clientHeight); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } - }, - scrollToCursor: function(cm, actionArgs) { - var lineNum = cm.getCursor().line; - var charCoords = cm.charCoords(Pos(lineNum, 0), 'local'); - var height = cm.getScrollInfo().clientHeight; - var y = charCoords.top; - var lineHeight = charCoords.bottom - y; - switch (actionArgs.position) { - case 'center': y = y - (height / 2) + lineHeight; - break; - case 'bottom': y = y - height + lineHeight*1.4; - break; - case 'top': y = y + lineHeight*0.4; - break; - } - cm.scrollTo(null, y); - }, - replayMacro: function(cm, actionArgs, vim) { - var registerName = actionArgs.selectedCharacter; - var repeat = actionArgs.repeat; - var macroModeState = vimGlobalState.macroModeState; - if (registerName == '@') { - registerName = macroModeState.latestRegister; - } - while(repeat--){ - executeMacroRegister(cm, vim, macroModeState, registerName); - } - }, - enterMacroRecordMode: function(cm, actionArgs) { - var macroModeState = vimGlobalState.macroModeState; - var registerName = actionArgs.selectedCharacter; - macroModeState.enterMacroRecordMode(cm, registerName); - }, - enterInsertMode: function(cm, actionArgs, vim) { - if (cm.getOption('readOnly')) { return; } - vim.insertMode = true; - vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1; - var insertAt = (actionArgs) ? actionArgs.insertAt : null; - var sel = vim.sel; - var head = actionArgs.head || cm.getCursor('head'); - var height = cm.listSelections().length; - if (insertAt == 'eol') { - head = Pos(head.line, lineLength(cm, head.line)); - } else if (insertAt == 'charAfter') { - head = offsetCursor(head, 0, 1); - } else if (insertAt == 'firstNonBlank') { - head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head); - } else if (insertAt == 'startOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line < sel.anchor.line) { - head = sel.head; - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.min(sel.head.ch, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'endOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line >= sel.anchor.line) { - head = offsetCursor(sel.head, 0, 1); - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.max(sel.head.ch + 1, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'inplace') { - if (vim.visualMode){ - return; - } - } - cm.setOption('keyMap', 'vim-insert'); - cm.setOption('disableInput', false); - if (actionArgs && actionArgs.replace) { - // Handle Replace-mode as a special case of insert mode. - cm.toggleOverwrite(true); - cm.setOption('keyMap', 'vim-replace'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"}); - } else { - cm.setOption('keyMap', 'vim-insert'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"}); - } - if (!vimGlobalState.macroModeState.isPlaying) { - // Only record if not replaying. - cm.on('change', onChange); - CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (vim.visualMode) { - exitVisualMode(cm); - } - selectForInsert(cm, head, height); - }, - toggleVisualMode: function(cm, actionArgs, vim) { - var repeat = actionArgs.repeat; - var anchor = cm.getCursor(); - var head; - // TODO: The repeat should actually select number of characters/lines - // equal to the repeat times the size of the previous visual - // operation. - if (!vim.visualMode) { - // Entering visual mode - vim.visualMode = true; - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - head = clipCursorToContent( - cm, Pos(anchor.line, anchor.ch + repeat - 1), - true /** includeLineBreak */); - vim.sel = { - anchor: anchor, - head: head - }; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - } else if (vim.visualLine ^ actionArgs.linewise || - vim.visualBlock ^ actionArgs.blockwise) { - // Toggling between modes - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - } else { - exitVisualMode(cm); - } - }, - reselectLastSelection: function(cm, _actionArgs, vim) { - var lastSelection = vim.lastSelection; - if (vim.visualMode) { - updateLastSelection(cm, vim); - } - if (lastSelection) { - var anchor = lastSelection.anchorMark.find(); - var head = lastSelection.headMark.find(); - if (!anchor || !head) { - // If the marks have been destroyed due to edits, do nothing. - return; - } - vim.sel = { - anchor: anchor, - head: head - }; - vim.visualMode = true; - vim.visualLine = lastSelection.visualLine; - vim.visualBlock = lastSelection.visualBlock; - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - CodeMirror.signal(cm, 'vim-mode-change', { - mode: 'visual', - subMode: vim.visualLine ? 'linewise' : - vim.visualBlock ? 'blockwise' : ''}); - } - }, - joinLines: function(cm, actionArgs, vim) { - var curStart, curEnd; - if (vim.visualMode) { - curStart = cm.getCursor('anchor'); - curEnd = cm.getCursor('head'); - curEnd.ch = lineLength(cm, curEnd.line) - 1; - } else { - // Repeat is the number of lines to join. Minimum 2 lines. - var repeat = Math.max(actionArgs.repeat, 2); - curStart = cm.getCursor(); - curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1, - Infinity)); - } - var finalCh = 0; - for (var i = curStart.line; i < curEnd.line; i++) { - finalCh = lineLength(cm, curStart.line); - var tmp = Pos(curStart.line + 1, - lineLength(cm, curStart.line + 1)); - var text = cm.getRange(curStart, tmp); - text = text.replace(/\n\s*/g, ' '); - cm.replaceRange(text, curStart, tmp); - } - var curFinalPos = Pos(curStart.line, finalCh); - cm.setCursor(curFinalPos); - if (vim.visualMode) { - exitVisualMode(cm); - } - }, - newLineAndEnterInsertMode: function(cm, actionArgs, vim) { - vim.insertMode = true; - var insertAt = copyCursor(cm.getCursor()); - if (insertAt.line === cm.firstLine() && !actionArgs.after) { - // Special case for inserting newline before start of document. - cm.replaceRange('\n', Pos(cm.firstLine(), 0)); - cm.setCursor(cm.firstLine(), 0); - } else { - insertAt.line = (actionArgs.after) ? insertAt.line : - insertAt.line - 1; - insertAt.ch = lineLength(cm, insertAt.line); - cm.setCursor(insertAt); - var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - newlineFn(cm); - } - this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim); - }, - paste: function(cm, actionArgs, vim) { - var cur = copyCursor(cm.getCursor()); - var register = vimGlobalState.registerController.getRegister( - actionArgs.registerName); - var text = register.toString(); - if (!text) { - return; - } - if (actionArgs.matchIndent) { - var tabSize = cm.getOption("tabSize"); - // length that considers tabs and tabSize - var whitespaceLength = function(str) { - var tabs = (str.split("\t").length - 1); - var spaces = (str.split(" ").length - 1); - return tabs * tabSize + spaces * 1; - }; - var currentLine = cm.getLine(cm.getCursor().line); - var indent = whitespaceLength(currentLine.match(/^\s*/)[0]); - // chomp last newline b/c don't want it to match /^\s*/gm - var chompedText = text.replace(/\n$/, ''); - var wasChomped = text !== chompedText; - var firstIndent = whitespaceLength(text.match(/^\s*/)[0]); - var text = chompedText.replace(/^\s*/gm, function(wspace) { - var newIndent = indent + (whitespaceLength(wspace) - firstIndent); - if (newIndent < 0) { - return ""; - } - else if (cm.getOption("indentWithTabs")) { - var quotient = Math.floor(newIndent / tabSize); - return Array(quotient + 1).join('\t'); - } - else { - return Array(newIndent + 1).join(' '); - } - }); - text += wasChomped ? "\n" : ""; - } - if (actionArgs.repeat > 1) { - var text = Array(actionArgs.repeat + 1).join(text); - } - var linewise = register.linewise; - var blockwise = register.blockwise; - if (linewise) { - if(vim.visualMode) { - text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; - } else if (actionArgs.after) { - // Move the newline at the end to the start instead, and paste just - // before the newline character of the line we are on right now. - text = '\n' + text.slice(0, text.length - 1); - cur.ch = lineLength(cm, cur.line); - } else { - cur.ch = 0; - } - } else { - if (blockwise) { - text = text.split('\n'); - for (var i = 0; i < text.length; i++) { - text[i] = (text[i] == '') ? ' ' : text[i]; - } - } - cur.ch += actionArgs.after ? 1 : 0; - } - var curPosFinal; - var idx; - if (vim.visualMode) { - // save the pasted text for reselection if the need arises - vim.lastPastedText = text; - var lastSelectionCurEnd; - var selectedArea = getSelectedAreaRange(cm, vim); - var selectionStart = selectedArea[0]; - var selectionEnd = selectedArea[1]; - var selectedText = cm.getSelection(); - var selections = cm.listSelections(); - var emptyStrings = new Array(selections.length).join('1').split('1'); - // save the curEnd marker before it get cleared due to cm.replaceRange. - if (vim.lastSelection) { - lastSelectionCurEnd = vim.lastSelection.headMark.find(); - } - // push the previously selected text to unnamed register - vimGlobalState.registerController.unnamedRegister.setText(selectedText); - if (blockwise) { - // first delete the selected text - cm.replaceSelections(emptyStrings); - // Set new selections as per the block length of the yanked text - selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch); - cm.setCursor(selectionStart); - selectBlock(cm, selectionEnd); - cm.replaceSelections(text); - curPosFinal = selectionStart; - } else if (vim.visualBlock) { - cm.replaceSelections(emptyStrings); - cm.setCursor(selectionStart); - cm.replaceRange(text, selectionStart, selectionStart); - curPosFinal = selectionStart; - } else { - cm.replaceRange(text, selectionStart, selectionEnd); - curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1); - } - // restore the the curEnd marker - if(lastSelectionCurEnd) { - vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd); - } - if (linewise) { - curPosFinal.ch=0; - } - } else { - if (blockwise) { - cm.setCursor(cur); - for (var i = 0; i < text.length; i++) { - var line = cur.line+i; - if (line > cm.lastLine()) { - cm.replaceRange('\n', Pos(line, 0)); - } - var lastCh = lineLength(cm, line); - if (lastCh < cur.ch) { - extendLineToColumn(cm, line, cur.ch); - } - } - cm.setCursor(cur); - selectBlock(cm, Pos(cur.line + text.length-1, cur.ch)); - cm.replaceSelections(text); - curPosFinal = cur; - } else { - cm.replaceRange(text, cur); - // Now fine tune the cursor to where we want it. - if (linewise && actionArgs.after) { - curPosFinal = Pos( - cur.line + 1, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); - } else if (linewise && !actionArgs.after) { - curPosFinal = Pos( - cur.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))); - } else if (!linewise && actionArgs.after) { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length - 1); - } else { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length); - } - } - } - if (vim.visualMode) { - exitVisualMode(cm); - } - cm.setCursor(curPosFinal); - }, - undo: function(cm, actionArgs) { - cm.operation(function() { - repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)(); - cm.setCursor(cm.getCursor('anchor')); - }); - }, - redo: function(cm, actionArgs) { - repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)(); - }, - setRegister: function(_cm, actionArgs, vim) { - vim.inputState.registerName = actionArgs.selectedCharacter; - }, - setMark: function(cm, actionArgs, vim) { - var markName = actionArgs.selectedCharacter; - updateMark(cm, vim, markName, cm.getCursor()); - }, - replace: function(cm, actionArgs, vim) { - var replaceWith = actionArgs.selectedCharacter; - var curStart = cm.getCursor(); - var replaceTo; - var curEnd; - var selections = cm.listSelections(); - if (vim.visualMode) { - curStart = cm.getCursor('start'); - curEnd = cm.getCursor('end'); - } else { - var line = cm.getLine(curStart.line); - replaceTo = curStart.ch + actionArgs.repeat; - if (replaceTo > line.length) { - replaceTo=line.length; - } - curEnd = Pos(curStart.line, replaceTo); - } - if (replaceWith=='\n') { - if (!vim.visualMode) cm.replaceRange('', curStart, curEnd); - // special case, where vim help says to replace by just one line-break - (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm); - } else { - var replaceWithStr = cm.getRange(curStart, curEnd); - //replace all characters in range by selected, but keep linebreaks - replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith); - if (vim.visualBlock) { - // Tabs are split in visua block before replacing - var spaces = new Array(cm.getOption("tabSize")+1).join(' '); - replaceWithStr = cm.getSelection(); - replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n'); - cm.replaceSelections(replaceWithStr); - } else { - cm.replaceRange(replaceWithStr, curStart, curEnd); - } - if (vim.visualMode) { - curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ? - selections[0].anchor : selections[0].head; - cm.setCursor(curStart); - exitVisualMode(cm); - } else { - cm.setCursor(offsetCursor(curEnd, 0, -1)); - } - } - }, - incrementNumberToken: function(cm, actionArgs) { - var cur = cm.getCursor(); - var lineStr = cm.getLine(cur.line); - var re = /-?\d+/g; - var match; - var start; - var end; - var numberStr; - var token; - while ((match = re.exec(lineStr)) !== null) { - token = match[0]; - start = match.index; - end = start + token.length; - if (cur.ch < end)break; - } - if (!actionArgs.backtrack && (end <= cur.ch))return; - if (token) { - var increment = actionArgs.increase ? 1 : -1; - var number = parseInt(token) + (increment * actionArgs.repeat); - var from = Pos(cur.line, start); - var to = Pos(cur.line, end); - numberStr = number.toString(); - cm.replaceRange(numberStr, from, to); - } else { - return; - } - cm.setCursor(Pos(cur.line, start + numberStr.length - 1)); - }, - repeatLastEdit: function(cm, actionArgs, vim) { - var lastEditInputState = vim.lastEditInputState; - if (!lastEditInputState) { return; } - var repeat = actionArgs.repeat; - if (repeat && actionArgs.repeatIsExplicit) { - vim.lastEditInputState.repeatOverride = repeat; - } else { - repeat = vim.lastEditInputState.repeatOverride || repeat; - } - repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */); - }, - exitInsertMode: exitInsertMode - }; - - /* - * Below are miscellaneous utility functions used by vim.js - */ - - /** - * Clips cursor to ensure that line is within the buffer's range - * If includeLineBreak is true, then allow cur.ch == lineLength. - */ - function clipCursorToContent(cm, cur, includeLineBreak) { - var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() ); - var maxCh = lineLength(cm, line) - 1; - maxCh = (includeLineBreak) ? maxCh + 1 : maxCh; - var ch = Math.min(Math.max(0, cur.ch), maxCh); - return Pos(line, ch); - } - function copyArgs(args) { - var ret = {}; - for (var prop in args) { - if (args.hasOwnProperty(prop)) { - ret[prop] = args[prop]; - } - } - return ret; - } - function offsetCursor(cur, offsetLine, offsetCh) { - if (typeof offsetLine === 'object') { - offsetCh = offsetLine.ch; - offsetLine = offsetLine.line; - } - return Pos(cur.line + offsetLine, cur.ch + offsetCh); - } - function getOffset(anchor, head) { - return { - line: head.line - anchor.line, - ch: head.line - anchor.line - }; - } - function commandMatches(keys, keyMap, context, inputState) { - // Partial matches are not applied. They inform the key handler - // that the current key sequence is a subsequence of a valid key - // sequence, so that the key buffer is not cleared. - var match, partial = [], full = []; - for (var i = 0; i < keyMap.length; i++) { - var command = keyMap[i]; - if (context == 'insert' && command.context != 'insert' || - command.context && command.context != context || - inputState.operator && command.type == 'action' || - !(match = commandMatch(keys, command.keys))) { continue; } - if (match == 'partial') { partial.push(command); } - if (match == 'full') { full.push(command); } - } - return { - partial: partial.length && partial, - full: full.length && full - }; - } - function commandMatch(pressed, mapped) { - if (mapped.slice(-11) == '') { - // Last character matches anything. - var prefixLen = mapped.length - 11; - var pressedPrefix = pressed.slice(0, prefixLen); - var mappedPrefix = mapped.slice(0, prefixLen); - return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' : - mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false; - } else { - return pressed == mapped ? 'full' : - mapped.indexOf(pressed) == 0 ? 'partial' : false; - } - } - function lastChar(keys) { - var match = /^.*(<[\w\-]+>)$/.exec(keys); - var selectedCharacter = match ? match[1] : keys.slice(-1); - if (selectedCharacter.length > 1){ - switch(selectedCharacter){ - case '': - selectedCharacter='\n'; - break; - case '': - selectedCharacter=' '; - break; - default: - break; - } - } - return selectedCharacter; - } - function repeatFn(cm, fn, repeat) { - return function() { - for (var i = 0; i < repeat; i++) { - fn(cm); - } - }; - } - function copyCursor(cur) { - return Pos(cur.line, cur.ch); - } - function cursorEqual(cur1, cur2) { - return cur1.ch == cur2.ch && cur1.line == cur2.line; - } - function cursorIsBefore(cur1, cur2) { - if (cur1.line < cur2.line) { - return true; - } - if (cur1.line == cur2.line && cur1.ch < cur2.ch) { - return true; - } - return false; - } - function cursorMin(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur1 : cur2; - } - function cursorMax(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur2 : cur1; - } - function cursorIsBetween(cur1, cur2, cur3) { - // returns true if cur2 is between cur1 and cur3. - var cur1before2 = cursorIsBefore(cur1, cur2); - var cur2before3 = cursorIsBefore(cur2, cur3); - return cur1before2 && cur2before3; - } - function lineLength(cm, lineNum) { - return cm.getLine(lineNum).length; - } - function reverse(s){ - return s.split('').reverse().join(''); - } - function trim(s) { - if (s.trim) { - return s.trim(); - } - return s.replace(/^\s+|\s+$/g, ''); - } - function escapeRegex(s) { - return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1'); - } - function extendLineToColumn(cm, lineNum, column) { - var endCh = lineLength(cm, lineNum); - var spaces = new Array(column-endCh+1).join(' '); - cm.setCursor(Pos(lineNum, endCh)); - cm.replaceRange(spaces, cm.getCursor()); - } - // This functions selects a rectangular block - // of text with selectionEnd as any of its corner - // Height of block: - // Difference in selectionEnd.line and first/last selection.line - // Width of the block: - // Distance between selectionEnd.ch and any(first considered here) selection.ch - function selectBlock(cm, selectionEnd) { - var selections = [], ranges = cm.listSelections(); - var head = copyCursor(cm.clipPos(selectionEnd)); - var isClipped = !cursorEqual(selectionEnd, head); - var curHead = cm.getCursor('head'); - var primIndex = getIndex(ranges, curHead); - var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor); - var max = ranges.length - 1; - var index = max - primIndex > primIndex ? max : 0; - var base = ranges[index].anchor; - - var firstLine = Math.min(base.line, head.line); - var lastLine = Math.max(base.line, head.line); - var baseCh = base.ch, headCh = head.ch; - - var dir = ranges[index].head.ch - baseCh; - var newDir = headCh - baseCh; - if (dir > 0 && newDir <= 0) { - baseCh++; - if (!isClipped) { headCh--; } - } else if (dir < 0 && newDir >= 0) { - baseCh--; - if (!wasClipped) { headCh++; } - } else if (dir < 0 && newDir == -1) { - baseCh--; - headCh++; - } - for (var line = firstLine; line <= lastLine; line++) { - var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)}; - selections.push(range); - } - primIndex = head.line == lastLine ? selections.length - 1 : 0; - cm.setSelections(selections); - selectionEnd.ch = headCh; - base.ch = baseCh; - return base; - } - function selectForInsert(cm, head, height) { - var sel = []; - for (var i = 0; i < height; i++) { - var lineHead = offsetCursor(head, i, 0); - sel.push({anchor: lineHead, head: lineHead}); - } - cm.setSelections(sel, 0); - } - // getIndex returns the index of the cursor in the selections. - function getIndex(ranges, cursor, end) { - for (var i = 0; i < ranges.length; i++) { - var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor); - var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor); - if (atAnchor || atHead) { - return i; - } - } - return -1; - } - function getSelectedAreaRange(cm, vim) { - var lastSelection = vim.lastSelection; - var getCurrentSelectedAreaRange = function() { - var selections = cm.listSelections(); - var start = selections[0]; - var end = selections[selections.length-1]; - var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head; - var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor; - return [selectionStart, selectionEnd]; - }; - var getLastSelectedAreaRange = function() { - var selectionStart = cm.getCursor(); - var selectionEnd = cm.getCursor(); - var block = lastSelection.visualBlock; - if (block) { - var width = block.width; - var height = block.height; - selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width); - var selections = []; - // selectBlock creates a 'proper' rectangular block. - // We do not want that in all cases, so we manually set selections. - for (var i = selectionStart.line; i < selectionEnd.line; i++) { - var anchor = Pos(i, selectionStart.ch); - var head = Pos(i, selectionEnd.ch); - var range = {anchor: anchor, head: head}; - selections.push(range); - } - cm.setSelections(selections); - } else { - var start = lastSelection.anchorMark.find(); - var end = lastSelection.headMark.find(); - var line = end.line - start.line; - var ch = end.ch - start.ch; - selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch}; - if (lastSelection.visualLine) { - selectionStart = Pos(selectionStart.line, 0); - selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line)); - } - cm.setSelection(selectionStart, selectionEnd); - } - return [selectionStart, selectionEnd]; - }; - if (!vim.visualMode) { - // In case of replaying the action. - return getLastSelectedAreaRange(); - } else { - return getCurrentSelectedAreaRange(); - } - } - // Updates the previous selection with the current selection's values. This - // should only be called in visual mode. - function updateLastSelection(cm, vim) { - var anchor = vim.sel.anchor; - var head = vim.sel.head; - // To accommodate the effect of lastPastedText in the last selection - if (vim.lastPastedText) { - head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); - vim.lastPastedText = null; - } - vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), - 'headMark': cm.setBookmark(head), - 'anchor': copyCursor(anchor), - 'head': copyCursor(head), - 'visualMode': vim.visualMode, - 'visualLine': vim.visualLine, - 'visualBlock': vim.visualBlock}; - } - function expandSelection(cm, start, end) { - var sel = cm.state.vim.sel; - var head = sel.head; - var anchor = sel.anchor; - var tmp; - if (cursorIsBefore(end, start)) { - tmp = end; - end = start; - start = tmp; - } - if (cursorIsBefore(head, anchor)) { - head = cursorMin(start, head); - anchor = cursorMax(anchor, end); - } else { - anchor = cursorMin(start, anchor); - head = cursorMax(head, end); - head = offsetCursor(head, 0, -1); - if (head.ch == -1 && head.line != cm.firstLine()) { - head = Pos(head.line - 1, lineLength(cm, head.line - 1)); - } - } - return [anchor, head]; - } - /** - * Updates the CodeMirror selection to match the provided vim selection. - * If no arguments are given, it uses the current vim selection state. - */ - function updateCmSelection(cm, sel, mode) { - var vim = cm.state.vim; - sel = sel || vim.sel; - var mode = mode || - vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char'; - var cmSel = makeCmSelection(cm, sel, mode); - cm.setSelections(cmSel.ranges, cmSel.primary); - updateFakeCursor(cm); - } - function makeCmSelection(cm, sel, mode, exclusive) { - var head = copyCursor(sel.head); - var anchor = copyCursor(sel.anchor); - if (mode == 'char') { - var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - head = offsetCursor(sel.head, 0, headOffset); - anchor = offsetCursor(sel.anchor, 0, anchorOffset); - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'line') { - if (!cursorIsBefore(sel.head, sel.anchor)) { - anchor.ch = 0; - - var lastLine = cm.lastLine(); - if (head.line > lastLine) { - head.line = lastLine; - } - head.ch = lineLength(cm, head.line); - } else { - head.ch = 0; - anchor.ch = lineLength(cm, anchor.line); - } - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'block') { - var top = Math.min(anchor.line, head.line), - left = Math.min(anchor.ch, head.ch), - bottom = Math.max(anchor.line, head.line), - right = Math.max(anchor.ch, head.ch) + 1; - var height = bottom - top + 1; - var primary = head.line == top ? 0 : height - 1; - var ranges = []; - for (var i = 0; i < height; i++) { - ranges.push({ - anchor: Pos(top + i, left), - head: Pos(top + i, right) - }); - } - return { - ranges: ranges, - primary: primary - }; - } - } - function getHead(cm) { - var cur = cm.getCursor('head'); - if (cm.getSelection().length == 1) { - // Small corner case when only 1 character is selected. The "real" - // head is the left of head and anchor. - cur = cursorMin(cur, cm.getCursor('anchor')); - } - return cur; - } - - /** - * If moveHead is set to false, the CodeMirror selection will not be - * touched. The caller assumes the responsibility of putting the cursor - * in the right place. - */ - function exitVisualMode(cm, moveHead) { - var vim = cm.state.vim; - if (moveHead !== false) { - cm.setCursor(clipCursorToContent(cm, vim.sel.head)); - } - updateLastSelection(cm, vim); - vim.visualMode = false; - vim.visualLine = false; - vim.visualBlock = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - } - - // Remove any trailing newlines from the selection. For - // example, with the caret at the start of the last word on the line, - // 'dw' should word, but not the newline, while 'w' should advance the - // caret to the first character of the next line. - function clipToLine(cm, curStart, curEnd) { - var selection = cm.getRange(curStart, curEnd); - // Only clip if the selection ends with trailing newline + whitespace - if (/\n\s*$/.test(selection)) { - var lines = selection.split('\n'); - // We know this is all whitepsace. - lines.pop(); - - // Cases: - // 1. Last word is an empty line - do not clip the trailing '\n' - // 2. Last word is not an empty line - clip the trailing '\n' - var line; - // Find the line containing the last word, and clip all whitespace up - // to it. - for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) { - curEnd.line--; - curEnd.ch = 0; - } - // If the last word is not an empty line, clip an additional newline - if (line) { - curEnd.line--; - curEnd.ch = lineLength(cm, curEnd.line); - } else { - curEnd.ch = 0; - } - } - } - - // Expand the selection to line ends. - function expandSelectionToLine(_cm, curStart, curEnd) { - curStart.ch = 0; - curEnd.ch = 0; - curEnd.line++; - } - - function findFirstNonWhiteSpaceCharacter(text) { - if (!text) { - return 0; - } - var firstNonWS = text.search(/\S/); - return firstNonWS == -1 ? text.length : firstNonWS; - } - - function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) { - var cur = getHead(cm); - var line = cm.getLine(cur.line); - var idx = cur.ch; - - // Seek to first word or non-whitespace character, depending on if - // noSymbol is true. - var textAfterIdx = line.substring(idx); - var firstMatchedChar; - if (noSymbol) { - firstMatchedChar = textAfterIdx.search(/\w/); - } else { - firstMatchedChar = textAfterIdx.search(/\S/); - } - if (firstMatchedChar == -1) { - return null; - } - idx += firstMatchedChar; - textAfterIdx = line.substring(idx); - var textBeforeIdx = line.substring(0, idx); - - var matchRegex; - // Greedy matchers for the "word" we are trying to expand. - if (bigWord) { - matchRegex = /^\S+/; - } else { - if ((/\w/).test(line.charAt(idx))) { - matchRegex = /^\w+/; - } else { - matchRegex = /^[^\w\s]+/; - } - } - - var wordAfterRegex = matchRegex.exec(textAfterIdx); - var wordStart = idx; - var wordEnd = idx + wordAfterRegex[0].length; - // TODO: Find a better way to do this. It will be slow on very long lines. - var revTextBeforeIdx = reverse(textBeforeIdx); - var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx); - if (wordBeforeRegex) { - wordStart -= wordBeforeRegex[0].length; - } - - if (inclusive) { - // If present, trim all whitespace after word. - // Otherwise, trim all whitespace before word. - var textAfterWordEnd = line.substring(wordEnd); - var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length; - if (whitespacesAfterWord > 0) { - wordEnd += whitespacesAfterWord; - } else { - var revTrim = revTextBeforeIdx.length - wordStart; - var textBeforeWordStart = revTextBeforeIdx.substring(revTrim); - var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length; - wordStart -= whitespacesBeforeWord; - } - } - - return { start: Pos(cur.line, wordStart), - end: Pos(cur.line, wordEnd) }; - } - - function recordJumpPosition(cm, oldCur, newCur) { - if (!cursorEqual(oldCur, newCur)) { - vimGlobalState.jumpList.add(cm, oldCur, newCur); - } - } - - function recordLastCharacterSearch(increment, args) { - vimGlobalState.lastChararacterSearch.increment = increment; - vimGlobalState.lastChararacterSearch.forward = args.forward; - vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter; - } - - var symbolToMode = { - '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket', - '[': 'section', ']': 'section', - '*': 'comment', '/': 'comment', - 'm': 'method', 'M': 'method', - '#': 'preprocess' - }; - var findSymbolModes = { - bracket: { - isComplete: function(state) { - if (state.nextCh === state.symb) { - state.depth++; - if (state.depth >= 1)return true; - } else if (state.nextCh === state.reverseSymb) { - state.depth--; - } - return false; - } - }, - section: { - init: function(state) { - state.curMoveThrough = true; - state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}'; - }, - isComplete: function(state) { - return state.index === 0 && state.nextCh === state.symb; - } - }, - comment: { - isComplete: function(state) { - var found = state.lastCh === '*' && state.nextCh === '/'; - state.lastCh = state.nextCh; - return found; - } - }, - // TODO: The original Vim implementation only operates on level 1 and 2. - // The current implementation doesn't check for code block level and - // therefore it operates on any levels. - method: { - init: function(state) { - state.symb = (state.symb === 'm' ? '{' : '}'); - state.reverseSymb = state.symb === '{' ? '}' : '{'; - }, - isComplete: function(state) { - if (state.nextCh === state.symb)return true; - return false; - } - }, - preprocess: { - init: function(state) { - state.index = 0; - }, - isComplete: function(state) { - if (state.nextCh === '#') { - var token = state.lineText.match(/#(\w+)/)[1]; - if (token === 'endif') { - if (state.forward && state.depth === 0) { - return true; - } - state.depth++; - } else if (token === 'if') { - if (!state.forward && state.depth === 0) { - return true; - } - state.depth--; - } - if (token === 'else' && state.depth === 0)return true; - } - return false; - } - } - }; - function findSymbol(cm, repeat, forward, symb) { - var cur = copyCursor(cm.getCursor()); - var increment = forward ? 1 : -1; - var endLine = forward ? cm.lineCount() : -1; - var curCh = cur.ch; - var line = cur.line; - var lineText = cm.getLine(line); - var state = { - lineText: lineText, - nextCh: lineText.charAt(curCh), - lastCh: null, - index: curCh, - symb: symb, - reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb], - forward: forward, - depth: 0, - curMoveThrough: false - }; - var mode = symbolToMode[symb]; - if (!mode)return cur; - var init = findSymbolModes[mode].init; - var isComplete = findSymbolModes[mode].isComplete; - if (init) { init(state); } - while (line !== endLine && repeat) { - state.index += increment; - state.nextCh = state.lineText.charAt(state.index); - if (!state.nextCh) { - line += increment; - state.lineText = cm.getLine(line) || ''; - if (increment > 0) { - state.index = 0; - } else { - var lineLen = state.lineText.length; - state.index = (lineLen > 0) ? (lineLen-1) : 0; - } - state.nextCh = state.lineText.charAt(state.index); - } - if (isComplete(state)) { - cur.line = line; - cur.ch = state.index; - repeat--; - } - } - if (state.nextCh || state.curMoveThrough) { - return Pos(line, state.index); - } - return cur; - } - - /* - * Returns the boundaries of the next word. If the cursor in the middle of - * the word, then returns the boundaries of the current word, starting at - * the cursor. If the cursor is at the start/end of a word, and we are going - * forward/backward, respectively, find the boundaries of the next word. - * - * @param {CodeMirror} cm CodeMirror object. - * @param {Cursor} cur The cursor position. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only [a-zA-Z0-9] characters count as part of the word. - * @param {boolean} emptyLineIsWord True if empty lines should be treated - * as words. - * @return {Object{from:number, to:number, line: number}} The boundaries of - * the word, or null if there are no more words. - */ - function findWord(cm, cur, forward, bigWord, emptyLineIsWord) { - var lineNum = cur.line; - var pos = cur.ch; - var line = cm.getLine(lineNum); - var dir = forward ? 1 : -1; - var regexps = bigWord ? bigWordRegexp : wordRegexp; - - if (emptyLineIsWord && line == '') { - lineNum += dir; - line = cm.getLine(lineNum); - if (!isLine(cm, lineNum)) { - return null; - } - pos = (forward) ? 0 : line.length; - } - - while (true) { - if (emptyLineIsWord && line == '') { - return { from: 0, to: 0, line: lineNum }; - } - var stop = (dir > 0) ? line.length : -1; - var wordStart = stop, wordEnd = stop; - // Find bounds of next word. - while (pos != stop) { - var foundWord = false; - for (var i = 0; i < regexps.length && !foundWord; ++i) { - if (regexps[i].test(line.charAt(pos))) { - wordStart = pos; - // Advance to end of word. - while (pos != stop && regexps[i].test(line.charAt(pos))) { - pos += dir; - } - wordEnd = pos; - foundWord = wordStart != wordEnd; - if (wordStart == cur.ch && lineNum == cur.line && - wordEnd == wordStart + dir) { - // We started at the end of a word. Find the next one. - continue; - } else { - return { - from: Math.min(wordStart, wordEnd + 1), - to: Math.max(wordStart, wordEnd), - line: lineNum }; - } - } - } - if (!foundWord) { - pos += dir; - } - } - // Advance to next/prev line. - lineNum += dir; - if (!isLine(cm, lineNum)) { - return null; - } - line = cm.getLine(lineNum); - pos = (dir > 0) ? 0 : line.length; - } - // Should never get here. - throw new Error('The impossible happened.'); - } - - /** - * @param {CodeMirror} cm CodeMirror object. - * @param {Pos} cur The position to start from. - * @param {int} repeat Number of words to move past. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} wordEnd True to move to end of word. False to move to - * beginning of word. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only alphabet characters count as part of the word. - * @return {Cursor} The position the cursor should move to. - */ - function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) { - var curStart = copyCursor(cur); - var words = []; - if (forward && !wordEnd || !forward && wordEnd) { - repeat++; - } - // For 'e', empty lines are not considered words, go figure. - var emptyLineIsWord = !(forward && wordEnd); - for (var i = 0; i < repeat; i++) { - var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord); - if (!word) { - var eodCh = lineLength(cm, cm.lastLine()); - words.push(forward - ? {line: cm.lastLine(), from: eodCh, to: eodCh} - : {line: 0, from: 0, to: 0}); - break; - } - words.push(word); - cur = Pos(word.line, forward ? (word.to - 1) : word.from); - } - var shortCircuit = words.length != repeat; - var firstWord = words[0]; - var lastWord = words.pop(); - if (forward && !wordEnd) { - // w - if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.from); - } else if (forward && wordEnd) { - return Pos(lastWord.line, lastWord.to - 1); - } else if (!forward && wordEnd) { - // ge - if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.to); - } else { - // b - return Pos(lastWord.line, lastWord.from); - } - } - - function moveToCharacter(cm, repeat, forward, character) { - var cur = cm.getCursor(); - var start = cur.ch; - var idx; - for (var i = 0; i < repeat; i ++) { - var line = cm.getLine(cur.line); - idx = charIdxInLine(start, line, character, forward, true); - if (idx == -1) { - return null; - } - start = idx; - } - return Pos(cm.getCursor().line, idx); - } - - function moveToColumn(cm, repeat) { - // repeat is always >= 1, so repeat - 1 always corresponds - // to the column we want to go to. - var line = cm.getCursor().line; - return clipCursorToContent(cm, Pos(line, repeat - 1)); - } - - function updateMark(cm, vim, markName, pos) { - if (!inArray(markName, validMarks)) { - return; - } - if (vim.marks[markName]) { - vim.marks[markName].clear(); - } - vim.marks[markName] = cm.setBookmark(pos); - } - - function charIdxInLine(start, line, character, forward, includeChar) { - // Search for char in line. - // motion_options: {forward, includeChar} - // If includeChar = true, include it too. - // If forward = true, search forward, else search backwards. - // If char is not found on this line, do nothing - var idx; - if (forward) { - idx = line.indexOf(character, start + 1); - if (idx != -1 && !includeChar) { - idx -= 1; - } - } else { - idx = line.lastIndexOf(character, start - 1); - if (idx != -1 && !includeChar) { - idx += 1; - } - } - return idx; - } - - function findParagraph(cm, head, repeat, dir, inclusive) { - var line = head.line; - var min = cm.firstLine(); - var max = cm.lastLine(); - var start, end, i = line; - function isEmpty(i) { return !cm.getLine(i); } - function isBoundary(i, dir, any) { - if (any) { return isEmpty(i) != isEmpty(i + dir); } - return !isEmpty(i) && isEmpty(i + dir); - } - if (dir) { - while (min <= i && i <= max && repeat > 0) { - if (isBoundary(i, dir)) { repeat--; } - i += dir; - } - return new Pos(i, 0); - } - - var vim = cm.state.vim; - if (vim.visualLine && isBoundary(line, 1, true)) { - var anchor = vim.sel.anchor; - if (isBoundary(anchor.line, -1, true)) { - if (!inclusive || anchor.line != line) { - line += 1; - } - } - } - var startState = isEmpty(line); - for (i = line; i <= max && repeat; i++) { - if (isBoundary(i, 1, true)) { - if (!inclusive || isEmpty(i) != startState) { - repeat--; - } - } - } - end = new Pos(i, 0); - // select boundary before paragraph for the last one - if (i > max && !startState) { startState = true; } - else { inclusive = false; } - for (i = line; i > min; i--) { - if (!inclusive || isEmpty(i) == startState || i == line) { - if (isBoundary(i, -1, true)) { break; } - } - } - start = new Pos(i, 0); - return { start: start, end: end }; - } - - // TODO: perhaps this finagling of start and end positions belonds - // in codmirror/replaceRange? - function selectCompanionObject(cm, head, symb, inclusive) { - var cur = head, start, end; - - var bracketRegexp = ({ - '(': /[()]/, ')': /[()]/, - '[': /[[\]]/, ']': /[[\]]/, - '{': /[{}]/, '}': /[{}]/})[symb]; - var openSym = ({ - '(': '(', ')': '(', - '[': '[', ']': '[', - '{': '{', '}': '{'})[symb]; - var curChar = cm.getLine(cur.line).charAt(cur.ch); - // Due to the behavior of scanForBracket, we need to add an offset if the - // cursor is on a matching open bracket. - var offset = curChar === openSym ? 1 : 0; - - start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp}); - end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp}); - - if (!start || !end) { - return { start: cur, end: cur }; - } - - start = start.pos; - end = end.pos; - - if ((start.line == end.line && start.ch > end.ch) - || (start.line > end.line)) { - var tmp = start; - start = end; - end = tmp; - } - - if (inclusive) { - end.ch += 1; - } else { - start.ch += 1; - } - - return { start: start, end: end }; - } - - // Takes in a symbol and a cursor and tries to simulate text objects that - // have identical opening and closing symbols - // TODO support across multiple lines - function findBeginningAndEnd(cm, head, symb, inclusive) { - var cur = copyCursor(head); - var line = cm.getLine(cur.line); - var chars = line.split(''); - var start, end, i, len; - var firstIndex = chars.indexOf(symb); - - // the decision tree is to always look backwards for the beginning first, - // but if the cursor is in front of the first instance of the symb, - // then move the cursor forward - if (cur.ch < firstIndex) { - cur.ch = firstIndex; - // Why is this line even here??? - // cm.setCursor(cur.line, firstIndex+1); - } - // otherwise if the cursor is currently on the closing symbol - else if (firstIndex < cur.ch && chars[cur.ch] == symb) { - end = cur.ch; // assign end to the current cursor - --cur.ch; // make sure to look backwards - } - - // if we're currently on the symbol, we've got a start - if (chars[cur.ch] == symb && !end) { - start = cur.ch + 1; // assign start to ahead of the cursor - } else { - // go backwards to find the start - for (i = cur.ch; i > -1 && !start; i--) { - if (chars[i] == symb) { - start = i + 1; - } - } - } - - // look forwards for the end symbol - if (start && !end) { - for (i = start, len = chars.length; i < len && !end; i++) { - if (chars[i] == symb) { - end = i; - } - } - } - - // nothing found - if (!start || !end) { - return { start: cur, end: cur }; - } - - // include the symbols - if (inclusive) { - --start; ++end; - } - - return { - start: Pos(cur.line, start), - end: Pos(cur.line, end) - }; - } - - // Search functions - defineOption('pcre', true, 'boolean'); - function SearchState() {} - SearchState.prototype = { - getQuery: function() { - return vimGlobalState.query; - }, - setQuery: function(query) { - vimGlobalState.query = query; - }, - getOverlay: function() { - return this.searchOverlay; - }, - setOverlay: function(overlay) { - this.searchOverlay = overlay; - }, - isReversed: function() { - return vimGlobalState.isReversed; - }, - setReversed: function(reversed) { - vimGlobalState.isReversed = reversed; - } - }; - function getSearchState(cm) { - var vim = cm.state.vim; - return vim.searchState_ || (vim.searchState_ = new SearchState()); - } - function dialog(cm, template, shortText, onClose, options) { - if (cm.openDialog) { - cm.openDialog(template, onClose, { bottom: true, value: options.value, - onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp }); - } - else { - onClose(prompt(shortText, '')); - } - } - function splitBySlash(argString) { - var slashes = findUnescapedSlashes(argString) || []; - if (!slashes.length) return []; - var tokens = []; - // in case of strings like foo/bar - if (slashes[0] !== 0) return; - for (var i = 0; i < slashes.length; i++) { - if (typeof slashes[i] == 'number') - tokens.push(argString.substring(slashes[i] + 1, slashes[i+1])); - } - return tokens; - } - - function findUnescapedSlashes(str) { - var escapeNextChar = false; - var slashes = []; - for (var i = 0; i < str.length; i++) { - var c = str.charAt(i); - if (!escapeNextChar && c == '/') { - slashes.push(i); - } - escapeNextChar = !escapeNextChar && (c == '\\'); - } - return slashes; - } - - // Translates a search string from ex (vim) syntax into javascript form. - function translateRegex(str) { - // When these match, add a '\' if unescaped or remove one if escaped. - var specials = '|(){'; - // Remove, but never add, a '\' for these. - var unescape = '}'; - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - var specialComesNext = (n && specials.indexOf(n) != -1); - if (escapeNextChar) { - if (c !== '\\' || !specialComesNext) { - out.push(c); - } - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - // Treat the unescape list as special for removing, but not adding '\'. - if (n && unescape.indexOf(n) != -1) { - specialComesNext = true; - } - // Not passing this test means removing a '\'. - if (!specialComesNext || n === '\\') { - out.push(c); - } - } else { - out.push(c); - if (specialComesNext && n !== '\\') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Translates the replace part of a search and replace from ex (vim) syntax into - // javascript form. Similar to translateRegex, but additionally fixes back references - // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. - function translateRegexReplace(str) { - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - if (escapeNextChar) { - // At any point in the loop, escapeNextChar is true if the previous - // character was a '\' and was not escaped. - out.push(c); - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - if ((isNumber(n) || n === '$')) { - out.push('$'); - } else if (n !== '/' && n !== '\\') { - out.push('\\'); - } - } else { - if (c === '$') { - out.push('$'); - } - out.push(c); - if (n === '/') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Unescape \ and / in the replace part, for PCRE mode. - function unescapeRegexReplace(str) { - var stream = new CodeMirror.StringStream(str); - var output = []; - while (!stream.eol()) { - // Search for \. - while (stream.peek() && stream.peek() != '\\') { - output.push(stream.next()); - } - if (stream.match('\\/', true)) { - // \/ => / - output.push('/'); - } else if (stream.match('\\\\', true)) { - // \\ => \ - output.push('\\'); - } else { - // Don't change anything - output.push(stream.next()); - } - } - return output.join(''); - } - - /** - * Extract the regular expression from the query and return a Regexp object. - * Returns null if the query is blank. - * If ignoreCase is passed in, the Regexp object will have the 'i' flag set. - * If smartCase is passed in, and the query contains upper case letters, - * then ignoreCase is overridden, and the 'i' flag will not be set. - * If the query contains the /i in the flag part of the regular expression, - * then both ignoreCase and smartCase are ignored, and 'i' will be passed - * through to the Regex object. - */ - function parseQuery(query, ignoreCase, smartCase) { - // First update the last search register - var lastSearchRegister = vimGlobalState.registerController.getRegister('/'); - lastSearchRegister.setText(query); - // Check if the query is already a regex. - if (query instanceof RegExp) { return query; } - // First try to extract regex + flags from the input. If no flags found, - // extract just the regex. IE does not accept flags directly defined in - // the regex string in the form /regex/flags - var slashes = findUnescapedSlashes(query); - var regexPart; - var forceIgnoreCase; - if (!slashes.length) { - // Query looks like 'regexp' - regexPart = query; - } else { - // Query looks like 'regexp/...' - regexPart = query.substring(0, slashes[0]); - var flagsPart = query.substring(slashes[0]); - forceIgnoreCase = (flagsPart.indexOf('i') != -1); - } - if (!regexPart) { - return null; - } - if (!getOption('pcre')) { - regexPart = translateRegex(regexPart); - } - if (smartCase) { - ignoreCase = (/^[^A-Z]*$/).test(regexPart); - } - var regexp = new RegExp(regexPart, - (ignoreCase || forceIgnoreCase) ? 'i' : undefined); - return regexp; - } - function showConfirm(cm, text) { - if (cm.openNotification) { - cm.openNotification('' + text + '', - {bottom: true, duration: 5000}); - } else { - alert(text); - } - } - function makePrompt(prefix, desc) { - var raw = ''; - if (prefix) { - raw += '' + prefix + ''; - } - raw += ' ' + - ''; - if (desc) { - raw += ''; - raw += desc; - raw += ''; - } - return raw; - } - var searchPromptDesc = '(Javascript regexp)'; - function showPrompt(cm, options) { - var shortText = (options.prefix || '') + ' ' + (options.desc || ''); - var prompt = makePrompt(options.prefix, options.desc); - dialog(cm, prompt, shortText, options.onClose, options); - } - function regexEqual(r1, r2) { - if (r1 instanceof RegExp && r2 instanceof RegExp) { - var props = ['global', 'multiline', 'ignoreCase', 'source']; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (r1[prop] !== r2[prop]) { - return false; - } - } - return true; - } - return false; - } - // Returns true if the query is valid. - function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) { - if (!rawQuery) { - return; - } - var state = getSearchState(cm); - var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase); - if (!query) { - return; - } - highlightSearchMatches(cm, query); - if (regexEqual(query, state.getQuery())) { - return query; - } - state.setQuery(query); - return query; - } - function searchOverlay(query) { - if (query.source.charAt(0) == '^') { - var matchSol = true; - } - return { - token: function(stream) { - if (matchSol && !stream.sol()) { - stream.skipToEnd(); - return; - } - var match = stream.match(query, false); - if (match) { - if (match[0].length == 0) { - // Matched empty string, skip to next. - stream.next(); - return 'searching'; - } - if (!stream.sol()) { - // Backtrack 1 to match \b - stream.backUp(1); - if (!query.exec(stream.next() + match[0])) { - stream.next(); - return null; - } - } - stream.match(query); - return 'searching'; - } - while (!stream.eol()) { - stream.next(); - if (stream.match(query, false)) break; - } - }, - query: query - }; - } - function highlightSearchMatches(cm, query) { - var overlay = getSearchState(cm).getOverlay(); - if (!overlay || query != overlay.query) { - if (overlay) { - cm.removeOverlay(overlay); - } - overlay = searchOverlay(query); - cm.addOverlay(overlay); - getSearchState(cm).setOverlay(overlay); - } - } - function findNext(cm, prev, query, repeat) { - if (repeat === undefined) { repeat = 1; } - return cm.operation(function() { - var pos = cm.getCursor(); - var cursor = cm.getSearchCursor(query, pos); - for (var i = 0; i < repeat; i++) { - var found = cursor.find(prev); - if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); } - if (!found) { - // SearchCursor may have returned null because it hit EOF, wrap - // around and try again. - cursor = cm.getSearchCursor(query, - (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) ); - if (!cursor.find(prev)) { - return; - } - } - } - return cursor.from(); - }); - } - function clearSearchHighlight(cm) { - cm.removeOverlay(getSearchState(cm).getOverlay()); - getSearchState(cm).setOverlay(null); - } - /** - * Check if pos is in the specified range, INCLUSIVE. - * Range can be specified with 1 or 2 arguments. - * If the first range argument is an array, treat it as an array of line - * numbers. Match pos against any of the lines. - * If the first range argument is a number, - * if there is only 1 range argument, check if pos has the same line - * number - * if there are 2 range arguments, then check if pos is in between the two - * range arguments. - */ - function isInRange(pos, start, end) { - if (typeof pos != 'number') { - // Assume it is a cursor position. Get the line number. - pos = pos.line; - } - if (start instanceof Array) { - return inArray(pos, start); - } else { - if (end) { - return (pos >= start && pos <= end); - } else { - return pos == start; - } - } - } - function getUserVisibleLines(cm) { - var renderer = cm.ace.renderer; - return { - top: renderer.getFirstFullyVisibleRow(), - bottom: renderer.getLastFullyVisibleRow() - } - } - - // Ex command handling - // Care must be taken when adding to the default Ex command map. For any - // pair of commands that have a shared prefix, at least one of their - // shortNames must not match the prefix of the other command. - var defaultExCommandMap = [ - { name: 'map' }, - { name: 'imap', shortName: 'im' }, - { name: 'nmap', shortName: 'nm' }, - { name: 'vmap', shortName: 'vm' }, - { name: 'unmap' }, - { name: 'write', shortName: 'w' }, - { name: 'undo', shortName: 'u' }, - { name: 'redo', shortName: 'red' }, - { name: 'set', shortName: 'set' }, - { name: 'sort', shortName: 'sor' }, - { name: 'substitute', shortName: 's', possiblyAsync: true }, - { name: 'nohlsearch', shortName: 'noh' }, - { name: 'delmarks', shortName: 'delm' }, - { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, - { name: 'global', shortName: 'g' } - ]; - var ExCommandDispatcher = function() { - this.buildCommandMap_(); - }; - ExCommandDispatcher.prototype = { - processCommand: function(cm, input, opt_params) { - var vim = cm.state.vim; - var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); - var previousCommand = commandHistoryRegister.toString(); - if (vim.visualMode) { - exitVisualMode(cm); - } - var inputStream = new CodeMirror.StringStream(input); - // update ": with the latest command whether valid or invalid - commandHistoryRegister.setText(input); - var params = opt_params || {}; - params.input = input; - try { - this.parseInput_(cm, inputStream, params); - } catch(e) { - showConfirm(cm, e); - throw e; - } - var command; - var commandName; - if (!params.commandName) { - // If only a line range is defined, move to the line. - if (params.line !== undefined) { - commandName = 'move'; - } - } else { - command = this.matchCommand_(params.commandName); - if (command) { - commandName = command.name; - if (command.excludeFromCommandHistory) { - commandHistoryRegister.setText(previousCommand); - } - this.parseCommandArgs_(inputStream, params, command); - if (command.type == 'exToKey') { - // Handle Ex to Key mapping. - for (var i = 0; i < command.toKeys.length; i++) { - CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping'); - } - return; - } else if (command.type == 'exToEx') { - // Handle Ex to Ex mapping. - this.processCommand(cm, command.toInput); - return; - } - } - } - if (!commandName) { - showConfirm(cm, 'Not an editor command ":' + input + '"'); - return; - } - try { - exCommands[commandName](cm, params); - // Possibly asynchronous commands (e.g. substitute, which might have a - // user confirmation), are responsible for calling the callback when - // done. All others have it taken care of for them here. - if ((!command || !command.possiblyAsync) && params.callback) { - params.callback(); - } - } catch(e) { - showConfirm(cm, e); - throw e; - } - }, - parseInput_: function(cm, inputStream, result) { - inputStream.eatWhile(':'); - // Parse range. - if (inputStream.eat('%')) { - result.line = cm.firstLine(); - result.lineEnd = cm.lastLine(); - } else { - result.line = this.parseLineSpec_(cm, inputStream); - if (result.line !== undefined && inputStream.eat(',')) { - result.lineEnd = this.parseLineSpec_(cm, inputStream); - } - } - - // Parse command name. - var commandMatch = inputStream.match(/^(\w+)/); - if (commandMatch) { - result.commandName = commandMatch[1]; - } else { - result.commandName = inputStream.match(/.*/)[0]; - } - - return result; - }, - parseLineSpec_: function(cm, inputStream) { - var numberMatch = inputStream.match(/^(\d+)/); - if (numberMatch) { - return parseInt(numberMatch[1], 10) - 1; - } - switch (inputStream.next()) { - case '.': - return cm.getCursor().line; - case '$': - return cm.lastLine(); - case '\'': - var mark = cm.state.vim.marks[inputStream.next()]; - if (mark && mark.find()) { - return mark.find().line; - } - throw new Error('Mark not set'); - default: - inputStream.backUp(1); - return undefined; - } - }, - parseCommandArgs_: function(inputStream, params, command) { - if (inputStream.eol()) { - return; - } - params.argString = inputStream.match(/.*/)[0]; - // Parse command-line arguments - var delim = command.argDelimiter || /\s+/; - var args = trim(params.argString).split(delim); - if (args.length && args[0]) { - params.args = args; - } - }, - matchCommand_: function(commandName) { - // Return the command in the command map that matches the shortest - // prefix of the passed in command name. The match is guaranteed to be - // unambiguous if the defaultExCommandMap's shortNames are set up - // correctly. (see @code{defaultExCommandMap}). - for (var i = commandName.length; i > 0; i--) { - var prefix = commandName.substring(0, i); - if (this.commandMap_[prefix]) { - var command = this.commandMap_[prefix]; - if (command.name.indexOf(commandName) === 0) { - return command; - } - } - } - return null; - }, - buildCommandMap_: function() { - this.commandMap_ = {}; - for (var i = 0; i < defaultExCommandMap.length; i++) { - var command = defaultExCommandMap[i]; - var key = command.shortName || command.name; - this.commandMap_[key] = command; - } - }, - map: function(lhs, rhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (rhs != ':' && rhs.charAt(0) == ':') { - // Ex to Ex mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToEx', - toInput: rhs.substring(1), - user: true - }; - } else { - // Ex to key mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToKey', - toKeys: rhs, - user: true - }; - } - } else { - if (rhs != ':' && rhs.charAt(0) == ':') { - // Key to Ex mapping. - var mapping = { - keys: lhs, - type: 'keyToEx', - exArgs: { input: rhs.substring(1) }, - user: true}; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } else { - // Key to key mapping - var mapping = { - keys: lhs, - type: 'keyToKey', - toKeys: rhs, - user: true - }; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } - } - }, - unmap: function(lhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - // Ex to Ex or Ex to key mapping - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (this.commandMap_[commandName] && this.commandMap_[commandName].user) { - delete this.commandMap_[commandName]; - return; - } - } else { - // Key to Ex or key to key mapping - var keys = lhs; - for (var i = 0; i < defaultKeymap.length; i++) { - if (keys == defaultKeymap[i].keys - && defaultKeymap[i].context === ctx - && defaultKeymap[i].user) { - defaultKeymap.splice(i, 1); - return; - } - } - } - throw Error('No such mapping.'); - } - }; - - var exCommands = { - map: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 2) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx); - }, - imap: function(cm, params) { this.map(cm, params, 'insert'); }, - nmap: function(cm, params) { this.map(cm, params, 'normal'); }, - vmap: function(cm, params) { this.map(cm, params, 'visual'); }, - unmap: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 1) { - if (cm) { - showConfirm(cm, 'No such mapping: ' + params.input); - } - return; - } - exCommandDispatcher.unmap(mapArgs[0], ctx); - }, - move: function(cm, params) { - commandDispatcher.processCommand(cm, cm.state.vim, { - type: 'motion', - motion: 'moveToLineOrEdgeOfDocument', - motionArgs: { forward: false, explicitRepeat: true, - linewise: true }, - repeatOverride: params.line+1}); - }, - set: function(cm, params) { - var setArgs = params.args; - if (!setArgs || setArgs.length < 1) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - var expr = setArgs[0].split('='); - var optionName = expr[0]; - var value = expr[1]; - var forceGet = false; - - if (optionName.charAt(optionName.length - 1) == '?') { - // If post-fixed with ?, then the set is actually a get. - if (value) { throw Error('Trailing characters: ' + params.argString); } - optionName = optionName.substring(0, optionName.length - 1); - forceGet = true; - } - if (value === undefined && optionName.substring(0, 2) == 'no') { - // To set boolean options to false, the option name is prefixed with - // 'no'. - optionName = optionName.substring(2); - value = false; - } - var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; - if (optionIsBoolean && value == undefined) { - // Calling set with a boolean option sets it to true. - value = true; - } - if (!optionIsBoolean && !value || forceGet) { - var oldValue = getOption(optionName); - // If no value is provided, then we assume this is a get. - if (oldValue === true || oldValue === false) { - showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); - } else { - showConfirm(cm, ' ' + optionName + '=' + oldValue); - } - } else { - setOption(optionName, value, cm); - } - }, - registers: function(cm,params) { - var regArgs = params.args; - var registers = vimGlobalState.registerController.registers; - var regInfo = '----------Registers----------

'; - if (!regArgs) { - for (var registerName in registers) { - var text = registers[registerName].toString(); - if (text.length) { - regInfo += '"' + registerName + ' ' + text + '
'; - } - } - } else { - var registerName; - regArgs = regArgs.join(''); - for (var i = 0; i < regArgs.length; i++) { - registerName = regArgs.charAt(i); - if (!vimGlobalState.registerController.isValidRegister(registerName)) { - continue; - } - var register = registers[registerName] || new Register(); - regInfo += '"' + registerName + ' ' + register.toString() + '
'; - } - } - showConfirm(cm, regInfo); - }, - sort: function(cm, params) { - var reverse, ignoreCase, unique, number; - function parseArgs() { - if (params.argString) { - var args = new CodeMirror.StringStream(params.argString); - if (args.eat('!')) { reverse = true; } - if (args.eol()) { return; } - if (!args.eatSpace()) { return 'Invalid arguments'; } - var opts = args.match(/[a-z]+/); - if (opts) { - opts = opts[0]; - ignoreCase = opts.indexOf('i') != -1; - unique = opts.indexOf('u') != -1; - var decimal = opts.indexOf('d') != -1 && 1; - var hex = opts.indexOf('x') != -1 && 1; - var octal = opts.indexOf('o') != -1 && 1; - if (decimal + hex + octal > 1) { return 'Invalid arguments'; } - number = decimal && 'decimal' || hex && 'hex' || octal && 'octal'; - } - if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; } - } - } - var err = parseArgs(); - if (err) { - showConfirm(cm, err + ': ' + params.argString); - return; - } - var lineStart = params.line || cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - if (lineStart == lineEnd) { return; } - var curStart = Pos(lineStart, 0); - var curEnd = Pos(lineEnd, lineLength(cm, lineEnd)); - var text = cm.getRange(curStart, curEnd).split('\n'); - var numberRegex = (number == 'decimal') ? /(-?)([\d]+)/ : - (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i : - (number == 'octal') ? /([0-7]+)/ : null; - var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null; - var numPart = [], textPart = []; - if (number) { - for (var i = 0; i < text.length; i++) { - if (numberRegex.exec(text[i])) { - numPart.push(text[i]); - } else { - textPart.push(text[i]); - } - } - } else { - textPart = text; - } - function compareFn(a, b) { - if (reverse) { var tmp; tmp = a; a = b; b = tmp; } - if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); } - var anum = number && numberRegex.exec(a); - var bnum = number && numberRegex.exec(b); - if (!anum) { return a < b ? -1 : 1; } - anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix); - bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix); - return anum - bnum; - } - numPart.sort(compareFn); - textPart.sort(compareFn); - text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart); - if (unique) { // Remove duplicate lines - var textOld = text; - var lastLine; - text = []; - for (var i = 0; i < textOld.length; i++) { - if (textOld[i] != lastLine) { - text.push(textOld[i]); - } - lastLine = textOld[i]; - } - } - cm.replaceRange(text.join('\n'), curStart, curEnd); - }, - global: function(cm, params) { - // a global command is of the form - // :[range]g/pattern/[cmd] - // argString holds the string /pattern/[cmd] - var argString = params.argString; - if (!argString) { - showConfirm(cm, 'Regular Expression missing from global'); - return; - } - // range is specified here - var lineStart = (params.line !== undefined) ? params.line : cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - // get the tokens from argString - var tokens = splitBySlash(argString); - var regexPart = argString, cmd; - if (tokens.length) { - regexPart = tokens[0]; - cmd = tokens.slice(1, tokens.length).join('/'); - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise - // use the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - // now that we have the regexPart, search for regex matches in the - // specified range of lines - var query = getSearchState(cm).getQuery(); - var matchedLines = [], content = ''; - for (var i = lineStart; i <= lineEnd; i++) { - var matched = query.test(cm.getLine(i)); - if (matched) { - matchedLines.push(i+1); - content+= cm.getLine(i) + '
'; - } - } - // if there is no [cmd], just display the list of matched lines - if (!cmd) { - showConfirm(cm, content); - return; - } - var index = 0; - var nextCommand = function() { - if (index < matchedLines.length) { - var command = matchedLines[index] + cmd; - exCommandDispatcher.processCommand(cm, command, { - callback: nextCommand - }); - } - index++; - }; - nextCommand(); - }, - substitute: function(cm, params) { - if (!cm.getSearchCursor) { - throw new Error('Search feature not available. Requires searchcursor.js or ' + - 'any other getSearchCursor implementation.'); - } - var argString = params.argString; - var tokens = argString ? splitBySlash(argString) : []; - var regexPart, replacePart = '', trailing, flagsPart, count; - var confirm = false; // Whether to confirm each replace. - var global = false; // True to replace all instances on a line, false to replace only 1. - if (tokens.length) { - regexPart = tokens[0]; - replacePart = tokens[1]; - if (replacePart !== undefined) { - if (getOption('pcre')) { - replacePart = unescapeRegexReplace(replacePart); - } else { - replacePart = translateRegexReplace(replacePart); - } - vimGlobalState.lastSubstituteReplacePart = replacePart; - } - trailing = tokens[2] ? tokens[2].split(' ') : []; - } else { - // either the argString is empty or its of the form ' hello/world' - // actually splitBySlash returns a list of tokens - // only if the string starts with a '/' - if (argString && argString.length) { - showConfirm(cm, 'Substitutions should be of the form ' + - ':s/pattern/replace/'); - return; - } - } - // After the 3rd slash, we can have flags followed by a space followed - // by count. - if (trailing) { - flagsPart = trailing[0]; - count = parseInt(trailing[1]); - if (flagsPart) { - if (flagsPart.indexOf('c') != -1) { - confirm = true; - flagsPart.replace('c', ''); - } - if (flagsPart.indexOf('g') != -1) { - global = true; - flagsPart.replace('g', ''); - } - regexPart = regexPart + '/' + flagsPart; - } - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise use - // the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart; - if (replacePart === undefined) { - showConfirm(cm, 'No previous substitute regular expression'); - return; - } - var state = getSearchState(cm); - var query = state.getQuery(); - var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; - var lineEnd = params.lineEnd || lineStart; - if (count) { - lineStart = lineEnd; - lineEnd = lineStart + count - 1; - } - var startPos = clipCursorToContent(cm, Pos(lineStart, 0)); - var cursor = cm.getSearchCursor(query, startPos); - doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback); - }, - redo: CodeMirror.commands.redo, - undo: CodeMirror.commands.undo, - write: function(cm) { - if (CodeMirror.commands.save) { - // If a save command is defined, call it. - CodeMirror.commands.save(cm); - } else { - // Saves to text area if no save command is defined. - cm.save(); - } - }, - nohlsearch: function(cm) { - clearSearchHighlight(cm); - }, - delmarks: function(cm, params) { - if (!params.argString || !trim(params.argString)) { - showConfirm(cm, 'Argument required'); - return; - } - - var state = cm.state.vim; - var stream = new CodeMirror.StringStream(trim(params.argString)); - while (!stream.eol()) { - stream.eatSpace(); - - // Record the streams position at the beginning of the loop for use - // in error messages. - var count = stream.pos; - - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var sym = stream.next(); - // Check if this symbol is part of a range - if (stream.match('-', true)) { - // This symbol is part of a range. - - // The range must terminate at an alphabetic character. - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var startMark = sym; - var finishMark = stream.next(); - // The range must terminate at an alphabetic character which - // shares the same case as the start of the range. - if (isLowerCase(startMark) && isLowerCase(finishMark) || - isUpperCase(startMark) && isUpperCase(finishMark)) { - var start = startMark.charCodeAt(0); - var finish = finishMark.charCodeAt(0); - if (start >= finish) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - // Because marks are always ASCII values, and we have - // determined that they are the same case, we can use - // their char codes to iterate through the defined range. - for (var j = 0; j <= finish - start; j++) { - var mark = String.fromCharCode(start + j); - delete state.marks[mark]; - } - } else { - showConfirm(cm, 'Invalid argument: ' + startMark + '-'); - return; - } - } else { - // This symbol is a valid mark, and is not part of a range. - delete state.marks[sym]; - } - } - } - }; - - var exCommandDispatcher = new ExCommandDispatcher(); - - /** - * @param {CodeMirror} cm CodeMirror instance we are in. - * @param {boolean} confirm Whether to confirm each replace. - * @param {Cursor} lineStart Line to start replacing from. - * @param {Cursor} lineEnd Line to stop replacing at. - * @param {RegExp} query Query for performing matches with. - * @param {string} replaceWith Text to replace matches with. May contain $1, - * $2, etc for replacing captured groups using Javascript replace. - * @param {function()} callback A callback for when the replace is done. - */ - function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, - replaceWith, callback) { - // Set up all the functions. - cm.state.vim.exMode = true; - var done = false; - var lastPos = searchCursor.from(); - function replaceAll() { - cm.operation(function() { - while (!done) { - replace(); - next(); - } - stop(); - }); - } - function replace() { - var text = cm.getRange(searchCursor.from(), searchCursor.to()); - var newText = text.replace(query, replaceWith); - searchCursor.replace(newText); - } - function next() { - var found; - // The below only loops to skip over multiple occurrences on the same - // line when 'global' is not true. - while(found = searchCursor.findNext() && - isInRange(searchCursor.from(), lineStart, lineEnd)) { - if (!global && lastPos && searchCursor.from().line == lastPos.line) { - continue; - } - cm.scrollIntoView(searchCursor.from(), 30); - cm.setSelection(searchCursor.from(), searchCursor.to()); - lastPos = searchCursor.from(); - done = false; - return; - } - done = true; - } - function stop(close) { - if (close) { close(); } - cm.focus(); - if (lastPos) { - cm.setCursor(lastPos); - var vim = cm.state.vim; - vim.exMode = false; - vim.lastHPos = vim.lastHSPos = lastPos.ch; - } - if (callback) { callback(); } - } - function onPromptKeyDown(e, _value, close) { - // Swallow all keys. - CodeMirror.e_stop(e); - var keyName = CodeMirror.keyName(e); - switch (keyName) { - case 'Y': - replace(); next(); break; - case 'N': - next(); break; - case 'A': - // replaceAll contains a call to close of its own. We don't want it - // to fire too early or multiple times. - var savedCallback = callback; - callback = undefined; - cm.operation(replaceAll); - callback = savedCallback; - break; - case 'L': - replace(); - // fall through and exit. - case 'Q': - case 'Esc': - case 'Ctrl-C': - case 'Ctrl-[': - stop(close); - break; - } - if (done) { stop(close); } - return true; - } - - // Actually do replace. - next(); - if (done) { - showConfirm(cm, 'No matches for ' + query.source); - return; - } - if (!confirm) { - replaceAll(); - if (callback) { callback(); }; - return; - } - showPrompt(cm, { - prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)', - onKeyDown: onPromptKeyDown - }); - } - - CodeMirror.keyMap.vim = { - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function exitInsertMode(cm) { - var vim = cm.state.vim; - var macroModeState = vimGlobalState.macroModeState; - var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.'); - var isPlaying = macroModeState.isPlaying; - var lastChange = macroModeState.lastInsertModeChanges; - // In case of visual block, the insertModeChanges are not saved as a - // single word, so we convert them to a single word - // so as to update the ". register as expected in real vim. - var text = []; - if (!isPlaying) { - var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1; - var changes = lastChange.changes; - var text = []; - var i = 0; - // In case of multiple selections in blockwise visual, - // the inserted text, for example: 'foo', is stored as - // 'f', 'f', InsertModeKey 'o', 'o', 'o', 'o'. (if you have a block with 2 lines). - // We push the contents of the changes array as per the following: - // 1. In case of InsertModeKey, just increment by 1. - // 2. In case of a character, jump by selLength (2 in the example). - while (i < changes.length) { - // This loop will convert 'ffoooo' to 'foo'. - text.push(changes[i]); - if (changes[i] instanceof InsertModeKey) { - i++; - } else { - i+= selLength; - } - } - lastChange.changes = text; - cm.off('change', onChange); - CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (!isPlaying && vim.insertModeRepeat > 1) { - // Perform insert mode repeat for commands like 3,a and 3,o. - repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, - true /** repeatForInsert */); - vim.lastEditInputState.repeatOverride = vim.insertModeRepeat; - } - delete vim.insertModeRepeat; - vim.insertMode = false; - cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1); - cm.setOption('keyMap', 'vim'); - cm.setOption('disableInput', true); - cm.toggleOverwrite(false); // exit replace mode if we were in it. - // update the ". register before exiting insert mode - insertModeChangeRegister.setText(lastChange.changes.join('')); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (macroModeState.isRecording) { - logInsertModeChange(macroModeState); - } - } - - // The timeout in milliseconds for the two-character ESC keymap should be - // adjusted according to your typing speed to prevent false positives. - defineOption('insertModeEscKeysTimeout', 200, 'number'); - - CodeMirror.keyMap['vim-insert'] = { - // TODO: override navigation keys so that Esc will cancel automatic - // indentation from o, O, i_ - 'Ctrl-N': 'autocomplete', - 'Ctrl-P': 'autocomplete', - 'Enter': function(cm) { - var fn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - fn(cm); - }, - fallthrough: ['default'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - CodeMirror.keyMap['vim-replace'] = { - 'Backspace': 'goCharLeft', - fallthrough: ['vim-insert'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function executeMacroRegister(cm, vim, macroModeState, registerName) { - var register = vimGlobalState.registerController.getRegister(registerName); - var keyBuffer = register.keyBuffer; - var imc = 0; - macroModeState.isPlaying = true; - macroModeState.replaySearchQueries = register.searchQueries.slice(0); - for (var i = 0; i < keyBuffer.length; i++) { - var text = keyBuffer[i]; - var match, key; - while (text) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(text); - key = match[0]; - text = text.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'macro'); - if (vim.insertMode) { - var changes = register.insertModeChanges[imc++].changes; - vimGlobalState.macroModeState.lastInsertModeChanges.changes = - changes; - repeatInsertModeChanges(cm, changes, 1); - exitInsertMode(cm); - } - } - }; - macroModeState.isPlaying = false; - } - - function logKey(macroModeState, key) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushText(key); - } - } - - function logInsertModeChange(macroModeState) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushInsertModeChanges(macroModeState.lastInsertModeChanges); - } - } - - function logSearchQuery(macroModeState, query) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushSearchQuery(query); - } - } - - /** - * Listens for changes made in insert mode. - * Should only be active in insert mode. - */ - function onChange(_cm, changeObj) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - if (!macroModeState.isPlaying) { - while(changeObj) { - lastChange.expectCursorActivityForChange = true; - if (changeObj.origin == '+input' || changeObj.origin == 'paste' - || changeObj.origin === undefined /* only in testing */) { - var text = changeObj.text.join('\n'); - lastChange.changes.push(text); - } - // Change objects may be chained with next. - changeObj = changeObj.next; - } - } - } - - /** - * Listens for any kind of cursor activity on CodeMirror. - */ - function onCursorActivity(cm) { - var vim = cm.state.vim; - if (vim.insertMode) { - // Tracking cursor activity in insert mode (for macro support). - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - var lastChange = macroModeState.lastInsertModeChanges; - if (lastChange.expectCursorActivityForChange) { - lastChange.expectCursorActivityForChange = false; - } else { - // Cursor moved outside the context of an edit. Reset the change. - lastChange.changes = []; - } - } else if (!cm.curOp.isVimOp) { - handleExternalSelection(cm, vim); - } - if (vim.visualMode) { - updateFakeCursor(cm); - } - } - function updateFakeCursor(cm) { - var vim = cm.state.vim; - var from = copyCursor(vim.sel.head); - var to = offsetCursor(from, 0, 1); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'}); - } - function handleExternalSelection(cm, vim) { - var anchor = cm.getCursor('anchor'); - var head = cm.getCursor('head'); - // Enter or exit visual mode to match mouse selection. - if (vim.visualMode && cursorEqual(head, anchor) && lineLength(cm, head.line) > head.ch) { - exitVisualMode(cm, false); - } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { - vim.visualMode = true; - vim.visualLine = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"}); - } - if (vim.visualMode) { - // Bind CodeMirror selection model to vim selection model. - // Mouse selections are considered visual characterwise. - var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; - var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; - head = offsetCursor(head, 0, headOffset); - anchor = offsetCursor(anchor, 0, anchorOffset); - vim.sel = { - anchor: anchor, - head: head - }; - updateMark(cm, vim, '<', cursorMin(head, anchor)); - updateMark(cm, vim, '>', cursorMax(head, anchor)); - } else if (!vim.insertMode) { - // Reset lastHPos if selection was modified by something outside of vim mode e.g. by mouse. - vim.lastHPos = cm.getCursor().ch; - } - } - - /** Wrapper for special keys pressed in insert mode */ - function InsertModeKey(keyName) { - this.keyName = keyName; - } - - /** - * Handles raw key down events from the text area. - * - Should only be active in insert mode. - * - For recording deletes in insert mode. - */ - function onKeyEventTargetKeyDown(e) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - var keyName = CodeMirror.keyName(e); - function onKeyFound() { - lastChange.changes.push(new InsertModeKey(keyName)); - return true; - } - if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) { - CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound); - } - } - - /** - * Repeats the last edit, which includes exactly 1 command and at most 1 - * insert. Operator and motion commands are read from lastEditInputState, - * while action commands are read from lastEditActionCommand. - * - * If repeatForInsert is true, then the function was called by - * exitInsertMode to repeat the insert mode changes the user just made. The - * corresponding enterInsertMode call was made with a count. - */ - function repeatLastEdit(cm, vim, repeat, repeatForInsert) { - var macroModeState = vimGlobalState.macroModeState; - macroModeState.isPlaying = true; - var isAction = !!vim.lastEditActionCommand; - var cachedInputState = vim.inputState; - function repeatCommand() { - if (isAction) { - commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand); - } else { - commandDispatcher.evalInput(cm, vim); - } - } - function repeatInsert(repeat) { - if (macroModeState.lastInsertModeChanges.changes.length > 0) { - // For some reason, repeat cw in desktop VIM does not repeat - // insert mode changes. Will conform to that behavior. - repeat = !vim.lastEditActionCommand ? 1 : repeat; - var changeObject = macroModeState.lastInsertModeChanges; - repeatInsertModeChanges(cm, changeObject.changes, repeat); - } - } - vim.inputState = vim.lastEditInputState; - if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) { - // o and O repeat have to be interlaced with insert repeats so that the - // insertions appear on separate lines instead of the last line. - for (var i = 0; i < repeat; i++) { - repeatCommand(); - repeatInsert(1); - } - } else { - if (!repeatForInsert) { - // Hack to get the cursor to end up at the right place. If I is - // repeated in insert mode repeat, cursor will be 1 insert - // change set left of where it should be. - repeatCommand(); - } - repeatInsert(repeat); - } - vim.inputState = cachedInputState; - if (vim.insertMode && !repeatForInsert) { - // Don't exit insert mode twice. If repeatForInsert is set, then we - // were called by an exitInsertMode call lower on the stack. - exitInsertMode(cm); - } - macroModeState.isPlaying = false; - }; - - function repeatInsertModeChanges(cm, changes, repeat) { - function keyHandler(binding) { - if (typeof binding == 'string') { - CodeMirror.commands[binding](cm); - } else { - binding(cm); - } - return true; - } - var head = cm.getCursor('head'); - var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock; - if (inVisualBlock) { - // Set up block selection again for repeating the changes. - var vim = cm.state.vim; - var lastSel = vim.lastSelection; - var offset = getOffset(lastSel.anchor, lastSel.head); - selectForInsert(cm, head, offset.line + 1); - repeat = cm.listSelections().length; - cm.setCursor(head); - } - for (var i = 0; i < repeat; i++) { - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, i, 0)); - } - for (var j = 0; j < changes.length; j++) { - var change = changes[j]; - if (change instanceof InsertModeKey) { - CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler); - } else { - var cur = cm.getCursor(); - cm.replaceRange(change, cur, cur); - } - } - } - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, 0, 1)); - } - } - - resetVimGlobalState(); - //}; - // Initialize Vim and make it available as an API. - CodeMirror.Vim = Vim(); - - Vim = CodeMirror.Vim; - - var specialKey = {'return':'CR',backspace:'BS','delete':'Del',esc:'Esc', - left:'Left',right:'Right',up:'Up',down:'Down',space: 'Space', - home:'Home',end:'End',pageup:'PageUp',pagedown:'PageDown', enter: 'CR' - }; - function lookupKey(hashId, key, e) { - if (key.length > 1 && key[0] == "n") { - key = key.replace("numpad", ""); - } - key = specialKey[key] || key; - var name = ''; - if (e.ctrlKey) { name += 'C-'; } - if (e.altKey) { name += 'A-'; } - if (e.shiftKey) { name += 'S-'; } - - name += key; - if (name.length > 1) { name = '<' + name + '>'; } - return name; - } - var handleKey = Vim.handleKey.bind(Vim); - Vim.handleKey = function(cm, key, origin) { - return cm.operation(function() { - return handleKey(cm, key, origin); - }, true); - } - function cloneVimState(state) { - var n = new state.constructor(); - Object.keys(state).forEach(function(key) { - var o = state[key]; - if (Array.isArray(o)) - o = o.slice(); - else if (o && typeof o == "object" && o.constructor != Object) - o = cloneVimState(o); - n[key] = o; - }); - if (state.sel) { - n.sel = { - head: state.sel.head && copyCursor(state.sel.head), - anchor: state.sel.anchor && copyCursor(state.sel.anchor) - }; - } - return n; - } - function multiSelectHandleKey(cm, key, origin) { - var isHandled = false; - var vim = Vim.maybeInitVimState_(cm); - var visualBlock = vim.visualBlock || vim.wasInVisualBlock; - if (vim.wasInVisualBlock && !cm.ace.inMultiSelectMode) { - vim.wasInVisualBlock = false; - } else if (cm.ace.inMultiSelectMode && vim.visualBlock) { - vim.wasInVisualBlock = true; - } - - if (key == '' && !vim.insertMode && !vim.visualMode && cm.ace.inMultiSelectMode) { - cm.ace.exitMultiSelectMode(); - } else if (visualBlock || !cm.ace.inMultiSelectMode || cm.ace.inVirtualSelectionMode) { - isHandled = Vim.handleKey(cm, key, origin); - } else { - var old = cloneVimState(vim); - cm.operation(function() { - cm.ace.forEachSelection(function() { - var sel = cm.ace.selection; - cm.state.vim.lastHPos = sel.$desiredColumn == null ? sel.lead.column : sel.$desiredColumn; - var head = cm.getCursor("head"); - var anchor = cm.getCursor("anchor"); - var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; - var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; - head = offsetCursor(head, 0, headOffset); - anchor = offsetCursor(anchor, 0, anchorOffset); - cm.state.vim.sel.head = head; - cm.state.vim.sel.anchor = anchor; - - isHandled = handleKey(cm, key, origin); - sel.$desiredColumn = cm.state.vim.lastHPos == -1 ? null : cm.state.vim.lastHPos; - if (cm.virtualSelectionMode()) { - cm.state.vim = cloneVimState(old); - } - }); - if (cm.curOp.cursorActivity && !isHandled) - cm.curOp.cursorActivity = false; - }, true); - } - return isHandled; - }; - exports.CodeMirror = CodeMirror; - var getVim = Vim.maybeInitVimState_; - exports.handler = { - $id: "ace/keyboard/vim", - drawCursor: function(style, pixelPos, config, sel, session) { - var vim = this.state.vim || {}; - var w = config.characterWidth; - var h = config.lineHeight; - var top = pixelPos.top; - var left = pixelPos.left; - if (!vim.insertMode) { - var isbackwards = !sel.cursor - ? session.selection.isBackwards() || session.selection.isEmpty() - : Range.comparePoints(sel.cursor, sel.start) <= 0 - if (!isbackwards && left > w) - left -= w - } - if (!vim.insertMode && vim.status) { - h = h / 2; - top += h; - } - style.left = left + "px"; - style.top = top + "px"; - style.width = w + "px"; - style.height = h + "px"; - }, - handleKeyboard: function(data, hashId, key, keyCode, e) { - var editor = data.editor; - var cm = editor.state.cm; - var vim = getVim(cm); - if (keyCode == -1) return; - - if (key == "c" && hashId == 1) { // key == "ctrl-c" - if (!useragent.isMac && editor.getCopyText()) { - editor.once("copy", function() { - editor.selection.clearSelection(); - }); - return {command: "null", passEvent: true}; - } - } else if (!vim.insertMode) { - if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) { - hashId = -1; - key = data.inputChar; - } - } - - if (hashId == -1 || hashId & 1 || hashId === 0 && key.length > 1) { - var insertMode = vim.insertMode; - var name = lookupKey(hashId, key, e || {}); - if (vim.status == null) - vim.status = ""; - var isHandled = multiSelectHandleKey(cm, name, 'user'); - vim = getVim(cm); // may be changed by multiSelectHandleKey - if (isHandled && vim.status != null) - vim.status += name; - else if (vim.status == null) - vim.status = ""; - cm._signal("changeStatus"); - if (!isHandled && (hashId != -1 || insertMode)) - return; - return {command: "null", passEvent: !isHandled}; - } - }, - attach: function(editor) { - if (!editor.state) editor.state = {}; - var cm = new CodeMirror(editor); - editor.state.cm = cm; - editor.$vimModeHandler = this; - CodeMirror.keyMap.vim.attach(cm); - getVim(cm).status = null; - cm.on('vim-command-done', function() { - if (cm.virtualSelectionMode()) return; - getVim(cm).status = null; - cm.ace._signal("changeStatus"); - cm.ace.session.markUndoGroup(); - }); - cm.on("changeStatus", function() { - cm.ace.renderer.updateCursor(); - cm.ace._signal("changeStatus"); - }); - cm.on("vim-mode-change", function() { - if (cm.virtualSelectionMode()) return; - cm.ace.renderer.setStyle("normal-mode", !getVim(cm).insertMode); - cm._signal("changeStatus"); - }); - cm.ace.renderer.setStyle("normal-mode", !getVim(cm).insertMode); - editor.renderer.$cursorLayer.drawCursor = this.drawCursor.bind(cm); - // renderVirtualNumbers.attach(editor); - this.updateMacCompositionHandlers(editor, true); - }, - detach: function(editor) { - var cm = editor.state.cm; - CodeMirror.keyMap.vim.detach(cm); - cm.destroy(); - editor.state.cm = null; - editor.$vimModeHandler = null; - editor.renderer.$cursorLayer.drawCursor = null; - editor.renderer.setStyle("normal-mode", false); - // renderVirtualNumbers.detach(editor); - this.updateMacCompositionHandlers(editor, false); - }, - getStatusText: function(editor) { - var cm = editor.state.cm; - var vim = getVim(cm); - if (vim.insertMode) - return "INSERT"; - var status = ""; - if (vim.visualMode) { - status += "VISUAL"; - if (vim.visualLine) - status += " LINE"; - if (vim.visualBlock) - status += " BLOCK"; - } - if (vim.status) - status += (status ? " " : "") + vim.status; - return status; - }, - // workaround for j not repeating with `defaults write -g ApplePressAndHoldEnabled -bool true` - handleMacRepeat: function(data, hashId, key) { - if (hashId == -1) { - // record key - data.inputChar = key; - data.lastEvent = "input"; - } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) { - // check for repeated keypress - if (data.lastEvent == "input") { - data.lastEvent = "input1"; - } else if (data.lastEvent == "input1") { - // simulate textinput - return true; - } - } else { - // reset - data.$lastHash = hashId; - data.$lastKey = key; - data.lastEvent = "keypress"; - } - }, - // on mac, with some keyboard layouts (e.g swedish) ^ starts composition, we don't need it in normal mode - updateMacCompositionHandlers: function(editor, enable) { - var onCompositionUpdateOverride = function(text) { - var cm = editor.state.cm; - var vim = getVim(cm); - if (!vim.insertMode) { - var el = this.textInput.getElement(); - el.blur(); - el.focus(); - el.value = text; - } else { - this.onCompositionUpdateOrig(text); - } - }; - var onCompositionStartOverride = function(text) { - var cm = editor.state.cm; - var vim = getVim(cm); - if (!vim.insertMode) { - this.onCompositionStartOrig(text); - } - }; - if (enable) { - if (!editor.onCompositionUpdateOrig) { - editor.onCompositionUpdateOrig = editor.onCompositionUpdate; - editor.onCompositionUpdate = onCompositionUpdateOverride; - editor.onCompositionStartOrig = editor.onCompositionStart; - editor.onCompositionStart = onCompositionStartOverride; - } - } else { - if (editor.onCompositionUpdateOrig) { - editor.onCompositionUpdate = editor.onCompositionUpdateOrig; - editor.onCompositionUpdateOrig = null; - editor.onCompositionStart = editor.onCompositionStartOrig; - editor.onCompositionStartOrig = null; - } - } - } - } - var renderVirtualNumbers = { - getText: function(session, row) { - return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + "" - }, - getWidth: function(session, lastLineNumber, config) { - return session.getLength().toString().length * config.characterWidth; - }, - update: function(e, editor) { - editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER) - }, - attach: function(editor) { - editor.renderer.$gutterLayer.$renderer = this; - editor.on("changeSelection", this.update); - }, - detach: function(editor) { - editor.renderer.$gutterLayer.$renderer = null; - editor.off("changeSelection", this.update); - } - }; - Vim.defineOption({ - name: "wrap", - set: function(value, cm) { - if (cm) {cm.ace.setOption("wrap", value)} - }, - type: "boolean" - }, false); - defaultKeymap.push( - { keys: 'zc', type: 'action', action: 'fold', actionArgs: { open: false } }, - { keys: 'zC', type: 'action', action: 'fold', actionArgs: { open: false, all: true } }, - { keys: 'zo', type: 'action', action: 'fold', actionArgs: { open: true, } }, - { keys: 'zO', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, - { keys: 'za', type: 'action', action: 'fold', actionArgs: { toggle: true } }, - { keys: 'zA', type: 'action', action: 'fold', actionArgs: { toggle: true, all: true } }, - { keys: 'zf', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, - { keys: 'zd', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, - - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAbove" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelow" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAboveSkipCurrent" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelowSkipCurrent" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreBefore" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreAfter" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextBefore" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextAfter" } } - ); - actions.aceCommand = function(cm, actionArgs, vim) { - cm.vimCmd = actionArgs; - if (cm.ace.inVirtualSelectionMode) - cm.ace.on("beforeEndOperation", delayedExecAceCommand); - else - delayedExecAceCommand(null, cm.ace) - }; - function delayedExecAceCommand(op, ace) { - ace.off("beforeEndOperation", delayedExecAceCommand); - var cmd = ace.state.cm.vimCmd; - if (cmd) { - ace.execCommand(cmd.exec ? cmd : cmd.name, cmd.args); - } - ace.curOp = ace.prevOp; - } - actions.fold = function(cm, actionArgs, vim) { - cm.ace.execCommand(['toggleFoldWidget', 'toggleFoldWidget', 'foldOther', 'unfoldall' - ][(actionArgs.all ? 2 : 0) + (actionArgs.open ? 1 : 0)]); - }, - - exports.handler.defaultKeymap = defaultKeymap; - exports.handler.actions = actions; - exports.Vim = Vim; - - Vim.map("Y", "yy"); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim_test.js deleted file mode 100644 index 8b726a33..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim_test.js +++ /dev/null @@ -1,3866 +0,0 @@ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { - -var EditSession = require("./../edit_session").EditSession; -var Editor = require("./../editor").Editor; -var UndoManager = require("./../undomanager").UndoManager; -var MockRenderer = require("./../test/mockrenderer").MockRenderer; -var JavaScriptMode = require("./../mode/javascript").Mode; -var VirtualRenderer = require("./../virtual_renderer").VirtualRenderer; -var assert = require("./../test/assertions"); -var keys = require("./../lib/keys"); -var vim = require("./vim"); - -var el = document.createElement("div"); -el.style.position = "fixed"; -el.style.left = "20px"; -el.style.top = "30px"; -el.style.width = "500px"; -el.style.height = "300px"; -document.body.appendChild(el); - -if (!el.getBoundingClientRect) - return console.log("Skipping test: This test only runs in the browser"); - -var renderer = new VirtualRenderer(el); -editor = new Editor(renderer);//(new MockRenderer()); -editor.session.setUndoManager(new UndoManager()); -editor.session.setUseWorker(false); -editor.session.setMode(new JavaScriptMode()); -function CodeMirror(place, opts) { - if (opts.value != null) - editor.session.setValue(opts.value); - editor.setOption("wrap", opts.lineWrapping); - editor.setOption("useSoftTabs", !opts.indentWithTabs); - editor.setKeyboardHandler(null); - editor.setKeyboardHandler(vim.handler); - var cm = editor.state.cm; - cm.setOption("tabSize", opts.tabSize || 4); - cm.setOption("indentUnit", opts.indentUnit || 2); - - cm.setSize = function(w, h) { - var changed = false; - if (w && editor.w != w) { - changed = true; - el.style.width = (editor.w = w) + "px"; - } - if (h && editor.h != h) { - changed = true; - el.style.height = (editor.h = h) + "px"; - } - if (changed) - editor.resize(true); - }; - cm.setSize(500, 300); - return cm; -} -for (var key in vim.CodeMirror) - CodeMirror[key] = vim.CodeMirror[key]; -var editor; -var i = 0; -function test(name, fn) { - // if (name != 'vim_search_history') return - // for (i = 0; i < 1000; i++) - // exports["test " + name + i] = fn; // vim_ex_global_confirm - if (i++ < 0 || /- /.test(name)) - exports["test " + name] = function() {}; - else - exports["test " + name] = fn; -} - -vim.CodeMirror.Vim.unmap("Y"); - - - -// cm.setBookmark({ch: 5, line: 0}) -// cm.setBookmark({ch: 4, line: 0}) -// cm.replaceRange("x-", {ch: 4, line: 0}, {ch: 5, line: 0}); [editor.$vimModeHandler.cm.marks[0].find(),editor.$vimModeHandler.cm.marks[1].find()] - -var lineText, verbose, phantom; -var Pos = CodeMirror.Pos; -var place = document.createElement("div"); -var eqPos = assert.deepEqual; -var eq = assert.equal; -var is = assert.ok; - - -var code = '' + -' wOrd1 (#%\n' + -' word3] \n' + -'aopop pop 0 1 2 3 4\n' + -' (a) [b] {c} \n' + -'int getchar(void) {\n' + -' static char buf[BUFSIZ];\n' + -' static char *bufp = buf;\n' + -' if (n == 0) { /* buffer is empty */\n' + -' n = read(0, buf, sizeof buf);\n' + -' bufp = buf;\n' + -' }\n' + -'\n' + -' return (--n >= 0) ? (unsigned char) *bufp++ : EOF;\n' + -' \n' + -'}\n'; - -var lines = (function() { - lineText = code.split('\n'); - var ret = []; - for (var i = 0; i < lineText.length; i++) { - ret[i] = { - line: i, - length: lineText[i].length, - lineText: lineText[i], - textStart: /^\s*/.exec(lineText[i])[0].length - }; - } - return ret; -})(); -var endOfDocument = makeCursor(lines.length - 1, - lines[lines.length - 1].length); -var wordLine = lines[0]; -var bigWordLine = lines[1]; -var charLine = lines[2]; -var bracesLine = lines[3]; -var seekBraceLine = lines[4]; - -var word1 = { - start: { line: wordLine.line, ch: 1 }, - end: { line: wordLine.line, ch: 5 } -}; -var word2 = { - start: { line: wordLine.line, ch: word1.end.ch + 2 }, - end: { line: wordLine.line, ch: word1.end.ch + 4 } -}; -var word3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 5 } -}; -var bigWord1 = word1; -var bigWord2 = word2; -var bigWord3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 7 } -}; -var bigWord4 = { - start: { line: bigWordLine.line, ch: bigWord1.end.ch + 3 }, - end: { line: bigWordLine.line, ch: bigWord1.end.ch + 7 } -}; - -var oChars = [ { line: charLine.line, ch: 1 }, - { line: charLine.line, ch: 3 }, - { line: charLine.line, ch: 7 } ]; -var pChars = [ { line: charLine.line, ch: 2 }, - { line: charLine.line, ch: 4 }, - { line: charLine.line, ch: 6 }, - { line: charLine.line, ch: 8 } ]; -var numChars = [ { line: charLine.line, ch: 10 }, - { line: charLine.line, ch: 12 }, - { line: charLine.line, ch: 14 }, - { line: charLine.line, ch: 16 }, - { line: charLine.line, ch: 18 }]; -var parens1 = { - start: { line: bracesLine.line, ch: 1 }, - end: { line: bracesLine.line, ch: 3 } -}; -var squares1 = { - start: { line: bracesLine.line, ch: 5 }, - end: { line: bracesLine.line, ch: 7 } -}; -var curlys1 = { - start: { line: bracesLine.line, ch: 9 }, - end: { line: bracesLine.line, ch: 11 } -}; -var seekOutside = { - start: { line: seekBraceLine.line, ch: 1 }, - end: { line: seekBraceLine.line, ch: 16 } -}; -var seekInside = { - start: { line: seekBraceLine.line, ch: 14 }, - end: { line: seekBraceLine.line, ch: 11 } -}; - -function copyCursor(cur) { - return { ch: cur.ch, line: cur.line }; -} - -function forEach(arr, func) { - for (var i = 0; i < arr.length; i++) { - func(arr[i], i, arr); - } -} - -function testVim(name, run, opts, expectedFail) { - var vimOpts = { - lineNumbers: true, - vimMode: true, - showCursorWhenSelecting: true, - value: code - }; - for (var prop in opts) { - if (opts.hasOwnProperty(prop)) { - vimOpts[prop] = opts[prop]; - } - } - return test('vim_' + name, function() { - var place = document.getElementById("testground"); - var cm = CodeMirror(place, vimOpts); - var vim = CodeMirror.Vim.maybeInitVimState_(cm); - - function doKeysFn(cm) { - return function(args) { - if (args instanceof Array) { - arguments = args; - } - for (var i = 0; i < arguments.length; i++) { - CodeMirror.Vim.handleKey(cm, arguments[i]); - } - } - } - function doInsertModeKeysFn(cm) { - return function(args) { - if (args instanceof Array) { arguments = args; } - function executeHandler(handler) { - if (typeof handler == 'string') { - CodeMirror.commands[handler](cm); - } else { - handler(cm); - } - return true; - } - for (var i = 0; i < arguments.length; i++) { - var key = arguments[i]; - // Find key in keymap and handle. - var handled = CodeMirror.lookupKey(key, 'vim-insert', executeHandler); - // Record for insert mode. - if (handled == "handled" && cm.state.vim.insertMode && arguments[i] != 'Esc') { - var lastChange = CodeMirror.Vim.getVimGlobalState_().macroModeState.lastInsertModeChanges; - if (lastChange) { - lastChange.changes.push(new CodeMirror.Vim.InsertModeKey(key)); - } - } - } - } - } - function doExFn(cm) { - return function(command) { - cm.openDialog = helpers.fakeOpenDialog(command); - helpers.doKeys(':'); - } - } - function assertCursorAtFn(cm) { - return function(line, ch) { - var pos; - if (ch == null && typeof line.line == 'number') { - pos = line; - } else { - pos = makeCursor(line, ch); - } - eqPos(pos, cm.getCursor()); - } - } - function fakeOpenDialog(result) { - return function(text, callback) { - return callback(result); - } - } - function fakeOpenNotification(matcher) { - return function(text) { - matcher(text); - } - } - var helpers = { - doKeys: doKeysFn(cm), - // Warning: Only emulates keymap events, not character insertions. Use - // replaceRange to simulate character insertions. - // Keys are in CodeMirror format, NOT vim format. - doInsertModeKeys: doInsertModeKeysFn(cm), - doEx: doExFn(cm), - assertCursorAt: assertCursorAtFn(cm), - fakeOpenDialog: fakeOpenDialog, - fakeOpenNotification: fakeOpenNotification, - getRegisterController: function() { - return CodeMirror.Vim.getRegisterController(); - } - } - CodeMirror.Vim.resetVimGlobalState_(); - var successful = false; - var savedOpenNotification = cm.openNotification; - try { - run(cm, vim, helpers); - successful = true; - } finally { - cm.openNotification = savedOpenNotification; - // if (!successful || verbose) { - // place.style.visibility = "visible"; - // } else { - // place.removeChild(cm.getWrapperElement()); - // } - } - }, expectedFail); -}; -testVim('qq@q', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'q', 'l', 'l', 'q'); - helpers.assertCursorAt(0,2); - helpers.doKeys('@', 'q'); - helpers.assertCursorAt(0,4); -}, { value: ' '}); -testVim('@@', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'q', 'l', 'l', 'q'); - helpers.assertCursorAt(0,2); - helpers.doKeys('@', 'q'); - helpers.assertCursorAt(0,4); - helpers.doKeys('@', '@'); - helpers.assertCursorAt(0,6); -}, { value: ' '}); -var jumplistScene = ''+ - 'word\n'+ - '(word)\n'+ - '{word\n'+ - 'word.\n'+ - '\n'+ - 'word search\n'+ - '}word\n'+ - 'word\n'+ - 'word\n'; -function testJumplist(name, keys, endPos, startPos, dialog) { - endPos = makeCursor(endPos[0], endPos[1]); - startPos = makeCursor(startPos[0], startPos[1]); - testVim(name, function(cm, vim, helpers) { - CodeMirror.Vim.resetVimGlobalState_(); - if(dialog)cm.openDialog = helpers.fakeOpenDialog('word'); - cm.setCursor(startPos); - helpers.doKeys.apply(null, keys); - helpers.assertCursorAt(endPos); - }, {value: jumplistScene}); -}; -testJumplist('jumplist_H', ['H', ''], [5,2], [5,2]); -testJumplist('jumplist_M', ['M', ''], [2,2], [2,2]); -testJumplist('jumplist_L', ['L', ''], [2,2], [2,2]); -testJumplist('jumplist_[[', ['[', '[', ''], [5,2], [5,2]); -testJumplist('jumplist_]]', [']', ']', ''], [2,2], [2,2]); -testJumplist('jumplist_G', ['G', ''], [5,2], [5,2]); -testJumplist('jumplist_gg', ['g', 'g', ''], [5,2], [5,2]); -testJumplist('jumplist_%', ['%', ''], [1,5], [1,5]); -testJumplist('jumplist_{', ['{', ''], [1,5], [1,5]); -testJumplist('jumplist_}', ['}', ''], [1,5], [1,5]); -testJumplist('jumplist_\'', ['m', 'a', 'h', '\'', 'a', 'h', ''], [1,0], [1,5]); -testJumplist('jumplist_`', ['m', 'a', 'h', '`', 'a', 'h', ''], [1,5], [1,5]); -testJumplist('jumplist_*_cachedCursor', ['*', ''], [1,3], [1,3]); -testJumplist('jumplist_#_cachedCursor', ['#', ''], [1,3], [1,3]); -testJumplist('jumplist_n', ['#', 'n', ''], [1,1], [2,3]); -testJumplist('jumplist_N', ['#', 'N', ''], [1,1], [2,3]); -testJumplist('jumplist_repeat_', ['*', '*', '*', '3', ''], [2,3], [2,3]); -testJumplist('jumplist_repeat_', ['*', '*', '*', '3', '', '2', ''], [5,0], [2,3]); -testJumplist('jumplist_repeated_motion', ['3', '*', ''], [2,3], [2,3]); -testJumplist('jumplist_/', ['/', ''], [2,3], [2,3], 'dialog'); -testJumplist('jumplist_?', ['?', ''], [2,3], [2,3], 'dialog'); -testJumplist('jumplist_skip_delted_mark', - ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], - [0,2], [0,2]); -testJumplist('jumplist_skip_delted_mark', - ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], - [1,0], [0,2]); - -/** - * @param name Name of the test - * @param keys An array of keys or a string with a single key to simulate. - * @param endPos The expected end position of the cursor. - * @param startPos The position the cursor should start at, defaults to 0, 0. - */ -function testMotion(name, keys, endPos, startPos) { - testVim(name, function(cm, vim, helpers) { - if (!startPos) { - startPos = { line: 0, ch: 0 }; - } - cm.setCursor(startPos); - helpers.doKeys(keys); - helpers.assertCursorAt(endPos); - }); -}; - -function makeCursor(line, ch) { - return { line: line, ch: ch }; -}; - -function offsetCursor(cur, offsetLine, offsetCh) { - return { line: cur.line + offsetLine, ch: cur.ch + offsetCh }; -}; - -// Motion tests -testMotion('|', '|', makeCursor(0, 0), makeCursor(0,4)); -testMotion('|_repeat', ['3', '|'], makeCursor(0, 2), makeCursor(0,4)); -testMotion('h', 'h', makeCursor(0, 0), word1.start); -testMotion('h_repeat', ['3', 'h'], offsetCursor(word1.end, 0, -3), word1.end); -testMotion('l', 'l', makeCursor(0, 1)); -testMotion('l_repeat', ['2', 'l'], makeCursor(0, 2)); -testMotion('j', 'j', offsetCursor(word1.end, 1, 0), word1.end); -testMotion('j_repeat', ['2', 'j'], offsetCursor(word1.end, 2, 0), word1.end); -testMotion('j_repeat_clip', ['1000', 'j'], endOfDocument); -testMotion('k', 'k', offsetCursor(word3.end, -1, 0), word3.end); -testMotion('k_repeat', ['2', 'k'], makeCursor(0, 4), makeCursor(2, 4)); -testMotion('k_repeat_clip', ['1000', 'k'], makeCursor(0, 4), makeCursor(2, 4)); -testMotion('w', 'w', word1.start); -testMotion('w_multiple_newlines_no_space', 'w', makeCursor(12, 2), makeCursor(11, 2)); -testMotion('w_multiple_newlines_with_space', 'w', makeCursor(14, 0), makeCursor(12, 51)); -testMotion('w_repeat', ['2', 'w'], word2.start); -testMotion('w_wrap', ['w'], word3.start, word2.start); -testMotion('w_endOfDocument', 'w', endOfDocument, endOfDocument); -testMotion('w_start_to_end', ['1000', 'w'], endOfDocument, makeCursor(0, 0)); -testMotion('W', 'W', bigWord1.start); -testMotion('W_repeat', ['2', 'W'], bigWord3.start, bigWord1.start); -testMotion('e', 'e', word1.end); -testMotion('e_repeat', ['2', 'e'], word2.end); -testMotion('e_wrap', 'e', word3.end, word2.end); -testMotion('e_endOfDocument', 'e', endOfDocument, endOfDocument); -testMotion('e_start_to_end', ['1000', 'e'], endOfDocument, makeCursor(0, 0)); -testMotion('b', 'b', word3.start, word3.end); -testMotion('b_repeat', ['2', 'b'], word2.start, word3.end); -testMotion('b_wrap', 'b', word2.start, word3.start); -testMotion('b_startOfDocument', 'b', makeCursor(0, 0), makeCursor(0, 0)); -testMotion('b_end_to_start', ['1000', 'b'], makeCursor(0, 0), endOfDocument); -testMotion('ge', ['g', 'e'], word2.end, word3.end); -testMotion('ge_repeat', ['2', 'g', 'e'], word1.end, word3.start); -testMotion('ge_wrap', ['g', 'e'], word2.end, word3.start); -testMotion('ge_startOfDocument', ['g', 'e'], makeCursor(0, 0), - makeCursor(0, 0)); -testMotion('ge_end_to_start', ['1000', 'g', 'e'], makeCursor(0, 0), endOfDocument); -testMotion('gg', ['g', 'g'], makeCursor(lines[0].line, lines[0].textStart), - makeCursor(3, 1)); -testMotion('gg_repeat', ['3', 'g', 'g'], - makeCursor(lines[2].line, lines[2].textStart)); -testMotion('G', 'G', - makeCursor(lines[lines.length - 1].line, lines[lines.length - 1].textStart), - makeCursor(3, 1)); -testMotion('G_repeat', ['3', 'G'], makeCursor(lines[2].line, - lines[2].textStart)); -// TODO: Make the test code long enough to test Ctrl-F and Ctrl-B. -testMotion('0', '0', makeCursor(0, 0), makeCursor(0, 8)); -testMotion('^', '^', makeCursor(0, lines[0].textStart), makeCursor(0, 8)); -testMotion('+', '+', makeCursor(1, lines[1].textStart), makeCursor(0, 8)); -testMotion('-', '-', makeCursor(0, lines[0].textStart), makeCursor(1, 4)); -testMotion('_', ['6','_'], makeCursor(5, lines[5].textStart), makeCursor(0, 8)); -testMotion('$', '$', makeCursor(0, lines[0].length - 1), makeCursor(0, 1)); -testMotion('$_repeat', ['2', '$'], makeCursor(1, lines[1].length - 1), - makeCursor(0, 3)); -testMotion('f', ['f', 'p'], pChars[0], makeCursor(charLine.line, 0)); -testMotion('f_repeat', ['2', 'f', 'p'], pChars[2], pChars[0]); -testMotion('f_num', ['f', '2'], numChars[2], makeCursor(charLine.line, 0)); -testMotion('t', ['t','p'], offsetCursor(pChars[0], 0, -1), - makeCursor(charLine.line, 0)); -testMotion('t_repeat', ['2', 't', 'p'], offsetCursor(pChars[2], 0, -1), - pChars[0]); -testMotion('F', ['F', 'p'], pChars[0], pChars[1]); -testMotion('F_repeat', ['2', 'F', 'p'], pChars[0], pChars[2]); -testMotion('T', ['T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[1]); -testMotion('T_repeat', ['2', 'T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[2]); -testMotion('%_parens', ['%'], parens1.end, parens1.start); -testMotion('%_squares', ['%'], squares1.end, squares1.start); -testMotion('%_braces', ['%'], curlys1.end, curlys1.start); -testMotion('%_seek_outside', ['%'], seekOutside.end, seekOutside.start); -testMotion('%_seek_inside', ['%'], seekInside.end, seekInside.start); -testVim('%_seek_skip', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,9); -}, {value:'01234"("()'}); -testVim('%_skip_string', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,4); - cm.setCursor(0,2); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,0); -}, {value:'(")")'}); -(')') -testVim('%_skip_comment', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,6); - cm.setCursor(0,3); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,0); -}, {value:'(/*)*/)'}); -// Make sure that moving down after going to the end of a line always leaves you -// at the end of a line, but preserves the offset in other cases -testVim('Changing lines after Eol operation', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['$']); - helpers.doKeys(['j']); - // After moving to Eol and then down, we should be at Eol of line 2 - helpers.assertCursorAt({ line: 1, ch: lines[1].length - 1 }); - helpers.doKeys(['j']); - // After moving down, we should be at Eol of line 3 - helpers.assertCursorAt({ line: 2, ch: lines[2].length - 1 }); - helpers.doKeys(['h']); - helpers.doKeys(['j']); - // After moving back one space and then down, since line 4 is shorter than line 2, we should - // be at Eol of line 2 - 1 - helpers.assertCursorAt({ line: 3, ch: lines[3].length - 1 }); - helpers.doKeys(['j']); - helpers.doKeys(['j']); - // After moving down again, since line 3 has enough characters, we should be back to the - // same place we were at on line 1 - helpers.assertCursorAt({ line: 5, ch: lines[2].length - 2 }); -}); -//making sure gj and gk recover from clipping -testVim('gj_gk_clipping', function(cm,vim,helpers){ - cm.setCursor(0, 1); - helpers.doKeys('g','j','g','j'); - helpers.assertCursorAt(2, 1); - helpers.doKeys('g','k','g','k'); - helpers.assertCursorAt(0, 1); -},{value: 'line 1\n\nline 2'}); -//testing a mix of j/k and gj/gk -testVim('j_k_and_gj_gk', function(cm,vim,helpers){ - cm.setSize(120); - cm.setCursor(0, 0); - //go to the last character on the first line - helpers.doKeys('$'); - //move up/down on the column within the wrapped line - //side-effect: cursor is not locked to eol anymore - helpers.doKeys('g','k'); - var cur=cm.getCursor(); - eq(cur.line,0); - is((cur.ch<176),'gk didn\'t move cursor back (1)'); - helpers.doKeys('g','j'); - helpers.assertCursorAt(0, 176); - //should move to character 177 on line 2 (j/k preserve character index within line) - helpers.doKeys('j'); - //due to different line wrapping, the cursor can be on a different screen-x now - //gj and gk preserve screen-x on movement, much like moveV - helpers.doKeys('3','g','k'); - cur=cm.getCursor(); - eq(cur.line,1); - is((cur.ch<176),'gk didn\'t move cursor back (2)'); - helpers.doKeys('g','j','2','g','j'); - //should return to the same character-index - helpers.doKeys('k'); - helpers.assertCursorAt(0, 176); -},{ lineWrapping:true, value: 'This line is intentially long to test movement of gj and gk over wrapped lines. I will start on the end of this line, then make a step up and back to set the origin for j and k.\nThis line is supposed to be even longer than the previous. I will jump here and make another wiggle with gj and gk, before I jump back to the line above. Both wiggles should not change my cursor\'s target character but both j/k and gj/gk change each other\'s reference position.'}); -testVim('gj_gk', function(cm, vim, helpers) { - if (phantom) return; - cm.setSize(120); - // Test top of document edge case. - cm.setCursor(0, 4); - helpers.doKeys('g', 'j'); - helpers.doKeys('10', 'g', 'k'); - helpers.assertCursorAt(0, 4); - - // Test moving down preserves column position. - helpers.doKeys('g', 'j'); - var pos1 = cm.getCursor(); - var expectedPos2 = { line: 0, ch: (pos1.ch - 4) * 2 + 4}; - helpers.doKeys('g', 'j'); - helpers.assertCursorAt(expectedPos2); - - // Move to the last character - cm.setCursor(0, 0); - // Move left to reset HSPos - helpers.doKeys('h'); - // Test bottom of document edge case. - helpers.doKeys('100', 'g', 'j'); - var endingPos = cm.getCursor(); - is(endingPos != 0, 'gj should not be on wrapped line 0'); - var topLeftCharCoords = cm.charCoords(makeCursor(0, 0)); - var endingCharCoords = cm.charCoords(endingPos); - is(topLeftCharCoords.left == endingCharCoords.left, 'gj should end up on column 0'); -},{ lineNumbers: false, lineWrapping:true, value: 'Thislineisintentiallylongtotestmovementofgjandgkoverwrappedlines.' }); -testVim('}', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('}'); - helpers.assertCursorAt(1, 0); - cm.setCursor(0, 0); - helpers.doKeys('2', '}'); - helpers.assertCursorAt(4, 0); - cm.setCursor(0, 0); - helpers.doKeys('6', '}'); - helpers.assertCursorAt(5, 0); -}, { value: 'a\n\nb\nc\n\nd' }); -testVim('{', function(cm, vim, helpers) { - cm.setCursor(5, 0); - helpers.doKeys('{'); - helpers.assertCursorAt(4, 0); - cm.setCursor(5, 0); - helpers.doKeys('2', '{'); - helpers.assertCursorAt(1, 0); - cm.setCursor(5, 0); - helpers.doKeys('6', '{'); - helpers.assertCursorAt(0, 0); -}, { value: 'a\n\nb\nc\n\nd' }); -testVim('paragraph motions', function(cm, vim, helpers) { - cm.setCursor(10, 0); - helpers.doKeys('{'); - helpers.assertCursorAt(4, 0); - helpers.doKeys('{'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('2', '}'); - helpers.assertCursorAt(7, 0); - helpers.doKeys('2', '}'); - helpers.assertCursorAt(16, 0); - - cm.setCursor(9, 0); - helpers.doKeys('}'); - helpers.assertCursorAt(14, 0); - - cm.setCursor(6, 0); - helpers.doKeys('}'); - helpers.assertCursorAt(7, 0); - - // ip inside empty space - cm.setCursor(10, 0); - helpers.doKeys('v', 'i', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(12, 0), cm.getCursor('head')); - helpers.doKeys('i', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(13, 1), cm.getCursor('head')); - helpers.doKeys('2', 'i', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(16, 1), cm.getCursor('head')); - - // should switch to visualLine mode - cm.setCursor(14, 0); - helpers.doKeys('', 'v', 'i', 'p'); - helpers.assertCursorAt(14, 0); - - cm.setCursor(14, 0); - helpers.doKeys('', 'V', 'i', 'p'); - eqPos(Pos(16, 1), cm.getCursor('head')); - - // ap inside empty space - cm.setCursor(10, 0); - helpers.doKeys('', 'v', 'a', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(13, 1), cm.getCursor('head')); - helpers.doKeys('a', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(16, 1), cm.getCursor('head')); - - cm.setCursor(13, 0); - helpers.doKeys('v', 'a', 'p'); - eqPos(Pos(13, 0), cm.getCursor('anchor')); - eqPos(Pos(14, 0), cm.getCursor('head')); - - cm.setCursor(16, 0); - helpers.doKeys('v', 'a', 'p'); - eqPos(Pos(14, 0), cm.getCursor('anchor')); - eqPos(Pos(16, 1), cm.getCursor('head')); - - cm.setCursor(0, 0); - helpers.doKeys('v', 'a', 'p'); - eqPos(Pos(0, 0), cm.getCursor('anchor')); - eqPos(Pos(4, 0), cm.getCursor('head')); - - cm.setCursor(0, 0); - helpers.doKeys('d', 'i', 'p'); - var register = helpers.getRegisterController().getRegister(); - eq('a\na\n', register.toString()); - is(register.linewise); - helpers.doKeys('3', 'j', 'p'); - helpers.doKeys('y', 'i', 'p'); - is(register.linewise); - eq('b\na\na\nc\n', register.toString()); -}, { value: 'a\na\n\n\n\nb\nc\n\n\n\n\n\n\nd\n\ne\nf' }); - -// Operator tests -testVim('dl', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'l'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dl_eol', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('d', 'l'); - eq(' word1', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 6); -}, { value: ' word1 ' }); -testVim('dl_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('2', 'd', 'l'); - eq('ord1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' w', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dh', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'h'); - eq(' wrd1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('o', register.toString()); - is(!register.linewise); - eqPos(offsetCursor(curStart, 0 , -1), cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dj', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2\n word3' }); -testVim('dj_end_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dk', function(cm, vim, helpers) { - var curStart = makeCursor(1, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2\n word3' }); -testVim('dk_start_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dw_space', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dw_word', function(cm, vim, helpers) { - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq(' word2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 word2' }); -testVim('dw_only_word', function(cm, vim, helpers) { - // Test that if there is only 1 word left, dw deletes till the end of the - // line. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1 ' }); -testVim('dw_eol', function(cm, vim, helpers) { - // Assert that dw does not delete the newline if last word to delete is at end - // of line. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' \nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2' }); -testVim('dw_eol_with_multiple_newlines', function(cm, vim, helpers) { - // Assert that dw does not delete the newline if last word to delete is at end - // of line and it is followed by multiple newlines. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' \n\nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\n\nword2' }); -testVim('dw_empty_line_followed_by_whitespace', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq(' \nword', cm.getValue()); -}, { value: '\n \nword' }); -testVim('dw_empty_line_followed_by_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('word', cm.getValue()); -}, { value: '\nword' }); -testVim('dw_empty_line_followed_by_empty_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n', cm.getValue()); -}, { value: '\n\n' }); -testVim('dw_whitespace_followed_by_whitespace', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n \n', cm.getValue()); -}, { value: ' \n \n' }); -testVim('dw_whitespace_followed_by_empty_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n\n', cm.getValue()); -}, { value: ' \n\n' }); -testVim('dw_word_whitespace_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n \nword2', cm.getValue()); -}, { value: 'word1\n \nword2'}) -testVim('dw_end_of_document', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('d', 'w'); - eq('\nab', cm.getValue()); -}, { value: '\nabc' }); -testVim('dw_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - cm.setCursor(0, 1); - helpers.doKeys('d', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2' }); -testVim('de_word_start_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'e'); - eq('\n\n', cm.getValue()); -}, { value: 'word\n\n' }); -testVim('de_word_end_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('d', 'e'); - eq('wor', cm.getValue()); -}, { value: 'word\n\n\n' }); -testVim('de_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'e'); - eq('', cm.getValue()); -}, { value: ' \n\n\n' }); -testVim('de_end_of_document', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('d', 'e'); - eq('\nab', cm.getValue()); -}, { value: '\nabc' }); -testVim('db_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('\n\n', cm.getValue()); -}, { value: '\n\n\n' }); -testVim('db_word_start_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('\nword', cm.getValue()); -}, { value: '\n\nword' }); -testVim('db_word_end_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 3); - helpers.doKeys('d', 'b'); - eq('\n\nd', cm.getValue()); -}, { value: '\n\nword' }); -testVim('db_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('', cm.getValue()); -}, { value: '\n \n' }); -testVim('db_start_of_document', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'b'); - eq('abc\n', cm.getValue()); -}, { value: 'abc\n' }); -testVim('dge_empty_lines', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doKeys('d', 'g', 'e'); - // Note: In real VIM the result should be '', but it's not quite consistent, - // since 2 newlines are deleted. But in the similar case of word\n\n, only - // 1 newline is deleted. We'll diverge from VIM's behavior since it's much - // easier this way. - eq('\n', cm.getValue()); -}, { value: '\n\n' }); -testVim('dge_word_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doKeys('d', 'g', 'e'); - eq('wor\n', cm.getValue()); -}, { value: 'word\n\n'}); -testVim('dge_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'g', 'e'); - eq('', cm.getValue()); -}, { value: '\n \n' }); -testVim('dge_start_of_document', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'g', 'e'); - eq('bc\n', cm.getValue()); -}, { value: 'abc\n' }); -testVim('d_inclusive', function(cm, vim, helpers) { - // Assert that when inclusive is set, the character the cursor is on gets - // deleted too. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'e'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('d_reverse', function(cm, vim, helpers) { - // Test that deleting in reverse works. - cm.setCursor(1, 0); - helpers.doKeys('d', 'b'); - eq(' word2 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\n', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2 ' }); -testVim('dd', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 1, ch: 0 }); - var expectedLineCount = cm.lineCount() - 1; - helpers.doKeys('d', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[1].textStart); -}); -testVim('dd_prefix_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('2', 'd', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[2].textStart); -}); -testVim('dd_motion_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('d', '2', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[2].textStart); -}); -testVim('dd_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 6; - helpers.doKeys('2', 'd', '3', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[6].textStart); -}); -testVim('dd_lastline', function(cm, vim, helpers) { - cm.setCursor(cm.lineCount(), 0); - var expectedLineCount = cm.lineCount() - 1; - helpers.doKeys('d', 'd'); - eq(expectedLineCount, cm.lineCount()); - helpers.assertCursorAt(cm.lineCount() - 1, 0); -}); -testVim('dd_only_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - var expectedRegister = cm.getValue() + "\n"; - helpers.doKeys('d','d'); - eq(1, cm.lineCount()); - eq('', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedRegister, register.toString()); -}, { value: "thisistheonlyline" }); -// Yank commands should behave the exact same as d commands, expect that nothing -// gets deleted. -testVim('yw_repeat', function(cm, vim, helpers) { - // Assert that yw does yank newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('y', '2', 'w'); - eq(' word1\nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('yy_multiply_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount(); - helpers.doKeys('2', 'y', '3', 'y'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - eqPos(curStart, cm.getCursor()); -}); -// Change commands behave like d commands except that it also enters insert -// mode. In addition, when the change is linewise, an additional newline is -// inserted so that insert mode starts on that line. -testVim('cw', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('c', '2', 'w'); - eq(' word3', cm.getValue()); - helpers.assertCursorAt(0, 0); -}, { value: 'word1 word2 word3'}); -testVim('cw_repeat', function(cm, vim, helpers) { - // Assert that cw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('c', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2' }); -testVim('cc_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 5; - helpers.doKeys('2', 'c', '3', 'c'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('cc_should_not_append_to_document', function(cm, vim, helpers) { - var expectedLineCount = cm.lineCount(); - cm.setCursor(cm.lastLine(), 0); - helpers.doKeys('c', 'c'); - eq(expectedLineCount, cm.lineCount()); -}); -function fillArray(val, times) { - var arr = []; - for (var i = 0; i < times; i++) { - arr.push(val); - } - return arr; -} -testVim('c_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'l', 'l', 'c'); - var replacement = fillArray('hello', 3); - cm.replaceSelections(replacement); - eq('1hello\n5hello\nahellofg', cm.getValue()); - helpers.doKeys(''); - cm.setCursor(2, 3); - helpers.doKeys('', '2', 'k', 'h', 'C'); - replacement = fillArray('world', 3); - cm.replaceSelections(replacement); - eq('1hworld\n5hworld\nahworld', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('c_visual_block_replay', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'c'); - var replacement = fillArray('fo', 3); - cm.replaceSelections(replacement); - eq('1fo4\n5fo8\nafodefg', cm.getValue()); - helpers.doKeys(''); - cm.setCursor(0, 0); - helpers.doKeys('.'); - eq('foo4\nfoo8\nfoodefg', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); - -testVim('d_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'l', 'l', 'd'); - eq('1\n5\nafg', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('D_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'D'); - eq('1\n5\na', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); - -// Swapcase commands edit in place and do not modify registers. -testVim('g~w_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('g', '~', '2', 'w'); - eq(' WORD1\nWORD2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('g~g~', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedLineCount = cm.lineCount(); - var expectedValue = cm.getValue().toUpperCase(); - helpers.doKeys('2', 'g', '~', '3', 'g', '~'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2\nword3\nword4\nword5\nword6' }); -testVim('gu_and_gU', function(cm, vim, helpers) { - var curStart = makeCursor(0, 7); - var value = cm.getValue(); - cm.setCursor(curStart); - helpers.doKeys('2', 'g', 'U', 'w'); - eq(cm.getValue(), 'wa wb xX WC wd'); - eqPos(curStart, cm.getCursor()); - helpers.doKeys('2', 'g', 'u', 'w'); - eq(cm.getValue(), value); - - helpers.doKeys('2', 'g', 'U', 'B'); - eq(cm.getValue(), 'wa WB Xx wc wd'); - eqPos(makeCursor(0, 3), cm.getCursor()); - - cm.setCursor(makeCursor(0, 4)); - helpers.doKeys('g', 'u', 'i', 'w'); - eq(cm.getValue(), 'wa wb Xx wc wd'); - eqPos(makeCursor(0, 3), cm.getCursor()); - - // TODO: support gUgU guu - // eqPos(makeCursor(0, 0), cm.getCursor()); - - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); -}, { value: 'wa wb xx wc wd' }); -testVim('visual_block_~', function(cm, vim, helpers) { - cm.setCursor(1, 1); - helpers.doKeys('', 'l', 'l', 'j', '~'); - helpers.assertCursorAt(1, 1); - eq('hello\nwoRLd\naBCDe', cm.getValue()); - cm.setCursor(2, 0); - helpers.doKeys('v', 'l', 'l', '~'); - helpers.assertCursorAt(2, 0); - eq('hello\nwoRLd\nAbcDe', cm.getValue()); -},{value: 'hello\nwOrld\nabcde' }); -testVim('._swapCase_visualBlock', function(cm, vim, helpers) { - helpers.doKeys('', 'j', 'j', 'l', '~'); - cm.setCursor(0, 3); - helpers.doKeys('.'); - eq('HelLO\nWorLd\nAbcdE', cm.getValue()); -},{value: 'hEllo\nwOrlD\naBcDe' }); -testVim('._delete_visualBlock', function(cm, vim, helpers) { - helpers.doKeys('', 'j', 'x'); - eq('ive\ne\nsome\nsugar', cm.getValue()); - helpers.doKeys('.'); - eq('ve\n\nsome\nsugar', cm.getValue()); - helpers.doKeys('j', 'j', '.'); - eq('ve\n\nome\nugar', cm.getValue()); - helpers.doKeys('u', '', '.'); - eq('ve\n\nme\ngar', cm.getValue()); -},{value: 'give\nme\nsome\nsugar' }); -testVim('>{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('>', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('>>', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('2', '>', '>'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('<{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('<', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); -testVim('<<', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('2', '<', '<'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); - -// Edit tests -function testEdit(name, before, pos, edit, after) { - return testVim(name, function(cm, vim, helpers) { - var ch = before.search(pos) - var line = before.substring(0, ch).split('\n').length - 1; - if (line) { - ch = before.substring(0, ch).split('\n').pop().length; - } - cm.setCursor(line, ch); - helpers.doKeys.apply(this, edit.split('')); - eq(after, cm.getValue()); - }, {value: before}); -} - -// These Delete tests effectively cover word-wise Change, Visual & Yank. -// Tabs are used as differentiated whitespace to catch edge cases. -// Normal word: -testEdit('diw_mid_spc', 'foo \tbAr\t baz', /A/, 'diw', 'foo \t\t baz'); -testEdit('daw_mid_spc', 'foo \tbAr\t baz', /A/, 'daw', 'foo \tbaz'); -testEdit('diw_mid_punct', 'foo \tbAr.\t baz', /A/, 'diw', 'foo \t.\t baz'); -testEdit('daw_mid_punct', 'foo \tbAr.\t baz', /A/, 'daw', 'foo.\t baz'); -testEdit('diw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diw', 'foo \t,.\t baz'); -testEdit('daw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daw', 'foo \t,.\t baz'); -testEdit('diw_start_spc', 'bAr \tbaz', /A/, 'diw', ' \tbaz'); -testEdit('daw_start_spc', 'bAr \tbaz', /A/, 'daw', 'baz'); -testEdit('diw_start_punct', 'bAr. \tbaz', /A/, 'diw', '. \tbaz'); -testEdit('daw_start_punct', 'bAr. \tbaz', /A/, 'daw', '. \tbaz'); -testEdit('diw_end_spc', 'foo \tbAr', /A/, 'diw', 'foo \t'); -testEdit('daw_end_spc', 'foo \tbAr', /A/, 'daw', 'foo'); -testEdit('diw_end_punct', 'foo \tbAr.', /A/, 'diw', 'foo \t.'); -testEdit('daw_end_punct', 'foo \tbAr.', /A/, 'daw', 'foo.'); -// Big word: -testEdit('diW_mid_spc', 'foo \tbAr\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_spc', 'foo \tbAr\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_mid_punct', 'foo \tbAr.\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_punct', 'foo \tbAr.\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_start_spc', 'bAr\t baz', /A/, 'diW', '\t baz'); -testEdit('daW_start_spc', 'bAr\t baz', /A/, 'daW', 'baz'); -testEdit('diW_start_punct', 'bAr.\t baz', /A/, 'diW', '\t baz'); -testEdit('daW_start_punct', 'bAr.\t baz', /A/, 'daW', 'baz'); -testEdit('diW_end_spc', 'foo \tbAr', /A/, 'diW', 'foo \t'); -testEdit('daW_end_spc', 'foo \tbAr', /A/, 'daW', 'foo'); -testEdit('diW_end_punct', 'foo \tbAr.', /A/, 'diW', 'foo \t'); -testEdit('daW_end_punct', 'foo \tbAr.', /A/, 'daW', 'foo'); -// Deleting text objects -// Open and close on same line -testEdit('di(_open_spc', 'foo (bAr) baz', /\(/, 'di(', 'foo () baz'); -testEdit('di)_open_spc', 'foo (bAr) baz', /\(/, 'di)', 'foo () baz'); -testEdit('dib_open_spc', 'foo (bAr) baz', /\(/, 'dib', 'foo () baz'); -testEdit('da(_open_spc', 'foo (bAr) baz', /\(/, 'da(', 'foo baz'); -testEdit('da)_open_spc', 'foo (bAr) baz', /\(/, 'da)', 'foo baz'); - -testEdit('di(_middle_spc', 'foo (bAr) baz', /A/, 'di(', 'foo () baz'); -testEdit('di)_middle_spc', 'foo (bAr) baz', /A/, 'di)', 'foo () baz'); -testEdit('da(_middle_spc', 'foo (bAr) baz', /A/, 'da(', 'foo baz'); -testEdit('da)_middle_spc', 'foo (bAr) baz', /A/, 'da)', 'foo baz'); - -testEdit('di(_close_spc', 'foo (bAr) baz', /\)/, 'di(', 'foo () baz'); -testEdit('di)_close_spc', 'foo (bAr) baz', /\)/, 'di)', 'foo () baz'); -testEdit('da(_close_spc', 'foo (bAr) baz', /\)/, 'da(', 'foo baz'); -testEdit('da)_close_spc', 'foo (bAr) baz', /\)/, 'da)', 'foo baz'); - -// delete around and inner b. -testEdit('dab_on_(_should_delete_around_()block', 'o( in(abc) )', /\(a/, 'dab', 'o( in )'); - -// delete around and inner B. -testEdit('daB_on_{_should_delete_around_{}block', 'o{ in{abc} }', /{a/, 'daB', 'o{ in }'); -testEdit('diB_on_{_should_delete_inner_{}block', 'o{ in{abc} }', /{a/, 'diB', 'o{ in{} }'); - -testEdit('da{_on_{_should_delete_inner_block', 'o{ in{abc} }', /{a/, 'da{', 'o{ in }'); -testEdit('di[_on_(_should_not_delete', 'foo (bAr) baz', /\(/, 'di[', 'foo (bAr) baz'); -testEdit('di[_on_)_should_not_delete', 'foo (bAr) baz', /\)/, 'di[', 'foo (bAr) baz'); -testEdit('da[_on_(_should_not_delete', 'foo (bAr) baz', /\(/, 'da[', 'foo (bAr) baz'); -testEdit('da[_on_)_should_not_delete', 'foo (bAr) baz', /\)/, 'da[', 'foo (bAr) baz'); -testMotion('di(_outside_should_stay', ['d', 'i', '('], { line: 0, ch: 0}, { line: 0, ch: 0}); - -// Open and close on different lines, equally indented -testEdit('di{_middle_spc', 'a{\n\tbar\n}b', /r/, 'di{', 'a{}b'); -testEdit('di}_middle_spc', 'a{\n\tbar\n}b', /r/, 'di}', 'a{}b'); -testEdit('da{_middle_spc', 'a{\n\tbar\n}b', /r/, 'da{', 'ab'); -testEdit('da}_middle_spc', 'a{\n\tbar\n}b', /r/, 'da}', 'ab'); -testEdit('daB_middle_spc', 'a{\n\tbar\n}b', /r/, 'daB', 'ab'); - -// open and close on diff lines, open indented less than close -testEdit('di{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di{', 'a{}b'); -testEdit('di}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di}', 'a{}b'); -testEdit('da{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da{', 'ab'); -testEdit('da}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da}', 'ab'); - -// open and close on diff lines, open indented more than close -testEdit('di[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di[', 'a\t[]b'); -testEdit('di]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di]', 'a\t[]b'); -testEdit('da[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da[', 'a\tb'); -testEdit('da]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da]', 'a\tb'); - -function testSelection(name, before, pos, keys, sel) { - return testVim(name, function(cm, vim, helpers) { - var ch = before.search(pos) - var line = before.substring(0, ch).split('\n').length - 1; - if (line) { - ch = before.substring(0, ch).split('\n').pop().length; - } - cm.setCursor(line, ch); - helpers.doKeys.apply(this, keys.split('')); - eq(sel, cm.getSelection()); - }, {value: before}); -} -testSelection('viw_middle_spc', 'foo \tbAr\t baz', /A/, 'viw', 'bAr'); -testSelection('vaw_middle_spc', 'foo \tbAr\t baz', /A/, 'vaw', 'bAr\t '); -testSelection('viw_middle_punct', 'foo \tbAr,\t baz', /A/, 'viw', 'bAr'); -testSelection('vaW_middle_punct', 'foo \tbAr,\t baz', /A/, 'vaW', 'bAr,\t '); -testSelection('viw_start_spc', 'foo \tbAr\t baz', /b/, 'viw', 'bAr'); -testSelection('viw_end_spc', 'foo \tbAr\t baz', /r/, 'viw', 'bAr'); -testSelection('viw_eol', 'foo \tbAr', /r/, 'viw', 'bAr'); -testSelection('vi{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'vi{', '\n\tbar\n\t'); -testSelection('va{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'va{', '{\n\tbar\n\t}'); - -testVim('mouse_select', function(cm, vim, helpers) { - cm.setSelection(Pos(0, 2), Pos(0, 4), {origin: '*mouse'}); - is(cm.state.vim.visualMode); - is(!cm.state.vim.visualLine); - is(!cm.state.vim.visualBlock); - helpers.doKeys(''); - is(!cm.somethingSelected()); - helpers.doKeys('g', 'v'); - eq('cd', cm.getSelection()); -}, {value: 'abcdef'}); - -// Operator-motion tests -testVim('D', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('D'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\n word3' }); -testVim('C', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('C'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2\n word3' }); -testVim('Y', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('Y'); - eq(' word1\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\n word3' }); -testVim('~', function(cm, vim, helpers) { - helpers.doKeys('3', '~'); - eq('ABCdefg', cm.getValue()); - helpers.assertCursorAt(0, 3); -}, { value: 'abcdefg' }); - -// Action tests -testVim('ctrl-a', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(''); - eq('-9', cm.getValue()); - helpers.assertCursorAt(0, 1); - helpers.doKeys('2',''); - eq('-7', cm.getValue()); -}, {value: '-10'}); -testVim('ctrl-x', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(''); - eq('-1', cm.getValue()); - helpers.assertCursorAt(0, 1); - helpers.doKeys('2',''); - eq('-3', cm.getValue()); -}, {value: '0'}); -testVim('/ search forward', function(cm, vim, helpers) { - forEach(['', ''], function(key) { - cm.setCursor(0, 0); - helpers.doKeys(key); - helpers.assertCursorAt(0, 5); - helpers.doKeys('l'); - helpers.doKeys(key); - helpers.assertCursorAt(0, 10); - cm.setCursor(0, 11); - helpers.doKeys(key); - helpers.assertCursorAt(0, 11); - }); -}, {value: '__jmp1 jmp2 jmp'}); -testVim('a', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('a'); - helpers.assertCursorAt(0, 2); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('a_eol', function(cm, vim, helpers) { - cm.setCursor(0, lines[0].length - 1); - helpers.doKeys('a'); - helpers.assertCursorAt(0, lines[0].length); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('A_endOfSelectedArea', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('v', 'j', 'l'); - helpers.doKeys('A'); - helpers.assertCursorAt(1, 2); - eq('vim-insert', cm.getOption('keyMap')); -}, {value: 'foo\nbar'}); -testVim('i', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('i'); - helpers.assertCursorAt(0, 1); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('i_repeat', function(cm, vim, helpers) { - helpers.doKeys('3', 'i'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - eq('testtesttest', cm.getValue()); - helpers.assertCursorAt(0, 11); -}, { value: '' }); -testVim('i_repeat_delete', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('2', 'i'); - cm.replaceRange('z', cm.getCursor()); - helpers.doInsertModeKeys('Backspace', 'Backspace'); - helpers.doKeys(''); - eq('abe', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'abcde' }); -testVim('A', function(cm, vim, helpers) { - helpers.doKeys('A'); - helpers.assertCursorAt(0, lines[0].length); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('A_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'l', 'A'); - var replacement = new Array(cm.listSelections().length+1).join('hello ').split(' '); - replacement.pop(); - cm.replaceSelections(replacement); - eq('testhello\nmehello\npleahellose', cm.getValue()); - helpers.doKeys(''); - cm.setCursor(0, 0); - helpers.doKeys('.'); - // TODO this doesn't work yet - // eq('teshellothello\nme hello hello\nplehelloahellose', cm.getValue()); -}, {value: 'test\nme\nplease'}); -testVim('I', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('I'); - helpers.assertCursorAt(0, lines[0].textStart); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('I_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('3', 'I'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - eq('testtesttestblah', cm.getValue()); - helpers.assertCursorAt(0, 11); -}, { value: 'blah' }); -testVim('I_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', 'l', 'l', 'I'); - var replacement = new Array(cm.listSelections().length+1).join('hello ').split(' '); - replacement.pop(); - cm.replaceSelections(replacement); - eq('hellotest\nhellome\nhelloplease', cm.getValue()); -}, {value: 'test\nme\nplease'}); -testVim('o', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('o'); - eq('word1\n\nword2', cm.getValue()); - helpers.assertCursorAt(1, 0); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('o_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('3', 'o'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - eq('\ntest\ntest\ntest', cm.getValue()); - helpers.assertCursorAt(3, 3); -}, { value: '' }); -testVim('O', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('O'); - eq('\nword1\nword2', cm.getValue()); - helpers.assertCursorAt(0, 0); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('J', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('J'); - var expectedValue = 'word1 word2\nword3\n word4'; - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(0, expectedValue.indexOf('word2') - 1); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('J_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('3', 'J'); - var expectedValue = 'word1 word2 word3\n word4'; - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(0, expectedValue.indexOf('word3') - 1); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('p', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('p'); - eq('__abc\ndef_', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').setText('abc\ndef', false); - helpers.doKeys('"', 'a', 'p'); - eq('__abc\ndef_', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_wrong_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').setText('abc\ndef', false); - helpers.doKeys('p'); - eq('___', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: '___' }); -testVim('p_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'p'); - eq('___\n a\nd\n a\nd', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_lastline', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd', true); - helpers.doKeys('2', 'p'); - eq('___\n a\nd\n a\nd', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim(']p_first_indent_is_smaller', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys(']', 'p'); - eq(' ___\n abc\n def', cm.getValue()); -}, { value: ' ___' }); -testVim(']p_first_indent_is_larger', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys(']', 'p'); - eq(' ___\n abc\ndef', cm.getValue()); -}, { value: ' ___' }); -testVim(']p_with_tab_indents', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', '\t\tabc\n\t\t\tdef\n', true); - helpers.doKeys(']', 'p'); - eq('\t___\n\tabc\n\t\tdef', cm.getValue()); -}, { value: '\t___', indentWithTabs: true}); -testVim(']p_with_spaces_translated_to_tabs', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys(']', 'p'); - eq('\t___\n\tabc\n\t\tdef', cm.getValue()); -}, { value: '\t___', indentWithTabs: true, tabSize: 2 }); -testVim('[p', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys('[', 'p'); - eq(' abc\n def\n ___', cm.getValue()); -}, { value: ' ___' }); -testVim('P', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('P'); - eq('_abc\ndef__', cm.getValue()); - helpers.assertCursorAt(1, 3); -}, { value: '___' }); -testVim('P_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'P'); - eq(' a\nd\n a\nd\n___', cm.getValue()); - helpers.assertCursorAt(0, 2); -}, { value: '___' }); -testVim('r', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('3', 'r', 'u'); - eq('wuuuet\nanother', cm.getValue(),'3r failed'); - helpers.assertCursorAt(0, 3); - cm.setCursor(0, 4); - helpers.doKeys('v', 'j', 'h', 'r', ''); - eq('wuuu \n her', cm.getValue(),'Replacing selection by space-characters failed'); -}, { value: 'wordet\nanother' }); -testVim('r_visual_block', function(cm, vim, helpers) { - cm.setCursor(2, 3); - helpers.doKeys('', 'k', 'k', 'h', 'h', 'r', 'l'); - eq('1lll\n5lll\nalllefg', cm.getValue()); - helpers.doKeys('', 'l', 'j', 'r', ''); - eq('1 l\n5 l\nalllefg', cm.getValue()); - cm.setCursor(2, 0); - helpers.doKeys('o'); - helpers.doKeys(''); - cm.replaceRange('\t\t', cm.getCursor()); - helpers.doKeys('', 'h', 'h', 'r', 'r'); - eq('1 l\n5 l\nalllefg\nrrrrrrrr', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('R', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('R'); - helpers.assertCursorAt(0, 1); - eq('vim-replace', cm.getOption('keyMap')); - is(cm.state.overwrite, 'Setting overwrite state failed'); -}); -testVim('mark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('`', 't'); - helpers.assertCursorAt(2, 2); - cm.setCursor(2, 0); - cm.replaceRange(' h', cm.getCursor()); - cm.setCursor(0, 0); - helpers.doKeys('\'', 't'); - helpers.assertCursorAt(2, 3); -}); -testVim('jumpToMark_next', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 2); - cm.setCursor(0, 0); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_next_repeat', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(0, 0); - helpers.doKeys('2', ']', '`'); - helpers.assertCursorAt(3, 2); - cm.setCursor(0, 0); - helpers.doKeys('2', ']', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_next_sameline', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 2); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 4); -}); -testVim('jumpToMark_next_onlyprev', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(4, 0); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(4, 0); -}); -testVim('jumpToMark_next_nomark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 2); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_next_linewise_over', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 1); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_next_action', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('d', ']', '`'); - helpers.assertCursorAt(0, 0); - var actual = cm.getLine(0); - var expected = 'pop pop 0 1 2 3 4'; - eq(actual, expected, "Deleting while jumping to the next mark failed."); -}); -testVim('jumpToMark_next_line_action', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('d', ']', '\''); - helpers.assertCursorAt(0, 1); - var actual = cm.getLine(0); - var expected = ' (a) [b] {c} ' - eq(actual, expected, "Deleting while jumping to the next mark line failed."); -}); -testVim('jumpToMark_prev', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(4, 0); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 2); - cm.setCursor(4, 0); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_repeat', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(5, 0); - helpers.doKeys('2', '[', '`'); - helpers.assertCursorAt(3, 2); - cm.setCursor(5, 0); - helpers.doKeys('2', '[', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_prev_sameline', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 2); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_onlynext', function(cm, vim, helpers) { - cm.setCursor(4, 4); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 0); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_nomark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 2); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_linewise_over', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 6); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('delmark_single', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 't'); - helpers.doEx('delmarks t'); - cm.setCursor(0, 0); - helpers.doKeys('`', 't'); - helpers.assertCursorAt(0, 0); -}); -testVim('delmark_range', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks b-d'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_multi', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks bcd'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_multi_space', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks b c d'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_all', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks a b-de'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(0, 0); -}); -testVim('visual', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l'); - helpers.assertCursorAt(0, 4); - eqPos(makeCursor(0, 1), cm.getCursor('anchor')); - helpers.doKeys('d'); - eq('15', cm.getValue()); -}, { value: '12345' }); -testVim('visual_yank', function(cm, vim, helpers) { - helpers.doKeys('v', '3', 'l', 'y'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('p'); - eq('aa te test for yank', cm.getValue()); -}, { value: 'a test for yank' }) -testVim('visual_w', function(cm, vim, helpers) { - helpers.doKeys('v', 'w'); - eq(cm.getSelection(), 'motion t'); -}, { value: 'motion test'}); -testVim('visual_initial_selection', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v'); - cm.getSelection('n'); -}, { value: 'init'}); -testVim('visual_crossover_left', function(cm, vim, helpers) { - cm.setCursor(0, 2); - helpers.doKeys('v', 'l', 'h', 'h'); - cm.getSelection('ro'); -}, { value: 'cross'}); -testVim('visual_crossover_left', function(cm, vim, helpers) { - cm.setCursor(0, 2); - helpers.doKeys('v', 'h', 'l', 'l'); - cm.getSelection('os'); -}, { value: 'cross'}); -testVim('visual_crossover_up', function(cm, vim, helpers) { - cm.setCursor(3, 2); - helpers.doKeys('v', 'j', 'k', 'k'); - eqPos(Pos(2, 2), cm.getCursor('head')); - eqPos(Pos(3, 3), cm.getCursor('anchor')); - helpers.doKeys('k'); - eqPos(Pos(1, 2), cm.getCursor('head')); - eqPos(Pos(3, 3), cm.getCursor('anchor')); -}, { value: 'cross\ncross\ncross\ncross\ncross\n'}); -testVim('visual_crossover_down', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('v', 'k', 'j', 'j'); - eqPos(Pos(2, 3), cm.getCursor('head')); - eqPos(Pos(1, 2), cm.getCursor('anchor')); - helpers.doKeys('j'); - eqPos(Pos(3, 3), cm.getCursor('head')); - eqPos(Pos(1, 2), cm.getCursor('anchor')); -}, { value: 'cross\ncross\ncross\ncross\ncross\n'}); -testVim('visual_exit', function(cm, vim, helpers) { - helpers.doKeys('', 'l', 'j', 'j', ''); - eqPos(cm.getCursor('anchor'), cm.getCursor('head')); - eq(vim.visualMode, false); -}, { value: 'hello\nworld\nfoo' }); -testVim('visual_line', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'l', 'j', 'j', 'd'); - eq(' 4\n 5', cm.getValue()); -}, { value: ' 1\n 2\n 3\n 4\n 5' }); -testVim('visual_block_move_to_eol', function(cm, vim, helpers) { - // moveToEol should move all block cursors to end of line - cm.setCursor(0, 0); - helpers.doKeys('', 'G', '$'); - var selections = cm.getSelections().join(); - console.log(selections); - eq("123,45,6", selections); -}, {value: '123\n45\n6'}); -testVim('visual_block_different_line_lengths', function(cm, vim, helpers) { - // test the block selection with lines of different length - // i.e. extending the selection - // till the end of the longest line. - helpers.doKeys('', 'l', 'j', 'j', '6', 'l', 'd'); - helpers.doKeys('d', 'd', 'd', 'd'); - eq('', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('visual_block_truncate_on_short_line', function(cm, vim, helpers) { - // check for left side selection in case - // of moving up to a shorter line. - cm.replaceRange('', cm.getCursor()); - cm.setCursor(3, 4); - helpers.doKeys('', 'l', 'k', 'k', 'd'); - eq('hello world\n{\ntis\nsa!', cm.getValue()); -}, {value: 'hello world\n{\nthis is\nsparta!'}); -testVim('visual_block_corners', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('', '2', 'l', 'k'); - // circle around the anchor - // and check the selections - var selections = cm.getSelections(); - eq('345891', selections.join('')); - helpers.doKeys('4', 'h'); - selections = cm.getSelections(); - eq('123678', selections.join('')); - helpers.doKeys('j', 'j'); - selections = cm.getSelections(); - eq('678abc', selections.join('')); - helpers.doKeys('4', 'l'); - selections = cm.getSelections(); - eq('891cde', selections.join('')); -}, {value: '12345\n67891\nabcde'}); -testVim('visual_block_mode_switch', function(cm, vim, helpers) { - // switch between visual modes - cm.setCursor(1, 1); - // blockwise to characterwise visual - helpers.doKeys('', 'j', 'l', 'v'); - selections = cm.getSelections(); - eq('7891\nabc', selections.join('')); - // characterwise to blockwise - helpers.doKeys(''); - selections = cm.getSelections(); - eq('78bc', selections.join('')); - // blockwise to linewise visual - helpers.doKeys('V'); - selections = cm.getSelections(); - eq('67891\nabcde', selections.join('')); -}, {value: '12345\n67891\nabcde'}); -testVim('visual_block_crossing_short_line', function(cm, vim, helpers) { - // visual block with long and short lines - cm.setCursor(0, 3); - helpers.doKeys('', 'j', 'j', 'j'); - var selections = cm.getSelections().join(); - eq('4,,d,b', selections); - helpers.doKeys('3', 'k'); - selections = cm.getSelections().join(); - eq('4', selections); - helpers.doKeys('5', 'j', 'k'); - selections = cm.getSelections().join(""); - eq(10, selections.length); -}, {value: '123456\n78\nabcdefg\nfoobar\n}\n'}); -testVim('visual_block_curPos_on_exit', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '3' , 'l', ''); - eqPos(makeCursor(0, 3), cm.getCursor()); - helpers.doKeys('h', '', '2' , 'j' ,'3' , 'l'); - eq(cm.getSelections().join(), "3456,,cdef"); - helpers.doKeys('4' , 'h'); - eq(cm.getSelections().join(), "23,8,bc"); - helpers.doKeys('2' , 'l'); - eq(cm.getSelections().join(), "34,,cd"); -}, {value: '123456\n78\nabcdefg\nfoobar'}); - -testVim('visual_marks', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l', 'j', 'j', 'v'); - // Test visual mode marks - cm.setCursor(2, 1); - helpers.doKeys('\'', '<'); - helpers.assertCursorAt(0, 1); - helpers.doKeys('\'', '>'); - helpers.assertCursorAt(2, 0); -}); -testVim('visual_join', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'l', 'j', 'j', 'J'); - eq(' 1 2 3\n 4\n 5', cm.getValue()); - is(!vim.visualMode); -}, { value: ' 1\n 2\n 3\n 4\n 5' }); -testVim('visual_blank', function(cm, vim, helpers) { - helpers.doKeys('v', 'k'); - eq(vim.visualMode, true); -}, { value: '\n' }); -testVim('reselect_visual', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l', 'l', 'y', 'g', 'v'); - helpers.assertCursorAt(0, 5); - eqPos(makeCursor(0, 1), cm.getCursor('anchor')); - helpers.doKeys('v'); - cm.setCursor(1, 0); - helpers.doKeys('v', 'l', 'l', 'p'); - eq('123456\n2345\nbar', cm.getValue()); - cm.setCursor(0, 0); - helpers.doKeys('g', 'v'); - // here the fake cursor is at (1, 3) - helpers.assertCursorAt(1, 4); - eqPos(makeCursor(1, 0), cm.getCursor('anchor')); - helpers.doKeys('v'); - cm.setCursor(2, 0); - helpers.doKeys('v', 'l', 'l', 'g', 'v'); - helpers.assertCursorAt(1, 4); - eqPos(makeCursor(1, 0), cm.getCursor('anchor')); - helpers.doKeys('g', 'v'); - helpers.assertCursorAt(2, 3); - eqPos(makeCursor(2, 0), cm.getCursor('anchor')); - eq('123456\n2345\nbar', cm.getValue()); -}, { value: '123456\nfoo\nbar' }); -testVim('reselect_visual_line', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'j', 'j', 'V', 'g', 'v', 'd'); - eq('foo\nand\nbar', cm.getValue()); - cm.setCursor(1, 0); - helpers.doKeys('V', 'y', 'j'); - helpers.doKeys('V', 'p' , 'g', 'v', 'd'); - eq('foo\nand', cm.getValue()); -}, { value: 'hello\nthis\nis\nfoo\nand\nbar' }); -testVim('reselect_visual_block', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('', 'k', 'h', ''); - cm.setCursor(2, 1); - helpers.doKeys('v', 'l', 'g', 'v'); - eqPos(Pos(1, 2), vim.sel.anchor); - eqPos(Pos(0, 1), vim.sel.head); - // Ensure selection is done with visual block mode rather than one - // continuous range. - eq(cm.getSelections().join(''), '23oo') - helpers.doKeys('g', 'v'); - eqPos(Pos(2, 1), vim.sel.anchor); - eqPos(Pos(2, 2), vim.sel.head); - helpers.doKeys(''); - // Ensure selection of deleted range - cm.setCursor(1, 1); - helpers.doKeys('v', '', 'j', 'd', 'g', 'v'); - eq(cm.getSelections().join(''), 'or'); -}, { value: '123456\nfoo\nbar' }); -testVim('s_normal', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('s'); - helpers.doKeys(''); - eq('ac', cm.getValue()); -}, { value: 'abc'}); -testVim('s_visual', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v', 's'); - helpers.doKeys(''); - helpers.assertCursorAt(0, 0); - eq('ac', cm.getValue()); -}, { value: 'abc'}); -testVim('o_visual', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys('v','l','l','l','o'); - helpers.assertCursorAt(0,0); - helpers.doKeys('v','v','j','j','j','o'); - helpers.assertCursorAt(0,0); - helpers.doKeys('O'); - helpers.doKeys('l','l') - helpers.assertCursorAt(3, 3); - helpers.doKeys('d'); - eq('p',cm.getValue()); -}, { value: 'abcd\nefgh\nijkl\nmnop'}); -testVim('o_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('','3','j','l','l', 'o'); - eqPos(Pos(3, 3), vim.sel.anchor); - eqPos(Pos(0, 1), vim.sel.head); - helpers.doKeys('O'); - eqPos(Pos(3, 1), vim.sel.anchor); - eqPos(Pos(0, 3), vim.sel.head); - helpers.doKeys('o'); - eqPos(Pos(0, 3), vim.sel.anchor); - eqPos(Pos(3, 1), vim.sel.head); -}, { value: 'abcd\nefgh\nijkl\nmnop'}); -testVim('changeCase_visual', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('v', 'l', 'l'); - helpers.doKeys('U'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('v', 'l', 'l'); - helpers.doKeys('u'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('l', 'l', 'l', '.'); - helpers.assertCursorAt(0, 3); - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'v', 'j', 'U', 'q'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('j', '@', 'a'); - helpers.assertCursorAt(1, 0); - cm.setCursor(3, 0); - helpers.doKeys('V', 'U', 'j', '.'); - eq('ABCDEF\nGHIJKL\nMnopq\nSHORT LINE\nLONG LINE OF TEXT', cm.getValue()); -}, { value: 'abcdef\nghijkl\nmnopq\nshort line\nlong line of text'}); -testVim('changeCase_visual_block', function(cm, vim, helpers) { - cm.setCursor(2, 1); - helpers.doKeys('', 'k', 'k', 'h', 'U'); - eq('ABcdef\nGHijkl\nMNopq\nfoo', cm.getValue()); - cm.setCursor(0, 2); - helpers.doKeys('.'); - eq('ABCDef\nGHIJkl\nMNOPq\nfoo', cm.getValue()); - // check when last line is shorter. - cm.setCursor(2, 2); - helpers.doKeys('.'); - eq('ABCDef\nGHIJkl\nMNOPq\nfoO', cm.getValue()); -}, { value: 'abcdef\nghijkl\nmnopq\nfoo'}); -testVim('visual_paste', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('v', 'l', 'l', 'y'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('3', 'l', 'j', 'v', 'l', 'p'); - helpers.assertCursorAt(1, 5); - eq('this is a\nunithitest for visual paste', cm.getValue()); - cm.setCursor(0, 0); - // in case of pasting whole line - helpers.doKeys('y', 'y'); - cm.setCursor(1, 6); - helpers.doKeys('v', 'l', 'l', 'l', 'p'); - helpers.assertCursorAt(2, 0); - eq('this is a\nunithi\nthis is a\n for visual paste', cm.getValue()); -}, { value: 'this is a\nunit test for visual paste'}); - -// This checks the contents of the register used to paste the text -testVim('v_paste_from_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'w'); - cm.setCursor(1, 0); - helpers.doKeys('v', 'p'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+register/.test(text)); - }); -}, { value: 'register contents\nare not erased'}); -testVim('S_normal', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('j', 'S'); - helpers.doKeys(''); - helpers.assertCursorAt(1, 0); - eq('aa\n\ncc', cm.getValue()); -}, { value: 'aa\nbb\ncc'}); -testVim('blockwise_paste', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '3', 'j', 'l', 'y'); - cm.setCursor(0, 2); - // paste one char after the current cursor position - helpers.doKeys('p'); - eq('helhelo\nworwold\nfoofo\nbarba', cm.getValue()); - cm.setCursor(0, 0); - helpers.doKeys('v', '4', 'l', 'y'); - cm.setCursor(0, 0); - helpers.doKeys('', '3', 'j', 'p'); - eq('helheelhelo\norwold\noofo\narba', cm.getValue()); -}, { value: 'hello\nworld\nfoo\nbar'}); -testVim('blockwise_paste_long/short_line', function(cm, vim, helpers) { - // extend short lines in case of different line lengths. - cm.setCursor(0, 0); - helpers.doKeys('', 'j', 'j', 'y'); - cm.setCursor(0, 3); - helpers.doKeys('p'); - eq('hellho\nfoo f\nbar b', cm.getValue()); -}, { value: 'hello\nfoo\nbar'}); -testVim('blockwise_paste_cut_paste', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', 'x'); - cm.setCursor(0, 0); - helpers.doKeys('P'); - eq('cut\nand\npaste\nme', cm.getValue()); -}, { value: 'cut\nand\npaste\nme'}); -testVim('blockwise_paste_from_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', '"', 'a', 'y'); - cm.setCursor(0, 3); - helpers.doKeys('"', 'a', 'p'); - eq('foobfar\nhellho\nworlwd', cm.getValue()); -}, { value: 'foobar\nhello\nworld'}); -testVim('blockwise_paste_last_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', 'l', 'y'); - cm.setCursor(3, 0); - helpers.doKeys('p'); - eq('cut\nand\npaste\nmcue\n an\n pa', cm.getValue()); -}, { value: 'cut\nand\npaste\nme'}); - -testVim('S_visual', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v', 'j', 'S'); - helpers.doKeys(''); - helpers.assertCursorAt(0, 0); - eq('\ncc', cm.getValue()); -}, { value: 'aa\nbb\ncc'}); - -testVim('/ and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 11); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 6); - helpers.doKeys('N'); - helpers.assertCursorAt(0, 11); - - cm.setCursor(0, 0); - helpers.doKeys('2', '/'); - helpers.assertCursorAt(1, 6); -}, { value: 'match nope match \n nope Match' }); -testVim('/_case', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('Match'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 6); -}, { value: 'match nope match \n nope Match' }); -testVim('/_2_pcre', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', true); - cm.openDialog = helpers.fakeOpenDialog('(word){2}'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 9); - helpers.doKeys('n'); - helpers.assertCursorAt(2, 1); -}, { value: 'word\n another wordword\n wordwordword\n' }); -testVim('/_2_nopcre', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', false); - cm.openDialog = helpers.fakeOpenDialog('\\(word\\)\\{2}'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 9); - helpers.doKeys('n'); - helpers.assertCursorAt(2, 1); -}, { value: 'word\n another wordword\n wordwordword\n' }); -testVim('/_nongreedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('aa'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('?_nongreedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('aa'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('/_greedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a+'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('?_greedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a+'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('/_greedy_0_or_more', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a*'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 5); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 0); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa\n aa'}); -testVim('?_greedy_0_or_more', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a*'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 0); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 5); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa\n aa'}); -testVim('? and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 6); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 11); - helpers.doKeys('N'); - helpers.assertCursorAt(1, 6); - - cm.setCursor(0, 0); - helpers.doKeys('2', '?'); - helpers.assertCursorAt(0, 11); -}, { value: 'match nope match \n nope Match' }); -testVim('*', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 22); - - cm.setCursor(0, 9); - helpers.doKeys('2', '*'); - helpers.assertCursorAt(1, 8); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_no_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 0); -}, { value: ' \n match \n' }); -testVim('*_symbol', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(1, 0); -}, { value: ' /}\n/} match \n' }); -testVim('#', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('#'); - helpers.assertCursorAt(1, 8); - - cm.setCursor(0, 9); - helpers.doKeys('2', '#'); - helpers.assertCursorAt(0, 22); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_seek', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 22); -}, { value: ' := match nomatch match \nnomatch Match' }); -testVim('#', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('#'); - helpers.assertCursorAt(1, 8); -}, { value: ' := match nomatch match \nnomatch Match' }); -testVim('g*', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('g', '*'); - helpers.assertCursorAt(0, 18); - cm.setCursor(0, 8); - helpers.doKeys('3', 'g', '*'); - helpers.assertCursorAt(1, 8); -}, { value: 'matches match alsoMatch\nmatchme matching' }); -testVim('g#', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('g', '#'); - helpers.assertCursorAt(0, 0); - cm.setCursor(0, 8); - helpers.doKeys('3', 'g', '#'); - helpers.assertCursorAt(1, 0); -}, { value: 'matches match alsoMatch\nmatchme matching' }); -testVim('macro_insert', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '0', 'i'); - cm.replaceRange('foo', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q', '@', 'a'); - eq('foofoo', cm.getValue()); -}, { value: ''}); -testVim('macro_insert_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '$', 'a'); - cm.replaceRange('larry.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('a'); - cm.replaceRange('curly.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('a'); - cm.replaceRange('moe.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('@', 'a'); - // At this point, the most recent edit should be the 2nd insert change - // inside the macro, i.e. "curly.". - helpers.doKeys('.'); - eq('larry.curly.moe.larry.curly.curly.', cm.getValue()); -}, { value: ''}); -testVim('macro_space', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', ''); - helpers.assertCursorAt(0, 2); - helpers.doKeys('q', 'a', '', '', 'q'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0, 6); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0, 8); -}, { value: 'one line of text.'}); -testVim('macro_t_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 't', 'e', 'q'); - helpers.assertCursorAt(0, 1); - helpers.doKeys('l', '@', 'a'); - helpers.assertCursorAt(0, 6); - helpers.doKeys('l', ';'); - helpers.assertCursorAt(0, 12); -}, { value: 'one line of text.'}); -testVim('macro_f_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'b', 'f', 'e', 'q'); - helpers.assertCursorAt(0, 2); - helpers.doKeys('@', 'b'); - helpers.assertCursorAt(0, 7); - helpers.doKeys(';'); - helpers.assertCursorAt(0, 13); -}, { value: 'one line of text.'}); -testVim('macro_slash_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'c'); - cm.openDialog = helpers.fakeOpenDialog('e'); - helpers.doKeys('/', 'q'); - helpers.assertCursorAt(0, 2); - helpers.doKeys('@', 'c'); - helpers.assertCursorAt(0, 7); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 13); -}, { value: 'one line of text.'}); -testVim('macro_multislash_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'd'); - cm.openDialog = helpers.fakeOpenDialog('e'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('t'); - helpers.doKeys('/', 'q'); - helpers.assertCursorAt(0, 12); - helpers.doKeys('@', 'd'); - helpers.assertCursorAt(0, 15); -}, { value: 'one line of text to rule them all.'}); -testVim('macro_parens', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'z', 'i'); - cm.replaceRange('(', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('e', 'a'); - cm.replaceRange(')', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('w', '@', 'z'); - helpers.doKeys('w', '@', 'z'); - eq('(see) (spot) (run)', cm.getValue()); -}, { value: 'see spot run'}); -testVim('macro_overwrite', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'z', '0', 'i'); - cm.replaceRange('I ', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('e'); - // Now replace the macro with something else. - helpers.doKeys('q', 'z', 'a'); - cm.replaceRange('.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('e', '@', 'z'); - helpers.doKeys('e', '@', 'z'); - eq('I see. spot. run.', cm.getValue()); -}, { value: 'see spot run'}); -testVim('macro_search_f', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'f', ' '); - helpers.assertCursorAt(0,3); - helpers.doKeys('q', '0'); - helpers.assertCursorAt(0,0); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0,3); -}, { value: 'The quick brown fox jumped over the lazy dog.'}); -testVim('macro_search_2f', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '2', 'f', ' '); - helpers.assertCursorAt(0,9); - helpers.doKeys('q', '0'); - helpers.assertCursorAt(0,0); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0,9); -}, { value: 'The quick brown fox jumped over the lazy dog.'}); -testVim('yank_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'y'); - helpers.doKeys('j', '"', 'b', 'y', 'y'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo/.test(text)); - is(/b\s+bar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', 'l', 'j', '"', 'a', 'y'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+oo\nar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_line_to_line_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'y'); - helpers.doKeys('j', '"', 'A', 'y', 'y'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo\nbar/.test(text)); - is(/"\s+foo\nbar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_word_to_word_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'w'); - helpers.doKeys('j', '"', 'A', 'y', 'w'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foobar/.test(text)); - is(/"\s+foobar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_line_to_word_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'w'); - helpers.doKeys('j', '"', 'A', 'y', 'y'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo\nbar/.test(text)); - is(/"\s+foo\nbar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_word_to_line_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'y'); - helpers.doKeys('j', '"', 'A', 'y', 'w'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo\nbar/.test(text)); - is(/"\s+foo\nbar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('macro_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'i'); - cm.replaceRange('gangnam', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('q', 'b', 'o'); - cm.replaceRange('style', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+i/.test(text)); - is(/b\s+o/.test(text)); - }); - helpers.doKeys(':'); -}, { value: ''}); -testVim('._register', function(cm,vim,helpers) { - cm.setCursor(0,0); - helpers.doKeys('i'); - cm.replaceRange('foo',cm.getCursor()); - helpers.doKeys(''); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/\.\s+foo/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim(':_register', function(cm,vim,helpers) { - helpers.doEx('bar'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/:\s+bar/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim('search_register_escape', function(cm, vim, helpers) { - // Check that the register is restored if the user escapes rather than confirms. - cm.openDialog = helpers.fakeOpenDialog('waldo'); - helpers.doKeys('/'); - var onKeyDown; - var onKeyUp; - var KEYCODES = { - f: 70, - o: 79, - Esc: 27 - }; - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - onKeyUp = options.onKeyUp; - }; - var close = function() {}; - helpers.doKeys('/'); - // Fake some keyboard events coming in. - onKeyDown({keyCode: KEYCODES.f}, '', close); - onKeyUp({keyCode: KEYCODES.f}, '', close); - onKeyDown({keyCode: KEYCODES.o}, 'f', close); - onKeyUp({keyCode: KEYCODES.o}, 'f', close); - onKeyDown({keyCode: KEYCODES.o}, 'fo', close); - onKeyUp({keyCode: KEYCODES.o}, 'fo', close); - onKeyDown({keyCode: KEYCODES.Esc}, 'foo', close); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/waldo/.test(text)); - is(!/foo/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim('search_register', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('foo'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/\/\s+foo/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim('search_history', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('this'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('checks'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('search'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('history'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('checks'); - helpers.doKeys('/'); - var onKeyDown; - var onKeyUp; - var query = ''; - var keyCodes = { - Up: 38, - Down: 40 - }; - cm.openDialog = function(template, callback, options) { - onKeyUp = options.onKeyUp; - onKeyDown = options.onKeyDown; - }; - var close = function(newVal) { - if (typeof newVal == 'string') query = newVal; - } - helpers.doKeys('/'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'checks'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'history'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'search'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'this'); - onKeyDown({keyCode: keyCodes.Down}, query, close); - onKeyUp({keyCode: keyCodes.Down}, query, close); - eq(query, 'search'); -}, {value: ''}); -testVim('exCommand_history', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('registers'); - helpers.doKeys(':'); - cm.openDialog = helpers.fakeOpenDialog('sort'); - helpers.doKeys(':'); - cm.openDialog = helpers.fakeOpenDialog('map'); - helpers.doKeys(':'); - cm.openDialog = helpers.fakeOpenDialog('invalid'); - helpers.doKeys(':'); - var onKeyDown; - var onKeyUp; - var input = ''; - var keyCodes = { - Up: 38, - Down: 40, - s: 115 - }; - cm.openDialog = function(template, callback, options) { - onKeyUp = options.onKeyUp; - onKeyDown = options.onKeyDown; - }; - var close = function(newVal) { - if (typeof newVal == 'string') input = newVal; - } - helpers.doKeys(':'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'invalid'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'map'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'sort'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'registers'); - onKeyDown({keyCode: keyCodes.s}, '', close); - input = 's'; - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'sort'); -}, {value: ''}); -testVim('.', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('2', 'd', 'w'); - helpers.doKeys('.'); - eq('5 6', cm.getValue()); -}, { value: '1 2 3 4 5 6'}); -testVim('._repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('2', 'd', 'w'); - helpers.doKeys('3', '.'); - eq('6', cm.getValue()); -}, { value: '1 2 3 4 5 6'}); -testVim('._insert', function(cm, vim, helpers) { - helpers.doKeys('i'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('testestt', cm.getValue()); - helpers.assertCursorAt(0, 6); -}, { value: ''}); -testVim('._insert_repeat', function(cm, vim, helpers) { - helpers.doKeys('i'); - cm.replaceRange('test', cm.getCursor()); - cm.setCursor(0, 4); - helpers.doKeys(''); - helpers.doKeys('2', '.'); - eq('testesttestt', cm.getValue()); - helpers.assertCursorAt(0, 10); -}, { value: ''}); -testVim('._repeat_insert', function(cm, vim, helpers) { - helpers.doKeys('3', 'i'); - cm.replaceRange('te', cm.getCursor()); - cm.setCursor(0, 2); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('tetettetetee', cm.getValue()); - helpers.assertCursorAt(0, 10); -}, { value: ''}); -testVim('._insert_o', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - cm.setCursor(1, 1); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('\nz\nz', cm.getValue()); - helpers.assertCursorAt(2, 0); -}, { value: ''}); -testVim('._insert_o_repeat', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(1, 0); - helpers.doKeys('2', '.'); - eq('\nz\nz\nz', cm.getValue()); - helpers.assertCursorAt(3, 0); -}, { value: ''}); -testVim('._insert_o_indent', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(1, 2); - helpers.doKeys('.'); - eq('{\n z\n z', cm.getValue()); - helpers.assertCursorAt(2, 2); -}, { value: '{'}); -testVim('._insert_cw', function(cm, vim, helpers) { - helpers.doKeys('c', 'w'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(0, 3); - helpers.doKeys('2', 'l'); - helpers.doKeys('.'); - eq('test test word3', cm.getValue()); - helpers.assertCursorAt(0, 8); -}, { value: 'word1 word2 word3' }); -testVim('._insert_cw_repeat', function(cm, vim, helpers) { - // For some reason, repeat cw in desktop VIM will does not repeat insert mode - // changes. Will conform to that behavior. - helpers.doKeys('c', 'w'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(0, 4); - helpers.doKeys('l'); - helpers.doKeys('2', '.'); - eq('test test', cm.getValue()); - helpers.assertCursorAt(0, 8); -}, { value: 'word1 word2 word3' }); -testVim('._delete', function(cm, vim, helpers) { - cm.setCursor(0, 5); - helpers.doKeys('i'); - helpers.doInsertModeKeys('Backspace'); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('zace', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'zabcde'}); -testVim('._delete_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('i'); - helpers.doInsertModeKeys('Backspace'); - helpers.doKeys(''); - helpers.doKeys('2', '.'); - eq('zzce', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'zzabcde'}); -testVim('._visual_>', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('V', 'j', '>'); - cm.setCursor(2, 0) - helpers.doKeys('.'); - eq(' 1\n 2\n 3\n 4', cm.getValue()); - helpers.assertCursorAt(2, 2); -}, { value: '1\n2\n3\n4'}); -testVim('f;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(9, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('F;', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('F', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(2, cm.getCursor().ch); -}, { value: '01x3xx6x8x'}); -testVim('t;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(8, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('T;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(2, cm.getCursor().ch); -}, { value: '0xx3xx678x'}); -testVim('f,', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('f', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(2, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('F,', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('F', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(9, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('t,', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('t', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(3, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('T,', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('T', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(8, cm.getCursor().ch); -}, { value: '01x3xx67xx'}); -testVim('fd,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('d', ';'); - eq('56789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('d', ','); - eq('01239', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fd,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('d', ';'); - eq('01239', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('d', ','); - eq('56789', cm.getValue()); -}, { value: '0123456789'}); -testVim('td,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('d', ';'); - eq('456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('d', ','); - eq('012349', cm.getValue()); -}, { value: '0123456789'}); -testVim('Td,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('d', ';'); - eq('012349', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('d', ','); - eq('456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('fc,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('c', ';', ''); - eq('56789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('c', ','); - eq('01239', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fc,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('c', ';', ''); - eq('01239', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('c', ','); - eq('56789', cm.getValue()); -}, { value: '0123456789'}); -testVim('tc,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('c', ';', ''); - eq('456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('c', ','); - eq('012349', cm.getValue()); -}, { value: '0123456789'}); -testVim('Tc,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('c', ';', ''); - eq('012349', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('c', ','); - eq('456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('fy,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('y', ';', 'P'); - eq('012340123456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('y', ',', 'P'); - eq('012345678456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fy,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('y', ';', 'p'); - eq('012345678945678', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('y', ',', 'P'); - eq('012340123456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('ty,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('y', ';', 'P'); - eq('01230123456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('y', ',', 'p'); - eq('01234567895678', cm.getValue()); -}, { value: '0123456789'}); -testVim('Ty,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('y', ';', 'p'); - eq('01234567895678', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('y', ',', 'P'); - eq('01230123456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('HML', function(cm, vim, helpers) { - var lines = 35; - var textHeight = cm.defaultTextHeight(); - cm.setSize(600, lines*textHeight); - cm.setCursor(120, 0); - cm.refresh(); //ace! - helpers.doKeys('H'); - helpers.assertCursorAt(86, 2); - helpers.doKeys('L'); - helpers.assertCursorAt(120, 4); - helpers.doKeys('M'); - helpers.assertCursorAt(103,4); -}, { value: (function(){ - var lines = new Array(100); - var upper = ' xx\n'; - var lower = ' xx\n'; - upper = lines.join(upper); - lower = lines.join(lower); - return upper + lower; -})()}); - -var zVals = []; -forEach(['zb','zz','zt','z-','z.','z'], function(e, idx){ - var lineNum = 250; - var lines = 35; - testVim(e, function(cm, vim, helpers) { - var k1 = e[0]; - var k2 = e.substring(1); - var textHeight = cm.defaultTextHeight(); - cm.setSize(600, lines*textHeight); - cm.setCursor(lineNum, 0); - helpers.doKeys(k1, k2); - zVals[idx] = cm.getScrollInfo().top; - }, { value: (function(){ - return new Array(500).join('\n'); - })()}); -}); -testVim('zb', function(cm, vim, helpers){ - eq(zVals[2], zVals[5]); -}); - -var moveTillCharacterSandbox = - 'The quick brown fox \n' - 'jumped over the lazy dog.' -testVim('moveTillCharacter', function(cm, vim, helpers){ - cm.setCursor(0, 0); - // Search for the 'q'. - cm.openDialog = helpers.fakeOpenDialog('q'); - helpers.doKeys('/'); - eq(4, cm.getCursor().ch); - // Jump to just before the first o in the list. - helpers.doKeys('t'); - helpers.doKeys('o'); - eq('The quick brown fox \n', cm.getValue()); - // Delete that one character. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('o'); - eq('The quick bown fox \n', cm.getValue()); - // Delete everything until the next 'o'. - helpers.doKeys('.'); - eq('The quick box \n', cm.getValue()); - // An unmatched character should have no effect. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('q'); - eq('The quick box \n', cm.getValue()); - // Matches should only be possible on single lines. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('z'); - eq('The quick box \n', cm.getValue()); - // After all that, the search for 'q' should still be active, so the 'N' command - // can run it again in reverse. Use that to delete everything back to the 'q'. - helpers.doKeys('d'); - helpers.doKeys('N'); - eq('The ox \n', cm.getValue()); - eq(4, cm.getCursor().ch); -}, { value: moveTillCharacterSandbox}); -testVim('searchForPipe', function(cm, vim, helpers){ - CodeMirror.Vim.setOption('pcre', false); - cm.setCursor(0, 0); - // Search for the '|'. - cm.openDialog = helpers.fakeOpenDialog('|'); - helpers.doKeys('/'); - eq(4, cm.getCursor().ch); -}, { value: 'this|that'}); - - -var scrollMotionSandbox = - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'; -testVim('scrollMotion', function(cm, vim, helpers){ - var prevCursor, prevScrollInfo; - cm.setCursor(0, 0); - // ctrl-y at the top of the file should have no effect. - helpers.doKeys(''); - eq(0, cm.getCursor().line); - prevScrollInfo = cm.getScrollInfo(); - helpers.doKeys(''); - eq(1, cm.getCursor().line); - is(prevScrollInfo.top < cm.getScrollInfo().top); - // Jump to the end of the sandbox. - cm.setCursor(1000, 0); - cm.refresh(); //ace! - prevCursor = cm.getCursor(); - // ctrl-e at the bottom of the file should have no effect. - helpers.doKeys(''); - eq(prevCursor.line, cm.getCursor().line); - cm.refresh(); //ace! - prevScrollInfo = cm.getScrollInfo(); - helpers.doKeys(''); - eq(prevCursor.line - 1, cm.getCursor().line); - is(prevScrollInfo.top > cm.getScrollInfo().top); -}, { value: scrollMotionSandbox}); - -var squareBracketMotionSandbox = ''+ - '({\n'+//0 - ' ({\n'+//11 - ' /*comment {\n'+//2 - ' */(\n'+//3 - '#else \n'+//4 - ' /* )\n'+//5 - '#if }\n'+//6 - ' )}*/\n'+//7 - ')}\n'+//8 - '{}\n'+//9 - '#else {{\n'+//10 - '{}\n'+//11 - '}\n'+//12 - '{\n'+//13 - '#endif\n'+//14 - '}\n'+//15 - '}\n'+//16 - '#else';//17 -testVim('[[, ]]', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(']', ']'); - helpers.assertCursorAt(9,0); - helpers.doKeys('2', ']', ']'); - helpers.assertCursorAt(13,0); - helpers.doKeys(']', ']'); - helpers.assertCursorAt(17,0); - helpers.doKeys('[', '['); - helpers.assertCursorAt(13,0); - helpers.doKeys('2', '[', '['); - helpers.assertCursorAt(9,0); - helpers.doKeys('[', '['); - helpers.assertCursorAt(0,0); -}, { value: squareBracketMotionSandbox}); -testVim('[], ][', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(']', '['); - helpers.assertCursorAt(12,0); - helpers.doKeys('2', ']', '['); - helpers.assertCursorAt(16,0); - helpers.doKeys(']', '['); - helpers.assertCursorAt(17,0); - helpers.doKeys('[', ']'); - helpers.assertCursorAt(16,0); - helpers.doKeys('2', '[', ']'); - helpers.assertCursorAt(12,0); - helpers.doKeys('[', ']'); - helpers.assertCursorAt(0,0); -}, { value: squareBracketMotionSandbox}); -testVim('[{, ]}', function(cm, vim, helpers) { - cm.setCursor(4, 10); - helpers.doKeys('[', '{'); - helpers.assertCursorAt(2,12); - helpers.doKeys('2', '[', '{'); - helpers.assertCursorAt(0,1); - cm.setCursor(4, 10); - helpers.doKeys(']', '}'); - helpers.assertCursorAt(6,11); - helpers.doKeys('2', ']', '}'); - helpers.assertCursorAt(8,1); - cm.setCursor(0,1); - helpers.doKeys(']', '}'); - helpers.assertCursorAt(8,1); - helpers.doKeys('[', '{'); - helpers.assertCursorAt(0,1); -}, { value: squareBracketMotionSandbox}); -testVim('[(, ])', function(cm, vim, helpers) { - cm.setCursor(4, 10); - helpers.doKeys('[', '('); - helpers.assertCursorAt(3,14); - helpers.doKeys('2', '[', '('); - helpers.assertCursorAt(0,0); - cm.setCursor(4, 10); - helpers.doKeys(']', ')'); - helpers.assertCursorAt(5,11); - helpers.doKeys('2', ']', ')'); - helpers.assertCursorAt(8,0); - helpers.doKeys('[', '('); - helpers.assertCursorAt(0,0); - helpers.doKeys(']', ')'); - helpers.assertCursorAt(8,0); -}, { value: squareBracketMotionSandbox}); -testVim('[*, ]*, [/, ]/', function(cm, vim, helpers) { - forEach(['*', '/'], function(key){ - cm.setCursor(7, 0); - helpers.doKeys('2', '[', key); - helpers.assertCursorAt(2,2); - helpers.doKeys('2', ']', key); - helpers.assertCursorAt(7,5); - }); -}, { value: squareBracketMotionSandbox}); -testVim('[#, ]#', function(cm, vim, helpers) { - cm.setCursor(10, 3); - helpers.doKeys('2', '[', '#'); - helpers.assertCursorAt(4,0); - helpers.doKeys('5', ']', '#'); - helpers.assertCursorAt(17,0); - cm.setCursor(10, 3); - helpers.doKeys(']', '#'); - helpers.assertCursorAt(14,0); -}, { value: squareBracketMotionSandbox}); -testVim('[m, ]m, [M, ]M', function(cm, vim, helpers) { - cm.setCursor(11, 0); - helpers.doKeys('[', 'm'); - helpers.assertCursorAt(10,7); - helpers.doKeys('4', '[', 'm'); - helpers.assertCursorAt(1,3); - helpers.doKeys('5', ']', 'm'); - helpers.assertCursorAt(11,0); - helpers.doKeys('[', 'M'); - helpers.assertCursorAt(9,1); - helpers.doKeys('3', ']', 'M'); - helpers.assertCursorAt(15,0); - helpers.doKeys('5', '[', 'M'); - helpers.assertCursorAt(7,3); -}, { value: squareBracketMotionSandbox}); - -// Ex mode tests -testVim('ex_go_to_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doEx('4'); - helpers.assertCursorAt(3, 0); -}, { value: 'a\nb\nc\nd\ne\n'}); -testVim('ex_write', function(cm, vim, helpers) { - var tmp = CodeMirror.commands.save; - var written; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - // Test that w, wr, wri ... write all trigger :write. - var command = 'write'; - for (var i = 1; i < command.length; i++) { - written = false; - actualCm = null; - helpers.doEx(command.substring(0, i)); - eq(written, true); - eq(actualCm, cm); - } - CodeMirror.commands.save = tmp; -}); -testVim('ex_sort', function(cm, vim, helpers) { - helpers.doEx('sort'); - eq('Z\na\nb\nc\nd', cm.getValue()); -}, { value: 'b\nZ\nd\nc\na'}); -testVim('ex_sort_reverse', function(cm, vim, helpers) { - helpers.doEx('sort!'); - eq('d\nc\nb\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_range', function(cm, vim, helpers) { - helpers.doEx('2,3sort'); - eq('b\nc\nd\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_oneline', function(cm, vim, helpers) { - helpers.doEx('2sort'); - // Expect no change. - eq('b\nd\nc\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_ignoreCase', function(cm, vim, helpers) { - helpers.doEx('sort i'); - eq('a\nb\nc\nd\nZ', cm.getValue()); -}, { value: 'b\nZ\nd\nc\na'}); -testVim('ex_sort_unique', function(cm, vim, helpers) { - helpers.doEx('sort u'); - eq('Z\na\nb\nc\nd', cm.getValue()); -}, { value: 'b\nZ\na\na\nd\na\nc\na'}); -testVim('ex_sort_decimal', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('d3\n s5\n6\n.9', cm.getValue()); -}, { value: '6\nd3\n s5\n.9'}); -testVim('ex_sort_decimal_negative', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('z-9\nd3\n s5\n6\n.9', cm.getValue()); -}, { value: '6\nd3\n s5\n.9\nz-9'}); -testVim('ex_sort_decimal_reverse', function(cm, vim, helpers) { - helpers.doEx('sort! d'); - eq('.9\n6\n s5\nd3', cm.getValue()); -}, { value: '6\nd3\n s5\n.9'}); -testVim('ex_sort_hex', function(cm, vim, helpers) { - helpers.doEx('sort x'); - eq(' s5\n6\n.9\n&0xB\nd3', cm.getValue()); -}, { value: '6\nd3\n s5\n&0xB\n.9'}); -testVim('ex_sort_octal', function(cm, vim, helpers) { - helpers.doEx('sort o'); - eq('.8\n.9\nd3\n s5\n6', cm.getValue()); -}, { value: '6\nd3\n s5\n.9\n.8'}); -testVim('ex_sort_decimal_mixed', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('y\nz\nc1\nb2\na3', cm.getValue()); -}, { value: 'a3\nz\nc1\ny\nb2'}); -testVim('ex_sort_decimal_mixed_reverse', function(cm, vim, helpers) { - helpers.doEx('sort! d'); - eq('a3\nb2\nc1\nz\ny', cm.getValue()); -}, { value: 'a3\nz\nc1\ny\nb2'}); -// test for :global command -testVim('ex_global', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doEx('g/one/s//two'); - eq('two two\n two two\n two two', cm.getValue()); - helpers.doEx('1,2g/two/s//one'); - eq('one one\n one one\n two two', cm.getValue()); -}, {value: 'one one\n one one\n one one'}); -testVim('ex_global_confirm', function(cm, vim, helpers) { - cm.setCursor(0, 0); - var onKeyDown; - var openDialogSave = cm.openDialog; - var KEYCODES = { - a: 65, - n: 78, - q: 81, - y: 89 - }; - // Intercept the ex command, 'global' - cm.openDialog = function(template, callback, options) { - // Intercept the prompt for the embedded ex command, 'substitute' - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - }; - callback('g/one/s//two/gc'); - }; - helpers.doKeys(':'); - var close = function() {}; - onKeyDown({keyCode: KEYCODES.n}, '', close); - onKeyDown({keyCode: KEYCODES.y}, '', close); - onKeyDown({keyCode: KEYCODES.a}, '', close); - onKeyDown({keyCode: KEYCODES.q}, '', close); - onKeyDown({keyCode: KEYCODES.y}, '', close); - eq('one two\n two two\n one one\n two one\n one one', cm.getValue()); -}, {value: 'one one\n one one\n one one\n one one\n one one'}); -// Basic substitute tests. -testVim('ex_substitute_same_line', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('s/one/two/g'); - eq('one one\n two two', cm.getValue()); -}, { value: 'one one\n one one'}); -testVim('ex_substitute_full_file', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('%s/one/two/g'); - eq('two two\n two two', cm.getValue()); -}, { value: 'one one\n one one'}); -testVim('ex_substitute_input_range', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('1,3s/\\d/0/g'); - eq('0\n0\n0\n4', cm.getValue()); -}, { value: '1\n2\n3\n4' }); -testVim('ex_substitute_visual_range', function(cm, vim, helpers) { - cm.setCursor(1, 0); - // Set last visual mode selection marks '< and '> at lines 2 and 4 - helpers.doKeys('V', '2', 'j', 'v'); - helpers.doEx('\'<,\'>s/\\d/0/g'); - eq('1\n0\n0\n0\n5', cm.getValue()); -}, { value: '1\n2\n3\n4\n5' }); -testVim('ex_substitute_empty_query', function(cm, vim, helpers) { - // If the query is empty, use last query. - cm.setCursor(1, 0); - cm.openDialog = helpers.fakeOpenDialog('1'); - helpers.doKeys('/'); - helpers.doEx('s//b/g'); - eq('abb ab2 ab3', cm.getValue()); -}, { value: 'a11 a12 a13' }); -testVim('ex_substitute_javascript', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', false); - cm.setCursor(1, 0); - // Throw all the things that javascript likes to treat as special values - // into the replace part. All should be literal (this is VIM). - helpers.doEx('s/\\(\\d+\\)/$$ $\' $` $& \\1/g') - eq('a $$ $\' $` $& 0 b', cm.getValue()); -}, { value: 'a 0 b' }); -testVim('ex_substitute_empty_arguments', function(cm,vim,helpers) { - cm.setCursor(0, 0); - helpers.doEx('s/a/b/g'); - cm.setCursor(1, 0); - helpers.doEx('s'); - eq('b b\nb a', cm.getValue()); -}, {value: 'a a\na a'}); - -// More complex substitute tests that test both pcre and nopcre options. -function testSubstitute(name, options) { - testVim(name + '_pcre', function(cm, vim, helpers) { - cm.setCursor(1, 0); - CodeMirror.Vim.setOption('pcre', true); - helpers.doEx(options.expr); - eq(options.expectedValue, cm.getValue()); - }, options); - // If no noPcreExpr is defined, assume that it's the same as the expr. - var noPcreExpr = options.noPcreExpr ? options.noPcreExpr : options.expr; - testVim(name + '_nopcre', function(cm, vim, helpers) { - cm.setCursor(1, 0); - CodeMirror.Vim.setOption('pcre', false); - helpers.doEx(noPcreExpr); - eq(options.expectedValue, cm.getValue()); - }, options); -} -testSubstitute('ex_substitute_capture', { - value: 'a11 a12 a13', - expectedValue: 'a1111 a1212 a1313', - // $n is a backreference - expr: 's/(\\d+)/$1$1/g', - // \n is a backreference. - noPcreExpr: 's/\\(\\d+\\)/\\1\\1/g'}); -testSubstitute('ex_substitute_capture2', { - value: 'a 0 b', - expectedValue: 'a $00 b', - expr: 's/(\\d+)/$$$1$1/g', - noPcreExpr: 's/\\(\\d+\\)/$\\1\\1/g'}); -testSubstitute('ex_substitute_nocapture', { - value: 'a11 a12 a13', - expectedValue: 'a$1$1 a$1$1 a$1$1', - expr: 's/(\\d+)/$$1$$1/g', - noPcreExpr: 's/\\(\\d+\\)/$1$1/g'}); -testSubstitute('ex_substitute_nocapture2', { - value: 'a 0 b', - expectedValue: 'a $10 b', - expr: 's/(\\d+)/$$1$1/g', - noPcreExpr: 's/\\(\\d+\\)/\\$1\\1/g'}); -testSubstitute('ex_substitute_nocapture', { - value: 'a b c', - expectedValue: 'a $ c', - expr: 's/b/$$/', - noPcreExpr: 's/b/$/'}); -testSubstitute('ex_substitute_slash_regex', { - value: 'one/two \n three/four', - expectedValue: 'one|two \n three|four', - expr: '%s/\\//|'}); -testSubstitute('ex_substitute_pipe_regex', { - value: 'one|two \n three|four', - expectedValue: 'one,two \n three,four', - expr: '%s/\\|/,/', - noPcreExpr: '%s/|/,/'}); -testSubstitute('ex_substitute_or_regex', { - value: 'one|two \n three|four', - expectedValue: 'ana|twa \n thraa|faar', - expr: '%s/o|e|u/a/g', - noPcreExpr: '%s/o\\|e\\|u/a/g'}); -testSubstitute('ex_substitute_or_word_regex', { - value: 'one|two \n three|four', - expectedValue: 'five|five \n three|four', - expr: '%s/(one|two)/five/g', - noPcreExpr: '%s/\\(one\\|two\\)/five/g'}); -testSubstitute('ex_substitute_backslashslash_regex', { - value: 'one\\two \n three\\four', - expectedValue: 'one,two \n three,four', - expr: '%s/\\\\/,'}); -testSubstitute('ex_substitute_slash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one/two \n three/four', - expr: '%s/,/\\/'}); -testSubstitute('ex_substitute_backslash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one\\two \n three\\four', - expr: '%s/,/\\\\/g'}); -testSubstitute('ex_substitute_multibackslash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one\\\\\\\\two \n three\\\\\\\\four', // 2*8 backslashes. - expr: '%s/,/\\\\\\\\\\\\\\\\/g'}); // 16 backslashes. -testSubstitute('ex_substitute_braces_word', { - value: 'ababab abb ab{2}', - expectedValue: 'ab abb ab{2}', - expr: '%s/(ab){2}//g', - noPcreExpr: '%s/\\(ab\\)\\{2\\}//g'}); -testSubstitute('ex_substitute_braces_range', { - value: 'a aa aaa aaaa', - expectedValue: 'a a', - expr: '%s/a{2,3}//g', - noPcreExpr: '%s/a\\{2,3\\}//g'}); -testSubstitute('ex_substitute_braces_literal', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab abb ', - expr: '%s/ab\\{2\\}//g', - noPcreExpr: '%s/ab{2}//g'}); -testSubstitute('ex_substitute_braces_char', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab ab{2}', - expr: '%s/ab{2}//g', - noPcreExpr: '%s/ab\\{2\\}//g'}); -testSubstitute('ex_substitute_braces_no_escape', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab ab{2}', - expr: '%s/ab{2}//g', - noPcreExpr: '%s/ab\\{2}//g'}); -testSubstitute('ex_substitute_count', { - value: '1\n2\n3\n4', - expectedValue: '1\n0\n0\n4', - expr: 's/\\d/0/i 2'}); -testSubstitute('ex_substitute_count_with_range', { - value: '1\n2\n3\n4', - expectedValue: '1\n2\n0\n0', - expr: '1,3s/\\d/0/ 3'}); -testSubstitute('ex_substitute_not_global', { - value: 'aaa\nbaa\ncaa', - expectedValue: 'xaa\nbxa\ncxa', - expr: '%s/a/x/'}); -function testSubstituteConfirm(name, command, initialValue, expectedValue, keys, finalPos) { - testVim(name, function(cm, vim, helpers) { - var savedOpenDialog = cm.openDialog; - var savedKeyName = CodeMirror.keyName; - var onKeyDown; - var recordedCallback; - var closed = true; // Start out closed, set false on second openDialog. - function close() { - closed = true; - } - // First openDialog should save callback. - cm.openDialog = function(template, callback, options) { - recordedCallback = callback; - } - // Do first openDialog. - helpers.doKeys(':'); - // Second openDialog should save keyDown handler. - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - closed = false; - }; - // Return the command to Vim and trigger second openDialog. - recordedCallback(command); - // The event should really use keyCode, but here just mock it out and use - // key and replace keyName to just return key. - CodeMirror.keyName = function (e) { return e.key; } - keys = keys.toUpperCase(); - for (var i = 0; i < keys.length; i++) { - is(!closed); - onKeyDown({ key: keys.charAt(i) }, '', close); - } - try { - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(finalPos); - is(closed); - } catch(e) { - throw e - } finally { - // Restore overriden functions. - CodeMirror.keyName = savedKeyName; - cm.openDialog = savedOpenDialog; - } - }, { value: initialValue }); -}; -testSubstituteConfirm('ex_substitute_confirm_emptydoc', - '%s/x/b/c', '', '', '', makeCursor(0, 0)); -testSubstituteConfirm('ex_substitute_confirm_nomatch', - '%s/x/b/c', 'ba a\nbab', 'ba a\nbab', '', makeCursor(0, 0)); -testSubstituteConfirm('ex_substitute_confirm_accept', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'yyy', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_random_keys', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'ysdkywerty', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_some', - '%s/a/b/cg', 'ba a\nbab', 'bb a\nbbb', 'yny', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_all', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'a', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_accept_then_all', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'ya', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_quit', - '%s/a/b/cg', 'ba a\nbab', 'bb a\nbab', 'yq', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_last', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_oneline', - '1s/a/b/cg', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_range_accept', - '1,2s/a/b/cg', 'aa\na \na\na', 'bb\nb \na\na', 'yyy', makeCursor(1, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_some', - '1,3s/a/b/cg', 'aa\na \na\na', 'ba\nb \nb\na', 'ynyy', makeCursor(2, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_all', - '1,3s/a/b/cg', 'aa\na \na\na', 'bb\nb \nb\na', 'a', makeCursor(2, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_last', - '1,3s/a/b/cg', 'aa\na \na\na', 'bb\nb \na\na', 'yyl', makeCursor(1, 0)); -//:noh should clear highlighting of search-results but allow to resume search through n -testVim('ex_noh_clearSearchHighlight', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.doEx('noh'); - eq(vim.searchState_.getOverlay(),null,'match-highlighting wasn\'t cleared'); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 11,'can\'t resume search after clearing highlighting'); -}, { value: 'match nope match \n nope Match' }); -testVim('set_boolean', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', true, 'boolean'); - // Test default value is set. - is(CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set to non-boolean - CodeMirror.Vim.setOption('testoption', '5'); - fail(); - } catch (expected) {}; - // Test setOption - CodeMirror.Vim.setOption('testoption', false); - is(!CodeMirror.Vim.getOption('testoption')); -}); -testVim('ex_set_boolean', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', true, 'boolean'); - // Test default value is set. - is(CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set to non-boolean - helpers.doEx('set testoption=22'); - fail(); - } catch (expected) {}; - // Test setOption - helpers.doEx('set notestoption'); - is(!CodeMirror.Vim.getOption('testoption')); -}); -testVim('set_string', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', 'a', 'string'); - // Test default value is set. - eq('a', CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set non-string. - CodeMirror.Vim.setOption('testoption', true); - fail(); - } catch (expected) {}; - try { - // Test fail to set 'notestoption' - CodeMirror.Vim.setOption('notestoption', 'b'); - fail(); - } catch (expected) {}; - // Test setOption - CodeMirror.Vim.setOption('testoption', 'c'); - eq('c', CodeMirror.Vim.getOption('testoption')); -}); -testVim('ex_set_string', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', 'a', 'string'); - // Test default value is set. - eq('a', CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set 'notestoption' - helpers.doEx('set notestoption=b'); - fail(); - } catch (expected) {}; - // Test setOption - helpers.doEx('set testoption=c') - eq('c', CodeMirror.Vim.getOption('testoption')); -}); -// TODO: Reset key maps after each test. -testVim('ex_map_key2key', function(cm, vim, helpers) { - helpers.doEx('map a x'); - helpers.doKeys('a'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); -testVim('ex_unmap_key2key', function(cm, vim, helpers) { - helpers.doEx('unmap a'); - helpers.doKeys('a'); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'abc' }); -testVim('ex_unmap_key2key_does_not_remove_default', function(cm, vim, helpers) { - try { - helpers.doEx('unmap a'); - fail(); - } catch (expected) {} - helpers.doKeys('a'); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'abc' }); -testVim('ex_map_key2key_to_colon', function(cm, vim, helpers) { - helpers.doEx('map ; :'); - var dialogOpened = false; - cm.openDialog = function() { - dialogOpened = true; - } - helpers.doKeys(';'); - eq(dialogOpened, true); -}); -testVim('ex_map_ex2key:', function(cm, vim, helpers) { - helpers.doEx('map :del x'); - helpers.doEx('del'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); -testVim('ex_map_ex2ex', function(cm, vim, helpers) { - helpers.doEx('map :del :w'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - helpers.doEx('del'); - CodeMirror.commands.save = tmp; - eq(written, true); - eq(actualCm, cm); -}); -testVim('ex_map_key2ex', function(cm, vim, helpers) { - helpers.doEx('map a :w'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - helpers.doKeys('a'); - CodeMirror.commands.save = tmp; - eq(written, true); - eq(actualCm, cm); -}); -testVim('ex_map_key2key_visual_api', function(cm, vim, helpers) { - CodeMirror.Vim.map('b', ':w', 'visual'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - // Mapping should not work in normal mode. - helpers.doKeys('b'); - eq(written, false); - // Mapping should work in visual mode. - helpers.doKeys('v', 'b'); - eq(written, true); - eq(actualCm, cm); - - CodeMirror.commands.save = tmp; -}); -testVim('ex_imap', function(cm, vim, helpers) { - CodeMirror.Vim.map('jk', '', 'insert'); - helpers.doKeys('i'); - is(vim.insertMode); - helpers.doKeys('j', 'k'); - is(!vim.insertMode); -}) - -// Testing registration of functions as ex-commands and mapping to -keys -testVim('ex_api_test', function(cm, vim, helpers) { - var res=false; - var val='from'; - CodeMirror.Vim.defineEx('extest','ext',function(cm,params){ - if(params.args)val=params.args[0]; - else res=true; - }); - helpers.doEx(':ext to'); - eq(val,'to','Defining ex-command failed'); - CodeMirror.Vim.map('',':ext'); - helpers.doKeys('',''); - is(res,'Mapping to key failed'); -}); -// For now, this test needs to be last because it messes up : for future tests. -testVim('ex_map_key2key_from_colon', function(cm, vim, helpers) { - helpers.doEx('map : x'); - helpers.doKeys(':'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); - -// Test event handlers -testVim('beforeSelectionChange', function(cm, vim, helpers) { - cm.setCursor(0, 100); - eqPos(cm.getCursor('head'), cm.getCursor('anchor')); -}, { value: 'abc' }); - - -}); - - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js deleted file mode 100644 index 53c30e56..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +++ /dev/null @@ -1,240 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("../lib/dom"); -var IE8; - -var Cursor = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_cursor-layer"; - parentEl.appendChild(this.element); - - if (IE8 === undefined) - IE8 = "opacity" in this.element; - - this.isVisible = false; - this.isBlinking = true; - this.blinkInterval = 1000; - this.smoothBlinking = false; - - this.cursors = []; - this.cursor = this.addCursor(); - dom.addCssClass(this.element, "ace_hidden-cursors"); - this.$updateCursors = this.$updateVisibility.bind(this); -}; - -(function() { - - this.$updateVisibility = function(val) { - var cursors = this.cursors; - for (var i = cursors.length; i--; ) - cursors[i].style.visibility = val ? "" : "hidden"; - }; - this.$updateOpacity = function(val) { - var cursors = this.cursors; - for (var i = cursors.length; i--; ) - cursors[i].style.opacity = val ? "" : "0"; - }; - - - this.$padding = 0; - this.setPadding = function(padding) { - this.$padding = padding; - }; - - this.setSession = function(session) { - this.session = session; - }; - - this.setBlinking = function(blinking) { - if (blinking != this.isBlinking){ - this.isBlinking = blinking; - this.restartTimer(); - } - }; - - this.setBlinkInterval = function(blinkInterval) { - if (blinkInterval != this.blinkInterval){ - this.blinkInterval = blinkInterval; - this.restartTimer(); - } - }; - - this.setSmoothBlinking = function(smoothBlinking) { - if (smoothBlinking != this.smoothBlinking && !IE8) { - this.smoothBlinking = smoothBlinking; - dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking); - this.$updateCursors(true); - this.$updateCursors = (smoothBlinking - ? this.$updateOpacity - : this.$updateVisibility).bind(this); - this.restartTimer(); - } - }; - - this.addCursor = function() { - var el = dom.createElement("div"); - el.className = "ace_cursor"; - this.element.appendChild(el); - this.cursors.push(el); - return el; - }; - - this.removeCursor = function() { - if (this.cursors.length > 1) { - var el = this.cursors.pop(); - el.parentNode.removeChild(el); - return el; - } - }; - - this.hideCursor = function() { - this.isVisible = false; - dom.addCssClass(this.element, "ace_hidden-cursors"); - this.restartTimer(); - }; - - this.showCursor = function() { - this.isVisible = true; - dom.removeCssClass(this.element, "ace_hidden-cursors"); - this.restartTimer(); - }; - - this.restartTimer = function() { - var update = this.$updateCursors; - clearInterval(this.intervalId); - clearTimeout(this.timeoutId); - if (this.smoothBlinking) { - dom.removeCssClass(this.element, "ace_smooth-blinking"); - } - - update(true); - - if (!this.isBlinking || !this.blinkInterval || !this.isVisible) - return; - - if (this.smoothBlinking) { - setTimeout(function(){ - dom.addCssClass(this.element, "ace_smooth-blinking"); - }.bind(this)); - } - - var blink = function(){ - this.timeoutId = setTimeout(function() { - update(false); - }, 0.6 * this.blinkInterval); - }.bind(this); - - this.intervalId = setInterval(function() { - update(true); - blink(); - }, this.blinkInterval); - - blink(); - }; - - this.getPixelPosition = function(position, onScreen) { - if (!this.config || !this.session) - return {left : 0, top : 0}; - - if (!position) - position = this.session.selection.getCursor(); - var pos = this.session.documentToScreenPosition(position); - var cursorLeft = 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; - - var selections = this.session.$selectionMarkers; - var i = 0, cursorIndex = 0; - - if (selections === undefined || selections.length === 0){ - selections = [{cursor: null}]; - } - - for (var i = 0, n = selections.length; i < n; i++) { - var pixelPos = this.getPixelPosition(selections[i].cursor, true); - if ((pixelPos.top > config.height + config.offset || - pixelPos.top < 0) && i > 1) { - continue; - } - - var style = (this.cursors[cursorIndex++] || this.addCursor()).style; - - if (!this.drawCursor) { - style.left = pixelPos.left + "px"; - style.top = pixelPos.top + "px"; - style.width = config.characterWidth + "px"; - style.height = config.lineHeight + "px"; - } else { - this.drawCursor(style, pixelPos, config, selections[i], this.session); - } - } - while (this.cursors.length > cursorIndex) - this.removeCursor(); - - var overwrite = this.session.getOverwrite(); - this.$setOverwrite(overwrite); - - // cache for textarea and gutter highlight - this.$pixelPos = pixelPos; - this.restartTimer(); - }; - - this.drawCursor = null; - - this.$setOverwrite = function(overwrite) { - if (overwrite != this.overwrite) { - this.overwrite = overwrite; - if (overwrite) - dom.addCssClass(this.element, "ace_overwrite-cursors"); - else - dom.removeCssClass(this.element, "ace_overwrite-cursors"); - } - }; - - this.destroy = function() { - clearInterval(this.intervalId); - clearTimeout(this.timeoutId); - }; - -}).call(Cursor.prototype); - -exports.Cursor = Cursor; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/font_metrics.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/font_metrics.js deleted file mode 100644 index 7e71f8a8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/font_metrics.js +++ /dev/null @@ -1,176 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var oop = require("../lib/oop"); -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var useragent = require("../lib/useragent"); -var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var CHAR_COUNT = 0; - -var FontMetrics = exports.FontMetrics = function(parentEl, interval) { - this.el = dom.createElement("div"); - this.$setMeasureNodeStyles(this.el.style, true); - - this.$main = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$main.style); - - this.$measureNode = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$measureNode.style); - - - this.el.appendChild(this.$main); - this.el.appendChild(this.$measureNode); - parentEl.appendChild(this.el); - - if (!CHAR_COUNT) - this.$testFractionalRect(); - this.$measureNode.innerHTML = lang.stringRepeat("X", CHAR_COUNT); - - this.$characterSize = {width: 0, height: 0}; - this.checkForSizeChanges(); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.$characterSize = {width: 0, height: 0}; - - this.$testFractionalRect = function() { - var el = dom.createElement("div"); - this.$setMeasureNodeStyles(el.style); - el.style.width = "0.2px"; - document.documentElement.appendChild(el); - var w = el.getBoundingClientRect().width; - if (w > 0 && w < 1) - CHAR_COUNT = 50; - else - CHAR_COUNT = 100; - el.parentNode.removeChild(el); - }; - - this.$setMeasureNodeStyles = function(style, isRoot) { - style.width = style.height = "auto"; - style.left = style.top = "0px"; - style.visibility = "hidden"; - style.position = "absolute"; - style.whiteSpace = "pre"; - - if (useragent.isIE < 8) { - style["font-family"] = "inherit"; - } else { - style.font = "inherit"; - } - style.overflow = isRoot ? "hidden" : "visible"; - }; - - this.checkForSizeChanges = function() { - var size = this.$measureSizes(); - if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { - this.$measureNode.style.fontWeight = "bold"; - var boldSize = this.$measureSizes(); - this.$measureNode.style.fontWeight = ""; - this.$characterSize = size; - this.charSizes = Object.create(null); - this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; - this._emit("changeCharacterSize", {data: size}); - } - }; - - this.$pollSizeChanges = function() { - if (this.$pollSizeChangesTimer) - return this.$pollSizeChangesTimer; - var self = this; - return this.$pollSizeChangesTimer = setInterval(function() { - self.checkForSizeChanges(); - }, 500); - }; - - this.setPolling = function(val) { - if (val) { - this.$pollSizeChanges(); - } else { - if (this.$pollSizeChangesTimer) - this.$pollSizeChangesTimer; - } - }; - - this.$measureSizes = function() { - if (CHAR_COUNT === 50) { - var rect = null; - try { - rect = this.$measureNode.getBoundingClientRect(); - } catch(e) { - rect = {width: 0, height:0 }; - }; - var size = { - height: rect.height, - width: rect.width / CHAR_COUNT - }; - } else { - var size = { - height: this.$measureNode.clientHeight, - width: this.$measureNode.clientWidth / CHAR_COUNT - }; - } - // 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.$measureCharWidth = function(ch) { - this.$main.innerHTML = lang.stringRepeat(ch, CHAR_COUNT); - var rect = this.$main.getBoundingClientRect(); - return rect.width / CHAR_COUNT; - }; - - this.getCharacterWidth = function(ch) { - var w = this.charSizes[ch]; - if (w === undefined) { - this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; - } - return w; - }; - - this.destroy = function() { - clearInterval(this.$pollSizeChangesTimer); - if (this.el && this.el.parentNode) - this.el.parentNode.removeChild(this.el); - }; - -}).call(FontMetrics.prototype); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js deleted file mode 100644 index 13ee8a25..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +++ /dev/null @@ -1,287 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("../lib/dom"); -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var EventEmitter = require("../lib/event_emitter").EventEmitter; - -var Gutter = function(parentEl) { - this.element = dom.createElement("div"); - this.element.className = "ace_layer ace_gutter-layer"; - parentEl.appendChild(this.element); - this.setShowFoldWidgets(this.$showFoldWidgets); - - this.gutterWidth = 0; - - this.$annotations = []; - this.$updateAnnotations = this.$updateAnnotations.bind(this); - - this.$cells = []; -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.setSession = function(session) { - if (this.session) - this.session.removeEventListener("change", this.$updateAnnotations); - this.session = session; - if (session) - session.on("change", this.$updateAnnotations); - }; - - this.addGutterDecoration = function(row, className){ - if (window.console) - console.warn && console.warn("deprecated use session.addGutterDecoration"); - this.session.addGutterDecoration(row, className); - }; - - this.removeGutterDecoration = function(row, className){ - if (window.console) - console.warn && console.warn("deprecated use session.removeGutterDecoration"); - this.session.removeGutterDecoration(row, className); - }; - - this.setAnnotations = function(annotations) { - // iterate over sparse array - this.$annotations = []; - for (var i = 0; i < annotations.length; i++) { - var annotation = annotations[i]; - var row = annotation.row; - var rowInfo = this.$annotations[row]; - if (!rowInfo) - rowInfo = this.$annotations[row] = {text: []}; - - var annoText = annotation.text; - annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || ""; - - if (rowInfo.text.indexOf(annoText) === -1) - rowInfo.text.push(annoText); - - var type = annotation.type; - if (type == "error") - rowInfo.className = " ace_error"; - else if (type == "warning" && rowInfo.className != " ace_error") - rowInfo.className = " ace_warning"; - else if (type == "info" && (!rowInfo.className)) - rowInfo.className = " ace_info"; - } - }; - - this.$updateAnnotations = function (e) { - if (!this.$annotations.length) - return; - var delta = e.data; - var range = delta.range; - var firstRow = range.start.row; - var len = range.end.row - firstRow; - if (len === 0) { - // do nothing - } else if (delta.action == "removeText" || delta.action == "removeLines") { - this.$annotations.splice(firstRow, len + 1, null); - } else { - var args = new Array(len + 1); - args.unshift(firstRow, 1); - this.$annotations.splice.apply(this.$annotations, args); - } - }; - - this.update = function(config) { - var session = this.session; - var firstRow = config.firstRow; - var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar - session.getLength() - 1); - var fold = session.getNextFoldLine(firstRow); - var foldStart = fold ? fold.start.row : Infinity; - var foldWidgets = this.$showFoldWidgets && session.foldWidgets; - var breakpoints = session.$breakpoints; - var decorations = session.$decorations; - var firstLineNumber = session.$firstLineNumber; - var lastLineNumber = 0; - - var gutterRenderer = session.gutterRenderer || this.$renderer; - - var cell = null; - var index = -1; - var row = firstRow; - while (true) { - if (row > foldStart) { - row = fold.end.row + 1; - fold = session.getNextFoldLine(row, fold); - foldStart = fold ? fold.start.row : Infinity; - } - if (row > lastRow) { - while (this.$cells.length > index + 1) { - cell = this.$cells.pop(); - this.element.removeChild(cell.element); - } - break; - } - - cell = this.$cells[++index]; - if (!cell) { - cell = {element: null, textNode: null, foldWidget: null}; - cell.element = dom.createElement("div"); - cell.textNode = document.createTextNode(''); - cell.element.appendChild(cell.textNode); - this.element.appendChild(cell.element); - this.$cells[index] = cell; - } - - var className = "ace_gutter-cell "; - if (breakpoints[row]) - className += breakpoints[row]; - if (decorations[row]) - className += decorations[row]; - if (this.$annotations[row]) - className += this.$annotations[row].className; - if (cell.element.className != className) - cell.element.className = className; - - var height = session.getRowLength(row) * config.lineHeight + "px"; - if (height != cell.element.style.height) - cell.element.style.height = height; - - if (foldWidgets) { - var c = foldWidgets[row]; - // check if cached value is invalidated and we need to recompute - if (c == null) - c = foldWidgets[row] = session.getFoldWidget(row); - } - - if (c) { - if (!cell.foldWidget) { - cell.foldWidget = dom.createElement("span"); - cell.element.appendChild(cell.foldWidget); - } - var className = "ace_fold-widget ace_" + c; - if (c == "start" && row == foldStart && row < fold.end.row) - className += " ace_closed"; - else - className += " ace_open"; - if (cell.foldWidget.className != className) - cell.foldWidget.className = className; - - var height = config.lineHeight + "px"; - if (cell.foldWidget.style.height != height) - cell.foldWidget.style.height = height; - } else { - if (cell.foldWidget) { - cell.element.removeChild(cell.foldWidget); - cell.foldWidget = null; - } - } - - var text = lastLineNumber = gutterRenderer - ? gutterRenderer.getText(session, row) - : row + firstLineNumber; - if (text != cell.textNode.data) - cell.textNode.data = text; - - row++; - } - - this.element.style.height = config.minHeight + "px"; - - if (this.$fixedWidth || session.$useWrapMode) - lastLineNumber = session.getLength() + firstLineNumber; - - var gutterWidth = gutterRenderer - ? gutterRenderer.getWidth(session, lastLineNumber, config) - : lastLineNumber.toString().length * config.characterWidth; - - var padding = this.$padding || this.$computePadding(); - gutterWidth += padding.left + padding.right; - if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) { - this.gutterWidth = gutterWidth; - this.element.style.width = Math.ceil(this.gutterWidth) + "px"; - this._emit("changeGutterWidth", gutterWidth); - } - }; - - this.$fixedWidth = false; - - this.$showLineNumbers = true; - this.$renderer = ""; - this.setShowLineNumbers = function(show) { - this.$renderer = !show && { - getWidth: function() {return ""}, - getText: function() {return ""} - }; - }; - - this.getShowLineNumbers = function() { - return this.$showLineNumbers; - }; - - this.$showFoldWidgets = true; - this.setShowFoldWidgets = function(show) { - if (show) - dom.addCssClass(this.element, "ace_folding-enabled"); - else - dom.removeCssClass(this.element, "ace_folding-enabled"); - - this.$showFoldWidgets = show; - this.$padding = null; - }; - - this.getShowFoldWidgets = function() { - return this.$showFoldWidgets; - }; - - this.$computePadding = function() { - if (!this.element.firstChild) - return {left: 0, right: 0}; - var style = dom.computedStyle(this.element.firstChild); - this.$padding = {}; - this.$padding.left = parseInt(style.paddingLeft) + 1 || 0; - this.$padding.right = parseInt(style.paddingRight) || 0; - return this.$padding; - }; - - this.getRegion = function(point) { - var padding = this.$padding || this.$computePadding(); - var rect = this.element.getBoundingClientRect(); - if (point.x < padding.left + rect.left) - return "markers"; - if (this.$showFoldWidgets && point.x > rect.right - padding.right) - return "foldWidgets"; - }; - -}).call(Gutter.prototype); - -exports.Gutter = Gutter; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js deleted file mode 100644 index 37e038b5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +++ /dev/null @@ -1,218 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Range = require("../range").Range; -var dom = require("../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]; - - if (!marker.range) { - marker.update(html, this, this.session, config); - continue; - } - - 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 = this.$padding + range.start.column * config.characterWidth; - marker.renderer(html, range, left, top, config); - } else if (marker.type == "fullLine") { - this.drawFullLineMarker(html, range, marker.clazz, config); - } else if (marker.type == "screenLine") { - this.drawScreenLineMarker(html, range, marker.clazz, config); - } else if (range.isMultiLine()) { - if (marker.type == "text") - this.drawTextMarker(html, range, marker.clazz, config); - else - this.drawMultiLineMarker(html, range, marker.clazz, config); - } else { - this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config); - } - } - this.element.innerHTML = html.join(""); - }; - - this.$getTop = function(row, layerConfig) { - return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; - }; - - // Draws a marker, which spans a range of text on multiple lines - this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) { - // 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 + " ace_start", layerConfig, 1, extraStyle); - - // selection end - row = range.end.row; - lineRange = new Range(row, 0, row, range.end.column); - this.drawSingleLineMarker(stringBuilder, lineRange, clazz, layerConfig, 0, extraStyle); - - 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, extraStyle); - } - }; - - // Draws a multi line marker, where lines span the full width - this.drawMultiLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - // from selection start to the end of the line - var padding = this.$padding; - var height = config.lineHeight; - var top = this.$getTop(range.start.row, config); - var left = padding + range.start.column * config.characterWidth; - extraStyle = extraStyle || ""; - - stringBuilder.push( - "
" - ); - - // from start of the last line to the selection end - top = this.$getTop(range.end.row, config); - var width = range.end.column * config.characterWidth; - - stringBuilder.push( - "
" - ); - - // all the complete lines - height = (range.end.row - range.start.row - 1) * config.lineHeight; - if (height < 0) - return; - top = this.$getTop(range.start.row + 1, config); - - stringBuilder.push( - "
" - ); - }; - - // Draws a marker which covers part or whole width of a single screen line - this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { - var height = config.lineHeight; - var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; - - var top = this.$getTop(range.start.row, config); - var left = this.$padding + range.start.column * config.characterWidth; - - stringBuilder.push( - "
" - ); - }; - - this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var top = this.$getTop(range.start.row, config); - var height = config.lineHeight; - if (range.start.row != range.end.row) - height += this.$getTop(range.end.row, config) - top; - - stringBuilder.push( - "
" - ); - }; - - this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var top = this.$getTop(range.start.row, config); - var height = config.lineHeight; - - stringBuilder.push( - "
" - ); - }; - -}).call(Marker.prototype); - -exports.Marker = Marker; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js deleted file mode 100644 index aeb74f1c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +++ /dev/null @@ -1,575 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var useragent = require("../lib/useragent"); -var EventEmitter = require("../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.$updateEolChar = this.$updateEolChar.bind(this); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.EOF_CHAR = "\xB6"; - this.EOL_CHAR_LF = "\xAC"; - this.EOL_CHAR_CRLF = "\xa4"; - this.EOL_CHAR = this.EOL_CHAR_LF; - this.TAB_CHAR = "\u2192"; //"\u21E5"; - this.SPACE_CHAR = "\xB7"; - this.$padding = 0; - - this.$updateEolChar = function() { - var EOL_CHAR = this.session.doc.getNewLineCharacter() == "\n" - ? this.EOL_CHAR_LF - : this.EOL_CHAR_CRLF; - if (this.EOL_CHAR != EOL_CHAR) { - this.EOL_CHAR = EOL_CHAR; - return true; - } - } - - this.setPadding = function(padding) { - this.$padding = padding; - this.element.style.padding = "0 " + padding + "px"; - }; - - this.getLineHeight = function() { - return this.$fontMetrics.$characterSize.height || 0; - }; - - this.getCharacterWidth = function() { - return this.$fontMetrics.$characterSize.width || 0; - }; - - this.$setFontMetrics = function(measure) { - this.$fontMetrics = measure; - this.$fontMetrics.on("changeCharacterSize", function(e) { - this._signal("changeCharacterSize", e); - }.bind(this)); - this.$pollSizeChanges(); - } - - this.checkForSizeChanges = function() { - this.$fontMetrics.checkForSizeChanges(); - }; - this.$pollSizeChanges = function() { - return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges(); - }; - this.setSession = function(session) { - this.session = session; - if (session) - this.$computeTabString(); - }; - - this.showInvisibles = false; - this.setShowInvisibles = function(showInvisibles) { - if (this.showInvisibles == showInvisibles) - return false; - - this.showInvisibles = showInvisibles; - this.$computeTabString(); - return true; - }; - - this.displayIndentGuides = true; - this.setDisplayIndentGuides = function(display) { - if (this.displayIndentGuides == display) - return false; - - this.displayIndentGuides = display; - this.$computeTabString(); - return true; - }; - - this.$tabStrings = []; - this.onChangeTabSize = - this.$computeTabString = function() { - var tabSize = this.session.getTabSize(); - this.tabSize = tabSize; - var tabStr = this.$tabStrings = [0]; - for (var i = 1; i < tabSize + 1; i++) { - if (this.showInvisibles) { - tabStr.push("" - + this.TAB_CHAR - + lang.stringRepeat("\xa0", i - 1) - + ""); - } else { - tabStr.push(lang.stringRepeat("\xa0", i)); - } - } - if (this.displayIndentGuides) { - this.$indentGuideRe = /\s\S| \t|\t |\s$/; - var className = "ace_indent-guide"; - var spaceClass = ""; - var tabClass = ""; - if (this.showInvisibles) { - className += " ace_invisible"; - spaceClass = " ace_invisible_space"; - tabClass = " ace_invisible_tab"; - var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); - var tabContent = this.TAB_CHAR + lang.stringRepeat("\xa0", this.tabSize - 1); - } else{ - var spaceContent = lang.stringRepeat("\xa0", this.tabSize); - var tabContent = spaceContent; - } - - this.$tabStrings[" "] = "" + spaceContent + ""; - this.$tabStrings["\t"] = "" + tabContent + ""; - } - }; - - this.updateLines = function(config, firstRow, lastRow) { - // 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)) { - first = foldLine.start.row; - break; - } else { - row = foldLine.end.row; - } - } - lineElementsIdx ++; - } - - var row = first; - var foldLine = this.session.getNextFoldLine(row); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (true) { - if (row > foldStart) { - row = foldLine.end.row+1; - foldLine = this.session.getNextFoldLine(row, foldLine); - foldStart = foldLine ? foldLine.start.row :Infinity; - } - if (row > last) - break; - - var lineElement = lineElements[lineElementsIdx++]; - if (lineElement) { - var html = []; - this.$renderLine( - html, row, !this.$useLineGroups(), row == foldStart ? foldLine : false - ); - lineElement.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; - lineElement.innerHTML = html.join(""); - } - row++; - } - }; - - this.scrollLines = function(config) { - 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(); - var row = firstRow; - var foldLine = this.session.getNextFoldLine(row); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (true) { - if (row > foldStart) { - row = foldLine.end.row+1; - foldLine = this.session.getNextFoldLine(row, foldLine); - foldStart = foldLine ? foldLine.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. - this.$renderLine(html, row, false, row == foldStart ? foldLine : 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); - container.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; - - } else { - while(container.firstChild) - fragment.appendChild(container.firstChild); - } - - row++; - } - return fragment; - }; - - this.update = function(config) { - this.config = config; - - var html = []; - var firstRow = config.firstRow, lastRow = config.lastRow; - - var row = firstRow; - var foldLine = this.session.getNextFoldLine(row); - var foldStart = foldLine ? foldLine.start.row : Infinity; - - while (true) { - if (row > foldStart) { - row = foldLine.end.row+1; - foldLine = this.session.getNextFoldLine(row, foldLine); - foldStart = foldLine ? foldLine.start.row :Infinity; - } - if (row > lastRow) - break; - - if (this.$useLineGroups()) - html.push("
") - - this.$renderLine(html, row, false, row == foldStart ? foldLine : false); - - if (this.$useLineGroups()) - html.push("
"); // end the line group - - row++; - } - this.element.innerHTML = html.join(""); - }; - - this.$textToken = { - "text": true, - "rparen": true, - "lparen": true - }; - - this.$renderToken = function(stringBuilder, screenColumn, token, value) { - var self = this; - var replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\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 (a) { - return self.showInvisibles ? - "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" : - lang.stringRepeat("\xa0", c.length); - } else if (c == "&") { - return "&"; - } else if (c == "<") { - return "<"; - } else if (c == "\t") { - var tabSize = self.session.getScreenTabSize(screenColumn + tabIdx); - screenColumn += tabSize - 1; - return self.$tabStrings[tabSize]; - } 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_invisible_space" : "ace_cjk"; - var space = self.showInvisibles ? self.SPACE_CHAR : ""; - screenColumn += 1; - return "" + space + ""; - } else if (b) { - return "" + self.SPACE_CHAR + ""; - } else { - screenColumn += 1; - return "" + c + ""; - } - }; - - var output = value.replace(replaceReg, replaceFunc); - - if (!this.$textToken[token.type]) { - var classes = "ace_" + token.type.replace(/\./g, " ace_"); - var style = ""; - if (token.type == "fold") - style = " style='width:" + (token.value.length * this.config.characterWidth) + "px;' "; - stringBuilder.push("", output, ""); - } - else { - stringBuilder.push(output); - } - return screenColumn + value.length; - }; - - this.renderIndentGuide = function(stringBuilder, value, max) { - var cols = value.search(this.$indentGuideRe); - if (cols <= 0 || cols >= max) - return value; - if (value[0] == " ") { - cols -= cols % this.tabSize; - stringBuilder.push(lang.stringRepeat(this.$tabStrings[" "], cols/this.tabSize)); - return value.substr(cols); - } else if (value[0] == "\t") { - stringBuilder.push(lang.stringRepeat(this.$tabStrings["\t"], cols)); - return value.substr(cols); - } - return value; - }; - - this.$renderWrappedLine = function(stringBuilder, tokens, splits, onlyContents) { - var chars = 0; - var split = 0; - var splitChars = splits[0]; - var screenColumn = 0; - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - var value = token.value; - if (i == 0 && this.displayIndentGuides) { - chars = value.length; - value = this.renderIndentGuide(stringBuilder, value, splitChars); - if (!value) - continue; - chars -= value.length; - } - - if (chars + value.length < splitChars) { - screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); - chars += value.length; - } else { - while (chars + value.length >= splitChars) { - screenColumn = this.$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 = this.$renderToken( - stringBuilder, screenColumn, token, value - ); - } - } - } - }; - - this.$renderSimpleLine = function(stringBuilder, tokens) { - var screenColumn = 0; - var token = tokens[0]; - var value = token.value; - if (this.displayIndentGuides) - value = this.renderIndentGuide(stringBuilder, value); - if (value) - screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); - for (var i = 1; i < tokens.length; i++) { - token = tokens[i]; - value = token.value; - screenColumn = this.$renderToken(stringBuilder, screenColumn, token, value); - } - }; - - // row is either first row of foldline or not in fold - this.$renderLine = function(stringBuilder, row, onlyContents, foldLine) { - if (!foldLine && foldLine != false) - foldLine = this.session.getFoldLine(row); - - if (foldLine) - var tokens = this.$getFoldLineTokens(row, foldLine); - else - var tokens = this.session.getTokens(row); - - - if (!onlyContents) { - stringBuilder.push( - "
" - ); - } - - if (tokens.length) { - var splits = this.session.getRowSplitData(row); - if (splits && splits.length) - this.$renderWrappedLine(stringBuilder, tokens, splits, onlyContents); - else - this.$renderSimpleLine(stringBuilder, tokens); - } - - if (this.showInvisibles) { - if (foldLine) - row = foldLine.end.row - - stringBuilder.push( - "", - row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, - "" - ); - } - if (!onlyContents) - stringBuilder.push("
"); - }; - - this.$getFoldLineTokens = function(row, foldLine) { - var session = this.session; - var 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 && idx < tokens.length) { - var value = tokens[idx].value; - if (value.length + col > to) { - renderTokens.push({ - type: tokens[idx].type, - value: value.substring(0, to - col) - }); - } else - renderTokens.push(tokens[idx]); - col += value.length; - idx += 1; - } - } - - var tokens = session.getTokens(row); - foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { - if (placeholder != null) { - renderTokens.push({ - type: "fold", - value: placeholder - }); - } else { - if (isNewRow) - tokens = session.getTokens(row); - - if (tokens.length) - addTokens(tokens, lastColumn, column); - } - }, foldLine.end.row, this.session.getLine(foldLine.end.row).length); - - return renderTokens; - }; - - 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; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js deleted file mode 100644 index 57601207..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +++ /dev/null @@ -1,126 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("../test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var assert = require("../test/assertions"); -var EditSession = require("../edit_session").EditSession; -var TextLayer = require("./text").Text; -var JavaScriptMode = require("../mode/javascript").Mode; - -module.exports = { - - setUp: function(next) { - this.session = new EditSession(""); - this.session.setMode(new JavaScriptMode()); - this.textLayer = new TextLayer(document.createElement("div")); - this.textLayer.setSession(this.session); - this.textLayer.config = { - characterWidth: 10, - lineHeight: 20 - }; - next() - }, - - "test: render line with hard tabs should render the same as lines with soft tabs" : function() { - this.session.setValue("a\ta\ta\t\na a a \n"); - this.textLayer.$computeTabString(); - - // row with hard tabs - var stringBuilder = []; - this.textLayer.$renderLine(stringBuilder, 0); - - // row with soft tabs - var stringBuilder2 = []; - this.textLayer.$renderLine(stringBuilder2, 1); - assert.equal(stringBuilder.join(""), stringBuilder2.join("")); - }, - - "test rendering width of ideographic space (U+3000)" : function() { - this.session.setValue("\u3000"); - - var stringBuilder = []; - this.textLayer.$renderLine(stringBuilder, 0, true); - assert.equal(stringBuilder.join(""), ""); - - this.textLayer.setShowInvisibles(true); - var stringBuilder = []; - this.textLayer.$renderLine(stringBuilder, 0, true); - assert.equal( - stringBuilder.join(""), - "" + this.textLayer.SPACE_CHAR + "" - + "\xB6" - ); - }, - - "test rendering of indent guides" : function() { - var textLayer = this.textLayer - var EOL = "" + textLayer.EOL_CHAR + ""; - var SPACE = function(i) {return Array(i+1).join("\xa0")} - var DOT = function(i) {return Array(i+1).join(textLayer.SPACE_CHAR)} - var TAB = function(i) {return textLayer.TAB_CHAR + SPACE(i-1)} - function testRender(results) { - for (var i = results.length; i--; ) { - var stringBuilder = []; - textLayer.$renderLine(stringBuilder, i, true); - assert.equal(stringBuilder.join(""), results[i]); - } - } - - this.session.setValue(" \n\t\tf\n "); - testRender([ - "" + SPACE(4) + "" + SPACE(2), - "" + SPACE(4) + "" + SPACE(4) + "f", - SPACE(3) - ]); - this.textLayer.setShowInvisibles(true); - testRender([ - "" + DOT(4) + "" + DOT(2) + "" + EOL, - "" + TAB(4) + "" + TAB(4) + "f" + EOL, - ]); - this.textLayer.setDisplayIndentGuides(false); - testRender([ - "" + DOT(6) + "" + EOL, - "" + TAB(4) + "" + TAB(4) + "f" + EOL - ]); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/app_config.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/app_config.js deleted file mode 100644 index 4fe78a1d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/app_config.js +++ /dev/null @@ -1,157 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"no use strict"; - -var oop = require("./oop"); -var EventEmitter = require("./event_emitter").EventEmitter; - -var optionsProvider = { - setOptions: function(optList) { - Object.keys(optList).forEach(function(key) { - this.setOption(key, optList[key]); - }, this); - }, - getOptions: function(optionNames) { - var result = {}; - if (!optionNames) { - optionNames = Object.keys(this.$options); - } else if (!Array.isArray(optionNames)) { - result = optionNames; - optionNames = Object.keys(result); - } - optionNames.forEach(function(key) { - result[key] = this.getOption(key); - }, this); - return result; - }, - setOption: function(name, value) { - if (this["$" + name] === value) - return; - var opt = this.$options[name]; - if (!opt) { - return warn('misspelled option "' + name + '"'); - } - if (opt.forwardTo) - return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value); - - if (!opt.handlesSet) - this["$" + name] = value; - if (opt && opt.set) - opt.set.call(this, value); - }, - getOption: function(name) { - var opt = this.$options[name]; - if (!opt) { - return warn('misspelled option "' + name + '"'); - } - if (opt.forwardTo) - return this[opt.forwardTo] && this[opt.forwardTo].getOption(name); - return opt && opt.get ? opt.get.call(this) : this["$" + name]; - } -}; - -function warn(message) { - if (typeof console != "undefined" && console.warn) - console.warn.apply(console, arguments); -} - -function reportError(msg, data) { - var e = new Error(msg); - e.data = data; - if (typeof console == "object" && console.error) - console.error(e); - setTimeout(function() { throw e; }); -} - -var AppConfig = function() { - this.$defaultOptions = {}; -}; - -(function() { - // module loading - oop.implement(this, EventEmitter); - /* - * option {name, value, initialValue, setterName, set, get } - */ - this.defineOptions = function(obj, path, options) { - if (!obj.$options) - this.$defaultOptions[path] = obj.$options = {}; - - Object.keys(options).forEach(function(key) { - var opt = options[key]; - if (typeof opt == "string") - opt = {forwardTo: opt}; - - opt.name || (opt.name = key); - obj.$options[opt.name] = opt; - if ("initialValue" in opt) - obj["$" + opt.name] = opt.initialValue; - }); - - // implement option provider interface - oop.implement(obj, optionsProvider); - - return this; - }; - - this.resetOptions = function(obj) { - Object.keys(obj.$options).forEach(function(key) { - var opt = obj.$options[key]; - if ("value" in opt) - obj.setOption(key, opt.value); - }); - }; - - this.setDefaultValue = function(path, name, value) { - var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {}); - if (opts[name]) { - if (opts.forwardTo) - this.setDefaultValue(opts.forwardTo, name, value); - else - opts[name].value = value; - } - }; - - this.setDefaultValues = function(path, optionHash) { - Object.keys(optionHash).forEach(function(key) { - this.setDefaultValue(path, key, optionHash[key]); - }, this); - }; - - this.warn = warn; - this.reportError = reportError; - -}).call(AppConfig.prototype); - -exports.AppConfig = AppConfig; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js deleted file mode 100644 index ef2f7caa..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +++ /dev/null @@ -1,284 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var XHTML_NS = "http://www.w3.org/1999/xhtml"; - -exports.getDocumentHead = function(doc) { - if (!doc) - doc = document; - return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; -} - -exports.createElement = function(tag, ns) { - return document.createElementNS ? - document.createElementNS(ns || XHTML_NS, tag) : - document.createElement(tag); -}; - -exports.hasCssClass = function(el, name) { - var classes = (el.className || "").split(/\s+/g); - return classes.indexOf(name) !== -1; -}; - -/* -* Add a CSS class to the list of classes on the given node -*/ -exports.addCssClass = function(el, name) { - if (!exports.hasCssClass(el, name)) { - el.className += " " + name; - } -}; - -/* -* Remove a CSS class from the list of classes on the given node -*/ -exports.removeCssClass = function(el, name) { - var classes = el.className.split(/\s+/g); - while (true) { - var index = classes.indexOf(name); - if (index == -1) { - break; - } - classes.splice(index, 1); - } - el.className = classes.join(" "); -}; - -exports.toggleCssClass = function(el, name) { - var classes = el.className.split(/\s+/g), add = true; - while (true) { - var index = classes.indexOf(name); - if (index == -1) { - break; - } - add = false; - classes.splice(index, 1); - } - if(add) - classes.push(name); - - el.className = classes.join(" "); - return add; -}; - -/* - * Add or remove a CSS class from the list of classes on the given node - * depending on the value of include - */ -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++].owningElement.id === 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.owningElement.id = id; - } else { - style = doc.createElementNS - ? doc.createElementNS(XHTML_NS, "style") - : doc.createElement("style"); - - style.appendChild(doc.createTextNode(cssText)); - if (id) - style.id = id; - - exports.getDocumentHead(doc).appendChild(style); - } -}; - -exports.importCssStylsheet = function(uri, doc) { - if (doc.createStyleSheet) { - doc.createStyleSheet(uri); - } else { - var link = exports.createElement('link'); - link.rel = 'stylesheet'; - link.href = uri; - - exports.getDocumentHead(doc).appendChild(link); - } -}; - -exports.getInnerWidth = function(element) { - return ( - parseInt(exports.computedStyle(element, "paddingLeft"), 10) + - parseInt(exports.computedStyle(element, "paddingRight"), 10) + - element.clientWidth - ); -}; - -exports.getInnerHeight = function(element) { - return ( - parseInt(exports.computedStyle(element, "paddingTop"), 10) + - parseInt(exports.computedStyle(element, "paddingBottom"), 10) + - element.clientHeight - ); -}; - - -if (typeof document == "undefined") - return; - -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("ace_inner"); - inner.style.width = "100%"; - inner.style.minWidth = "0px"; - inner.style.height = "200px"; - inner.style.display = "block"; - - var outer = exports.createElement("ace_outer"); - var style = outer.style; - - style.position = "absolute"; - style.left = "-10000px"; - style.overflow = "hidden"; - style.width = "200px"; - style.minWidth = "0px"; - style.height = "150px"; - style.display = "block"; - - outer.appendChild(inner); - - var 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; -}; - -if ("textContent" in document.documentElement) { - exports.setInnerText = function(el, innerText) { - el.textContent = innerText; - }; - - exports.getInnerText = function(el) { - return el.textContent; - }; -} -else { - exports.setInnerText = function(el, innerText) { - el.innerText = innerText; - }; - - exports.getInnerText = function(el) { - return el.innerText; - }; -} - -exports.getParentWindow = function(document) { - return document.defaultView || document.parentWindow; -}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js deleted file mode 100644 index 217bdc61..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +++ /dev/null @@ -1,1062 +0,0 @@ -// https://github.com/kriskowal/es5-shim -// Copyright 2009-2012 by contributors, MIT License - -define(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 - * Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/ - */ - -// -// Function -// ======== -// - -// ES-5 15.3.4.5 -// http://es5.github.com/#x15.3.4.5 - -function Empty() {} - -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("Function.prototype.bind called on incompatible " + target); - } - // 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 result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - - } 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)) - ); - - } - - }; - if(target.prototype) { - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - // Clean up dangling references. - Empty.prototype = null; - } - // 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; -// Having a toString local variable name breaks in Opera so use _toString. -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.4.12 -// http://es5.github.com/#x15.4.4.12 -// Default value for second param -// [bugfix, ielt9, old browsers] -// IE < 9 bug: [1,2].splice(0).join("") == "" but should be "12" -if ([1,2].splice(0).length != 2) { - if(function() { // test IE < 9 to splice bug - see issue #138 - function makeArray(l) { - var a = new Array(l+2); - a[0] = a[1] = 0; - return a; - } - var array = [], lengthBefore; - - array.splice.apply(array, makeArray(20)); - array.splice.apply(array, makeArray(26)); - - lengthBefore = array.length; //46 - array.splice(5, 0, "XXX"); // add one element - - lengthBefore + 1 == array.length - - if (lengthBefore + 1 == array.length) { - return true;// has right splice implementation without bugs - } - // else { - // IE8 bug - // } - }()) {//IE 6/7 - var array_splice = Array.prototype.splice; - Array.prototype.splice = function(start, deleteCount) { - if (!arguments.length) { - return []; - } else { - return array_splice.apply(this, [ - start === void 0 ? 0 : start, - deleteCount === void 0 ? (this.length - start) : deleteCount - ].concat(slice.call(arguments, 2))) - } - }; - } else {//IE8 - // taken from http://docs.sencha.com/ext-js/4-1/source/Array2.html - Array.prototype.splice = function(pos, removeCount){ - var length = this.length; - if (pos > 0) { - if (pos > length) - pos = length; - } else if (pos == void 0) { - pos = 0; - } else if (pos < 0) { - pos = Math.max(length + pos, 0); - } - - if (!(pos+removeCount < length)) - removeCount = length - pos; - - var removed = this.slice(pos, pos+removeCount); - var insert = slice.call(arguments, 2); - var add = insert.length; - - // we try to use Array.push when we can for efficiency... - if (pos === length) { - if (add) { - this.push.apply(this, insert); - } - } else { - var remove = Math.min(removeCount, length - pos); - var tailOldPos = pos + remove; - var tailNewPos = tailOldPos + add - remove; - var tailCount = length - tailOldPos; - var lengthAfterRemove = length - remove; - - if (tailNewPos < tailOldPos) { // case A - for (var i = 0; i < tailCount; ++i) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } else if (tailNewPos > tailOldPos) { // case B - for (i = tailCount; i--; ) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } // else, add == remove (nothing to do) - - if (add && pos === lengthAfterRemove) { - this.length = lengthAfterRemove; // truncate array - this.push.apply(this, insert); - } else { - this.length = lengthAfterRemove + add; // reserves space - for (i = 0; i < add; ++i) { - this[pos+i] = insert[i]; - } - } - } - return removed; - }; - } -} - -// 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 - -// Check failure of by-index access of string characters (IE < 9) -// and failure of `0 in boxedString` (Rhino) -var boxedString = Object("a"), - splitString = boxedString[0] != "a" || !(0 in boxedString); - -if (!Array.prototype.forEach) { - Array.prototype.forEach = function forEach(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - thisp = arguments[1], - i = -1, - 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, object); - } - } - }; -} - -// 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - 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(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) - result[i] = fun.call(thisp, self[i], i, object); - } - 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0, - result = [], - value, - thisp = arguments[1]; - - // If no callback function or if callback is not a callable function - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self) { - value = self[i]; - if (fun.call(thisp, value, i, object)) { - result.push(value); - } - } - } - 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - 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(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && !fun.call(thisp, self[i], i, object)) { - 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - 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(fun + " is not a function"); - } - - for (var i = 0; i < length; i++) { - if (i in self && fun.call(thisp, self[i], i, object)) { - 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - - // If no callback function or if callback is not a callable function - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - // no value to return if no initial value and an empty array - if (!length && arguments.length == 1) { - throw new TypeError("reduce of empty array with no initial value"); - } - - 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("reduce of empty array with no initial value"); - } - } while (true); - } - - for (; i < length; i++) { - if (i in self) { - result = fun.call(void 0, result, self[i], i, object); - } - } - - 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, - length = self.length >>> 0; - - // If no callback function or if callback is not a callable function - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); - } - - // no value to return if no initial value, empty array - if (!length && arguments.length == 1) { - throw new TypeError("reduceRight of empty array with no initial value"); - } - - 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("reduceRight of empty array with no initial value"); - } - } while (true); - } - - do { - if (i in this) { - result = fun.call(void 0, result, self[i], i, object); - } - } 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 || ([0, 1].indexOf(1, 2) != -1)) { - Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - 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 || ([0, 1].lastIndexOf(0, -3) != -1)) { - Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - 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) { - var createEmpty; - if (Object.prototype.__proto__ === null) { - createEmpty = function () { - return { "__proto__": null }; - }; - } else { - // In old IE __proto__ can't be used to manually set `null` - createEmpty = function () { - var empty = {}; - for (var i in empty) - empty[i] = null; - empty.constructor = - empty.hasOwnProperty = - empty.propertyIsEnumerable = - empty.isPrototypeOf = - empty.toLocaleString = - empty.toString = - empty.valueOf = - empty.__proto__ = null; - return empty; - } - } - - Object.create = function create(prototype, properties) { - var object; - if (prototype === null) { - object = createEmpty(); - } 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; - }; - -} - -// -// most of es5-shim Date section is removed since ace doesn't need it, it is too intrusive and it causes problems for users -// ==== -// - -// ES5 15.9.4.4 -// http://es5.github.com/#x15.9.4.4 -if (!Date.now) { - Date.now = function now() { - return new Date().getTime(); - }; -} - - -// -// 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 - -function toInteger(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; -} - -function isPrimitive(input) { - var type = typeof input; - return ( - input === null || - type === "undefined" || - type === "boolean" || - type === "number" || - type === "string" - ); -} - -function toPrimitive(input) { - var val, valueOf, toString; - if (isPrimitive(input)) { - return input; - } - valueOf = input.valueOf; - if (typeof valueOf === "function") { - val = valueOf.call(input); - if (isPrimitive(val)) { - return val; - } - } - toString = input.toString; - if (typeof toString === "function") { - val = toString.call(input); - if (isPrimitive(val)) { - return val; - } - } - throw new TypeError(); -} - -// ES5 9.9 -// http://es5.github.com/#x9.9 -var toObject = function (o) { - if (o == null) { // this matches both null and undefined - throw new TypeError("can't convert "+o+" to object"); - } - return Object(o); -}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js deleted file mode 100644 index b9f3ebe4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +++ /dev/null @@ -1,367 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var keys = require("./keys"); -var useragent = require("./useragent"); - -exports.addListener = function(elem, type, callback) { - if (elem.addEventListener) { - return elem.addEventListener(type, callback, false); - } - if (elem.attachEvent) { - var wrapper = function() { - callback.call(elem, window.event); - }; - callback._wrapper = wrapper; - elem.attachEvent("on" + type, wrapper); - } -}; - -exports.removeListener = function(elem, type, callback) { - if (elem.removeEventListener) { - return elem.removeEventListener(type, callback, false); - } - if (elem.detachEvent) { - elem.detachEvent("on" + type, callback._wrapper || callback); - } -}; - -/* -* Prevents propagation and clobbers the default action of the passed event -*/ -exports.stopEvent = function(e) { - exports.stopPropagation(e); - exports.preventDefault(e); - return false; -}; - -exports.stopPropagation = function(e) { - if (e.stopPropagation) - e.stopPropagation(); - else - e.cancelBubble = true; -}; - -exports.preventDefault = function(e) { - if (e.preventDefault) - e.preventDefault(); - else - e.returnValue = false; -}; - -/* - * @return {Number} 0 for left button, 1 for middle button, 2 for right button - */ -exports.getButton = function(e) { - if (e.type == "dblclick") - return 0; - if (e.type == "contextmenu" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey))) - return 2; - - // DOM Event - if (e.preventDefault) { - return e.button; - } - // old IE - else { - return {1:0, 2:2, 4:1}[e.button]; - } -}; - -exports.capture = function(el, eventHandler, releaseCaptureHandler) { - function onMouseUp(e) { - eventHandler && eventHandler(e); - releaseCaptureHandler && releaseCaptureHandler(e); - - exports.removeListener(document, "mousemove", eventHandler, true); - exports.removeListener(document, "mouseup", onMouseUp, true); - exports.removeListener(document, "dragstart", onMouseUp, true); - } - - exports.addListener(document, "mousemove", eventHandler, true); - exports.addListener(document, "mouseup", onMouseUp, true); - exports.addListener(document, "dragstart", onMouseUp, true); - - return onMouseUp; -}; - -exports.addMouseWheelListener = function(el, callback) { - if ("onmousewheel" in el) { - exports.addListener(el, "mousewheel", function(e) { - var 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; - } - callback(e); - }); - } else if ("onwheel" in el) { - exports.addListener(el, "wheel", function(e) { - var factor = 0.35; - switch (e.deltaMode) { - case e.DOM_DELTA_PIXEL: - e.wheelX = e.deltaX * factor || 0; - e.wheelY = e.deltaY * factor || 0; - break; - case e.DOM_DELTA_LINE: - case e.DOM_DELTA_PAGE: - e.wheelX = (e.deltaX || 0) * 5; - e.wheelY = (e.deltaY || 0) * 5; - break; - } - - callback(e); - }); - } else { - exports.addListener(el, "DOMMouseScroll", function(e) { - if (e.axis && e.axis == e.HORIZONTAL_AXIS) { - e.wheelX = (e.detail || 0) * 5; - e.wheelY = 0; - } else { - e.wheelX = 0; - e.wheelY = (e.detail || 0) * 5; - } - callback(e); - }); - } -}; - -exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbackName) { - var clicks = 0; - var startX, startY, timer; - var eventNames = { - 2: "dblclick", - 3: "tripleclick", - 4: "quadclick" - }; - - exports.addListener(el, "mousedown", function(e) { - if (exports.getButton(e) !== 0) { - clicks = 0; - } else if (e.detail > 1) { - clicks++; - if (clicks > 4) - clicks = 1; - } else { - clicks = 1; - } - if (useragent.isIE) { - var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; - if (!timer || isNewClick) - clicks = 1; - if (timer) - clearTimeout(timer); - timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); - - if (clicks == 1) { - startX = e.clientX; - startY = e.clientY; - } - } - - e._clicks = clicks; - - eventHandler[callbackName]("mousedown", e); - - if (clicks > 4) - clicks = 0; - else if (clicks > 1) - return eventHandler[callbackName](eventNames[clicks], e); - }); - - if (useragent.isOldIE) { - exports.addListener(el, "dblclick", function(e) { - clicks = 2; - if (timer) - clearTimeout(timer); - timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); - eventHandler[callbackName]("mousedown", e); - eventHandler[callbackName](eventNames[clicks], e); - }); - } -}; - -var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window) - ? function(e) { - return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); - } - : function(e) { - return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); - }; - -exports.getModifierString = function(e) { - return keys.KEY_MODS[getModifierHash(e)]; -}; - -function normalizeCommandKeys(callback, e, keyCode) { - var hashId = getModifierHash(e); - - if (!useragent.isMac && pressedKeys) { - if (pressedKeys[91] || pressedKeys[92]) - hashId |= 8; - if (pressedKeys.altGr) { - if ((3 & hashId) != 3) - pressedKeys.altGr = 0; - else - return; - } - if (keyCode === 18 || keyCode === 17) { - var location = "location" in e ? e.location : e.keyLocation; - if (keyCode === 17 && location === 1) { - ts = e.timeStamp; - } else if (keyCode === 18 && hashId === 3 && location === 2) { - var dt = -ts; - ts = e.timeStamp; - dt += ts; - if (dt < 3) - pressedKeys.altGr = true; - } - } - } - - if (keyCode in keys.MODIFIER_KEYS) { - keyCode = -1; - } - - if (hashId & 8 && (keyCode === 91 || keyCode === 93)) { - keyCode = -1; - } - - if (!hashId && keyCode === 13) { - var location = "location" in e ? e.location : e.keyLocation; - if (location === 3) { - callback(e, hashId, -keyCode); - if (e.defaultPrevented) - return; - } - } - - if (useragent.isChromeOS && hashId & 8) { - callback(e, hashId, keyCode); - if (e.defaultPrevented) - return; - else - hashId &= ~8; - } - - // If there is no hashId and the keyCode is not a function key, then - // we don't call the callback as we don't handle a command key here - // (it's a normal key/character input). - if (!hashId && !(keyCode in keys.FUNCTION_KEYS) && !(keyCode in keys.PRINTABLE_KEYS)) { - return false; - } - - return callback(e, hashId, keyCode); -} - -var pressedKeys = null; -var ts = 0; -exports.addCommandKeyListener = function(el, callback) { - var addListener = exports.addListener; - if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { - // Old versions of Gecko aka. Firefox < 4.0 didn't repeat the keydown - // event if the user pressed the key for a longer time. Instead, the - // keydown event was fired once and later on only the keypress event. - // To emulate the 'right' keydown behavior, the keyCode of the initial - // keyDown event is stored and in the following keypress events the - // stores keyCode is used to emulate a keyDown event. - var lastKeyDownKeyCode = null; - addListener(el, "keydown", function(e) { - lastKeyDownKeyCode = e.keyCode; - }); - addListener(el, "keypress", function(e) { - return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); - }); - } else { - var lastDefaultPrevented = null; - - addListener(el, "keydown", function(e) { - pressedKeys[e.keyCode] = true; - var result = normalizeCommandKeys(callback, e, e.keyCode); - lastDefaultPrevented = e.defaultPrevented; - return result; - }); - - addListener(el, "keypress", function(e) { - if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { - exports.stopEvent(e); - lastDefaultPrevented = null; - } - }); - - addListener(el, "keyup", function(e) { - pressedKeys[e.keyCode] = null; - }); - - if (!pressedKeys) { - pressedKeys = Object.create(null); - addListener(window, "focus", function(e) { - pressedKeys = Object.create(null); - }); - } - } -}; - -if (window.postMessage && !useragent.isOldIE) { - var postMessageId = 1; - exports.nextTick = function(callback, win) { - win = win || window; - var messageName = "zero-timeout-message-" + postMessageId; - exports.addListener(win, "message", function listener(e) { - if (e.data == messageName) { - exports.stopPropagation(e); - exports.removeListener(win, "message", listener); - callback(); - } - }); - win.postMessage(messageName, "*"); - }; -} - - -exports.nextFrame = window.requestAnimationFrame || - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - window.msRequestAnimationFrame || - window.oRequestAnimationFrame; - -if (exports.nextFrame) - exports.nextFrame = exports.nextFrame.bind(window); -else - exports.nextFrame = function(callback) { - setTimeout(callback, 17); - }; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js deleted file mode 100644 index b9860145..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +++ /dev/null @@ -1,155 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var EventEmitter = {}; -var stopPropagation = function() { this.propagationStopped = true; }; -var preventDefault = function() { this.defaultPrevented = true; }; - -EventEmitter._emit = -EventEmitter._dispatchEvent = function(eventName, e) { - this._eventRegistry || (this._eventRegistry = {}); - this._defaultHandlers || (this._defaultHandlers = {}); - - var listeners = this._eventRegistry[eventName] || []; - var defaultHandler = this._defaultHandlers[eventName]; - if (!listeners.length && !defaultHandler) - return; - - if (typeof e != "object" || !e) - e = {}; - - if (!e.type) - e.type = eventName; - if (!e.stopPropagation) - e.stopPropagation = stopPropagation; - if (!e.preventDefault) - e.preventDefault = preventDefault; - - listeners = listeners.slice(); - for (var i=0; i 0) { - if (count & 1) - result += string; - - if (count >>= 1) - string += string; - } - return result; -}; - -var trimBeginRegexp = /^\s\s*/; -var trimEndRegexp = /\s\s*$/; - -exports.stringTrimLeft = function (string) { - return string.replace(trimBeginRegexp, ''); -}; - -exports.stringTrimRight = function (string) { - return string.replace(trimEndRegexp, ''); -}; - -exports.copyObject = function(obj) { - var copy = {}; - for (var key in obj) { - copy[key] = obj[key]; - } - return copy; -}; - -exports.copyArray = function(array){ - var copy = []; - for (var i=0, l=array.length; i - * Provides an augmented, extensible, cross-browser implementation of regular expressions, - * including support for additional syntax, flags, and methods - */ - -define(function(require, exports, module) { -"use strict"; - - //--------------------------------- - // Private variables - //--------------------------------- - - var real = { - exec: RegExp.prototype.exec, - test: RegExp.prototype.test, - match: String.prototype.match, - replace: String.prototype.replace, - split: String.prototype.split - }, - compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups - compliantLastIndexIncrement = function () { - var x = /^/g; - real.test.call(x, ""); - return !x.lastIndex; - }(); - - if (compliantLastIndexIncrement && compliantExecNpcg) - return; - - //--------------------------------- - // Overriden native methods - //--------------------------------- - - // Adds named capture support (with backreferences returned as `result.name`), and fixes two - // cross-browser issues per ES3: - // - Captured values for nonparticipating capturing groups should be returned as `undefined`, - // rather than the empty string. - // - `lastIndex` should not be incremented after zero-length matches. - RegExp.prototype.exec = function (str) { - var match = real.exec.apply(this, arguments), - name, r2; - if ( typeof(str) == 'string' && match) { - // Fix browsers whose `exec` methods don't consistently return `undefined` for - // nonparticipating capturing groups - if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { - r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", "")); - // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed - // matching due to characters outside the match - real.replace.call(str.slice(match.index), r2, function () { - for (var i = 1; i < arguments.length - 2; i++) { - if (arguments[i] === undefined) - match[i] = undefined; - } - }); - } - // Attach named capture properties - if (this._xregexp && this._xregexp.captureNames) { - for (var i = 1; i < match.length; i++) { - name = this._xregexp.captureNames[i - 1]; - if (name) - match[name] = match[i]; - } - } - // Fix browsers that increment `lastIndex` after zero-length matches - if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - } - return match; - }; - - // Don't override `test` if it won't change anything - if (!compliantLastIndexIncrement) { - // Fix browser bug in native method - RegExp.prototype.test = function (str) { - // Use the native `exec` to skip some processing overhead, even though the overriden - // `exec` would take care of the `lastIndex` fix - var match = real.exec.call(this, str); - // Fix browsers that increment `lastIndex` after zero-length matches - if (match && this.global && !match[0].length && (this.lastIndex > match.index)) - this.lastIndex--; - return !!match; - }; - } - - //--------------------------------- - // Private helper functions - //--------------------------------- - - function getNativeFlags (regex) { - return (regex.global ? "g" : "") + - (regex.ignoreCase ? "i" : "") + - (regex.multiline ? "m" : "") + - (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 - (regex.sticky ? "y" : ""); - } - - function indexOf (array, item, from) { - if (Array.prototype.indexOf) // Use the native array method if available - return array.indexOf(item, from); - for (var i = from || 0; i < array.length; i++) { - if (array[i] === item) - return i; - } - return -1; - } - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js deleted file mode 100644 index 0d1d9f4d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +++ /dev/null @@ -1,106 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -/* - * I hate doing this, but we need some way to determine if the user is on a Mac - * The reason is that users have different expectations of their key combinations. - * - * Take copy as an example, Mac people expect to use CMD or APPLE + C - * Windows folks expect to use CTRL + C - */ -exports.OS = { - LINUX: "LINUX", - MAC: "MAC", - WINDOWS: "WINDOWS" -}; - -/* - * Return an exports.OS constant - */ -exports.getOS = function() { - if (exports.isMac) { - return exports.OS.MAC; - } else if (exports.isLinux) { - return exports.OS.LINUX; - } else { - return exports.OS.WINDOWS; - } -}; - -// this can be called in non browser environments (e.g. from ace/requirejs/text) -if (typeof navigator != "object") - return; - -var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); -var ua = navigator.userAgent; - -// Is the user using a browser that identifies itself as Windows -exports.isWin = (os == "win"); - -// Is the user using a browser that identifies itself as Mac OS -exports.isMac = (os == "mac"); - -// Is the user using a browser that identifies itself as Linux -exports.isLinux = (os == "linux"); - -// Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead. -exports.isIE = - (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) - ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]) - : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]); // for ie - -exports.isOldIE = exports.isIE && exports.isIE < 9; - -// Is this Firefox or related? -exports.isGecko = exports.isMozilla = (window.Controllers || window.controllers) && window.navigator.product === "Gecko"; - -// oldGecko == rev < 2.0 -exports.isOldGecko = exports.isGecko && parseInt((ua.match(/rv\:(\d+)/)||[])[1], 10) < 4; - -// Is this Opera -exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; - -// Is the user using a browser that identifies itself as WebKit -exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; - -exports.isChrome = parseFloat(ua.split(" Chrome/")[1]) || undefined; - -exports.isAIR = ua.indexOf("AdobeAIR") >= 0; - -exports.isIPad = ua.indexOf("iPad") >= 0; - -exports.isTouchPad = ua.indexOf("TouchPad") >= 0; - -exports.isChromeOS = ua.indexOf(" CrOS ") >= 0; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/line_widgets.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/line_widgets.js deleted file mode 100644 index d4080b53..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/line_widgets.js +++ /dev/null @@ -1,297 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var Range = require("./range").Range; - - -function LineWidgets(session) { - this.session = session; - this.session.widgetManager = this; - this.session.getRowLength = this.getRowLength; - this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; - this.updateOnChange = this.updateOnChange.bind(this); - this.renderWidgets = this.renderWidgets.bind(this); - this.measureWidgets = this.measureWidgets.bind(this); - this.session._changedWidgets = []; - this.$onChangeEditor = this.$onChangeEditor.bind(this); - - this.session.on("change", this.updateOnChange); - this.session.on("changeEditor", this.$onChangeEditor); -} - -(function() { - this.getRowLength = function(row) { - var h; - if (this.lineWidgets) - h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0; - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1 + h; - } else { - return this.$wrapData[row].length + 1 + h; - } - }; - - this.$getWidgetScreenLength = function() { - var screenRows = 0; - this.lineWidgets.forEach(function(w){ - if (w && w.rowCount) - screenRows +=w.rowCount; - }); - return screenRows; - }; - - this.$onChangeEditor = function(e) { - this.attach(e.editor); - }; - - this.attach = function(editor) { - if (editor && editor.widgetManager && editor.widgetManager != this) - editor.widgetManager.detach(); - - if (this.editor == editor) - return; - - this.detach(); - this.editor = editor; - - if (editor) { - editor.widgetManager = this; - editor.renderer.on("beforeRender", this.measureWidgets); - editor.renderer.on("afterRender", this.renderWidgets); - } - }; - this.detach = function(e) { - var editor = this.editor; - if (!editor) - return; - - this.editor = null; - editor.widgetManager = null; - - editor.renderer.off("beforeRender", this.measureWidgets); - editor.renderer.off("afterRender", this.renderWidgets); - var lineWidgets = this.session.lineWidgets; - lineWidgets && lineWidgets.forEach(function(w) { - if (w && w.el && w.el.parentNode) { - w._inDocument = false; - w.el.parentNode.removeChild(w.el); - } - }); - }; - - this.updateOnChange = function(e) { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - - var delta = e.data; - var range = delta.range; - var startRow = range.start.row; - var len = range.end.row - startRow; - - if (len === 0) { - // return - } else if (delta.action == "removeText" || delta.action == "removeLines") { - var removed = lineWidgets.splice(startRow + 1, len); - removed.forEach(function(w) { - w && this.removeLineWidget(w); - }, this); - this.$updateRows(); - } else { - var args = new Array(len); - args.unshift(startRow, 0); - lineWidgets.splice.apply(lineWidgets, args); - this.$updateRows(); - } - }; - - this.$updateRows = function() { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - var noWidgets = true; - lineWidgets.forEach(function(w, i) { - if (w) { - noWidgets = false; - w.row = i; - } - }); - if (noWidgets) - this.session.lineWidgets = null; - }; - - this.addLineWidget = function(w) { - if (!this.session.lineWidgets) - this.session.lineWidgets = new Array(this.session.getLength()); - - this.session.lineWidgets[w.row] = w; - - var renderer = this.editor.renderer; - if (w.html && !w.el) { - w.el = dom.createElement("div"); - w.el.innerHTML = w.html; - } - if (w.el) { - dom.addCssClass(w.el, "ace_lineWidgetContainer"); - w.el.style.position = "absolute"; - w.el.style.zIndex = 5; - renderer.container.appendChild(w.el); - w._inDocument = true; - } - - if (!w.coverGutter) { - w.el.style.zIndex = 3; - } - if (!w.pixelHeight) { - w.pixelHeight = w.el.offsetHeight; - } - if (w.rowCount == null) - w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; - - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - - this.$updateRows(); - this.renderWidgets(null, renderer); - return w; - }; - - this.removeLineWidget = function(w) { - w._inDocument = false; - if (w.el && w.el.parentNode) - w.el.parentNode.removeChild(w.el); - if (w.editor && w.editor.destroy) try { - w.editor.destroy(); - } catch(e){} - if (this.session.lineWidgets) - this.session.lineWidgets[w.row] = undefined; - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - this.$updateRows(); - }; - - this.onWidgetChanged = function(w) { - this.session._changedWidgets.push(w); - this.editor && this.editor.renderer.updateFull(); - }; - - this.measureWidgets = function(e, renderer) { - var changedWidgets = this.session._changedWidgets; - var config = renderer.layerConfig; - - if (!changedWidgets || !changedWidgets.length) return; - var min = Infinity; - for (var i = 0; i < changedWidgets.length; i++) { - var w = changedWidgets[i]; - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); - } - - w.h = w.el.offsetHeight; - - if (!w.fixedWidth) { - w.w = w.el.offsetWidth; - w.screenWidth = Math.ceil(w.w / config.characterWidth); - } - - var rowCount = w.h / config.lineHeight; - if (w.coverLine) { - rowCount -= this.session.getRowLineCount(w.row); - if (rowCount < 0) - rowCount = 0; - } - if (w.rowCount != rowCount) { - w.rowCount = rowCount; - if (w.row < min) - min = w.row; - } - } - if (min != Infinity) { - this.session._emit("changeFold", {data:{start:{row: min}}}); - this.session.lineWidgetWidth = null; - } - this.session._changedWidgets = []; - }; - - this.renderWidgets = function(e, renderer) { - var config = renderer.layerConfig; - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) - return; - var first = Math.min(this.firstRow, config.firstRow); - var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); - - while (first > 0 && !lineWidgets[first]) - first--; - - this.firstRow = config.firstRow; - this.lastRow = config.lastRow; - - renderer.$cursorLayer.config = config; - for (var i = first; i <= last; i++) { - var w = lineWidgets[i]; - if (!w || !w.el) continue; - - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); - } - var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top; - if (!w.coverLine) - top += config.lineHeight * this.session.getRowLineCount(w.row); - w.el.style.top = top - config.offset + "px"; - - var left = w.coverGutter ? 0 : renderer.gutterWidth; - if (!w.fixedWidth) - left -= renderer.scrollLeft; - w.el.style.left = left + "px"; - - if (w.fixedWidth) { - w.el.style.right = renderer.scrollBar.getWidth() + "px"; - } else { - w.el.style.right = ""; - } - } - }; - -}).call(LineWidgets.prototype); - - -exports.LineWidgets = LineWidgets; - -}); - - - - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/Readme.md b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/Readme.md deleted file mode 100644 index c2871c0d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/Readme.md +++ /dev/null @@ -1,9 +0,0 @@ -`tokens_.json` files keep information about correct tokens and tokenizer states for all modes supported by ace. -They are generated from `text_.txt` or `demo/kitchen-sink/doc/*` with - -```sh -node highlight_rules_test.js -gen -``` - -command. - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/highlight_rules_test.js deleted file mode 100644 index 3e8af609..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/highlight_rules_test.js +++ /dev/null @@ -1,210 +0,0 @@ -var fs = require("fs"); -var path = require("path"); -if (!fs.existsSync) - fs.existsSync = path.existsSync; - -require("amd-loader"); - -var cwd = __dirname + "/"; -var root = path.normalize(cwd + Array(5).join("../")); - -function jsFileList(path, filter) { - if (!filter) filter = /_test/; - return fs.readdirSync(path).map(function(x) { - if (x.slice(-3) == ".js" && !filter.test(x) && !/\s/.test(x)) - return x.slice(0, -3); - }).filter(Boolean); -} - -function modeList() { - return jsFileList(cwd + "../", /_highlight_rules|_test|_worker|xml_util|_outdent|behaviour|completions/); -} - -function checkModes() { - modeList().forEach(function(modeName) { - try { - var Mode = require("../" + modeName).Mode; - } catch(e) { - console.warn("Can't load mode :" + modeName, e); - return; - } - var m = new Mode(); - if (!m.lineCommentStart && !m.blockComment) - console.warn("missing comment in " + modeName); - if (!m.$id) - console.warn("missing id in " + modeName); - var tokenizer = (new Mode).getTokenizer(); - if (m.lineCommentStart) { - if (Array.isArray(m.lineCommentStart)) { - m.lineCommentStart.forEach(function(x) { - testLineComment(tokenizer, x, modeName) - }); - } else { - testLineComment(tokenizer, m.lineCommentStart, modeName) - } - } - // if (m.blockComment) { - // var tokens = tok.getLineTokens(m.lineCommentStart, "start"); - // if (!/comment/.test(tokens[0])) - // console.warn("broken lineCommentStart in " + modeName); - // } - }); - - function testLineComment(tokenizer, commentStart, modeName) { - var tokens = tokenizer.getLineTokens(commentStart + " ", "start").tokens; - if (!/comment/.test(tokens[0].type)) - console.warn("broken lineCommentStart in " + modeName); - } -} - -function generateTestData() { - var docRoot = root + "/demo/kitchen-sink/docs"; - var docs = fs.readdirSync(docRoot); - var specialDocs = fs.readdirSync(cwd); - var modes = modeList(); - - // console.log("Docs:", docs); - // console.log("Modes:", modes); - - docs.forEach(function(docName) { - var p = docName.toLowerCase().split("."); - if (!p[1]) - return; - var modeName; - if (modes.indexOf(p[0]) != -1) - modeName = p[0]; - else if (modes.indexOf(p[1]) != -1) - modeName = p[1]; - else - modeName = {"txt": "text", cpp: "c_cpp"}[p[1]]; - - var filePath = "text_" + modeName + ".txt"; - if (specialDocs.indexOf(filePath) == -1) { - filePath = docRoot + "/" + docName; - } else { - filePath = cwd + filePath; - } - - var text = fs.readFileSync(filePath, "utf8"); - try { - var Mode = require("../" + modeName).Mode; - } catch(e) { - console.warn("Can't load mode :" + modeName, p, e); - return; - } - console.log(modeName); - var tokenizer = new Mode().getTokenizer(); - - var state = "start"; - var data = text.split(/\r\n|\r|\n/).map(function(line) { - var data = tokenizer.getLineTokens(line, state); - var tmp = []; - tmp.push(JSON.stringify(data.state)); - var tokenizedLine = ""; - data.tokens.forEach(function(x) { - tokenizedLine += x.value; - tmp.push(JSON.stringify([x.type, x.value])); - }); - if (tokenizedLine != line) - tmp.push(JSON.stringify(line)); - state = data.state; - return tmp.join(",\n "); - }); - - var jsonStr = "[[\n " + data.join("\n],[\n ") + "\n]]"; - fs.writeFileSync(cwd + "tokens_" + modeName + ".json", jsonStr, "utf8"); - }); -} - -function test(startAt) { - var modes = fs.readdirSync(cwd).map(function(x) { - return (x.match(/tokens_(.*).json/) || {})[1]; - }).filter(function(x){return !!x}); - - for (var i = Math.max(0, startAt||0); i < modes.length; i++) - testMode(modes[i], i); - - console.log("\u001b[32m" + "all ok" + "\u001b[0m"); -} -function testMode(modeName, i) { - console.log(padNumber(i+1, 3) + ") testing: \u001b[33m" + modeName + "\u001b[0m"); - - var text = fs.readFileSync(cwd + "tokens_" + modeName + ".json", "utf8"); - var data = JSON.parse(text); - var Mode = require("../" + modeName).Mode; - var tokenizer = new Mode().getTokenizer(); - - var state = "start"; - data.forEach(function(lineData) { - lineData.values = []; - lineData.types = []; - lineData.state = lineData.shift(); - var line = null; - if (typeof lineData[lineData.length - 1] == "string") - line = lineData.pop(); - lineData.forEach(function(x) { - lineData.types.push(x[0]); - lineData.values.push(x[1]); - }); - if (typeof line != "string") - line = lineData.values.join(""); - - var tokens = tokenizer.getLineTokens(line, state); - var values = tokens.tokens.map(function(x) {return x.value;}); - var types = tokens.tokens.map(function(x) {return x.type;}); - - var err = testEqual([ - JSON.stringify(lineData.state), JSON.stringify(tokens.state), - lineData.types, types, - lineData.values, values]); - - if (err) { - console.log(line); - throw "error"; - } - - state = tokens.state; - }); -} -function testEqual(a) { - var err; - if (a[0] + "" !== a[1] + "") { - console.log(a[0],a[1]); - err = 1; - } - - if ( a[2] + "" !== a[3] + "" || a[4] + "" !== a[5] + "") { - arrayDiff(a[2],a[3]); - arrayDiff(a[4],a[5]); - err = 1; - } - return err; -} -function arrayDiff(a1, a2) { - var l = Math.max(a1.length, a2.length); - var out = []; - for (var i = 0; i < l; i++) { - out.push("\n", padNumber(i+1, 3), ") "); - if (a1[i] !== a2[i]) - out.push("\u001b[31m", a1[i], "\u001b[0m != \u001b[32m", a2[i], "\u001b[0m"); - else - out.push(a1[i]); - } - console.log(out.join("")); -} -function padNumber(num, digits) { - return (" " + num).slice(-digits); -} - -// cli -var arg = process.argv[2]; -if (!arg) - test(); -else if (/--?g(en)?/.test(arg)) - generateTestData(process.argv.splice(3)); -else if (/--?c(heck)?/.test(arg)) - checkModes(process.argv.splice(3)); -else if (/\d+/.test(arg)) - test(parseInt(process.argv[2],10) || 0); -else - testMode(arg, -1); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json deleted file mode 100644 index 3fdc706d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "ace-mode-creator", - "version": "0.1.0", - "dependencies": { - "connect": "", - "socket.io": "" - } -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_asciidoc.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_asciidoc.txt deleted file mode 100644 index af7eaecc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_asciidoc.txt +++ /dev/null @@ -1,111 +0,0 @@ ------------------------------------- ------------------------------------ -_ita_lic_, *bo*ld*, +mo+no+, normal. -``double quoted'', `single quoted'. - normal, ^super^, ~sub~. - -'''' -Escaped: -\_italic_, +++_italic_+++, -t\__e__st, +++t__e__st+++, -+++bold+++, $$normal$$ -\¶ ¶ -\`not single quoted' -\`\`not double quoted'' - - -[fffff] -+++++++++++++++++++++++++++++++++++++ -(C) {ss} ss -+++++++++++++++++++++++++++++++++++++ - -............. -callout <1> -.............. - -> 1 -1> 2 -<2> 3 - -Escaped: -\_italic_, -t\__e__st, o__ - -.optional title -............. -callout <1> -.............. - - -:macro: dddd - -.lists -. 1 -.. 2 -... d -..... big -+ -continue + -next line -xi) no ++la+tin++ - -xi) la++tin++ -2. num__ber__ [red]#red# --- - 5. f <> {macro} --- -image::path[beauty] ->--<= -- replacements - - image::s -sssss -sss -sssss - - -== 1 - heading -=== not a heading -==================================== - -================================== -====4 -NOTE: above - -NOTE: above - -[[x6]] -WARNING: - -[options[]] ---------------------------- -literal ---------------------------- - - -= Tables -|==================================== -| _italic_ | *bold* | text | (R) - -|==================================== - - -[more, options] -/////////// -comment -/////////// -// one line comment - - - -[red]#red text# [yellow-background]#on yellow# -[big]#large# [red yellow-background big]*all bold* - - -https://site text callto:ace http://ace.ajaxorg.com[awesome] - .still normal text -.break out thoug should not ---------------------------- -/////////////////////////// ---------------------------- - - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_coffee.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_coffee.txt deleted file mode 100644 index 2d9ba5ad..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_coffee.txt +++ /dev/null @@ -1,57 +0,0 @@ -#test: tokenize keyword - for (i 1..2) -#test: tokenize regexp -/"[a]/ -#test: tokenize functions -foo = ({args}) -> - foo = ({a1, a2}) -> - foo = ({@a1, a2}) -> - foo : ({args}) -> - foo = ({args}) -> - foo = ({0abc}) -> - foo = ({/abc}) => - foo = ({abc/}) -> - foo = ({#abc}) -> - foo = ({abc#}) -> - foo = ({)abc}) -> - foo = ({abc)}) -> - foo = ({a{bc}) -> - foo = ({}) -> - foo = ({ }) -> - foo : ({}) -> - foo = (args) -> - foo = (arg1, arg2) -> - foo = (arg1 = 1, arg2 = 'name') -> - foo = (@arg1 = /abc/, arg2 = 'name') -> - #test: tokenize function: invalid case: - foo=(/args) -> - foo = () -> - foo = ( ) -> - foo : ( ) -> - window.foo = (args) -> - foo = -> - foo = -> - foo : -> - #test: tokenize callback function - foo bar: 1, (args) -> - foo = (1, 2 (x) -> -#test: tokenize class -class Foo -class Foo extends Bar -#test: tokenize illegal name property -foo.static.function -#!test tokenize string with interpolation -a = "#{ 22 / 7 + {x: "#{a + b}"} + 2}" -" #{ "" + {} } )" -"""heredoc - """ -do -> - ### - herecomment - ### - re = /regex/imgy.test /// - heregex # comment - ///imgy - this isnt: `just - JavaScript` - undefined diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_curly.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_curly.txt deleted file mode 100644 index 1be54b59..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_curly.txt +++ /dev/null @@ -1,9 +0,0 @@ -tokenize Curly template{{test}} -tokenize embedded script -'123' -tokenize multiline attribute value with double quotes - -tokenize multiline attribute value with single quotes - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_html.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_html.txt deleted file mode 100644 index d2ce8aaa..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_html.txt +++ /dev/null @@ -1,10 +0,0 @@ - - -'123' - - - - - \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt deleted file mode 100644 index 48d4af7d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +++ /dev/null @@ -1,86 +0,0 @@ -//test: tokenize 'standard' functions -string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');"; -test: /**tokenize doc*/ comment -/**tokenize doc comment with @tag {}*/ -//test: tokenize parens - var line = "[{( )}]"; -//test tokenize arithmetic expression which looks like a regexp -a/b/c -a/=b/c -//test tokenize reg exps -a=/b/g -a+/b/g -a = 1 + /2 + 1/gimyxk -a=/a/ / /a/ -case /a/.test(c) -//test tokenize multi-line comment containing a single line comment -noRegex -/* foo // bar */ -canBeRegex; -/* foo // bar */ -// test tokenize identifier with umlauts -fu?e -// test // is not a regexp -{ // 123 -//test skipping escaped chars -'Meh\\nNeh' -console.log('\\u1232Feh' -"test multiline\ - strings" -a=' -b="\ -still a string - - -function foo(items, nada) { - for (var i=0; ihttp://ace.ajaxorg.com - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_php.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_php.txt deleted file mode 100644 index b76aa8a5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_php.txt +++ /dev/null @@ -1,24 +0,0 @@ - not &js; diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_ruby.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_ruby.txt deleted file mode 100644 index c16ff7c5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_ruby.txt +++ /dev/null @@ -1,34 +0,0 @@ - #test: symbol tokenizer - [:@thing, :$thing, :_thing, :thing, :Thing, :thing1, :thing_a, - :THING, :thing!, :thing=, :thing?, :t?, - :, :@, :$, :1, :1thing, :th?ing, :thi=ng, :1thing, - :th!ing, :thing# - ] - - #test: namespaces aren't symbols" : function() { - Namespaced::Class - #test: hex tokenizer - 0x9a, 0XA1, 0x9_a, 0x, 0x_9a, 0x9a_, - #test: float tokenizer - [1, +1, -1, 12_345, 0.000_1, - _, 3_1, 1_2, 1_.0, 0._1]; - -{:id => ?", :key => "value", anotherKey: [x, y?]} - -=begin -=end - -=begin x -=end- -=end x - - herDocs = [<<'FOO', <//Juhu Kinners -test: two tags in the same lines should be in separate tokens" - -test: multiline attributes" - \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abap.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abap.json deleted file mode 100644 index 95f2f811..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abap.json +++ /dev/null @@ -1,189 +0,0 @@ -[[ - "start", - ["doc.comment","***************************************"] -],[ - "start", - ["doc.comment","** Program: EXAMPLE **"] -],[ - "start", - ["doc.comment","** Author: Joe Byte, 07-Jul-2007 **"] -],[ - "start", - ["doc.comment","***************************************"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","REPORT"], - ["text"," BOOKINGS"], - ["keyword.operator","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["doc.comment","* Read flight bookings from the database"] -],[ - "start", - ["keyword","SELECT"], - ["keyword.operator"," * "], - ["keyword","FROM"], - ["text"," FLIGHTINFO"] -],[ - "start", - ["text"," "], - ["keyword","WHERE"], - ["text"," "], - ["keyword","CLASS"], - ["keyword.operator"," = "], - ["string","'Y'"], - ["text"," "], - ["comment","\"Y = economy"] -],[ - "start", - ["text"," "], - ["keyword","OR"], - ["text"," "], - ["keyword","CLASS"], - ["keyword.operator"," = "], - ["string","'C'"], - ["keyword.operator","."], - ["text"," "], - ["comment","\"C = business"] -],[ - "start", - ["paren.lparen","("], - ["invalid","..."], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","REPORT"], - ["text"," TEST"], - ["keyword.operator","."] -],[ - "start", - ["keyword","WRITE"], - ["text"," "], - ["string","'Hello World'"], - ["keyword.operator","."] -],[ - "start" -],[ - "start", - ["text","USERPROMPT"], - ["keyword.operator"," = "], - ["string","'Please double-click on a line in the output list '"], - ["text"," "], - ["keyword.operator","&"] -],[ - "start", - ["text"," "], - ["string","'to see the complete details of the transaction.'"], - ["keyword.operator","."] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","DATA"], - ["text"," LAST_EOM "], - ["keyword","TYPE"], - ["text"," "], - ["support.type","D"], - ["keyword.operator","."], - ["text"," "], - ["comment","\"last end-of-month date"] -],[ - "start", - ["text"," "] -],[ - "start", - ["doc.comment","* Start from today's date"] -],[ - "start", - ["text"," LAST_EOM"], - ["keyword.operator"," = "], - ["variable.parameter","SY"], - ["keyword.operator","-"], - ["text","DATUM"], - ["keyword.operator","."] -],[ - "start", - ["doc.comment","* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to \"01\","] -],[ - "start", - ["doc.comment","* giving the first day of the current month"] -],[ - "start", - ["text"," LAST_EOM"], - ["constant.numeric","+6"], - ["paren.lparen","("], - ["constant.numeric","2"], - ["paren.rparen",")"], - ["keyword.operator"," = "], - ["string","'01'"], - ["keyword.operator","."] -],[ - "start", - ["doc.comment","* Subtract one day"] -],[ - "start", - ["text"," LAST_EOM"], - ["keyword.operator"," = "], - ["text","LAST_EOM"], - ["keyword.operator"," - "], - ["constant.numeric","1"], - ["keyword.operator","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","WRITE"], - ["keyword.operator",":"], - ["text"," "], - ["string","'Last day of previous month was'"], - ["keyword.operator",","], - ["text"," LAST_EOM"], - ["keyword.operator","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","DATA"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["keyword","BEGIN OF"], - ["text"," I_VBRK "], - ["keyword","OCCURS"], - ["text"," "], - ["constant.numeric","0"], - ["keyword.operator",","] -],[ - "start", - ["text"," VBELN "], - ["keyword","LIKE"], - ["text"," "], - ["variable.parameter","VBRK-VBELN"], - ["keyword.operator",","] -],[ - "start", - ["text"," ZUONR "], - ["keyword","LIKE"], - ["text"," "], - ["variable.parameter","VBRK-ZUONR"], - ["keyword.operator",","] -],[ - "start", - ["text"," "], - ["keyword","END OF"], - ["text"," I_VBRK"], - ["keyword.operator","."] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abc.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abc.json deleted file mode 100644 index c65ae2a5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abc.json +++ /dev/null @@ -1,2207 +0,0 @@ -[[ - "start", - ["comment.line.percentage","%abc-2.1"] -],[ - "start", - ["information.keyword","H:"], - ["information.argument.string.unquoted","This file contains some example English tunes"] -],[ - "start", - ["comment.line.percentage","% note that the comments (like this one) are to highlight usages"] -],[ - "start", - ["comment.line.percentage","% and would not normally be included in such detail"] -],[ - "start", - ["information.keyword","O:"], - ["information.argument.string.unquoted","England "], - ["comment.line.percentage","% the origin of all tunes is England"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","1 "], - ["comment.line.percentage","% tune no 1"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Dusty Miller, The "], - ["comment.line.percentage","% title"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Binny's Jig "], - ["comment.line.percentage","% an alternative title"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad. "], - ["comment.line.percentage","% traditional"] -],[ - "start", - ["information.keyword","R:"], - ["information.argument.string.unquoted","DH "], - ["comment.line.percentage","% double hornpipe"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","3/4 "], - ["comment.line.percentage","% meter"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G "], - ["comment.line.percentage","% key"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","a"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","Hey, the dusty miller, and his dusty coat;"] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","He will win a shilling, or he spend a groat."] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","Dusty was the coat, dusty was the colour;"] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","Dusty was the kiss, that I got frae the miller."] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","2"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Old Sir Simon the King"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","S:"], - ["information.argument.string.unquoted","Offord MSS "], - ["comment.line.percentage","% from Offord manuscript"] -],[ - "start", - ["information.keyword","N:"], - ["information.argument.string.unquoted","see also Playford "], - ["comment.line.percentage","% reference note"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","9/8"] -],[ - "start", - ["information.keyword","R:"], - ["information.argument.string.unquoted","SJ "], - ["comment.line.percentage","% slip jig"] -],[ - "start", - ["information.keyword","N:"], - ["information.argument.string.unquoted","originally in C "], - ["comment.line.percentage","% transcription note"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|[1"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["text","["], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text","] "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"], - ["text","\\ "], - ["comment.line.percentage","% no line-break in score"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","12/8 "], - ["comment.line.percentage","% change of meter"] -],[ - "start", - ["barline.keyword.operator","[2"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["text","\\ "], - ["comment.line.percentage","% no line-break in score"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","9/8 "], - ["comment.line.percentage","% change of meter"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|]"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","3"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","William and Nancy"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","New Mown Hay"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Legacy, The"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","O:"], - ["information.argument.string.unquoted","England; Gloucs; Bledington "], - ["comment.line.percentage","% place of origin"] -],[ - "start", - ["information.keyword","B:"], - ["information.argument.string.unquoted","Sussex Tune Book "], - ["comment.line.percentage","% can be found in these books"] -],[ - "start", - ["information.keyword","B:"], - ["information.argument.string.unquoted","Mally's Cotswold Morris vol.1 2"] -],[ - "start", - ["information.keyword","D:"], - ["information.argument.string.unquoted","Morris On "], - ["comment.line.percentage","% can be heard on this record"] -],[ - "start", - ["information.keyword","P:"], - ["information.argument.string.unquoted","(AB)2(AC)2A "], - ["comment.line.percentage","% play the parts in this order"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","6/8"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G "] -],[ - "start", - ["information.keyword.embedded","[P:"], - ["information.argument.string.unquoted","A]"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","F"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword.embedded","[P:"], - ["information.argument.string.unquoted","B]"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","F"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["comment.line.percentage","% changes of meter, using inline fields"] -],[ - "start", - ["information.keyword.embedded","[T:"], - ["information.argument.string.unquoted","Slows]"], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","4/4]"], - ["information.keyword.embedded","[L:"], - ["information.argument.string.unquoted","1/4]"], - ["information.keyword.embedded","[P:"], - ["information.argument.string.unquoted","C]"], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["string.quoted","\"Em\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text"," "], - ["string.quoted","\"A7\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["text","\\"] -],[ - "start", - ["text"," "], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","3/8]"], - ["information.keyword.embedded","[L:"], - ["information.argument.string.unquoted","1/8]"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["text"," "], - ["barline.keyword.operator","|"], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","6/8]"], - ["text"," "], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","F"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","4"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","South Downs Jig"] -],[ - "start", - ["information.keyword","R:"], - ["information.argument.string.unquoted","jig"] -],[ - "start", - ["information.keyword","S:"], - ["information.argument.string.unquoted","Robert Harbron"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","6/8"] -],[ - "start", - ["information.keyword","L:"], - ["information.argument.string.unquoted","1/8"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["barline.keyword.operator","|:"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","9/8]"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","6/8]"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","D"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|1"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator",":|2"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|]"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","5"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Atholl Brose"] -],[ - "start", - ["comment.line.percentage","% in this example, which reproduces Highland Bagpipe gracing,"] -],[ - "start", - ["comment.line.percentage","% the large number of grace notes mean that it is more convenient to be specific about"] -],[ - "start", - ["comment.line.percentage","% score line-breaks (using the $ symbol), rather than using code line breaks to indicate them"] -],[ - "start", - ["information.keyword","I:"], - ["information.argument.string.unquoted","linebreak $"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","D"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","f"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric",">"], - ["text","{"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","B"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","G"], - ["text"," {"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator",":|"], - ["text","$"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","G"], - ["text"," {"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","a"], - ["text"," {"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","g"], - ["text"," {"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","c"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","G"], - ["text"," {"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|]"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","6"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Untitled Reel"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","D"] -],[ - "start", - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","b"], - ["text"," "], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","b"], - ["pitch.constant.numeric","g"], - ["text"," "], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"], - ["text","\\"] -],[ - "start", - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","7"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Kitchen Girl"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","D"] -],[ - "start", - ["text","["], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","4"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","4"], - ["text","] ["], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","4"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","4"], - ["text","]"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","b"], - ["pitch.constant.numeric","a"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"] -],[ - "start", - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","4"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","f"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator",":|"] -],[ - "start" -],[ - "start", - ["comment.line.percentage","%abc-2.1"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","pagewidth 21cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","pageheight 29.7cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","topspace 0.5cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","topmargin 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","botmargin 0cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","leftmargin 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","rightmargin 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","titlespace 0cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","titlefont Times-Bold 32"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","subtitlefont Times-Bold 24"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","composerfont Times 16"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","vocalfont Times-Roman 14"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","staffsep 60pt"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","sysstaffsep 20pt"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","musicspace 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","vocalspace 5pt"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","measurenb 0"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","barsperstaff 5"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","scale 0.7"] -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted"," 1"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted"," Canzonetta a tre voci"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted"," Claudio Monteverdi (1567-1643)"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted"," C"] -],[ - "start", - ["information.keyword","L:"], - ["information.argument.string.unquoted"," 1/4"] -],[ - "start", - ["information.keyword","Q:"], - ["information.argument.string.unquoted"," \"Andante mosso\" 1/4 = 110"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","score [1 2 3]"] -],[ - "start", - ["information.keyword","V:"], - ["information.argument.string.unquoted"," 1 clef=treble name=\"Soprano\"sname=\"A\""] -],[ - "start", - ["information.keyword","V:"], - ["information.argument.string.unquoted"," 2 clef=treble name=\"Alto\" sname=\"T\""] -],[ - "start", - ["information.keyword","V:"], - ["information.argument.string.unquoted"," 3 clef=bass middle=d name=\"Tenor\" sname=\"B\""] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","MIDI program 1 75 % recorder"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","MIDI program 2 75"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","MIDI program 3 75"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted"," Eb"] -],[ - "start", - ["comment.line.percentage","% 1 - 4"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 1]"], - ["text"," "], - ["barline.keyword.operator","|:"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Son que-sti~i cre-spi cri-ni~e"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Que-sti son gli~oc-chi che mi-"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 2]"], - ["text"," "], - ["barline.keyword.operator","|:"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"], - ["text","("], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","/"], - ["text",")"], - ["pitch.constant.numeric","c"], - ["accent.constant.language","="], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Son que-sti~i cre-spi cri-ni~e que - - - - sto~il vi-so e"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Que-sti son~gli oc-chi che mi-ran - - - - do fi-so mi-"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 3]"], - ["text"," "], - ["barline.keyword.operator","|:"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","f"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text","("], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","/"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","/"], - ["text",")"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Son que-sti~i cre-spi cri-ni~e que - - - - sto~il"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Que-sti son~gli oc-chi che mi-ran - - - - do"] -],[ - "start", - ["comment.line.percentage","% 5 - 9"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 1]"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["string.quoted","!fermata!"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","z"], - ["text"," "], - ["barline.keyword.operator","::"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," ran-do fi-so, tut-to re-stai con-qui-so."] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 2]"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","F"], - ["barline.keyword.operator","|"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","!fermata!"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","z"], - ["barline.keyword.operator","::"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," ran-do fi-so tut-to re-stai con-qui-so."] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 3]"], - ["text"," ("], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text",")"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["string.quoted","!fermata!"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","z"], - ["text"," "], - ["barline.keyword.operator","::"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," vi - - - so ond' io ti-man-go~uc-ci-so. Deh,"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," fi - - - so tut-to re-stai con-qui-so."] -],[ - "start", - ["comment.line.percentage","% 10 - 15"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 1]"], - ["text"," "], - ["pitch.constant.numeric","f"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","z"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text","\\"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," dim-me-lo ben mi-o, che que-sto"], - ["text","\\"] -],[ - "start", - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator","|1"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|2"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","8"], - ["barline.keyword.operator","|]"], - ["text"," "], - ["comment.line.percentage","% more notes"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," sol de-si-o_. "], - ["comment.line.percentage","% more lyrics"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 2]"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text","("], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","3/2"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","//"], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","//"], - ["pitch.constant.numeric","E"], - ["text",")"], - ["barline.keyword.operator","|1"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|2"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","8"], - ["barline.keyword.operator","|]"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," dim-me-lo ben mi-o, che que-sto sol de-si - - - - o_."] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 3]"], - ["text"," "], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["barline.keyword.operator","|"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","c"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|1"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|2"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","8"], - ["barline.keyword.operator","|]"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," dim-me-lo ben mi-o, che que-sto sol de-si-o_."] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_actionscript.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_actionscript.json deleted file mode 100644 index e3fad38f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_actionscript.json +++ /dev/null @@ -1,263 +0,0 @@ -[[ - "start", - ["text","package code"] -],[ - "start", - ["text","{"] -],[ - "punctuation.definition.comment.actionscript.2", - ["text"," "], - ["punctuation.definition.comment.actionscript.2","/*"], - ["comment.block.actionscript.2","****************************************"] -],[ - "punctuation.definition.comment.actionscript.2", - ["comment.block.actionscript.2","\t * based on textmate actionscript bundle"] -],[ - "start", - ["comment.block.actionscript.2","\t ***************************************"], - ["punctuation.definition.comment.actionscript.2","*/"] -],[ - "start", - ["text","\t "] -],[ - "start", - ["text","\t"], - ["keyword.control.actionscript.2","import"], - ["text"," fl.events.SliderEvent;"] -],[ - "start", - ["text","\t"] -],[ - "start", - ["text","\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["storage.type.class.actionscript.2","class"], - ["meta.class.actionscript.2"," "], - ["entity.name.type.class.actionscript.2","Foo"], - ["meta.class.actionscript.2"," "], - ["storage.modifier.extends.actionscript.2","extends"], - ["meta.class.actionscript.2"," "], - ["entity.other.inherited-class.actionscript.2","MovieClip"] -],[ - "start", - ["text","\t{"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//*************************"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","// Properties:"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["keyword.control.actionscript.2","var"], - ["text"," activeSwatch"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["support.class.actionscript.2","MovieClip"], - ["text",";"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","// Color offsets"] -],[ - "start", - ["text","\t\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["keyword.control.actionscript.2","var"], - ["text"," c1"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["storage.type.actionscript.2","Number"], - ["text"," "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["constant.numeric.actionscript.2","0"], - ["text",";\t"], - ["punctuation.definition.comment.actionscript.2","// R"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//*************************"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","// Constructor:"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["storage.type.function.actionscript.2","function"], - ["meta.function.actionscript.2"," "], - ["entity.name.function.actionscript.2","Foo"], - ["punctuation.definition.parameters.begin.actionscript.2","("], - ["punctuation.definition.parameters.end.actionscript.2",")"] -],[ - "start", - ["text","\t\t{"] -],[ - "start", - ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","// Respond to mouse events"] -],[ - "start", - ["text","\t\t\tswatch1_btn."], - ["support.function.actionscript.2","addEventListener"], - ["text","(MouseEvent.CLICK,swatchHandler,"], - ["constant.language.actionscript.2","false"], - ["text",","], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.language.actionscript.2","false"], - ["text",");"] -],[ - "start", - ["text","\t\t\tpreviewBox_btn."], - ["support.function.actionscript.2","addEventListener"], - ["text","(MouseEvent.MOUSE_DOWN,dragPressHandler);"] -],[ - "start", - ["text","\t\t\t"] -],[ - "start", - ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","// Respond to drag events"] -],[ - "start", - ["text","\t\t\tred_slider."], - ["support.function.actionscript.2","addEventListener"], - ["text","(SliderEvent.THUMB_DRAG,sliderHandler);"] -],[ - "start", - ["text","\t\t\t"] -],[ - "start", - ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","// Draw a frame later"] -],[ - "start", - ["text","\t\t\t"], - ["support.function.actionscript.2","addEventListener"], - ["text","(Event.ENTER_FRAME,"], - ["support.function.actionscript.2","draw"], - ["text",");"] -],[ - "start", - ["text","\t\t}"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text","\t\tprotected "], - ["storage.type.function.actionscript.2","function"], - ["meta.function.actionscript.2"," "], - ["entity.name.function.actionscript.2","clickHandler"], - ["punctuation.definition.parameters.begin.actionscript.2","("], - ["variable.parameter.function.actionscript.2","event:MouseEvent"], - ["punctuation.definition.parameters.end.actionscript.2",")"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["support.function.actionscript.2","void"] -],[ - "start", - ["text","\t\t{"] -],[ - "start", - ["text","\t\t\tcar.transform.colorTransform "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["keyword.control.actionscript.2","new"], - ["text"," ColorTransform("], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.numeric.actionscript.2","1"], - ["text",",c1,c2,c3);"] -],[ - "start", - ["text","\t\t}"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\tprotected "], - ["storage.type.function.actionscript.2","function"], - ["meta.function.actionscript.2"," "], - ["entity.name.function.actionscript.2","changeRGBHandler"], - ["punctuation.definition.parameters.begin.actionscript.2","("], - ["variable.parameter.function.actionscript.2","event:Event"], - ["punctuation.definition.parameters.end.actionscript.2",")"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["support.function.actionscript.2","void"] -],[ - "start", - ["text","\t\t{"] -],[ - "start", - ["text","\t\t\tc1 "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["storage.type.actionscript.2","Number"], - ["text","(c1_txt."], - ["support.function.actionscript.2","text"], - ["text",");"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text","\t\t\t"], - ["keyword.control.actionscript.2","if"], - ["text","("], - ["keyword.operator.symbolic.actionscript.2","!"], - ["text","(c1>"], - ["keyword.operator.symbolic.actionscript.2","="], - ["constant.numeric.actionscript.2","0"], - ["text",")){"] -],[ - "start", - ["text","\t\t\t\tc1 "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["constant.numeric.actionscript.2","0"], - ["text",";"] -],[ - "start", - ["text","\t\t\t}\t\t\t"] -],[ - "start", - ["text","\t\t\t"] -],[ - "start", - ["text","\t\t\tupdateSliders();"] -],[ - "start", - ["text","\t\t}"] -],[ - "start", - ["text","\t}"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ada.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ada.json deleted file mode 100644 index bdef7256..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ada.json +++ /dev/null @@ -1,39 +0,0 @@ -[[ - "start", - ["keyword","with"], - ["text"," "], - ["identifier","Ada"], - ["text","."], - ["identifier","Text_IO"], - ["text","; "], - ["keyword","use"], - ["text"," "], - ["identifier","Ada"], - ["text","."], - ["identifier","Text_IO"], - ["text",";"] -],[ - "start", - ["keyword","procedure"], - ["text"," "], - ["identifier","Hello"], - ["text"," "], - ["keyword","is"] -],[ - "start", - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["identifier","Put_Line"], - ["paren.lparen","("], - ["string","\"Hello, world!\""], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["keyword","end"], - ["text"," "], - ["identifier","Hello"], - ["text",";"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_asciidoc.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_asciidoc.json deleted file mode 100644 index f54c355e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_asciidoc.json +++ /dev/null @@ -1,422 +0,0 @@ -[[ - "literalBlock", - ["support.function","------------------------------------"] -],[ - "dissallowDelimitedBlock", - ["support.function","-----------------------------------"] -],[ - "text", - ["string.italic","_ita_lic_"], - ["text",", "], - ["keyword.bold","*bo*ld*"], - ["text",", "], - ["support.function","+mo+no+"], - ["text",", normal. "] -],[ - "text", - ["keyword","``"], - ["text","double quoted"], - ["keyword","''"], - ["text",", `single quoted'."] -],[ - "text", - ["text"," normal, ^super^, "], - ["keyword","~sub~"], - ["text","."] -],[ - "start" -],[ - "text", - ["text","''''"] -],[ - "text", - ["text","Escaped:"] -],[ - "text", - ["constant.language.escape","\\_"], - ["text","italic_, "], - ["support.function","+++"], - ["text","_italic_"], - ["support.function","+++"], - ["text",","] -],[ - "smallPassthrough", - ["text","t"], - ["constant.language.escape","\\_"], - ["text","_e"], - ["string.italic","__st, +++t__"], - ["text","e__st"], - ["support.function","+++"], - ["text",","] -],[ - "smallPassthrough", - ["support.function","+++"], - ["text","bold"], - ["support.function","+++"], - ["text",", $$<"], - ["support.function","b"], - ["text",">"], - ["support.function","normal"], - ["text","$$"] -],[ - "smallPassthrough", - ["text","\\&#"], - ["support.function","182"], - ["text","; &#"], - ["support.function","182"], - ["text",";"] -],[ - "smallPassthrough", - ["text","\\`"], - ["support.function","not"], - ["text"," "], - ["support.function","single"], - ["text"," "], - ["support.function","quoted"], - ["text","'"] -],[ - "smallPassthrough", - ["text","\\`\\`"], - ["support.function","not"], - ["text"," "], - ["support.function","double"], - ["text"," "], - ["support.function","quoted"], - ["text","''"] -],[ - "dissallowDelimitedBlock" -],[ - "text" -],[ - "start", - ["string.regexp","[fffff]"] -],[ - "passthroughBlock", - ["string","+++++++++++++++++++++++++++++++++++++"] -],[ - "passthroughBlock", - ["support.function","(C) "], - ["constant.character","{ss}"], - ["support.function"," ss"] -],[ - "dissallowDelimitedBlock", - ["support.function","+++++++++++++++++++++++++++++++++++++"] -],[ - "text" -],[ - "listingBlock", - ["support.function","............."] -],[ - "listingBlock", - ["support.function","callout "], - ["constant.numeric","<1>"] -],[ - "dissallowDelimitedBlock", - ["support.function",".............."] -],[ - "text" -],[ - "text", - ["text","> 1"] -],[ - "text", - ["text","1> 2"] -],[ - "text", - ["text","<2> 3"] -],[ - "start" -],[ - "text", - ["text","Escaped:"] -],[ - "text", - ["constant.language.escape","\\_"], - ["text","italic_,"] -],[ - "text", - ["text","t"], - ["constant.language.escape","\\_"], - ["text","_e"], - ["string.italic","__st, o__"] -],[ - "start" -],[ - "start", - ["constant.numeric",".optional title"] -],[ - "listingBlock", - ["support.function","............."] -],[ - "listingBlock", - ["support.function","callout "], - ["constant.numeric","<1>"] -],[ - "dissallowDelimitedBlock", - ["support.function",".............."] -],[ - "text" -],[ - "start" -],[ - "text", - ["keyword",":macro:"], - ["text"," dddd"] -],[ - "start" -],[ - "start", - ["constant.numeric",".lists"] -],[ - "listText", - ["keyword",". "], - ["text","1"] -],[ - "listText", - ["keyword",".. "], - ["text","2"] -],[ - "listText", - ["keyword","... "], - ["text","d"] -],[ - "listText", - ["keyword","..... "], - ["text","big"] -],[ - "start", - ["keyword","+"] -],[ - "text", - ["text","continue"], - ["keyword"," +"] -],[ - "text", - ["text","next line"] -],[ - "text", - ["text","xi) no "], - ["support.function","++la+tin++"] -],[ - "start" -],[ - "listText", - ["keyword","xi) "], - ["text","la"], - ["support.function","++tin++"] -],[ - "listText", - ["keyword","2. "], - ["text","num"], - ["string.italic","__ber__"], - ["text"," [red]"], - ["keyword","#"], - ["text","red"], - ["keyword","#"] -],[ - "start", - ["keyword","--"] -],[ - "listText", - ["keyword"," 5. "], - ["text","f "], - ["keyword","<>"], - ["text"," "], - ["constant.character","{macro}"] -],[ - "start", - ["keyword","--"] -],[ - "text", - ["markup.list.macro","image::"], - ["keyword","path"], - ["string","[beauty]"], - ["text"," "], - ["constant.language.escape","->"], - ["text","--"], - ["constant.language.escape","<= --"], - ["text"," replacements"] -],[ - "start" -],[ - "indentedBlock", - ["support.function"," image::s"] -],[ - "indentedBlock", - ["support.function","sssss"] -],[ - "indentedBlock", - ["support.function","sss "] -],[ - "indentedBlock", - ["support.function","sssss"] -],[ - "start" -],[ - "start" -],[ - "start", - ["markup.heading","== 1"] -],[ - "indentedBlock", - ["support.function"," heading"] -],[ - "start", - ["markup.heading","=== not a heading"] -],[ - "start", - ["keyword","===================================="] -],[ - "start" -],[ - "start", - ["keyword","=================================="] -],[ - "text", - ["text","====4 "] -],[ - "text", - ["text","NOTE: above"] -],[ - "start" -],[ - "text", - ["keyword","NOTE:"], - ["text"," above"] -],[ - "start" -],[ - "start", - ["string.regexp","[[x6]]"] -],[ - "text", - ["keyword","WARNING:"], - ["text"," "] -],[ - "start" -],[ - "start", - ["string.regexp","[options[]]"] -],[ - "literalBlock", - ["support.function","---------------------------"] -],[ - "literalBlock", - ["support.function","literal"] -],[ - "dissallowDelimitedBlock", - ["support.function","---------------------------"] -],[ - "text" -],[ - "start" -],[ - "start", - ["markup.heading","= Tables"] -],[ - "tableBlock", - ["doc.comment","|===================================="] -],[ - "tableBlock", - ["doc.comment","|"], - ["text"," "], - ["string.italic","_italic_"], - ["text"," "], - ["doc.comment","|"], - ["text"," "], - ["keyword.bold","*bold*"], - ["text"," "], - ["doc.comment","|"], - ["text"," text "], - ["doc.comment","|"], - ["text"," "], - ["constant.language.escape","(R)"] -],[ - "tableBlock" -],[ - "dissallowDelimitedBlock", - ["doc.comment","|===================================="] -],[ - "text" -],[ - "start" -],[ - "start", - ["string.regexp","[more, options]"] -],[ - "commentBlock", - ["doc.comment","///////////"] -],[ - "commentBlock", - ["doc.comment","comment"] -],[ - "dissallowDelimitedBlock", - ["doc.comment","///////////"] -],[ - "text", - ["comment","// one line comment"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "text", - ["text","[red]"], - ["keyword","#"], - ["text","red text"], - ["keyword","#"], - ["text"," [yellow-background]"], - ["keyword","#"], - ["text","on yellow"], - ["keyword","#"] -],[ - "text", - ["text","[big]"], - ["keyword","#"], - ["text","large"], - ["keyword","#"], - ["text"," [red yellow-background big]"], - ["keyword.bold","*all bold*"] -],[ - "start" -],[ - "start", - ["text","\t"] -],[ - "text", - ["markup.underline.list","https://site"], - ["text"," text <"], - ["markup.underline.list","mail@i.am"], - ["text","> "], - ["markup.underline.list","callto:ace"], - ["text"," "], - ["link","http://ace.ajaxorg.com"], - ["variable.language","[awesome]"] -],[ - "text", - ["text"," .still normal text"] -],[ - "start", - ["constant.numeric",".break out thoug should not"] -],[ - "literalBlock", - ["support.function","---------------------------"] -],[ - "literalBlock", - ["support.function","///////////////////////////"] -],[ - "dissallowDelimitedBlock", - ["support.function","---------------------------"] -],[ - "text" -],[ - "start" -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_assembly_x86.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_assembly_x86.json deleted file mode 100644 index 5da0470e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_assembly_x86.json +++ /dev/null @@ -1,114 +0,0 @@ -[[ - "start", - ["support.function.directive.assembly","section"], - ["text","\t.text"] -],[ - "start", - ["text"," "], - ["support.function.directive.assembly","global"], - ["text"," "], - ["entity.name.function.assembly","main"], - ["text"," "], - ["comment.assembly",";must be declared for using gcc"] -],[ - "start" -],[ - "start", - ["entity.name.function.assembly","main:"], - ["text","\t "], - ["comment.assembly",";tell linker entry point"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","edx"], - ["text",", len\t "], - ["comment.assembly",";message length"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","ecx"], - ["text",", msg\t "], - ["comment.assembly",";message to write"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","ebx"], - ["text",", "], - ["constant.character.decimal.assembly","1"], - ["text","\t "], - ["comment.assembly",";file descriptor (stdout)"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","eax"], - ["text",", "], - ["constant.character.decimal.assembly","4"], - ["text","\t "], - ["comment.assembly",";system call number (sys_write)"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","int"], - ["text","\t"], - ["constant.character.hexadecimal.assembly","0x80"], - ["text","\t "], - ["comment.assembly",";call kernel"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","eax"], - ["text",", "], - ["constant.character.decimal.assembly","1"], - ["text","\t "], - ["comment.assembly",";system call number (sys_exit)"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","int"], - ["text","\t"], - ["constant.character.hexadecimal.assembly","0x80"], - ["text","\t "], - ["comment.assembly",";call kernel"] -],[ - "start" -],[ - "start", - ["support.function.directive.assembly","section"], - ["text","\t.data"] -],[ - "start" -],[ - "start", - ["entity.name.function.assembly","msg"], - ["text","\t"], - ["support.function.directive.assembly","db"], - ["text","\t"], - ["string.assembly","'Hello, world!'"], - ["text",","], - ["constant.character.hexadecimal.assembly","0xa"], - ["text","\t"], - ["comment.assembly",";our dear string"] -],[ - "start", - ["entity.name.function.assembly","len"], - ["text","\t"], - ["support.function.directive.assembly","equ"], - ["text","\t$ - msg\t\t\t"], - ["comment.assembly",";length of our dear string"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_autohotkey.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_autohotkey.json deleted file mode 100644 index 374310fb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_autohotkey.json +++ /dev/null @@ -1,261 +0,0 @@ -[[ - "start", - ["punctuation.ahk","#"], - ["keyword.command.ahk","NoEnv"] -],[ - "start", - ["keyword.command.ahk","SetBatchLines"], - ["text"," "], - ["constant.numeric","-1"] -],[ - "start" -],[ - "start", - ["keyword.command.ahk","CoordMode"], - ["text"," "], - ["variable.parameter","Mouse"], - ["punctuation.ahk",","], - ["text"," "], - ["variable.parameter","Screen"] -],[ - "start", - ["keyword.command.ahk","OnExit"], - ["text"," "], - ["variable.parameter","GuiClose"] -],[ - "start" -],[ - "start", - ["text","zoom "], - ["keyword.operator.ahk",":="], - ["text"," 9"] -],[ - "start" -],[ - "start", - ["text","computeSize"], - ["punctuation.ahk","(){"] -],[ - "start", - ["text","\t"], - ["keyword.control.ahk","global"], - ["text"," as_x"] -],[ - "start", - ["text","\tas_x "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","Round"], - ["punctuation.ahk","("], - ["text","ws_x"], - ["keyword.operator.ahk","/"], - ["text","zoom"], - ["keyword.operator.ahk","/"], - ["text","2 "], - ["keyword.operator.ahk","-"], - ["text"," 0.5"], - ["punctuation.ahk",")"] -],[ - "start", - ["text","\t"], - ["keyword.control.ahk","if"], - ["text"," "], - ["punctuation.ahk","("], - ["text","zoom"], - ["keyword.operator.ahk",">"], - ["text","1"], - ["punctuation.ahk",")"], - ["text"," "], - ["punctuation.ahk","{"] -],[ - "start", - ["text","\t\tpix "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","Round"], - ["punctuation.ahk","("], - ["text","zoom"], - ["punctuation.ahk",")"] -],[ - "start", - ["text","\t"], - ["punctuation.ahk","}"], - ["text"," ele "], - ["punctuation.ahk","{"] -],[ - "start", - ["text","\t\tpix "], - ["keyword.operator.ahk",":="], - ["text"," 1"] -],[ - "start", - ["text","\t"], - ["punctuation.ahk","}"] -],[ - "start", - ["text"," "], - ["keyword.command.ahk","ToolTip"], - ["text"," Message "], - ["punctuation.ahk","%"], - ["text","as_x"], - ["punctuation.ahk","%"], - ["text"," "], - ["punctuation.ahk","%"], - ["text","zoom"], - ["punctuation.ahk","%"], - ["text"," "], - ["punctuation.ahk","%"], - ["text","ws_x"], - ["punctuation.ahk","%"], - ["text"," "], - ["punctuation.ahk","%"], - ["text","hws_x"], - ["punctuation.ahk","%"], - ["text"," "] -],[ - "start", - ["punctuation.ahk","}"] -],[ - "start" -],[ - "start", - ["text","hdc_frame "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","DllCall"], - ["punctuation.ahk","("], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","GetDC"], - ["punctuation.quote.double","\""], - ["punctuation.ahk",","], - ["text"," UInt"], - ["punctuation.ahk",","], - ["text"," MagnifierID"], - ["punctuation.ahk",")"] -],[ - "start" -],[ - "start", - ["comment.line.ahk","; comment"] -],[ - "start", - ["text","DrawCross"], - ["punctuation.ahk","("], - ["keyword.control.ahk","byRef"], - ["text"," x"], - ["keyword.operator.ahk","="], - ["punctuation.quote.double","\""], - ["punctuation.quote.double","\""], - ["punctuation.ahk",","], - ["text"," rX"], - ["punctuation.ahk",","], - ["text","rY"], - ["punctuation.ahk",","], - ["text","z"], - ["punctuation.ahk",","], - ["text"," dc"], - ["punctuation.ahk","){"] -],[ - "start", - ["text"," "], - ["comment.line.ahk"," ;specify the style, thickness and color of the cross lines"] -],[ - "start", - ["text"," h_pen "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","DllCall"], - ["punctuation.ahk","("], - ["text"," "], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","gdi32.dll\\CreatePen"], - ["punctuation.quote.double","\""], - ["punctuation.ahk",","], - ["text"," "], - ["constant.language","Int"], - ["punctuation.ahk",","], - ["text"," 0"], - ["punctuation.ahk",","], - ["text"," "], - ["constant.language","Int"], - ["punctuation.ahk",","], - ["text"," 1"], - ["punctuation.ahk",","], - ["text"," UInt"], - ["punctuation.ahk",","], - ["text"," 0x0000FF"], - ["punctuation.ahk",")"] -],[ - "start", - ["punctuation.ahk","}"] -],[ - "start" -],[ - "start", - ["comment.line.ahk",";Ctrl ^; Shift +; Win #; Alt !"] -],[ - "start", - ["text","^"], - ["support.constant.ahk","NumPadAdd"], - ["keyword.operator.ahk","::"] -],[ - "start", - ["text","^"], - ["support.constant.ahk","WheelUp"], - ["keyword.operator.ahk","::"], - ["text"," "] -],[ - "start", - ["text","^;"], - ["keyword.operator.ahk","::"], - ["text"," "], - ["comment.line.ahk"," ;comment"] -],[ - "start", - ["text"," "], - ["keyword.control.ahk","If"], - ["punctuation.ahk","("], - ["text","zoom "], - ["keyword.operator.ahk","<"], - ["text"," ws_x "], - ["variable.parameter","and"], - ["text"," "], - ["punctuation.ahk","("], - ["text"," "], - ["variable.predefined.ahk","A_ThisHotKey"], - ["text"," "], - ["keyword.operator.ahk","="], - ["text"," "], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","^WheelUp"], - ["punctuation.quote.double","\""], - ["text"," "], - ["variable.parameter","or"], - ["text"," "], - ["variable.predefined.ahk","A_ThisHotKey"], - ["text"," "], - ["keyword.operator.ahk","="], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","^NumPadAdd"], - ["punctuation.quote.double","\""], - ["punctuation.ahk",")"], - ["text"," "], - ["punctuation.ahk",")"] -],[ - "start", - ["text","\t\tzoom "], - ["keyword.operator.ahk","*="], - ["text"," 1.189207115 "], - ["comment.line.ahk"," ; sqrt(sqrt(2))"] -],[ - "start", - ["text","\t"], - ["keyword.command.ahk","Gosub"], - ["punctuation.ahk",","], - ["text","setZoom"] -],[ - "start", - ["keyword.control.ahk","return"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_batchfile.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_batchfile.json deleted file mode 100644 index 0f1f138c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_batchfile.json +++ /dev/null @@ -1,70 +0,0 @@ -[[ - "start", - ["comment.line.colons.dosbatch",":: batch file highlighting in Ace!"] -],[ - "start", - ["text","@"], - ["keyword.command.dosbatch","echo"], - ["text"," off"] -],[ - "start" -],[ - "start", - ["keyword.control.statement.dosbatch","CALL"], - ["text"," "], - ["keyword.command.dosbatch","set"], - ["text"," var1="], - ["constant.numeric","%cd%"] -],[ - "start", - ["keyword.command.dosbatch","echo"], - ["text"," unhide everything in "], - ["constant.numeric","%var1%"], - ["text","!"] -],[ - "start" -],[ - "start", - ["comment.line.colons.dosbatch",":: FOR loop in bat is super strange!"] -],[ - "start", - ["keyword.control.repeat.dosbatch","FOR"], - ["text"," /f "], - ["punctuation.definition.string.begin.shell","\""], - ["string.quoted.double.dosbatch","tokens=*"], - ["punctuation.definition.string.end.shell","\""], - ["text"," "], - ["constant.numeric","%%G"], - ["text"," IN ('"], - ["keyword.command.dosbatch","dir"], - ["text"," /A:D /b') DO ("] -],[ - "start", - ["keyword.command.dosbatch","echo"], - ["text"," "], - ["constant.numeric","%var1%%%G"] -],[ - "start", - ["keyword.command.dosbatch","attrib"], - ["text"," -r -a -h -s "], - ["punctuation.definition.string.begin.shell","\""], - ["constant.numeric","%var1%%%G"], - ["punctuation.definition.string.end.shell","\""], - ["text"," /D /S"] -],[ - "start", - ["text",")"] -],[ - "start" -],[ - "start", - ["keyword.command.dosbatch","pause"] -],[ - "start" -],[ - "start", - ["doc.comment","REM"], - ["comment"," that's all"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json deleted file mode 100644 index 902d8dce..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +++ /dev/null @@ -1,131 +0,0 @@ -[[ - ["start",{}], - ["text","Searching for '"], - ["text","var"], - ["text","' in"], - ["text"," /.c9/metadata/workspace/plugins "], - ["text","(regexp, case sensitive, whole word)"], - "Searching for \u0001var\u0001 in\u0001/.c9/metadata/workspace/plugins\u0001\u0001regexp, case sensitive, whole word\u0001" -],[ - ["start",{}] -],[ - ["start",{}], - ["string","configs/default.js"], - ["text",":"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric"," 1"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," fs = require(\"fs\");"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t2"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," argv = require('optimist').argv;"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t3"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," path = require(\"path\");"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t5"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," clientExtensions = {};"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t6"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," clientDirs = fs.readdirSync(__dirname + \"/../plugins-client\");"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t7"], - ["c9searchresults.text",": "], - ["c9searchresults.text","for ("], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," i = 0; i < clientDirs.length; i++) {"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t8"], - ["c9searchresults.text",": "], - ["c9searchresults.text"," "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," dir = clientDirs[i];"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t12"], - ["c9searchresults.text",": "], - ["c9searchresults.text"," "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," name = dir.split(\".\")[1];"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t16"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," projectDir = (argv.w && path.resolve(process.cwd(), argv.w)) || process.cwd();"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t17"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," fsUrl = \"/workspace\";"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t19"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," port = argv.p || process.env.PORT || 3131;"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t20"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," host = argv.l || \"localhost\";"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t22"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," config = {"] -],[ - ["start",{}] -],[ - ["start",{}], - ["string","configs/local.js"], - ["text",":"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t2"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," config = require(\"./default\");"] -],[ - ["start",{}] -],[ - ["start",{}], - ["string","configs/packed.js"], - ["text",":"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t1"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," config = require(\"./default\");"] -],[ - ["start",{}] -],[ - ["start",{}] -],[ - ["start",{}], - ["text","Found "], - ["constant.numeric","15"], - ["text"," matches in "], - ["constant.numeric","3"], - ["text"," files"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json deleted file mode 100644 index a8668b0b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +++ /dev/null @@ -1,190 +0,0 @@ -[[ - "start", - ["comment","// compound assignment operators"] -],[ - "start" -],[ - "start", - ["keyword","#include"], - ["constant.other"," "] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "start", - ["constant.other"," "] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \\"] -],[ - "start", - ["constant.other"," "] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \\"] -],[ - "start", - ["constant.other"," \"iostream\""] -],[ - "start" -],[ - "start", - ["keyword","#include"], - ["constant.other"," "] -],[ - "start", - ["keyword","#include"], - ["constant.other"," \"boost/asio/io_service.hpp\""] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \"iostream\" \\"] -],[ - "directive", - ["constant.other.multiline"," \"string\" \\"] -],[ - "start", - ["constant.other"," "] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword.control","using"], - ["text"," "], - ["keyword.operator","namespace"], - ["text"," "], - ["identifier","std"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["storage.type","int"], - ["text"," "], - ["identifier","main"], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","a"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","b"], - ["keyword.operator","="], - ["constant.numeric","3"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","/* foobar */"] -],[ - "start", - ["text"," "], - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","b"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","a"], - ["keyword.operator","+="], - ["constant.numeric","2"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","// equivalent to a=a+2"] -],[ - "start", - ["text"," "], - ["identifier","cout"], - ["text"," "], - ["keyword.operator","<<"], - ["text"," "], - ["identifier","a"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","#if"], - ["text"," "], - ["identifier","VERBOSE"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","2"] -],[ - "start", - ["text"," "], - ["identifier","prints"], - ["paren.lparen","("], - ["string","\"trace message\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","#endif"] -],[ - "start", - ["text"," "], - ["keyword.control","return"], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","/* Print an error message and get out */"] -],[ - "directive", - ["keyword","#define"], - ["constant.other.multiline"," ABORT \\"] -],[ - "directive", - ["constant.other.multiline"," do { \\"] -],[ - "directive", - ["constant.other.multiline"," print( \"Abort\\n\" ); \\"] -],[ - "directive", - ["constant.other.multiline"," exit(8); \\"] -],[ - "start", - ["constant.other","} while (0) "], - ["comment","/* Note: No semicolon */"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cirru.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cirru.json deleted file mode 100644 index de4852e6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cirru.json +++ /dev/null @@ -1,267 +0,0 @@ -[[ - "start", - ["comment.line.double-dash","-- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr,"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","a"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","self"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["storage.modifier","("], - ["support.function","child"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","under"], - ["text"," "], - ["variable.parameter","c"] -],[ - "line", - ["markup.raw"," "], - ["support.function","under"], - ["text"," "], - ["variable.parameter","parent"] -],[ - "line", - ["markup.raw"," "], - ["support.function","print"], - ["text"," "], - ["variable.parameter","a"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","get"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["variable.parameter","a"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["variable.parameter","x"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","3"], - ["storage.modifier",")"] -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","get"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["variable.parameter","x"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","just-print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","code"] -],[ - "line", - ["markup.raw"," "], - ["support.function","print"], - ["text"," "], - ["variable.parameter","a"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["variable.parameter","just-print"] -],[ - "start" -],[ - "line", - ["support.function","eval"], - ["text"," "], - ["storage.modifier","("], - ["support.function","self"], - ["storage.modifier",")"], - ["text"," "], - ["variable.parameter","just-print"] -],[ - "line", - ["support.function","eval"], - ["text"," "], - ["variable.parameter","just-print"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","string"], - ["text"," "], - ["string.quoted.double","\"string with space\""], - ["storage.modifier",")"] -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","string"], - ["text"," "], - ["string.quoted.double","\"escapes "], - ["constant.character.escape","\\n"], - ["string.quoted.double"," "], - ["constant.character.escape","\\\"\\\\"], - ["string.quoted.double","\""], - ["storage.modifier",")"] -],[ - "start" -],[ - "start", - ["support.function","brackets"], - ["text"," "], - ["storage.modifier","((((()))))"] -],[ - "start" -],[ - "line", - ["string.quoted.double","\"eval\""], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","string"], - ["text"," "], - ["string.quoted.double","\"eval\""] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","add"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","1"], - ["storage.modifier",")"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"], - ["storage.modifier","))"] -],[ - "start" -],[ - "start", - ["support.function","print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","unwrap"], - ["text"," "], - ["storage.modifier","$"] -],[ - "line", - ["text"," "], - ["support.function","map"], - ["text"," "], - ["storage.modifier","("], - ["support.function","a"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","1"], - ["storage.modifier",")"], - ["text"," "], - ["storage.modifier","("], - ["support.function","b"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["variable.parameter","a"] -],[ - "line", - ["markup.raw"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","1"] -],[ - "line", - ["markup.raw"," "], - ["storage.modifier",","], - ["text"," "], - ["variable.parameter","b"], - ["text"," "], - ["variable.parameter","c"] -],[ - "line", - ["markup.raw"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"] -],[ - "line", - ["markup.raw"," "], - ["storage.modifier",","], - ["text"," "], - ["variable.parameter","d"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json deleted file mode 100644 index 824cba59..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +++ /dev/null @@ -1,162 +0,0 @@ -[[ - "start", - ["keyword","("], - ["support.function","defn"], - ["text"," "], - ["identifier","parting"] -],[ - "start", - ["text"," "], - ["string","\"returns a String parting in a given language\""] -],[ - "start", - ["text"," "], - ["keyword","([]"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"World\""], - ["keyword","))"] -],[ - "start", - ["text"," "], - ["keyword","(["], - ["support.function","name"], - ["keyword","]"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["support.function","name"], - ["text"," "], - ["string","\"en\""], - ["keyword","))"] -],[ - "start", - ["text"," "], - ["keyword","(["], - ["support.function","name"], - ["text"," "], - ["identifier","language"], - ["keyword","]"] -],[ - "start", - ["text"," "], - ["comment","; condp is similar to a case statement in other languages."] -],[ - "start", - ["text"," "], - ["comment","; It is described in more detail later."] -],[ - "start", - ["text"," "], - ["comment","; It is used here to take different actions based on whether the"] -],[ - "start", - ["text"," "], - ["comment","; parameter \"language\" is set to \"en\", \"es\" or something else."] -],[ - "start", - ["text"," "], - ["keyword","("], - ["support.function","condp"], - ["text"," "], - ["constant.language","="], - ["text"," "], - ["identifier","language"] -],[ - "start", - ["text"," "], - ["string","\"en\""], - ["text"," "], - ["keyword","("], - ["support.function","str"], - ["text"," "], - ["string","\"Goodbye, \""], - ["text"," "], - ["support.function","name"], - ["keyword",")"] -],[ - "start", - ["text"," "], - ["string","\"es\""], - ["text"," "], - ["keyword","("], - ["support.function","str"], - ["text"," "], - ["string","\"Adios, \""], - ["text"," "], - ["support.function","name"], - ["keyword",")"] -],[ - "start", - ["text"," "], - ["keyword","(throw"], - ["text"," "], - ["keyword","("], - ["identifier","IllegalArgumentException"], - ["text","."] -],[ - "start", - ["text"," "], - ["keyword","("], - ["support.function","str"], - ["text"," "], - ["string","\"unsupported language \""], - ["text"," "], - ["identifier","language"], - ["keyword","))))))"] -],[ - "start" -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["keyword","))"], - ["text"," "], - ["comment","; -> Goodbye, World"] -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"Mark\""], - ["keyword","))"], - ["text"," "], - ["comment","; -> Goodbye, Mark"] -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"Mark\""], - ["text"," "], - ["string","\"es\""], - ["keyword","))"], - ["text"," "], - ["comment","; -> Adios, Mark"] -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"Mark\""], - ["text",", "], - ["string","\"xy\""], - ["keyword","))"], - ["text"," "], - ["comment","; -> java.lang.IllegalArgumentException: unsupported language xy"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cobol.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cobol.json deleted file mode 100644 index 9909eadd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cobol.json +++ /dev/null @@ -1,4 +0,0 @@ -[[ - "start", - ["identifier","TODO"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json deleted file mode 100644 index b0703b37..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +++ /dev/null @@ -1,545 +0,0 @@ -[[ - "start", - ["comment","#test: tokenize keyword"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["identifier","i"], - ["text"," "], - ["constant.numeric","1"], - ["punctuation.operator","."], - ["constant.numeric",".2"], - ["paren.rparen",")"] -],[ - "start", - ["comment","#test: tokenize regexp"] -],[ - "start", - ["string.regex","/\"[a]/"] -],[ - "start", - ["comment","#test: tokenize functions"] -],[ - "start", - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{args}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{a1, a2}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{@a1, a2}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{args}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{args}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{0abc}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["keyword.operator","/"], - ["identifier","abc"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","=>"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["identifier","abc"], - ["keyword.operator","/"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{#abc}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{abc#}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["paren.rparen",")"], - ["identifier","abc"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["identifier","abc"], - ["paren.rparen",")"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{a{bc}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{ }"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","arg1, arg2"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","arg1 = 1, arg2 = 'name'"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","@arg1 = /abc/, arg2 = 'name'"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["comment","#test: tokenize function: invalid case:"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["keyword.operator","="], - ["paren.lparen","("], - ["keyword.operator","/"], - ["identifier","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter"," "], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter"," "], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["variable.language","window"], - ["punctuation.operator","."], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["comment","#test: tokenize callback function"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["identifier","bar"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","x"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["comment","#test: tokenize class"] -],[ - "start", - ["keyword","class"], - ["text"," "], - ["language.support.class","Foo"] -],[ - "start", - ["keyword","class"], - ["text"," "], - ["language.support.class","Foo"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["language.support.class","Bar"] -],[ - "start", - ["comment","#test: tokenize illegal name property"] -],[ - "start", - ["identifier","foo"], - ["punctuation.operator","."], - ["identifier","static"], - ["punctuation.operator","."], - ["identifier","function"] -],[ - "start", - ["comment","#!test tokenize string with interpolation"] -],[ - "start", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.start","\""], - ["paren.string","#{"], - ["text"," "], - ["constant.numeric","22"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["constant.numeric","7"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren","{"], - ["identifier","x"], - ["keyword.operator",":"], - ["text"," "], - ["string.start","\""], - ["paren.string","#{"], - ["identifier","a"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","b"], - ["paren.string","}"], - ["string.end","\""], - ["paren","}"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","2"], - ["paren.string","}"], - ["string.end","\""] -],[ - "start", - ["string.start","\""], - ["string"," "], - ["paren.string","#{"], - ["text"," "], - ["string.start","\""], - ["string.end","\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren","{}"], - ["text"," "], - ["paren.string","}"], - ["string"," )"], - ["string.end","\""], - ["text"," "] -],[ - "qqdoc", - ["string","\"\"\"heredoc"] -],[ - "start", - ["string"," \"\"\""] -],[ - "start", - ["keyword","do"], - ["text"," "], - ["storage.type","->"] -],[ - "comment", - ["text"," "], - ["comment","###"] -],[ - "comment", - ["comment"," herecomment"] -],[ - "start", - ["comment"," ###"] -],[ - "heregex", - ["text"," "], - ["identifier","re"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regex","/regex/imgy"], - ["punctuation.operator","."], - ["identifier","test"], - ["text"," "], - ["string.regex","///"] -],[ - "heregex", - ["comment.regex"," "], - ["string.regex","heregex"], - ["comment.regex"," # comment"] -],[ - "start", - ["string.regex"," ///imgy"] -],[ - "js", - ["text"," "], - ["keyword","this"], - ["text"," "], - ["keyword","isnt"], - ["keyword.operator",":"], - ["text"," "], - ["string","`just "] -],[ - "start", - ["string"," JavaScript`"] -],[ - "start", - ["text"," "], - ["constant.language","undefined"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json deleted file mode 100644 index 804e647d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +++ /dev/null @@ -1,26 +0,0 @@ -[[ - "start", - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","cfset"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","welcome"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Hello World!\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","cfoutput"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","#welcome#"], - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json deleted file mode 100644 index dcc6d0e9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +++ /dev/null @@ -1,31 +0,0 @@ -[[ - "start", - ["keyword","public"], - ["text"," "], - ["keyword","void"], - ["text"," "], - ["identifier","HelloWorld"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","//Say Hello!"] -],[ - "start", - ["text"," "], - ["identifier","Console"], - ["punctuation.operator","."], - ["identifier","WriteLine"], - ["paren.lparen","("], - ["string.start","\""], - ["string","Hello World"], - ["string.end","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json deleted file mode 100644 index e1a7ba05..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +++ /dev/null @@ -1,148 +0,0 @@ -[[ - "ruleset", - ["variable",".text-layer"], - ["text"," "], - ["paren.lparen","{"] -],[ - "ruleset", - ["text"," "], - ["support.type","font-family"], - ["text",": Monaco, "], - ["string","\"Courier New\""], - ["text",", "], - ["support.constant.fonts","monospace"], - ["text",";"] -],[ - "ruleset", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","12"], - ["keyword","pX"], - ["text",";"] -],[ - "ruleset", - ["text"," "], - ["support.type","cursor"], - ["text",": "], - ["support.constant","text"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "ruleset", - ["variable",".blinker"], - ["text"," "], - ["paren.lparen","{"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-duration"], - ["text",": "], - ["constant.numeric","1"], - ["keyword","s"], - ["text",";"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-name"], - ["text",": blink;"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-iteration-count"], - ["text",": infinite;"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-direction"], - ["text",": alternate;"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-timing-function"], - ["text",": "], - ["support.constant","linear"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "media", - ["string","@keyframes blink {"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","0"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","0"], - ["text",";"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","40"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","0"], - ["text",";"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","40"], - ["variable",".5"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","1"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","100"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","1"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["string","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_curly.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_curly.json deleted file mode 100644 index d87a627a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_curly.json +++ /dev/null @@ -1,56 +0,0 @@ -[[ - "start", - ["text.xml","tokenize Curly template"], - ["variable","{{"], - ["text","test"], - ["variable","}}"] -],[ - "start", - ["text.xml","tokenize embedded script"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","a"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'a'"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["storage.type","var"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml","'123'"] -],[ - "start", - ["text.xml","tokenize multiline attribute value with double quotes"] -],[ - ["string.attribute-value.xml0","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"abc{{xyz}}"] -],[ - "start", - ["string.attribute-value.xml","def\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","tokenize multiline attribute value with single quotes"] -],[ - ["string.attribute-value.xml","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'abc"] -],[ - "start", - ["string.attribute-value.xml","def\\\"'"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_d.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_d.json deleted file mode 100644 index 85831cc3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_d.json +++ /dev/null @@ -1,111 +0,0 @@ -[[ - "start", - ["comment.shebang","#!/usr/bin/env rdmd"] -],[ - "start", - ["comment","// Computes average line length for standard input."] -],[ - "start", - ["keyword","import"], - ["text"," "], - ["variable.module","std.stdio"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword.type","void"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.type","ulong"], - ["text"," "], - ["identifier","lines"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.type","double"], - ["text"," "], - ["identifier","sumLength"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control","foreach"], - ["text"," "], - ["paren.lparen","("], - ["identifier","line"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","stdin"], - ["punctuation.operator","."], - ["identifier","byLine"], - ["paren.lparen","("], - ["paren.rparen","))"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator","++"], - ["identifier","lines"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","sumLength"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["identifier","line"], - ["punctuation.operator","."], - ["identifier","length"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","writeln"], - ["paren.lparen","("], - ["string","\"Average line length: \""], - ["punctuation.operator",","] -],[ - "start", - ["text"," "], - ["identifier","lines"], - ["text"," "], - ["keyword.operator","?"], - ["text"," "], - ["identifier","sumLength"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["identifier","lines"], - ["text"," "], - ["punctuation.operator",":"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dart.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dart.json deleted file mode 100644 index 37cdc323..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dart.json +++ /dev/null @@ -1,368 +0,0 @@ -[[ - "start", - ["identifier","main"], - ["text","() {"] -],[ - "start", - ["text"," "], - ["identifier","print"], - ["text","("], - ["string","'Hello World!'"], - ["text",");"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["storage.type.primitive.dart","int"], - ["text"," "], - ["identifier","fib"], - ["text","("], - ["storage.type.primitive.dart","int"], - ["text"," "], - ["identifier","n"], - ["text",") "], - ["keyword.operator.assignment.dart","="], - ["keyword.operator.comparison.dart",">"], - ["text"," ("], - ["identifier","n"], - ["text"," "], - ["keyword.operator.comparison.dart",">"], - ["text"," "], - ["constant.numeric","1"], - ["text",") "], - ["keyword.control.ternary.dart","?"], - ["text"," ("], - ["identifier","fib"], - ["text","("], - ["identifier","n"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["constant.numeric","1"], - ["text",") "], - ["keyword.operator.arithmetic.dart","+"], - ["text"," "], - ["identifier","fib"], - ["text","("], - ["identifier","n"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["constant.numeric","2"], - ["text",")) "], - ["keyword.control.ternary.dart",":"], - ["text"," "], - ["identifier","n"], - ["text",";"] -],[ - "start", - ["identifier","main"], - ["text","() {"] -],[ - "start", - ["text"," "], - ["identifier","print"], - ["text","("], - ["string","'fib(20) = ${fib(20)}'"], - ["text",");"] -],[ - "start", - ["text","}"] -],[ - "comment", - ["comment","/*asd"] -],[ - "comment", - ["comment","asdad"] -],[ - "start", - ["comment","*/"] -],[ - "start", - ["constant.numeric","0.67"] -],[ - "start", - ["constant.numeric","77"] -],[ - "start", - ["text","."], - ["constant.numeric","86"] -],[ - "start" -],[ - "start", - ["keyword.other.import.dart","import"], - ["text","("], - ["string","\"http://dartwatch.com/myOtherLibrary.dart\""], - ["text",");"] -],[ - "start", - ["keyword.other.import.dart","import"], - ["text","("], - ["string","\"myOtherLibrary.dart\""], - ["text",", "], - ["keyword.other.import.dart","prefix"], - ["text",":"], - ["string","\"lib1\""], - ["text",");"] -],[ - "start" -],[ - "qqdoc", - ["string","\"\"\"asdasdads"] -],[ - "qqdoc", - ["string","asdadsadsasd"] -],[ - "start", - ["string","asdasdasdad\"\"\""] -],[ - "start", - ["text"," "] -],[ - "start", - ["string","'23424'"] -],[ - "start" -],[ - "start", - ["constant.numeric","0x234"] -],[ - "start" -],[ - "start", - ["identifier","foo"], - ["text"," "], - ["keyword.operator.dart","is"], - ["text"," "], - ["identifier","bar"] -],[ - "start" -],[ - "start", - ["storage.type.primitive.dart","int"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["keyword.operator.bitwise.dart","<<"], - ["text"," "], - ["constant.numeric","10"], - ["text"," "] -],[ - "start", - ["comment","// Create a class for Point."] -],[ - "start", - ["keyword.declaration.dart","class"], - ["text"," "], - ["identifier","Point"], - ["text"," {"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// Final variables cannot be changed once they are assigned."] -],[ - "start", - ["text"," "], - ["comment","// Create two instance variables."] -],[ - "start", - ["text"," "], - ["storage.modifier.dart","final"], - ["text"," "], - ["storage.type.primitive.dart","num"], - ["text"," "], - ["identifier","x"], - ["text",", "], - ["identifier","y"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// A constructor, with syntactic sugar for setting instance variables."] -],[ - "start", - ["text"," "], - ["identifier","Point"], - ["text","("], - ["variable.language.dart","this"], - ["text","."], - ["identifier","x"], - ["text",", "], - ["variable.language.dart","this"], - ["text","."], - ["identifier","y"], - ["text",");"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// A named constructor with an initializer list."] -],[ - "start", - ["text"," "], - ["identifier","Point"], - ["text","."], - ["identifier","origin"], - ["text","() "], - ["keyword.control.ternary.dart",":"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","0"], - ["text",", "], - ["identifier","y"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","0"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// A method."] -],[ - "start", - ["text"," "], - ["storage.type.primitive.dart","num"], - ["text"," "], - ["identifier","distanceTo"], - ["text","("], - ["identifier","Point"], - ["text"," "], - ["identifier","other"], - ["text",") {"] -],[ - "start", - ["text"," "], - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","dx"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["identifier","other"], - ["text","."], - ["identifier","x"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","dy"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["identifier","other"], - ["text","."], - ["identifier","y"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.control.dart","return"], - ["text"," "], - ["identifier","sqrt"], - ["text","("], - ["identifier","dx"], - ["text"," "], - ["keyword.operator.arithmetic.dart","*"], - ["text"," "], - ["identifier","dx"], - ["text"," "], - ["keyword.operator.arithmetic.dart","+"], - ["text"," "], - ["identifier","dy"], - ["text"," "], - ["keyword.operator.arithmetic.dart","*"], - ["text"," "], - ["identifier","dy"], - ["text",");"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text","}"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// Check for null."] -],[ - "start", - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","unicorn"], - ["text",";"] -],[ - "start", - ["keyword.control.dart","assert"], - ["text","("], - ["identifier","unicorn"], - ["text"," "], - ["keyword.operator.comparison.dart","=="], - ["text"," "], - ["constant.language.dart","null"], - ["text",");"] -],[ - "start" -],[ - "start", - ["comment","// Check for NaN."] -],[ - "start", - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","iMeantToDoThis"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","0"], - ["keyword.operator.arithmetic.dart","/"], - ["constant.numeric","0"], - ["text",";"] -],[ - "start", - ["keyword.control.dart","assert"], - ["text","("], - ["identifier","iMeantToDoThis"], - ["text","."], - ["identifier","isNaN"], - ["text","());"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json deleted file mode 100644 index 6c36f5fa..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +++ /dev/null @@ -1,262 +0,0 @@ -[[ - "start", - ["variable","diff"], - ["variable"," --git"], - ["keyword"," a/lib/ace/edit_session.js"], - ["variable"," b/lib/ace/edit_session.js"] -],[ - "start", - ["variable","index 23fc3fc..ed3b273 100644"] -],[ - "start", - ["constant.numeric","---"], - ["meta.tag"," a/lib/ace/edit_session.js"] -],[ - "start", - ["constant.numeric","+++"], - ["meta.tag"," b/lib/ace/edit_session.js"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -51,6 +51,7 "], - ["constant","@@"], - ["comment.doc.tag"," var TextMode = require(\"./mode/text\").Mode;"] -],[ - "start", - ["invisible"," var Range = require(\"./range\").Range;"] -],[ - "start", - ["invisible"," var Document = require(\"./document\").Document;"] -],[ - "start", - ["invisible"," var BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;"] -],[ - "start", - ["support.constant","+"], - ["text","var SearchHighlight = require(\"./search_highlight\").SearchHighlight;"] -],[ - "start", - ["text"," "] -],[ - "start", - ["invisible"," /**"] -],[ - "start", - ["invisible"," * class EditSession"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -307,6 +308,13 "], - ["constant","@@"], - ["comment.doc.tag"," var EditSession = function(text, mode) {"] -],[ - "start", - ["invisible"," return token;"] -],[ - "start", - ["invisible"," };"] -],[ - "start", - ["text"," "] -],[ - "start", - ["support.constant","+"], - ["text"," this.highlight = function(re) {"] -],[ - "start", - ["support.constant","+"], - ["text"," if (!this.$searchHighlight) {"] -],[ - "start", - ["support.constant","+"], - ["text"," var highlight = new SearchHighlight(null, \"ace_selected-word\", \"text\");"] -],[ - "start", - ["support.constant","+"], - ["text"," this.$searchHighlight = this.addDynamicMarker(highlight);"] -],[ - "start", - ["support.constant","+"], - ["text"," }"] -],[ - "start", - ["support.constant","+"], - ["text"," this.$searchHighlight.setRegexp(re);"] -],[ - "start", - ["support.constant","+"], - ["text"," }"] -],[ - "start", - ["invisible"," /**"] -],[ - "start", - ["invisible"," * EditSession.setUndoManager(undoManager)"] -],[ - "start", - ["invisible"," * - undoManager (UndoManager): The new undo manager"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -556,7 +564,8 "], - ["constant","@@"], - ["comment.doc.tag"," var EditSession = function(text, mode) {"] -],[ - "start", - ["invisible"," type : type || \"line\","] -],[ - "start", - ["invisible"," renderer: typeof type == \"function\" ? type : null,"] -],[ - "start", - ["invisible"," clazz : clazz,"] -],[ - "start", - ["support.function","-"], - ["string"," inFront: !!inFront"] -],[ - "start", - ["support.constant","+"], - ["text"," inFront: !!inFront,"] -],[ - "start", - ["support.constant","+"], - ["text"," id: id"] -],[ - "start", - ["invisible"," }"] -],[ - "start", - ["text"," "] -],[ - "start", - ["invisible"," if (inFront) {"] -],[ - "start", - ["variable","diff"], - ["variable"," --git"], - ["keyword"," a/lib/ace/editor.js"], - ["variable"," b/lib/ace/editor.js"] -],[ - "start", - ["variable","index 834e603..b27ec73 100644"] -],[ - "start", - ["constant.numeric","---"], - ["meta.tag"," a/lib/ace/editor.js"] -],[ - "start", - ["constant.numeric","+++"], - ["meta.tag"," b/lib/ace/editor.js"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -494,7 +494,7 "], - ["constant","@@"], - ["comment.doc.tag"," var Editor = function(renderer, session) {"] -],[ - "start", - ["invisible"," * Emitted when a selection has changed."] -],[ - "start", - ["invisible"," **/"] -],[ - "start", - ["invisible"," this.onSelectionChange = function(e) {"] -],[ - "start", - ["support.function","-"], - ["string"," var session = this.getSession();"] -],[ - "start", - ["support.constant","+"], - ["text"," var session = this.session;"] -],[ - "start", - ["text"," "] -],[ - "start", - ["invisible"," if (session.$selectionMarker) {"] -],[ - "start", - ["invisible"," session.removeMarker(session.$selectionMarker);"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -509,12 +509,40 "], - ["constant","@@"], - ["comment.doc.tag"," var Editor = function(renderer, session) {"] -],[ - "start", - ["invisible"," this.$updateHighlightActiveLine();"] -],[ - "start", - ["invisible"," }"] -],[ - "start", - ["text"," "] -],[ - "start", - ["support.function","-"], - ["string"," var self = this;"] -],[ - "start", - ["support.function","-"], - ["string"," if (this.$highlightSelectedWord && !this.$wordHighlightTimer)"] -],[ - "start", - ["support.function","-"], - ["string"," this.$wordHighlightTimer = setTimeout(function() {"] -],[ - "start", - ["support.function","-"], - ["string"," self.session.$mode.highlightSelection(self);"] -],[ - "start", - ["support.function","-"], - ["string"," self.$wordHighlightTimer = null;"] -],[ - "start", - ["support.function","-"], - ["string"," }, 30, this);"] -],[ - "start", - ["support.constant","+"], - ["text"," var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp()"] -],[ - "start", - ["invisible"," };"] -],[ - "start", - ["variable","diff"], - ["variable"," --git"], - ["keyword"," a/lib/ace/search_highlight.js"], - ["variable"," b/lib/ace/search_highlight.js"] -],[ - "start", - ["invisible","new file mode 100644"] -],[ - "start", - ["variable","index 0000000..b2df779"] -],[ - "start", - ["constant.numeric","---"], - ["meta.tag"," /dev/null"] -],[ - "start", - ["constant.numeric","+++"], - ["meta.tag"," b/lib/ace/search_highlight.js"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -0,0 +1,3 "], - ["constant","@@"] -],[ - "start", - ["support.constant","+"], - ["text","new"] -],[ - "start", - ["support.constant","+"], - ["text","empty file"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dot.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dot.json deleted file mode 100644 index fec8b969..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dot.json +++ /dev/null @@ -1,2254 +0,0 @@ -[[ - "start", - ["comment","// Original source: http://www.graphviz.org/content/lion_share"] -],[ - "start", - ["comment","##\"A few people in the field of genetics are using dot to draw \"marriage node diagram\" pedigree drawings. Here is one I have done of a test pedigree from the FTREE pedigree drawing package (Lion Share was a racehorse).\" Contributed by David Duffy."] -],[ - "start" -],[ - "start", - ["comment","##Command to get the layout: \"dot -Tpng thisfile > thisfile.png\""] -],[ - "start" -],[ - "start", - ["keyword","digraph"], - ["text"," Ped_Lion_Share "], - ["paren.lparen","{"] -],[ - "start", - ["comment","# page = \"8.2677165,11.692913\" ;"] -],[ - "start", - ["variable","ratio"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"auto\""], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["text","mincross "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","2.0"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["variable","label"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"Pedigree Lion_Share\""], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["string","\"001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ01\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ02\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"023\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"020\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"021\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"018\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"025\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"019\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"022\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"024\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"027\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"026\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"028\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","grey "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"001\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"007\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0001\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"001\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ02\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"003\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0003\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"006\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0004\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ01\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"004\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"009\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0006\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"015\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0007\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"023\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"016\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0008\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"020\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"012\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0009\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"021\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"008\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"017\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0010\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"018\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"011\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"023\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0011\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"025\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"013\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"014\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0012\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"019\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"010\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"021\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0013\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"022\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"019\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"020\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0014\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"024\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"022\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"025\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0015\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"027\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"024\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"018\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0016\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"026\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"026\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"027\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0017\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"028\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_eiffel.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_eiffel.json deleted file mode 100644 index 344dbc62..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_eiffel.json +++ /dev/null @@ -1,141 +0,0 @@ -[[ - "start", - ["keyword","note"] -],[ - "start", - ["text","\t"], - ["identifier","description"], - ["keyword.operator",":"], - ["text"," "], - ["string.quoted.double","\"Represents a person.\""] -],[ - "start" -],[ - "start", - ["keyword","class"] -],[ - "start", - ["text","\t"], - ["entity.name.type","PERSON"] -],[ - "start" -],[ - "start", - ["keyword","create"] -],[ - "start", - ["text","\t"], - ["identifier","make"], - ["keyword.operator",","], - ["text"," "], - ["identifier","make_unknown"] -],[ - "start" -],[ - "start", - ["keyword","feature"], - ["text"," "], - ["paren.lparen","{"], - ["entity.name.type","NONE"], - ["paren.rparen","}"], - ["text"," "], - ["comment.line.double-dash","-- Creation"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["identifier","make"], - ["text"," "], - ["paren.lparen","("], - ["identifier","a_name"], - ["keyword.operator",":"], - ["text"," "], - ["keyword","like"], - ["text"," "], - ["identifier","name"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t\t\t"], - ["comment.line.double-dash","-- Create a person with `a_name' as `name'."] -],[ - "start", - ["text","\t\t"], - ["keyword","do"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","name"], - ["text"," "], - ["keyword.operator",":="], - ["text"," "], - ["identifier","a_name"] -],[ - "start", - ["text","\t\t"], - ["keyword","ensure"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","name"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","a_name"] -],[ - "start", - ["text","\t\t"], - ["keyword","end"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["identifier","make_unknown"] -],[ - "start", - ["text","\t\t"], - ["keyword","do"], - ["text"," "], - ["keyword","ensure"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","name"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.language","Void"] -],[ - "start", - ["text","\t\t"], - ["keyword","end"] -],[ - "start" -],[ - "start", - ["keyword","feature"], - ["text"," "], - ["comment.line.double-dash","-- Access"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["identifier","name"], - ["keyword.operator",":"], - ["text"," "], - ["keyword","detachable"], - ["text"," "], - ["entity.name.type","STRING"] -],[ - "start", - ["text","\t\t\t"], - ["comment.line.double-dash","-- Full name or Void if unknown."] -],[ - "start" -],[ - "start", - ["keyword","end"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ejs.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ejs.json deleted file mode 100644 index 7e54af91..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ejs.json +++ /dev/null @@ -1,296 +0,0 @@ -[[ - "start", - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Cloud9 Rocks!"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"table\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Name"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Size"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["keyword.operator","!"], - ["identifier","isRoot"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"..\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml",".."], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["identifier","entries"], - ["punctuation.operator","."], - ["identifier","forEach"], - ["paren.lparen","("], - ["storage.type","function"], - ["paren.lparen","("], - ["identifier","entry"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","span"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"glyphicon "], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","mime"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["string","'directory'"], - ["text"," "], - ["punctuation.operator","?"], - ["text"," "], - ["string","'folder'"], - ["punctuation.operator",":"], - ["text"," "], - ["string","'file'"], - ["markup.list.meta.tag","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","name"], - ["text"," "], - ["markup.list.meta.tag","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","name"], - ["text"," "], - ["markup.list.meta.tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","size"], - ["text"," "], - ["markup.list.meta.tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["paren.rparen","})"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elixir.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elixir.json deleted file mode 100644 index cbbe1fee..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elixir.json +++ /dev/null @@ -1,196 +0,0 @@ -[[ - "start", - ["keyword.control.module.elixir","defmodule"], - ["meta.module.elixir"," "], - ["entity.name.type.module.elixir","HelloModule"], - ["text"," "], - ["keyword.control.elixir","do"] -],[ - "comment.documentation.heredoc", - ["text"," "], - ["comment.documentation.heredoc","@moduledoc \"\"\""] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," This is supposed to be `markdown`."] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," __Yes__ this is [mark](http://down.format)"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," # Truly"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," ## marked"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," * with lists"] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," * more"] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," * and more"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," Even.with(code)"] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," blocks |> with |> samples"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," _Docs are first class citizens in Elixir_ (Jose Valim)"] -],[ - "start", - ["comment.documentation.heredoc"," \"\"\""] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.elixir","#"], - ["comment.line.number-sign.elixir"," A \"Hello world\" function"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","def"], - ["text"," some_fun "], - ["keyword.control.elixir","do"] -],[ - "start", - ["text"," "], - ["variable.other.constant.elixir","IO"], - ["punctuation.separator.method.elixir","."], - ["text","puts "], - ["punctuation.definition.string.begin.elixir","\""], - ["string.quoted.double.elixir","Juhu Kinners!"], - ["punctuation.definition.string.end.elixir","\""] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","end"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.elixir","#"], - ["comment.line.number-sign.elixir"," A private function"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","defp"], - ["text"," priv "], - ["keyword.control.elixir","do"] -],[ - "punctuation.definition.string.begin.elixir7", - ["text"," is_regex "], - ["punctuation.definition.string.begin.elixir","~r\"\"\""] -],[ - "punctuation.definition.string.begin.elixir7", - ["string.quoted.double.heredoc.elixir"," This is a regex"] -],[ - "punctuation.definition.string.begin.elixir7", - ["string.quoted.double.heredoc.elixir"," spanning several"] -],[ - "punctuation.definition.string.begin.elixir7", - ["string.quoted.double.heredoc.elixir"," lines."] -],[ - "start", - ["punctuation.definition.string.end.elixir"," \"\"\""] -],[ - "start", - ["text"," x "], - ["keyword.operator.assignment.elixir","="], - ["text"," elem"], - ["punctuation.section.function.elixir","("], - ["punctuation.section.scope.elixir","{"], - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","a"], - ["punctuation.separator.object.elixir",","], - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","b"], - ["punctuation.separator.object.elixir",","], - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","c"], - ["text"," "], - ["punctuation.section.scope.elixir","}"], - ["punctuation.separator.object.elixir",","], - ["text"," "], - ["constant.numeric.elixir","0"], - ["punctuation.section.function.elixir",")"], - ["text"," "], - ["punctuation.definition.comment.elixir","#"], - ["comment.line.number-sign.elixir","=> :a"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","end"] -],[ - "start", - ["keyword.control.elixir","end"] -],[ - "start" -],[ - "start", - ["text","test_fun "], - ["keyword.operator.assignment.elixir","="], - ["text"," "], - ["keyword.control.elixir","fn"], - ["punctuation.section.function.elixir","("], - ["text","x"], - ["punctuation.section.function.elixir",")"], - ["text"," "], - ["keyword.operator.arithmetic.elixir","-"], - ["keyword.operator.comparison.elixir",">"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","cond"], - ["text"," "], - ["keyword.control.elixir","do"] -],[ - "start", - ["text"," x "], - ["keyword.operator.comparison.elixir",">"], - ["text"," "], - ["constant.numeric.elixir","10"], - ["text"," "], - ["keyword.operator.arithmetic.elixir","-"], - ["keyword.operator.comparison.elixir",">"] -],[ - "start", - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","greater_than_ten"] -],[ - "start", - ["text"," "], - ["constant.language.elixir","true"], - ["text"," "], - ["keyword.operator.arithmetic.elixir","-"], - ["keyword.operator.comparison.elixir",">"] -],[ - "start", - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","maybe_ten"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","end"] -],[ - "start", - ["keyword.control.elixir","end"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elm.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elm.json deleted file mode 100644 index b39de92f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elm.json +++ /dev/null @@ -1,198 +0,0 @@ -[[ - "start", - ["comment.start","{-"], - ["comment"," Ace "], - ["comment.start","{-"], - ["comment"," 4 "], - ["comment.end","-}"], - ["comment"," Elm "], - ["comment.end","-}"] -],[ - "start", - ["constant.language","main"], - ["text"," "], - ["keyword","="], - ["text"," "], - ["identifier","lift"], - ["text"," "], - ["identifier","clock"], - ["text"," "], - ["paren.lparen","("], - ["identifier","every"], - ["text"," "], - ["identifier","second"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["constant.language","clock"], - ["text"," "], - ["identifier","t"], - ["text"," "], - ["keyword","="], - ["text"," "], - ["identifier","collage"], - ["text"," "], - ["constant.numeric","400"], - ["text"," "], - ["constant.numeric","400"], - ["text"," "], - ["paren.lparen","["], - ["text"," "], - ["identifier","filled"], - ["text"," "], - ["identifier","lightGrey"], - ["text"," "], - ["paren.lparen","("], - ["identifier","ngon"], - ["text"," "], - ["constant.numeric","12"], - ["text"," "], - ["constant.numeric","110"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","outlined"], - ["text"," "], - ["paren.lparen","("], - ["identifier","solid"], - ["text"," "], - ["identifier","grey"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","("], - ["identifier","ngon"], - ["text"," "], - ["constant.numeric","12"], - ["text"," "], - ["constant.numeric","110"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","hand"], - ["text"," "], - ["identifier","orange"], - ["text"," "], - ["constant.numeric","100"], - ["text"," "], - ["identifier","t"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","hand"], - ["text"," "], - ["identifier","charcoal"], - ["text"," "], - ["constant.numeric","100"], - ["text"," "], - ["paren.lparen","("], - ["identifier","t"], - ["keyword.operator","/"], - ["constant.numeric","60"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","hand"], - ["text"," "], - ["identifier","charcoal"], - ["text"," "], - ["constant.numeric","60"], - ["text"," "], - ["paren.lparen","("], - ["identifier","t"], - ["keyword.operator","/"], - ["constant.numeric","720"], - ["paren.rparen",")"], - ["text"," "], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["constant.language","hand"], - ["text"," "], - ["identifier","clr"], - ["text"," "], - ["identifier","len"], - ["text"," "], - ["identifier","time"], - ["text"," "], - ["keyword","="] -],[ - "start", - ["text"," "], - ["keyword","let"], - ["text"," "], - ["identifier","angle"], - ["text"," "], - ["keyword","="], - ["text"," "], - ["identifier","degrees"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","90"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","6"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","inSeconds"], - ["text"," "], - ["identifier","time"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","traced"], - ["text"," "], - ["paren.lparen","("], - ["identifier","solid"], - ["text"," "], - ["identifier","clr"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","<|"], - ["text"," "], - ["identifier","segment"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","0"], - ["operator.punctuation",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","("], - ["identifier","len"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","cos"], - ["text"," "], - ["identifier","angle"], - ["operator.punctuation",","], - ["text"," "], - ["identifier","len"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","sin"], - ["text"," "], - ["identifier","angle"], - ["paren.rparen",")"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_erlang.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_erlang.json deleted file mode 100644 index 8a828976..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_erlang.json +++ /dev/null @@ -1,166 +0,0 @@ -[[ - "start", - ["text"," "], - ["punctuation.definition.comment.erlang","%% A process whose only job is to keep a counter."] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.erlang","%% First version"] -],[ - "start", - ["meta.directive.module.erlang"," "], - ["punctuation.section.directive.begin.erlang","-"], - ["keyword.control.directive.module.erlang","module"], - ["punctuation.definition.parameters.begin.erlang","("], - ["entity.name.type.class.module.definition.erlang","counter"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.section.directive.end.erlang","."] -],[ - "start", - ["meta.directive.export.erlang"," "], - ["punctuation.section.directive.begin.erlang","-"], - ["keyword.control.directive.export.erlang","export"], - ["punctuation.definition.parameters.begin.erlang","("], - ["punctuation.definition.list.begin.erlang","["], - ["entity.name.function.erlang","start"], - ["punctuation.separator.function-arity.erlang","/"], - ["constant.numeric.integer.decimal.erlang","0"], - ["punctuation.separator.list.erlang",","], - ["meta.structure.list.function.erlang"," "], - ["entity.name.function.erlang","codeswitch"], - ["punctuation.separator.function-arity.erlang","/"], - ["constant.numeric.integer.decimal.erlang","1"], - ["punctuation.definition.list.end.erlang","]"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.section.directive.end.erlang","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["meta.function.erlang"," "], - ["entity.name.function.definition.erlang","start"], - ["punctuation.section.expression.begin.erlang","("], - ["punctuation.section.expression.end.erlang",")"], - ["text"," "], - ["keyword.operator.symbolic.erlang","->"], - ["text"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["constant.numeric.integer.decimal.erlang","0"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.terminator.function.erlang","."] -],[ - "start", - ["text"," "] -],[ - ["text6","meta.function.erlang"], - ["meta.function.erlang"," "], - ["entity.name.function.definition.erlang","loop"], - ["punctuation.section.expression.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.section.expression.end.erlang",")"], - ["text"," "], - ["keyword.operator.symbolic.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["text"," "], - ["keyword.control.receive.erlang","receive"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.tuple.begin.erlang","{"], - ["constant.other.symbol.unquoted.erlang","increment"], - ["punctuation.separator.tuple.erlang",","], - ["meta.structure.tuple.erlang"," "], - ["variable.other.erlang","Count"], - ["punctuation.definition.tuple.end.erlang","}"], - ["meta.expression.receive.erlang"," "], - ["punctuation.separator.clause-head-body.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["keyword.operator.symbolic.erlang","+"], - ["variable.other.erlang","Count"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.separator.clauses.erlang",";"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.tuple.begin.erlang","{"], - ["constant.other.symbol.unquoted.erlang","counter"], - ["punctuation.separator.tuple.erlang",","], - ["meta.structure.tuple.erlang"," "], - ["variable.other.erlang","Pid"], - ["punctuation.definition.tuple.end.erlang","}"], - ["meta.expression.receive.erlang"," "], - ["punctuation.separator.clause-head-body.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["variable.other.erlang","Pid"], - ["meta.expression.receive.erlang"," "], - ["keyword.operator.symbolic.erlang","!"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.tuple.begin.erlang","{"], - ["constant.other.symbol.unquoted.erlang","counter"], - ["punctuation.separator.tuple.erlang",","], - ["meta.structure.tuple.erlang"," "], - ["variable.other.erlang","Sum"], - ["punctuation.definition.tuple.end.erlang","}"], - ["punctuation.separator.expressions.erlang",","] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.separator.clauses.erlang",";"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["constant.other.symbol.unquoted.erlang","code_switch"], - ["meta.expression.receive.erlang"," "], - ["punctuation.separator.clause-head-body.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["keyword.operator.macro.erlang","?"], - ["entity.name.function.macro.erlang","MODULE"], - ["meta.expression.receive.erlang",":"], - ["entity.name.function.erlang","codeswitch"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.definition.parameters.end.erlang",")"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.comment.erlang","% Force the use of 'codeswitch/1' from the latest MODULE version"] -],[ - "start", - ["meta.expression.receive.erlang"," "], - ["keyword.control.end.erlang","end"], - ["punctuation.terminator.function.erlang","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["meta.function.erlang"," "], - ["entity.name.function.definition.erlang","codeswitch"], - ["punctuation.section.expression.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.section.expression.end.erlang",")"], - ["text"," "], - ["keyword.operator.symbolic.erlang","->"], - ["text"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.terminator.function.erlang","."] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_forth.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_forth.json deleted file mode 100644 index 8c8a007e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_forth.json +++ /dev/null @@ -1,219 +0,0 @@ -[[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","HELLO"], - ["meta.block.forth"," "], - ["comment.line.parentheses.forth"," ( -- )"], - ["meta.block.forth"," CR "], - ["string.quoted.double.forth",".\" Hello, world!\""], - ["meta.block.forth"," "], - ["keyword.other.compile-only.forth",";"], - ["text"," "] -],[ - "start" -],[ - "start", - ["text","HELLO "] -],[ - "start", - ["text","Hello, world!"] -],[ - "start" -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","[CHAR]"], - ["meta.block.forth"," "], - ["keyword.other.non-immediate.forth"," CHAR"], - ["meta.block.forth"," "], - ["keyword.other.compile-only.forth"," POSTPONE"], - ["meta.block.forth"," LITERAL "], - ["keyword.other.compile-only.forth",";"], - ["keyword.other.immediate.forth"," IMMEDIATE"] -],[ - "start" -],[ - "start", - ["constant.numeric.forth","0"], - ["storage.type.forth"," value"], - ["text"," ii "], - ["constant.numeric.forth"," 0"], - ["storage.type.forth"," value"], - ["text"," jj"] -],[ - "start", - ["constant.numeric.forth","0"], - ["storage.type.forth"," value"], - ["text"," KeyAddr "], - ["constant.numeric.forth"," 0"], - ["storage.type.forth"," value"], - ["text"," KeyLen"] -],[ - "start", - ["storage.type.forth","create"], - ["text"," SArray "], - ["constant.numeric.forth"," 256"], - ["text"," allot "], - ["comment.line.backslash.forth"," \\ state array of 256 bytes"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","KeyArray"], - ["meta.block.forth"," KeyLen mod KeyAddr "], - ["keyword.other.compile-only.forth",";"] -],[ - "start" -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","get_byte"], - ["meta.block.forth"," + c@ "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","set_byte"], - ["meta.block.forth"," + c! "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","as_byte"], - ["meta.block.forth"," "], - ["constant.numeric.forth"," 255"], - ["meta.block.forth"," and "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","reset_ij"], - ["meta.block.forth"," "], - ["constant.numeric.forth"," 0"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," ii "], - ["constant.numeric.forth"," 0"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," jj "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","i_update"], - ["meta.block.forth"," "], - ["constant.numeric.forth"," 1"], - ["meta.block.forth"," + as_byte"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," ii "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","j_update"], - ["meta.block.forth"," ii SArray get_byte + as_byte"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," jj "], - ["keyword.other.compile-only.forth",";"] -],[ - "keyword.other.compile-only.forth", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","swap_s_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," jj SArray get_byte"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii SArray get_byte jj SArray set_byte"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii SArray set_byte"] -],[ - "start", - ["keyword.other.compile-only.forth",";"] -],[ - "start" -],[ - "keyword.other.compile-only.forth", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","rc4_init"], - ["comment.line.parentheses.forth"," ( KeyAddr KeyLen -- )"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["constant.numeric.forth"," 256"], - ["meta.block.forth"," min"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," KeyLen "], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," KeyAddr"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["constant.numeric.forth"," 256 0"], - ["keyword.control.compile-only.forth"," DO"], - ["meta.block.forth"," "], - ["variable.language.forth","i"], - ["meta.block.forth"," "], - ["variable.language.forth","i"], - ["meta.block.forth"," SArray set_byte "], - ["keyword.control.compile-only.forth"," LOOP"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," reset_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["keyword.control.compile-only.forth"," BEGIN"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii KeyArray get_byte jj + j_update"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," swap_s_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii"], - ["constant.numeric.forth"," 255"], - ["meta.block.forth"," <"], - ["keyword.control.compile-only.forth"," WHILE"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii i_update"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["keyword.control.compile-only.forth"," REPEAT"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," reset_ij"] -],[ - "start", - ["keyword.other.compile-only.forth",";"] -],[ - "keyword.other.compile-only.forth", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","rc4_byte"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii i_update jj j_update"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," swap_s_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii SArray get_byte jj SArray get_byte + as_byte SArray get_byte xor"] -],[ - "start", - ["keyword.other.compile-only.forth",";"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ftl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ftl.json deleted file mode 100644 index 75e7a6f1..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ftl.json +++ /dev/null @@ -1,341 +0,0 @@ -[[ - "start", - ["keyword.function","<#ftl"], - ["text"," "], - ["entity.other.attribute-name","encoding"], - ["keyword.operator","="], - ["string","\"utf-8\""], - ["text"," "], - ["keyword","/>"] -],[ - "start", - ["keyword.function","<#setting"], - ["text"," "], - ["entity.other.attribute-name","locale"], - ["keyword.operator","="], - ["string","\"en_US\""], - ["text"," "], - ["keyword","/>"] -],[ - "start", - ["keyword.function","<#import"], - ["text"," "], - ["string","\"library\""], - ["text"," "], - ["keyword.operator","as"], - ["text"," "], - ["variable","lib"], - ["text"," "], - ["keyword","/>"] -],[ - "ftl-dcomment", - ["comment","<#--"] -],[ - "ftl-dcomment", - ["comment"," FreeMarker comment"] -],[ - "ftl-dcomment", - ["comment"," ${abc} <#assign a=12 />"] -],[ - "start", - ["comment","-->"] -],[ - "start" -],[ - "start", - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","lang"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"en-us\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","meta"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","charset"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"utf-8\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["string.interpolated","${"], - ["variable","title"], - ["keyword.operator","!"], - ["string","\"FreeMarker\""], - ["string.interpolated","}"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h1"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Hello "], - ["string.interpolated","${"], - ["variable","name"], - ["keyword.operator","!"], - ["string","\"\""], - ["string.interpolated","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Today is: "], - ["string.interpolated","${"], - ["language.variable",".now"], - ["support.function","?date"], - ["string.interpolated","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#assign"], - ["text"," "], - ["variable","x"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","13"], - ["keyword",">"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#if"], - ["text"," "], - ["variable","x"], - ["text"," "], - ["constant.character.entity",">"], - ["text"," "], - ["constant.numeric","12"], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["variable","x"], - ["text"," "], - ["keyword.operator","lt"], - ["text"," "], - ["constant.numeric","14"], - ["keyword",">"], - ["text.xml","x equals 13: "], - ["string.interpolated","${"], - ["variable","x"], - ["string.interpolated","}"], - ["keyword.function",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#list"], - ["text"," "], - ["variable","items"], - ["text"," "], - ["keyword.operator","as"], - ["text"," "], - ["variable","item"], - ["keyword",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["string.interpolated","${"], - ["variable","item_index"], - ["string.interpolated","}"], - ["text.xml",": "], - ["string.interpolated","${"], - ["variable","item.name"], - ["keyword.operator","!"], - ["support.function","?split"], - ["paren.lparen","("], - ["string","\""], - ["constant.character.escape","\\n"], - ["string","\""], - ["paren.rparen",")"], - ["paren.lparen","["], - ["constant.numeric","0"], - ["paren.rparen","]"], - ["string.interpolated","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["keyword.function",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," User directive: "], - ["keyword.other","<@lib.function"], - ["text"," "], - ["variable","attr1"], - ["keyword.operator","="], - ["constant.language","true"], - ["text"," "], - ["variable","attr2"], - ["keyword.operator","="], - ["string","'value'"], - ["text"," "], - ["variable","attr3"], - ["keyword.operator","="], - ["constant.numeric","-42.12"], - ["keyword",">"], - ["text.xml","Test"], - ["keyword.other",""] -],[ - "start", - ["text.xml"," "], - ["keyword.other","<@anotherOne"], - ["text"," "], - ["keyword","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#if"], - ["text"," "], - ["variable","variable"], - ["support.function.deprecated","?exists"], - ["keyword",">"] -],[ - "start", - ["text.xml"," Deprecated"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#elseif"], - ["text"," "], - ["variable","variable"], - ["support.function","??"], - ["keyword",">"] -],[ - "start", - ["text.xml"," Better"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#else"], - ["keyword",">"] -],[ - "start", - ["text.xml"," Default"] -],[ - "start", - ["text.xml"," "], - ["keyword.function",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.image.tag-name.xml","img"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","src"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"images/"], - ["string.interpolated","${"], - ["variable","user.id"], - ["string.interpolated","}"], - ["string.attribute-value.xml",".png\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gcode.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gcode.json deleted file mode 100644 index d6227473..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gcode.json +++ /dev/null @@ -1,296 +0,0 @@ -[[ - "start", - ["identifier","O"], - ["constant.numeric","003"], - ["text"," "], - ["comment","(DIAMOND SQUARE)"] -],[ - "start", - ["comment","N2"], - ["text"," "], - ["string","G54"], - ["text"," "], - ["string","G90"], - ["text"," "], - ["string","G49"], - ["text"," "], - ["string","G80"] -],[ - "start", - ["comment","N3"], - ["text"," "], - ["string","M6"], - ["text"," "], - ["identifier","T"], - ["constant.numeric","1"], - ["text"," "], - ["comment","(1.ENDMILL)"] -],[ - "start", - ["comment","N4"], - ["text"," "], - ["string","M3"], - ["text"," "], - ["identifier","S"], - ["constant.numeric","1800"] -],[ - "start", - ["comment","N5"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-.6"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","2.050"] -],[ - "start", - ["comment","N6"], - ["text"," "], - ["string","G43"], - ["text"," "], - ["identifier","H"], - ["constant.numeric","1"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric",".1"] -],[ - "start", - ["comment","N7"], - ["text"," "], - ["string","G1"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","-.3"], - ["text"," "], - ["identifier","F"], - ["constant.numeric","50."] -],[ - "start", - ["comment","N8"], - ["text"," "], - ["string","G41"], - ["text"," "], - ["identifier","D"], - ["constant.numeric","1"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","1.45"] -],[ - "start", - ["comment","N9"], - ["text"," "], - ["string","G1"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","0"], - ["text"," "], - ["identifier","F"], - ["constant.numeric","20."] -],[ - "start", - ["comment","N10"], - ["text"," "], - ["string","G2"], - ["text"," "], - ["identifier","J"], - ["constant.numeric","-1.45"] -],[ - "start", - ["comment","(CUTTER COMP CANCEL)"] -],[ - "start", - ["comment","N11"], - ["text"," "], - ["string","G1"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","-.2"], - ["text"," "], - ["identifier","F"], - ["constant.numeric","50."] -],[ - "start", - ["comment","N12"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","-.990"] -],[ - "start", - ["comment","N13"], - ["text"," "], - ["string","G40"] -],[ - "start", - ["comment","N14"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-.6"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","1.590"] -],[ - "start", - ["comment","N15"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric",".1"] -],[ - "start", - ["comment","N16"], - ["text"," "], - ["string","M5"], - ["text"," "], - ["string","G49"], - ["text"," "], - ["string","G28"], - ["text"," "], - ["string","G91"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","0"] -],[ - "start", - ["comment","N17"], - ["text"," "], - ["identifier","CALL"], - ["text"," "], - ["identifier","O"], - ["constant.numeric","9456"] -],[ - "start", - ["comment","N18"], - ["text"," #"], - ["constant.numeric","500"], - ["text","="], - ["constant.numeric","0.004"] -],[ - "start", - ["comment","N19"], - ["text"," #"], - ["constant.numeric","503"], - ["text","="], - ["paren.lparen","["], - ["text","#"], - ["constant.numeric","500"], - ["text","+#"], - ["constant.numeric","501"], - ["paren.rparen","]"] -],[ - "start", - ["comment","N20"], - ["text"," "], - ["identifier","VC"], - ["constant.numeric","45"], - ["text","="], - ["constant.numeric","0.0006"] -],[ - "start", - ["identifier","VS"], - ["constant.numeric","4"], - ["text","="], - ["constant.numeric","0.0007"] -],[ - "start", - ["comment","N21"], - ["text"," "], - ["string","G90"], - ["text"," "], - ["string","G10"], - ["text"," "], - ["identifier","L"], - ["constant.numeric","20"], - ["text"," "], - ["identifier","P"], - ["constant.numeric","3"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","5."], - ["identifier","Y"], - ["constant.numeric","4."], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","6.567"] -],[ - "start", - ["comment","N22"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","5000"] -],[ - "start", - ["comment","N23"], - ["text"," "], - ["identifier","IF"], - ["text"," "], - ["paren.lparen","["], - ["text","#"], - ["constant.numeric","1"], - ["text"," "], - ["identifier","LT"], - ["text"," "], - ["constant.numeric","0.370"], - ["paren.rparen","]"], - ["text"," "], - ["identifier","GOTO"], - ["text"," "], - ["constant.numeric","49"] -],[ - "start", - ["comment","N24"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-0.678"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","+.990"] -],[ - "start", - ["comment","N25"], - ["text"," "], - ["string","G84.3"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-0.1"] -],[ - "start", - ["comment","N26"], - ["text"," #"], - ["constant.numeric","4"], - ["text","=#"], - ["constant.numeric","5"], - ["text","*"], - ["identifier","COS"], - ["paren.lparen","["], - ["constant.numeric","45"], - ["paren.rparen","]"] -],[ - "start", - ["comment","N27"], - ["text"," #"], - ["constant.numeric","4"], - ["text","=#"], - ["constant.numeric","5"], - ["text","*"], - ["identifier","SIN"], - ["paren.lparen","["], - ["constant.numeric","45"], - ["paren.rparen","]"] -],[ - "start", - ["comment","N28"], - ["text"," "], - ["identifier","VZOFZ"], - ["text","="], - ["constant.numeric","652.9658"] -],[ - "start", - ["text","%"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gherkin.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gherkin.json deleted file mode 100644 index d16ffc6c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gherkin.json +++ /dev/null @@ -1,142 +0,0 @@ -[[ - "start", - ["comment","@these"], - ["text"," "], - ["comment","@are"], - ["text"," "], - ["comment","@tags"] -],[ - "start", - ["keyword","Feature:"], - ["text"," Serve coffee"] -],[ - "start", - ["text"," Coffee should not be served until paid for"] -],[ - "start", - ["text"," Coffee should not be served until the button has been pressed"] -],[ - "start", - ["text"," If there is no coffee left then money should be refunded"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","Scenario Outline:"], - ["text"," Eating"] -],[ - "start", - ["text"," "], - ["keyword","Given"], - ["text"," there are "], - ["comment",""], - ["text"," cucumbers"] -],[ - "start", - ["text"," "], - ["keyword","When"], - ["text"," I eat "], - ["comment",""], - ["text"," cucumbers"] -],[ - "start", - ["text"," "], - ["keyword","Then"], - ["text"," I should have "], - ["comment",""], - ["text"," cucumbers"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","Examples:"] -],[ - "start", - ["text"," "], - ["comment","| "], - ["string","start "], - ["comment","| "], - ["string","eat "], - ["comment","| "], - ["string","left "], - ["comment","|"] -],[ - "start", - ["text"," "], - ["comment","| "], - ["string"," 12 "], - ["comment","| "], - ["string"," 5 "], - ["comment","| "], - ["string"," 7 "], - ["comment","|"] -],[ - "start", - ["text"," "], - ["comment","| "], - ["string"," 20 "], - ["comment","| "], - ["string"," 5 "], - ["comment","| "], - ["string"," 15 "], - ["comment","| "], - ["string"," "] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","Scenario:"], - ["text"," Buy last coffee"] -],[ - "start", - ["text"," "], - ["keyword","Given"], - ["text"," there are "], - ["constant.numeric","1"], - ["text"," coffees left in the machine"] -],[ - "start", - ["text"," "], - ["keyword","And"], - ["text"," I have deposited "], - ["constant.numeric","1"], - ["text","$ "] -],[ - "start", - ["text"," "], - ["keyword","When"], - ["text"," I press the coffee button"] -],[ - "start", - ["text"," "], - ["keyword","Then"], - ["text"," I should be served a "], - ["string","\"coffee\""] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","# this a comment"] -],[ - "start", - ["text"," "] -],[ - "qqstring3", - ["text"," "], - ["string","\"\"\""] -],[ - "qqstring3", - ["string"," this is a "] -],[ - "qqstring3", - ["string"," pystring"] -],[ - "start", - ["string"," \"\"\""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gitignore.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gitignore.json deleted file mode 100644 index 8689a724..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gitignore.json +++ /dev/null @@ -1,33 +0,0 @@ -[[ - "start", - ["comment","# A sample .gitignore file."] -],[ - "start" -],[ - "start", - ["text",".buildlog"] -],[ - "start", - ["text",".DS_Store"] -],[ - "start", - ["text",".svn"] -],[ - "start" -],[ - "start", - ["comment","# Negated patterns:"] -],[ - "start", - ["keyword","!foo.bar"] -],[ - "start" -],[ - "start", - ["comment","# Also ignore user settings..."] -],[ - "start", - ["text","/.settings"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json deleted file mode 100644 index ce8a4d16..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +++ /dev/null @@ -1,127 +0,0 @@ -[[ - "start", - ["keyword","uniform"], - ["text"," "], - ["keyword","float"], - ["text"," "], - ["identifier","amplitude"], - ["punctuation.operator",";"] -],[ - "start", - ["keyword","attribute"], - ["text"," "], - ["keyword","float"], - ["text"," "], - ["identifier","displacement"], - ["punctuation.operator",";"] -],[ - "start", - ["keyword","varying"], - ["text"," "], - ["keyword","vec3"], - ["text"," "], - ["identifier","vNormal"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","void"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start" -],[ - "start", - ["text"," "], - ["identifier","vNormal"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","normal"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// multiply our displacement by the"] -],[ - "start", - ["text"," "], - ["comment","// amplitude. The amp will get animated"] -],[ - "start", - ["text"," "], - ["comment","// so we'll have animated displacement"] -],[ - "start", - ["text"," "], - ["keyword","vec3"], - ["text"," "], - ["identifier","newPosition"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","position"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "] -],[ - "start", - ["text"," "], - ["identifier","normal"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","vec3"], - ["paren.lparen","("], - ["identifier","displacement"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["text"," "], - ["identifier","amplitude"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["constant.language","gl_Position"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","projectionMatrix"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["text"," "], - ["identifier","modelViewMatrix"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["text"," "], - ["keyword","vec4"], - ["paren.lparen","("], - ["identifier","newPosition"], - ["punctuation.operator",","], - ["constant.numeric","1.0"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json deleted file mode 100644 index 070c0a17..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +++ /dev/null @@ -1,256 +0,0 @@ -[[ - "start", - ["comment","// Concurrent computation of pi."] -],[ - "start", - ["comment","// See http://goo.gl/ZuTZM."] -],[ - "start", - ["comment","//"] -],[ - "start", - ["comment","// This demonstrates Go's ability to handle"] -],[ - "start", - ["comment","// large numbers of concurrent processes."] -],[ - "start", - ["comment","// It is an unreasonable way to calculate pi."] -],[ - "start", - ["keyword","package"], - ["text"," "], - ["identifier","main"] -],[ - "start" -],[ - "start", - ["keyword","import"], - ["text"," "], - ["paren.lparen","("] -],[ - "start", - ["text"," "], - ["string","\"fmt\""] -],[ - "start", - ["text"," "], - ["string","\"math\""] -],[ - "start", - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","func"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","fmt"], - ["punctuation.operator","."], - ["identifier","Println"], - ["paren.lparen","("], - ["identifier","pi"], - ["paren.lparen","("], - ["constant.numeric","5000"], - ["paren.rparen","))"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","// pi launches n goroutines to compute an"] -],[ - "start", - ["comment","// approximation of pi."] -],[ - "start", - ["keyword","func"], - ["text"," "], - ["identifier","pi"], - ["paren.lparen","("], - ["identifier","n"], - ["text"," "], - ["support.type","int"], - ["paren.rparen",")"], - ["text"," "], - ["support.type","float64"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","ch"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["support.function","make"], - ["paren.lparen","("], - ["keyword","chan"], - ["text"," "], - ["support.type","float64"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","n"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["keyword.operator","++"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","go"], - ["text"," "], - ["identifier","term"], - ["paren.lparen","("], - ["identifier","ch"], - ["punctuation.operator",","], - ["text"," "], - ["support.type","float64"], - ["paren.lparen","("], - ["identifier","k"], - ["paren.rparen","))"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","f"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0.0"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","n"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["keyword.operator","++"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","f"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["keyword.operator","<-"], - ["identifier","ch"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["identifier","f"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","func"], - ["text"," "], - ["identifier","term"], - ["paren.lparen","("], - ["identifier","ch"], - ["text"," "], - ["keyword","chan"], - ["text"," "], - ["support.type","float64"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["support.type","float64"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","ch"], - ["text"," "], - ["keyword.operator","<-"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","math"], - ["punctuation.operator","."], - ["identifier","Pow"], - ["paren.lparen","("], - ["constant.numeric","-1"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","k"], - ["paren.rparen",")"], - ["text"," / "], - ["paren.lparen","("], - ["constant.numeric","2"], - ["keyword.operator","*"], - ["identifier","k"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json deleted file mode 100644 index c7dae6b1..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +++ /dev/null @@ -1,410 +0,0 @@ -[[ - "start", - ["comment","//http://groovy.codehaus.org/Martin+Fowler%27s+closure+examples+in+Groovy"] -],[ - "start" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Employee"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","def"], - ["text"," "], - ["identifier","name"], - ["text",", "], - ["identifier","salary"] -],[ - "start", - ["text"," "], - ["keyword","boolean"], - ["text"," "], - ["identifier","manager"] -],[ - "start", - ["text"," "], - ["support.function","String"], - ["text"," "], - ["identifier","toString"], - ["lparen","("], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["keyword","return"], - ["text"," "], - ["identifier","name"], - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","emps"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["lparen","["], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Guillaume'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","true"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","200"], - ["rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Graeme'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","true"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","200"], - ["rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Dierk'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","false"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","151"], - ["rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Bernd'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","false"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","50"], - ["rparen",")]"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","managers"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","emps"], - ["text","."], - ["identifier","findAll"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","e"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","e"], - ["text","."], - ["identifier","isManager"], - ["lparen","("], - ["rparen",")"], - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["text",".."], - ["constant.numeric","1"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","managers"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["comment","// [Guillaume, Graeme]"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","highPaid"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","threshold"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","150"] -],[ - "start", - ["text"," "], - ["identifier","emps"], - ["text","."], - ["identifier","findAll"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","e"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","e"], - ["text","."], - ["identifier","salary"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["identifier","threshold"], - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["text",".."], - ["constant.numeric","2"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","highPaid"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["comment","// [Guillaume, Graeme, Dierk]"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","paidMore"], - ["lparen","("], - ["identifier","amount"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","e"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","e"], - ["text","."], - ["identifier","salary"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["identifier","amount"], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","highPaid"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","paidMore"], - ["lparen","("], - ["constant.numeric","150"], - ["rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","highPaid"], - ["lparen","("], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["rparen","])"], - ["text"," "], - ["comment","// true"] -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["text",".."], - ["constant.numeric","2"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","emps"], - ["text","."], - ["identifier","findAll"], - ["lparen","("], - ["identifier","highPaid"], - ["rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","filename"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'test.txt'"] -],[ - "start", - ["keyword","new"], - ["text"," "], - ["identifier","File"], - ["lparen","("], - ["identifier","filename"], - ["rparen",")"], - ["text","."], - ["identifier","withReader"], - ["lparen","{"], - ["text"," "], - ["identifier","reader"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","doSomethingWith"], - ["lparen","("], - ["identifier","reader"], - ["rparen",")"], - ["text"," "], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","readersText"] -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","doSomethingWith"], - ["lparen","("], - ["identifier","reader"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","readersText"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","reader"], - ["text","."], - ["identifier","text"], - ["text"," "], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","File"], - ["lparen","("], - ["identifier","filename"], - ["rparen",")"], - ["text","."], - ["identifier","text"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","readersText"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haml.json deleted file mode 100644 index 423c3bd5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haml.json +++ /dev/null @@ -1,174 +0,0 @@ -[[ - "start", - ["keyword.other.doctype","!!!5"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start" -],[ - "start" -],[ - "start", - ["punctuation.section.comment","/adasdasdad"] -],[ - "start", - ["entity.name.tag.haml","%div"], - ["punctuation.section","{"], - ["constant.other.symbol.ruby",":id"], - ["text"," => "], - ["string","\"#{@item.type}_#{@item.number}\""], - ["text",", "], - ["constant.other.symbol.ruby",":class"], - ["text"," => "], - ["string","'#{@item.type} #{@item.urgency}'"], - ["text",", "], - ["constant.other.symbol.ruby",":phoney"], - ["text"," => "], - ["string","`asdasdasd`"], - ["punctuation.section","}"] -],[ - "start", - ["punctuation.section.comment","/ file: app/views/movies/index.html.haml"] -],[ - "start", - ["meta.escape.haml","\\d"] -],[ - "start", - ["entity.name.tag.haml","%ads:"], - ["punctuation.section","{"], - ["constant.other.symbol.ruby",":bleh"], - ["text"," => "], - ["constant.numeric","33"], - ["punctuation.section","}"] -],[ - "embedded_ruby", - ["entity.name.tag.haml","%p"], - ["text","==ddd=="] -],[ - "start", - ["text"," Date/Time:"] -],[ - "embedded_ruby", - ["text"," - "], - ["identifier","now"], - ["text"," = "], - ["support.class","DateTime"], - ["text","."], - ["identifier","now"], - ["text"," "] -],[ - "start", - ["entity.name.tag.haml"," %strong"], - ["text","= now"] -],[ - "embedded_ruby", - ["text"," = "], - ["keyword","if"], - ["text"," "], - ["identifier","now"], - ["text"," "], - ["support.class","DateTime"], - ["text","."], - ["identifier","parse"], - ["text","(\""], - ["support.class","December"], - ["text"," "], - ["constant.numeric","31"], - ["text",", "], - ["constant.numeric","2006"], - ["text","\")"] -],[ - "embedded_ruby", - ["text"," = \""], - ["support.class","Happy"], - ["text"," "], - ["identifier","new"], - ["text"," \" + \""], - ["identifier","year"], - ["text","!\""] -],[ - "start", - ["entity.name.tag.haml","%sfd"], - ["entity.other.attribute-name.class.haml",".dfdfg"] -],[ - "start", - ["punctuation.section.comment","#content"] -],[ - "start", - ["text"," .title"] -],[ - "start", - ["entity.name.tag.haml"," %h1"], - ["text","= @title"] -],[ - "embedded_ruby", - ["text"," = "], - ["support.function","link_to"], - ["text"," '"], - ["support.class","Home"], - ["text","', "], - ["identifier","home_url"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment"," #contents"] -],[ - "start", - ["entity.name.tag.haml","%div"], - ["entity.other.attribute-name.id.haml","#content"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".articles"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".article.title"], - ["text"," Blah"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".article.date"], - ["text"," "], - ["constant.numeric","2006-11-05"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".article.entry"] -],[ - "start", - ["text"," Neil Patrick Harris "] -],[ - "start" -],[ - "start", - ["entity.name.tag.haml","%div"], - ["text","[@user, "], - ["constant.other.symbol.ruby",":greeting"], - ["text","]"] -],[ - "start", - ["entity.name.tag.haml"," %bar"], - ["text","["], - ["constant.numeric","290"], - ["text","]/"] -],[ - "start", - ["text"," "], - ["string.quoted.double","==Hello!=="] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_handlebars.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_handlebars.json deleted file mode 100644 index 1ec79139..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_handlebars.json +++ /dev/null @@ -1,81 +0,0 @@ -[[ - "start", - ["comment.start","{{!--"], - ["comment"," Ace + :-}} "], - ["comment.end","--}}"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"comments\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["storage.type.start","{{#"], - ["variable.parameter","each"], - ["text"," "], - ["variable.parameter","comments"], - ["storage.type.end","}}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"/posts/"], - ["storage.type.start","{{"], - ["text","../"], - ["variable.parameter","permalink"], - ["storage.type.end","}}"], - ["string.attribute-value.xml","#"], - ["storage.type.start","{{"], - ["variable.parameter","id"], - ["storage.type.end","}}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["storage.type.start","{{"], - ["variable.parameter","title"], - ["storage.type.end","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.function","{{{"], - ["variable.parameter","body"], - ["support.function","}}}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["storage.type.start","{{/"], - ["variable.parameter","each"], - ["storage.type.end","}}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haskell.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haskell.json deleted file mode 100644 index 8f9a2b38..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haskell.json +++ /dev/null @@ -1,156 +0,0 @@ -[[ - "start", - ["punctuation.definition.comment.haskell","-- Type annotation (optional)"] -],[ - "start", - ["entity.name.function.haskell","fib"], - ["meta.function.type-declaration.haskell"," "], - ["keyword.other.double-colon.haskell","::"], - ["meta.function.type-declaration.haskell"," "], - ["support.type.prelude.haskell","Int"], - ["meta.function.type-declaration.haskell"," "], - ["keyword.other.arrow.haskell","->"], - ["meta.function.type-declaration.haskell"," "], - ["support.type.prelude.haskell","Integer"] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- With self-referencing data"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs "], - ["keyword.operator.haskell","="], - ["text"," "], - ["constant.numeric.haskell","0"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["support.function.prelude.haskell","scanl"], - ["text"," "], - ["entity.name.function.infix.haskell","(+)"], - ["text"," "], - ["constant.numeric.haskell","1"], - ["text"," fibs"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.haskell","-- 0,1,1,2,3,5,..."] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- Same, coded directly"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs "], - ["keyword.operator.haskell","="], - ["text"," "], - ["constant.numeric.haskell","0"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["constant.numeric.haskell","1"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," next fibs"] -],[ - "start", - ["text"," next (a "], - ["keyword.operator.haskell",":"], - ["text"," t@(b"], - ["keyword.operator.haskell",":"], - ["text","_)) "], - ["keyword.operator.haskell","="], - ["text"," (a"], - ["keyword.operator.haskell","+"], - ["text","b) "], - ["keyword.operator.haskell",":"], - ["text"," next t"] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- Similar idea, using zipWith"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs "], - ["keyword.operator.haskell","="], - ["text"," "], - ["constant.numeric.haskell","0"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["constant.numeric.haskell","1"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["support.function.prelude.haskell","zipWith"], - ["text"," "], - ["entity.name.function.infix.haskell","(+)"], - ["text"," fibs ("], - ["support.function.prelude.haskell","tail"], - ["text"," fibs)"] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- Using a generator function"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs ("], - ["constant.numeric.haskell","0"], - ["punctuation.separator.comma.haskell",","], - ["constant.numeric.haskell","1"], - ["text",") "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs (a"], - ["punctuation.separator.comma.haskell",","], - ["text","b) "], - ["keyword.operator.haskell","="], - ["text"," a "], - ["keyword.operator.haskell",":"], - ["text"," fibs (b"], - ["punctuation.separator.comma.haskell",","], - ["text","a"], - ["keyword.operator.haskell","+"], - ["text","b)"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json deleted file mode 100644 index f0f79a48..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +++ /dev/null @@ -1,143 +0,0 @@ -[[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Haxe"], - ["text"," "] -],[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","public"], - ["text"," "], - ["keyword","static"], - ["text"," "], - ["keyword","function"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","// Say Hello!"] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","greeting"], - ["punctuation.operator",":"], - ["keyword","String"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"Hello World\""], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["paren.lparen","("], - ["identifier","greeting"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","targets"], - ["punctuation.operator",":"], - ["keyword","Array"], - ["keyword.operator","<"], - ["keyword","String"], - ["keyword.operator",">"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["string","\"Flash\""], - ["punctuation.operator",","], - ["string","\"Javascript\""], - ["punctuation.operator",","], - ["string","\"PHP\""], - ["punctuation.operator",","], - ["string","\"Neko\""], - ["punctuation.operator",","], - ["string","\"C++\""], - ["punctuation.operator",","], - ["string","\"iOS\""], - ["punctuation.operator",","], - ["string","\"Android\""], - ["punctuation.operator",","], - ["string","\"webOS\""], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["paren.lparen","("], - ["string","\"Haxe is a great language that can target:\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["identifier","target"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","targets"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["text"," "], - ["paren.lparen","("], - ["string","\" - \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","target"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["paren.lparen","("], - ["string","\"And many more!\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json deleted file mode 100644 index c5f75eff..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +++ /dev/null @@ -1,63 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","scripts"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","a"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'a'"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["storage.type","var"], - ["text"," "], - ["string","\""], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml","'123'"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - ["string.attribute-value.xml0","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"abc"] -],[ - "start", - ["string.attribute-value.xml"," def\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["string.attribute-value.xml","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'abc"] -],[ - "start", - ["string.attribute-value.xml","def\\'"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html_ruby.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html_ruby.json deleted file mode 100644 index 8ff5f6ea..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html_ruby.json +++ /dev/null @@ -1,257 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h1"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Listing Books"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Title"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Summary"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["support.ruby_tag","<%"], - ["text"," "], - ["variable.instance","@books"], - ["text","."], - ["identifier","each"], - ["text"," "], - ["keyword","do"], - ["text"," |"], - ["identifier","book"], - ["text","| "], - ["support.ruby_tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["comment.start.erb","<%#"], - ["comment"," comment "], - ["comment.end.erb","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["identifier","book"], - ["text","."], - ["identifier","title"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["identifier","book"], - ["text","."], - ["identifier","content"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","Show"], - ["string.end","'"], - ["text",", "], - ["identifier","book"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","Edit"], - ["string.end","'"], - ["text",", "], - ["identifier","edit_book_path"], - ["paren.lparen","("], - ["identifier","book"], - ["paren.rparen",")"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","Remove"], - ["string.end","'"], - ["text",", "], - ["identifier","book"], - ["text",", "], - ["constant.other.symbol.ruby",":confirm"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["string.start","'"], - ["string","Are you sure?"], - ["string.end","'"], - ["text",", "], - ["constant.other.symbol.ruby",":method"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["constant.other.symbol.ruby",":delete"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["support.ruby_tag","<%"], - ["text"," "], - ["keyword","end"], - ["text"," "], - ["support.ruby_tag","%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","br"], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","New book"], - ["string.end","'"], - ["text",", "], - ["identifier","new_book_path"], - ["text"," "], - ["support.ruby_tag","%>"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ini.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ini.json deleted file mode 100644 index 11d28017..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ini.json +++ /dev/null @@ -1,23 +0,0 @@ -[[ - "start", - ["punctuation.definition.entity.ini","["], - ["constant.section.group-title.ini",".ShellClassInfo"], - ["punctuation.definition.entity.ini","]"] -],[ - "start", - ["keyword.other.definition.ini","IconResource"], - ["punctuation.separator.key-value.ini","="], - ["text","..\\logo.png"] -],[ - "start", - ["punctuation.definition.entity.ini","["], - ["constant.section.group-title.ini","ViewState"], - ["punctuation.definition.entity.ini","]"] -],[ - "start", - ["keyword.other.definition.ini","FolderType"], - ["punctuation.separator.key-value.ini","="], - ["text","Generic"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_io.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_io.json deleted file mode 100644 index b83a675a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_io.json +++ /dev/null @@ -1,49 +0,0 @@ -[[ - "start", - ["punctuation.definition.comment.io","//"], - ["comment.line.double-slash.io"," computes factorial of a number"] -],[ - "start", - ["text","factorial "], - ["keyword.operator.io",":="], - ["text"," "], - ["support.function.io","method"], - ["text","(n,"] -],[ - "start", - ["text"," "], - ["keyword.control.io","if"], - ["text","(n "], - ["keyword.operator.io","=="], - ["text"," "], - ["constant.numeric.io","0"], - ["text",", "], - ["keyword.control.io","return"], - ["text"," "], - ["constant.numeric.io","1"], - ["text",")"] -],[ - "start", - ["text"," res "], - ["keyword.operator.io",":="], - ["text"," "], - ["constant.numeric.io","1"] -],[ - "start", - ["text"," "], - ["support.class.io","Range"], - ["text"," "], - ["constant.numeric.io","1"], - ["text"," "], - ["support.function.io","to"], - ["text","(n) "], - ["keyword.control.io","foreach"], - ["text","(i, res "], - ["keyword.operator.io","="], - ["text"," res "], - ["keyword.operator.io","*"], - ["text"," i)"] -],[ - "start", - ["text",")"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jack.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jack.json deleted file mode 100644 index c3d694dd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jack.json +++ /dev/null @@ -1,1786 +0,0 @@ -[[ - "start", - ["keyword","vars"], - ["text"," "], - ["variable","it"], - ["text",", "], - ["variable","p"] -],[ - "start" -],[ - "start", - ["variable","p"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","label"], - ["text",", "], - ["variable","value"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\""], - ["constant.language.escape","\\n"], - ["string","\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","label"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["language.builtin","inspect"], - ["paren.lparen","("], - ["variable","value"], - ["paren.rparen","))"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["comment","-- Create an array from 0 to 15"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"range\""], - ["text",", "], - ["language.builtin","i-collect"], - ["paren.lparen","("], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["paren.rparen",")))"] -],[ - "start" -],[ - "start", - ["comment","-- Create an array from 0 to 15 and break up in chunks of 4"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"chunked range\""], - ["text",", "], - ["language.builtin","i-collect"], - ["paren.lparen","("], - ["language.builtin","i-chunk"], - ["paren.lparen","("], - ["constant.numeric","4"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","16"], - ["paren.rparen","))))"] -],[ - "start" -],[ - "start", - ["comment","-- Check if all or none items in stream pass test."] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"all < 60 in range(60)\""], - ["text",", "], - ["variable","i-all?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator","<"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","60"], - ["paren.rparen",")))"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"any < 60 in range(60)\""], - ["text",", "], - ["variable","i-any?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator",">"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","60"], - ["paren.rparen",")))"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"all < 60 in range(70)\""], - ["text",", "], - ["variable","i-all?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator","<"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","70"], - ["paren.rparen",")))"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"any < 60 in range(70)\""], - ["text",", "], - ["variable","i-any?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator",">"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","70"], - ["paren.rparen",")))"] -],[ - "start" -],[ - "start", - ["comment","-- Zip three different collections together"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"zipped\""], - ["text",", "], - ["language.builtin","i-collect"], - ["paren.lparen","("], - ["language.builtin","i-zip"], - ["paren.lparen","("] -],[ - "start", - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["constant.numeric","4"], - ["text",","], - ["constant.numeric","5"], - ["paren.rparen","]"], - ["text",","] -],[ - "start", - ["text"," "], - ["language.builtin","i-map"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator","*"], - ["variable","i"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen","))"] -],[ - "start", - ["paren.rparen",")))"] -],[ - "start" -],[ - "start", - ["keyword","vars"], - ["text"," "], - ["variable","names"], - ["text",", "], - ["variable","person"], - ["text",", "], - ["variable","i"], - ["text",", "], - ["variable","doubles"], - ["text",", "], - ["variable","lengths"], - ["text",", "], - ["variable","cubeRange"] -],[ - "start", - ["variable","names"], - ["text"," = "], - ["paren.lparen","["], - ["string","\"Thorin\""], - ["text",", "], - ["string","\"Dwalin\""], - ["text",", "], - ["string","\"Balin\""], - ["text",", "], - ["string","\"Bifur\""], - ["text",", "], - ["string","\"Bofur\""], - ["text",", "], - ["string","\"Bombur\""], - ["text",", "], - ["string","\"Oin\""], - ["text",","] -],[ - "start", - ["text"," "], - ["string","\"Gloin\""], - ["text",", "], - ["string","\"Ori\""], - ["text",", "], - ["string","\"Nori\""], - ["text",", "], - ["string","\"Dori\""], - ["text",", "], - ["string","\"Fili\""], - ["text",", "], - ["string","\"Kili\""], - ["text",", "], - ["string","\"Bilbo\""], - ["text",", "], - ["string","\"Gandalf\""], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","names"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["string","\"Bilbo\""], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["string","\"Gandalf\""], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["variable","person"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","name"], - ["text",": "], - ["string","\"Tim\""], - ["text",", "], - ["variable","age"], - ["text",": "], - ["constant.numeric","30"], - ["paren.rparen","}"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","key"], - ["text",", "], - ["variable","value"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","person"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","key"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\" = \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","value"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["variable","i"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["keyword","while"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["constant.numeric","10"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","i"], - ["text"," = "], - ["variable","i"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","i"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"range\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","i"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["variable","i"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","-- Dynamic object that gives the first 10 doubles"] -],[ - "start", - ["variable","doubles"], - ["text"," = "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.form","@len"], - ["text",": "], - ["paren.lparen","{"], - ["text","| "], - ["constant.numeric","10"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["storage.form","@get"], - ["text",": "], - ["paren.lparen","{"], - ["variable","key"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["keyword","is"], - ["text"," "], - ["storage.type","Integer"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"#doubles\""], - ["text",", "], - ["keyword.operator","#"], - ["variable","doubles"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"Doubles\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","doubles"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","-- Dynamic object that has names list as keys and string lenth as values"] -],[ - "start", - ["variable","lengths"], - ["text"," = "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.form","@keys"], - ["text",": "], - ["paren.lparen","{"], - ["text","| "], - ["variable","names"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["storage.form","@get"], - ["text",": "], - ["paren.lparen","{"], - ["variable","key"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["keyword","is"], - ["text"," "], - ["storage.type","String"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["keyword.operator","#"], - ["variable","key"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["text"," "], - ["paren.lparen","("], - ["string","\"Lengths\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","lengths"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["variable","cubeRange"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","n"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","vars"], - ["text"," "], - ["variable","i"], - ["text",", "], - ["variable","v"] -],[ - "start", - ["text"," "], - ["variable","i"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.form","@call"], - ["text",": "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["variable","v"], - ["text"," = "], - ["variable","i"] -],[ - "start", - ["text"," "], - ["variable","i"], - ["text"," = "], - ["variable","i"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["variable","n"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"Cubes\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","cubeRange"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"String\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["string","\"Hello World\""], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","i"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")])"] -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","i"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","20"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["constant.numeric","3"], - ["paren.rparen","])"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- Example showing how to do parallel work using split..and"] -],[ - "start", - ["variable","base"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","bootstrap"], - ["text",", "], - ["variable","target-dir"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","split"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","copy"], - ["paren.lparen","("], - ["string","\"res\""], - ["text",", "], - ["variable","target-dir"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","newer"], - ["paren.lparen","("], - ["string","\"src/*.less\""], - ["text",", "], - ["variable","target-dir"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"/style.css\""], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","lessc"], - ["paren.lparen","("], - ["string","\"src/\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","bootstrap"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\".less\""], - ["text",", "], - ["variable","target-dir"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"/style.css\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","build"], - ["paren.lparen","("], - ["string","\"src/\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","bootstrap"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\".js\""], - ["text",", "], - ["variable","target-dir"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"/app.js\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","vars"], - ["text"," "], - ["variable","Dragon"], - ["text",", "], - ["variable","pet"] -],[ - "start" -],[ - "start", - ["variable","Dragon"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","name"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","vars"], - ["text"," "], - ["variable","asleep"], - ["text",", "], - ["variable","stuff-in-belly"], - ["text",", "], - ["variable","stuff-in-intestine"], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","feed"], - ["text",", "], - ["variable","walk"], - ["text",", "], - ["variable","put-to-bed"], - ["text",", "], - ["variable","toss"], - ["text",", "], - ["variable","rock"], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","hungry?"], - ["text",", "], - ["variable","poopy?"], - ["text",", "], - ["variable","passage-of-time"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," = "], - ["constant.numeric","10"], - ["text"," "], - ["comment","-- He's full."] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["constant.numeric","0"], - ["text"," "], - ["comment","-- He doesn't need to go."] -],[ - "start" -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' is born.'"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","feed"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You feed '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","'.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," = "], - ["constant.numeric","10"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","walk"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You walk '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\".\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","put-to-bed"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You put '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' to bed.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","true"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","3"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' snores, filling the room with smoke.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' wakes up slowly.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","toss"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You toss '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' up into the air.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He giggles, which singes your eyebrows.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","rock"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You rock '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' gently.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","true"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He briefly dozes off...'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'...but wakes when you stop.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","hungry?"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["constant.numeric","2"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","poopy?"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","8"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","-- Move food from belly to intestine"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," = "], - ["variable","stuff-in-belly"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["variable","stuff-in-intestine"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["comment","-- Our dragon is starving!"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He wakes up suddenly!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' is starving! In desperation, he ate YOU!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","abort"], - ["text"," "], - ["string","\"died\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","10"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'Whoops! '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' had an accident...'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","hungry?"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He wakes up suddenly!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"'s stomach grumbles...\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","poopy?"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He wakes up suddenly!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' does the potty dance...'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","-- Export the public interface to this closure object."] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","feed"], - ["text",": "], - ["variable","feed"] -],[ - "start", - ["text"," "], - ["variable","walk"], - ["text",": "], - ["variable","walk"] -],[ - "start", - ["text"," "], - ["variable","put-to-bed"], - ["text",": "], - ["variable","put-to-bed"] -],[ - "start", - ["text"," "], - ["variable","toss"], - ["text",": "], - ["variable","toss"] -],[ - "start", - ["text"," "], - ["variable","rock"], - ["text",": "], - ["variable","rock"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["variable","pet"], - ["text"," = "], - ["variable","Dragon"], - ["paren.lparen","("], - ["string","'Norbert'"], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","feed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","toss"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","walk"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","rock"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jade.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jade.json deleted file mode 100644 index 5bf45968..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jade.json +++ /dev/null @@ -1,188 +0,0 @@ -[[ - "start", - ["keyword.other.doctype.jade","!!!doctype"] -],[ - "start", - ["keyword.other.doctype.jade","!!!5"] -],[ - "start", - ["keyword.other.doctype.jade","!!!"] -],[ - "start" -],[ - "start", - ["keyword.control.import.include.jade","include"], - ["text"," something"] -],[ - "start" -],[ - "start", - ["keyword.control.import.include.jade"," include"], - ["text"," another_thing"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment"," // let's talk about it"] -],[ - "start" -],[ - ["comment_block",0,"start"], - ["comment","// "] -],[ - ["comment_block",0,"start"], - ["comment"," here it is. a block comment!"] -],[ - ["comment_block",0,"start"], - ["comment"," and another row!"] -],[ - "start", - ["meta.tag.any.jade","but"], - ["text"," not here."] -],[ - "start" -],[ - ["comment_block",5,"start"], - ["comment"," // "] -],[ - ["comment_block",5,"start"], - ["comment"," a far spaced"] -],[ - "start", - ["text"," should be lack of block"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment"," // also not a comment"] -],[ - "start", - ["meta.tag.any.jade"," div"], - ["entity.other.attribute-name.class.jade",".attemptAtBlock"] -],[ - "start", - ["text"," "] -],[ - "start", - ["meta.tag.any.jade"," span"], - ["entity.other.attribute-name.id.jade","#myName"] -],[ - "start" -],[ - "start", - ["text"," "], - ["string.interpolated.jade","#{implicit}"] -],[ - "start", - ["text"," "], - ["string.interpolated.jade","!{more_explicit}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["suport.type.attribute.id.jade","#idDiv"] -],[ - "start" -],[ - "start", - ["text"," "], - ["suport.type.attribute.class.jade",".idDiv"] -],[ - "start" -],[ - "start", - ["meta.tag.any.jade"," test"], - ["punctuation","("], - ["entity.other.attribute-name.jade","id"], - ["text","="], - ["string","\"tag\""], - ["punctuation",")"] -],[ - "start", - ["meta.tag.any.jade"," header"], - ["punctuation","("], - ["entity.other.attribute-name.jade","id"], - ["text","="], - ["string","\"tag\""], - ["text",", "], - ["entity.other.attribute-name.jade","blah"], - ["text","="], - ["string","\"foo\""], - ["text",", "], - ["entity.other.attribute-name.jade","meh"], - ["text","="], - ["string","\"aads\""], - ["punctuation",")"] -],[ - "start", - ["storage.type.function.jade","mixin"], - ["entity.name.function.jade"," article"], - ["punctuation.definition.parameters.begin.jade","("], - ["variable.parameter.function.jade","obj, parents"], - ["punctuation.definition.parameters.end.jade",")"] -],[ - "start" -],[ - "start", - ["storage.type.function.jade"," mixin"], - ["entity.name.function.jade"," bleh"], - ["punctuation.definition.parameters.begin.jade","("], - ["punctuation.definition.parameters.end.jade",")"] -],[ - "start" -],[ - "start", - ["storage.type.function.jade"," mixin"], - ["entity.name.function.jade"," clever-name"] -],[ - "start" -],[ - "start", - ["source.js.embedded.jade"," -"], - ["storage.type","var"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"0\""], - ["text",";"] -],[ - "start", - ["source.js.embedded.jade"," -"], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["identifier","each"], - ["text"," z"] -],[ - "start" -],[ - "start", - ["source.js.embedded.jade"," -"], - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["string","\"one\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"two\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"three\""], - ["text","]"] -],[ - "start", - ["meta.tag.any.jade"," each"], - ["text"," item in items"] -],[ - "start", - ["meta.tag.any.jade"," li"], - ["text","= item"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json deleted file mode 100644 index 799ebdb5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +++ /dev/null @@ -1,95 +0,0 @@ -[[ - "start", - ["keyword","public"], - ["text"," "], - ["keyword","class"], - ["text"," "], - ["identifier","InfiniteLoop"], - ["text"," "], - ["lparen","{"] -],[ - "start" -],[ - "comment", - ["text"," "], - ["comment","/*"] -],[ - "comment", - ["comment"," * This will cause the program to hang..."] -],[ - "comment", - ["comment"," *"] -],[ - "comment", - ["comment"," * Taken from:"] -],[ - "comment", - ["comment"," * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/"] -],[ - "start", - ["comment"," */"] -],[ - "start", - ["text"," "], - ["keyword","public"], - ["text"," "], - ["keyword","static"], - ["text"," "], - ["keyword","void"], - ["text"," "], - ["identifier","main"], - ["lparen","("], - ["support.function","String"], - ["lparen","["], - ["rparen","]"], - ["text"," "], - ["identifier","args"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","double"], - ["text"," "], - ["identifier","d"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["support.function","Double"], - ["text","."], - ["identifier","parseDouble"], - ["lparen","("], - ["string","\"2.2250738585072012e-308\""], - ["rparen",")"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","// unreachable code"] -],[ - "start", - ["text"," "], - ["support.function","System"], - ["text","."], - ["identifier","out"], - ["text","."], - ["identifier","println"], - ["lparen","("], - ["string","\"Value: \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","d"], - ["rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json deleted file mode 100644 index 1be3f605..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +++ /dev/null @@ -1,593 +0,0 @@ -[[ - "start", - ["comment","//test: tokenize 'standard' functions"] -],[ - "no_regex", - ["identifier","string"], - ["punctuation.operator","."], - ["support.function","charCodeAt"], - ["paren.lparen","("], - ["constant.numeric","23"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["text"," "], - ["variable.language","document"], - ["punctuation.operator","."], - ["support.function.dom","getElementById"], - ["paren.lparen","("], - ["string","'test'"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["text"," "], - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","'Here it is'"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["string","\";"] -],[ - "no_regex", - ["identifier","test"], - ["punctuation.operator",":"], - ["text"," "], - ["comment.doc","/**tokenize doc*/"], - ["text"," "], - ["identifier","comment"] -],[ - "no_regex", - ["comment.doc","/**tokenize doc comment with "], - ["comment.doc.tag","@tag"], - ["comment.doc"," {}*/"] -],[ - "no_regex", - ["comment","//test: tokenize parens"] -],[ - "start", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","line"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"[{( )}]\""], - ["punctuation.operator",";"] -],[ - "start", - ["comment","//test tokenize arithmetic expression which looks like a regexp"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","/"], - ["identifier","b"], - ["keyword.operator","/"], - ["identifier","c"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","/="], - ["identifier","b"], - ["keyword.operator","/"], - ["identifier","c"] -],[ - "no_regex", - ["comment","//test tokenize reg exps"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["string.regexp","/b/g"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","+"], - ["string.regexp","/b/g"] -],[ - "no_regex", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string.regexp","/2 "], - ["constant.language.escape","+"], - ["string.regexp"," 1/gimyx"], - ["identifier","k"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["string.regexp","/a/"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["string.regexp","/a/"] -],[ - "no_regex", - ["keyword","case"], - ["text"," "], - ["string.regexp","/a/"], - ["punctuation.operator","."], - ["support.function","test"], - ["paren.lparen","("], - ["identifier","c"], - ["paren.rparen",")"] -],[ - "no_regex", - ["comment","//test tokenize multi-line comment containing a single line comment"] -],[ - "no_regex", - ["identifier","noRegex"] -],[ - "no_regex", - ["comment","/* foo // bar */"] -],[ - "start", - ["identifier","canBeRegex"], - ["punctuation.operator",";"] -],[ - "start", - ["comment","/* foo // bar */"] -],[ - "start", - ["comment","// test tokenize identifier with umlauts"] -],[ - "no_regex", - ["identifier","fu"], - ["punctuation.operator","?"], - ["identifier","e"] -],[ - "no_regex", - ["comment","// test // is not a regexp"] -],[ - "start", - ["paren.lparen","{"], - ["text"," "], - ["comment","// 123"] -],[ - "start", - ["comment","//test skipping escaped chars"] -],[ - "no_regex", - ["string","'Meh"], - ["constant.language.escape","\\\\"], - ["string","nNeh'"] -],[ - "no_regex", - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","'"], - ["constant.language.escape","\\\\"], - ["string","u1232Feh'"] -],[ - "qqstring", - ["string","\"test multiline\\"] -],[ - "no_regex", - ["string"," strings\""] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["text","'"] -],[ - "qqstring", - ["identifier","b"], - ["keyword.operator","="], - ["string","\"\\"] -],[ - "no_regex", - ["string","still a string"] -],[ - "no_regex", - ["text"," "] -],[ - "no_regex", - ["text"," "] -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["entity.name.function","foo"], - ["paren.lparen","("], - ["variable.parameter","items"], - ["punctuation.operator",", "], - ["variable.parameter","nada"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["storage.type","var"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","="], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","<"], - ["identifier","items"], - ["punctuation.operator","."], - ["support.constant","length"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","++"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["identifier","items"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"juhu"], - ["constant.language.escape","\\n"], - ["string","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"], - ["text","\t"], - ["comment","// Real Tab."] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "no_regex", - ["identifier","regexp"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/p"], - ["constant.language.delimiter","|"], - ["string.regexp","p/"], - ["text"," "], - ["comment","// ends here"] -],[ - "no_regex" -],[ - "no_regex", - ["identifier","r"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/d"], - ["constant.language.escape","{1,2}?"], - ["string.regexp","f{e}"], - ["invalid","++"], - ["string.regexp","r"], - ["constant.language.escape","*?"], - ["regexp.keyword.operator","\\d"], - ["constant.language.escape","+?[]"], - ["string.regexp","r"], - ["constant.language.escape","[^"], - ["string.regexp.charachterclass","r"], - ["constant.language.escape","-"], - ["string.regexp.charachterclass","o"], - ["regexp.charclass.keyword.operator","\\f\\f"], - ["string.regexp.charachterclass","["], - ["regexp.charclass.keyword.operator","\\f"], - ["constant.language.escape","]?"], - ["string.regexp","r"], - ["invalid","{7}+"], - ["string.regexp","r"], - ["regexp.keyword.operator","\\{"], - ["string.regexp","7}"], - ["constant.language.escape","+"], - ["string.regexp","rr--rr"], - ["constant.language.escape","$^(?:"], - ["string.regexp","d"], - ["constant.language.delimiter","|"], - ["string.regexp","s"], - ["constant.language.escape",")(?="], - ["string.regexp","a"], - ["constant.language.delimiter","|"], - ["constant.language.escape",")(?!"], - ["string.regexp","y"], - ["constant.language.escape",")[]"], - ["constant.language.delimiter","|"], - ["invalid","$?"], - ["constant.language.delimiter","|"], - ["invalid","^*"], - ["string.regexp","/"], - ["text"," "], - ["identifier","o"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["string.regexp","/a/"], - ["text"," "], - ["identifier","jk"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/ /"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["string.regexp","/ /"] -],[ - "no_regex", - ["text"," "], - ["comment.doc","/************************************/"] -],[ - "no_regex", - ["comment.doc","/** total mess, tricky to highlight**/"] -],[ - "no_regex" -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "doc-start", - ["text","\t"], - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc","\t * docComment"] -],[ - "no_regex", - ["comment.doc","\t **/"] -],[ - "no_regex", - ["text","\t"], - ["identifier","r"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/u"], - ["regexp.keyword.operator","\\t"], - ["constant.language.escape","*"], - ["string.regexp","/"] -],[ - "no_regex", - ["text","\t"], - ["identifier","g"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1."], - ["text","00"], - ["identifier","E"], - ["keyword.operator","^"], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1.2"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["punctuation.operator","."], - ["constant.numeric","2"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","052"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","0x25"] -],[ - "no_regex", - ["text","\t"], - ["identifier","t"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["string","'d'"], - ["punctuation.operator",","], - ["text"," "], - ["string","''"], - ["paren.rparen","]"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["comment","/* eee */"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "qqstring", - ["string","\"s\\"] -],[ - "no_regex", - ["string","s"], - ["constant.language.escape","\\u7824"], - ["string","sss"], - ["constant.language.escape","\\u"], - ["string","1\""] -],[ - "no_regex" -],[ - "qstring", - ["string","'\\"] -],[ - "no_regex", - ["string","string'"] -],[ - "no_regex" -],[ - "no_regex", - ["text","'"] -],[ - "no_regex", - ["identifier","string"], - ["text","'"] -],[ - "no_regex" -],[ - "no_regex", - ["string","\"trailing space"], - ["constant.language.escape","\\ "], - ["string"," "] -],[ - "no_regex", - ["string","\" \""], - ["text"," "], - ["keyword.operator","/"], - ["identifier","not"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["identifier","regexp"], - ["keyword.operator","/"], - ["identifier","g"] -],[ - "no_regex" -],[ - "doc-start", - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc"," *doc"] -],[ - "no_regex", - ["comment.doc"," */"] -],[ - "no_regex" -],[ - "start", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["string","'a'"], - ["punctuation.operator",":"], - ["text"," "], - ["identifier","b"], - ["punctuation.operator",","] -],[ - "no_regex", - ["text","\t"], - ["string","'g'"], - ["text",":"], - ["text"," "], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","t"], - ["paren.rparen",")"] -],[ - "no_regex", - ["text","\t"], - ["entity.name.function","gta"], - ["punctuation.operator",":"], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",","], - ["variable.parameter","b"], - ["paren.rparen",")"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "no_regex" -],[ - "function_arguments", - ["identifier","foo"], - ["punctuation.operator","."], - ["storage.type","protoype"], - ["punctuation.operator","."], - ["entity.name.function","d"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",", "], - ["variable.parameter","b"], - ["punctuation.operator",","] -],[ - "no_regex", - ["punctuation.operator"," "], - ["variable.parameter","c"], - ["punctuation.operator",", "], - ["variable.parameter","d"], - ["paren.rparen",")"] -],[ - "no_regex", - ["storage.type","foo"], - ["punctuation.operator","."], - ["entity.name.function","d"], - ["text"," "], - ["keyword.operator","="], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",", "], - ["variable.parameter","b"], - ["paren.rparen",")"] -],[ - "no_regex", - ["storage.type","foo"], - ["punctuation.operator","."], - ["entity.name.function","d"], - ["text"," "], - ["keyword.operator","="], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",", "], - ["comment.doc","/*****/"], - ["text"," "], - ["identifier","d"], - ["string","\"string\""], - ["text"," "] -],[ - "no_regex" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json deleted file mode 100644 index 4420a740..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +++ /dev/null @@ -1,412 +0,0 @@ -[[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"query\""], - ["text",": "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"count\""], - ["text",": "], - ["constant.numeric","10"], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"created\""], - ["text",": "], - ["string","\"2011-06-21T08:10:46Z\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"lang\""], - ["text",": "], - ["string","\"en-US\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"results\""], - ["text",": "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"photo\""], - ["text",": "], - ["paren.lparen","["] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"6\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5855620975\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"f1f5e8515d\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"5110\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"7087 bandit cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"4\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856170534\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"ff1efb2a6f\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"3217\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"6975 rusty cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"6\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856172972\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"51249875@N03\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"6c6887347c\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"5192\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"watermarked-cats\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"6\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856168328\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"0c1cfdf64c\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"5078\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"7020 mandy cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"3\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856171774\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"7f5a3180ab\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"2696\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"7448 bobby cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","]"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsoniq.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsoniq.json deleted file mode 100644 index 0f4ee6e9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsoniq.json +++ /dev/null @@ -1,4 +0,0 @@ -[[ - "[\"start\"]", - ["support.function","TODO"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsp.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsp.json deleted file mode 100644 index 25d3af4d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsp.json +++ /dev/null @@ -1,435 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "js-start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "js-start", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"abc\""], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["storage.type","function"], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "css-start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.style.tag-name.xml","style"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["variable",".class"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","background"], - ["text",": "], - ["constant.numeric","#124356"], - ["text",";"] -],[ - "css-start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," Today's date: "], - ["meta.tag","<%"], - ["keyword.operator","="], - ["text"," "], - ["lparen","("], - ["keyword","new"], - ["text"," "], - ["identifier","java"], - ["text","."], - ["identifier","util"], - ["text","."], - ["identifier","Date"], - ["lparen","("], - ["rparen","))"], - ["text","."], - ["identifier","toLocaleString"], - ["lparen","("], - ["rparen",")"], - ["meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag","<%"], - ["keyword.operator","!"], - ["text"," "], - ["keyword","int"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["text","; "], - ["meta.tag","%>"] -],[ - "jsp-start", - ["text.xml"," "], - ["meta.tag",""] -],[ - "jsp-start", - ["text"," "], - ["keyword","int"], - ["text"," "], - ["identifier","j"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","10"], - ["text",";"] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["comment","<%-- This is JSP comment --%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag","<%@"], - ["text"," "], - ["identifier","directive"], - ["text"," "], - ["identifier","attribute"], - ["keyword.operator","="], - ["string","\"value\""], - ["text"," "], - ["meta.tag","%>"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Select Languages:"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","form"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","ACTION"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"jspCheckBox.jsp\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Java\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," Java"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\".NET\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," .NET"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"PHP\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," PHP"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"C/C++\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," C/C++"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"PERL\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," PERL "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"submit\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Submit\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "jsp-start", - ["text.xml"," "], - ["meta.tag","<%"] -],[ - "jsp-start", - ["text"," "], - ["support.function","String"], - ["text"," "], - ["identifier","select"], - ["lparen","["], - ["rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["variable.language","request"], - ["text","."], - ["identifier","getParameterValues"], - ["lparen","("], - ["string","\"id\""], - ["rparen",")"], - ["text","; "] -],[ - "jsp-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["identifier","select"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["constant.language","null"], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["identifier","select"], - ["text","."], - ["identifier","length"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["constant.numeric","0"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "jsp-start", - ["text"," "], - ["variable.language","out"], - ["text","."], - ["identifier","println"], - ["lparen","("], - ["string","\"You have selected: \""], - ["rparen",")"], - ["text",";"] -],[ - "jsp-start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["lparen","("], - ["keyword","int"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["text","; "], - ["identifier","i"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["identifier","select"], - ["text","."], - ["identifier","length"], - ["text","; "], - ["identifier","i"], - ["keyword.operator","++"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "jsp-start", - ["text"," "], - ["variable.language","out"], - ["text","."], - ["identifier","println"], - ["lparen","("], - ["identifier","select"], - ["lparen","["], - ["identifier","i"], - ["rparen","])"], - ["text","; "] -],[ - "jsp-start", - ["text"," "], - ["rparen","}"] -],[ - "jsp-start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag","%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json deleted file mode 100644 index d1a740b0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +++ /dev/null @@ -1,51 +0,0 @@ -[[ - "comment", - ["comment","/*EXPECTED"] -],[ - "comment", - ["comment","hello world!"] -],[ - "start", - ["comment","*/"] -],[ - "start", - ["keyword","class"], - ["text"," "], - ["language.support.class","Test"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","static"], - ["text"," "], - ["storage.type","function"], - ["text"," "], - ["entity.name.function","run"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["punctuation.operator",":"], - ["text"," "], - ["keyword","void"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","// console.log(\"hello world!\");"] -],[ - "start", - ["text"," "], - ["keyword","log"], - ["text"," "], - ["string","\"hello world!\""], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_julia.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_julia.json deleted file mode 100644 index 5aaef6f9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_julia.json +++ /dev/null @@ -1,111 +0,0 @@ -[[ - "start", - ["keyword.control.julia","for"], - ["text"," op "], - ["keyword.operator.update.julia","="], - ["text"," ("], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.arithmetic.julia","+"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.arithmetic.julia","*"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.bitwise.julia","&"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.bitwise.julia","|"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.interpolation.julia","$"], - ["text",")"] -],[ - "start", - ["text"," "], - ["variable.macro.julia","@eval"], - ["text"," ("], - ["keyword.operator.interpolation.julia","$"], - ["text","op)(a,b,c) "], - ["keyword.operator.update.julia","="], - ["text"," ("], - ["keyword.operator.interpolation.julia","$"], - ["text","op)(("], - ["keyword.operator.interpolation.julia","$"], - ["text","op)(a,b),c)"] -],[ - "start", - ["keyword.control.julia","end"] -],[ - "start" -],[ - "start", - ["text","v "], - ["keyword.operator.update.julia","="], - ["text"," "], - ["variable","α"], - ["keyword.operator.transposed-variable.julia","'"], - ["text",";"] -],[ - "start", - ["keyword.other.julia","function"], - ["meta.function.julia"," "], - ["entity.name.function.julia","g"], - ["text","("], - ["text","x,y)"] -],[ - "start", - ["text"," "], - ["keyword.control.julia","return"], - ["text"," x "], - ["keyword.operator.arithmetic.julia","*"], - ["text"," y"] -],[ - "start", - ["text"," x "], - ["keyword.operator.arithmetic.julia","+"], - ["text"," y"] -],[ - "start", - ["keyword.control.julia","end"] -],[ - "start" -],[ - "start", - ["support.function.julia","cd"], - ["text","("], - ["punctuation.definition.string.begin.julia","\""], - ["string.quoted.double.julia","data"], - ["punctuation.definition.string.end.julia","\""], - ["text",") "], - ["keyword.control.julia","do"] -],[ - "start", - ["text"," "], - ["support.function.julia","open"], - ["text","("], - ["punctuation.definition.string.begin.julia","\""], - ["string.quoted.double.julia","outfile"], - ["punctuation.definition.string.end.julia","\""], - ["text",", "], - ["punctuation.definition.string.begin.julia","\""], - ["string.quoted.double.julia","w"], - ["punctuation.definition.string.end.julia","\""], - ["text",") "], - ["keyword.control.julia","do"], - ["text"," f"] -],[ - "start", - ["text"," "], - ["support.function.julia","write"], - ["text","("], - ["text","f, data)"] -],[ - "start", - ["text"," "], - ["keyword.control.julia","end"] -],[ - "start", - ["keyword.control.julia","end"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json deleted file mode 100644 index 52508e0d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +++ /dev/null @@ -1,127 +0,0 @@ -[[ - "start", - ["keyword","\\usepackage"], - ["lparen","{"], - ["storage.type","amsmath"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\title"], - ["lparen","{"], - ["storage.type","\\LaTeX"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\date"], - ["lparen","{"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\begin"], - ["lparen","{"], - ["variable.parameter","document"], - ["rparen","}"] -],[ - "start", - ["text"," "], - ["storage.type","\\maketitle"] -],[ - "start", - ["text"," "], - ["storage.type","\\LaTeX"], - ["lparen","{"], - ["rparen","}"], - ["text"," is a document preparation system for the "], - ["storage.type","\\TeX"], - ["lparen","{"], - ["rparen","}"] -],[ - "start", - ["text"," typesetting program. It offers programmable desktop publishing"] -],[ - "start", - ["text"," features and extensive facilities for automating most aspects of"] -],[ - "start", - ["text"," typesetting and desktop publishing, including numbering and"] -],[ - "start", - ["text"," cross-referencing, tables and figures, page layout, bibliographies,"] -],[ - "start", - ["text"," and much more. "], - ["storage.type","\\LaTeX"], - ["lparen","{"], - ["rparen","}"], - ["text"," was originally written in 1984 by Leslie"] -],[ - "start", - ["text"," Lamport and has become the dominant method for using "], - ["storage.type","\\TeX"], - ["text","; few"] -],[ - "start", - ["text"," people write in plain "], - ["storage.type","\\TeX"], - ["lparen","{"], - ["rparen","}"], - ["text"," anymore. The current version is"] -],[ - "start", - ["text"," "], - ["storage.type","\\LaTeXe"], - ["text","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","% This is a comment; it will not be shown in the final output."] -],[ - "start", - ["text"," "], - ["comment","% The following shows a little of the typesetting power of LaTeX:"] -],[ - "start", - ["text"," "], - ["storage.type","\\begin"], - ["lparen","{"], - ["variable.parameter","align"], - ["rparen","}"] -],[ - "start", - ["text"," E &= mc^2 "], - ["constant.character.escape","\\\\"] -],[ - "start", - ["text"," m &= "], - ["storage.type","\\frac"], - ["lparen","{"], - ["text","m_0"], - ["rparen","}"], - ["lparen","{"], - ["storage.type","\\sqrt"], - ["lparen","{"], - ["text","1-"], - ["storage.type","\\frac"], - ["lparen","{"], - ["text","v^2"], - ["rparen","}"], - ["lparen","{"], - ["text","c^2"], - ["rparen","}}}"] -],[ - "start", - ["text"," "], - ["storage.type","\\end"], - ["lparen","{"], - ["variable.parameter","align"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\end"], - ["lparen","{"], - ["variable.parameter","document"], - ["rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json deleted file mode 100644 index 81fe0c20..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +++ /dev/null @@ -1,204 +0,0 @@ -[[ - "start", - ["comment","/* styles.less */"] -],[ - "start" -],[ - "start", - ["variable","@base"], - ["text",": "], - ["constant.numeric","#f938ab"], - ["text",";"] -],[ - "start" -],[ - "start", - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["variable","@style"], - ["text",", "], - ["variable","@c"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["paren.lparen","("], - ["support.function","iscolor"], - ["paren.lparen","("], - ["variable","@c"], - ["paren.rparen","))"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," box-shadow: "], - ["variable","@style"], - ["text"," "], - ["variable","@c"], - ["text",";"] -],[ - "start", - ["text"," -webkit-box-shadow: "], - ["variable","@style"], - ["text"," "], - ["variable","@c"], - ["text",";"] -],[ - "start", - ["text"," -moz-box-shadow: "], - ["variable","@style"], - ["text"," "], - ["variable","@c"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["variable","@style"], - ["text",", "], - ["variable","@alpha"], - ["text",": "], - ["constant.numeric","50%"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["paren.lparen","("], - ["support.function","isnumber"], - ["paren.lparen","("], - ["variable","@alpha"], - ["paren.rparen","))"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["variable","@style"], - ["text",", "], - ["support.function","rgba"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",", "], - ["constant.numeric","0"], - ["text",", "], - ["constant.numeric","0"], - ["text",", "], - ["variable","@alpha"], - ["paren.rparen","))"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","// Box styles"] -],[ - "start", - ["variable.language",".box"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["support.function","saturate"], - ["paren.lparen","("], - ["variable","@base"], - ["text",", "], - ["constant.numeric","5%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["support.type","border-color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","@base"], - ["text",", "], - ["constant.numeric","30%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["variable.language","div"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","5px"], - ["text",", "], - ["constant.numeric","30%"], - ["paren.rparen",")"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["variable.language","a"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["variable","@base"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," &"], - ["variable.language",":hover"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","@base"], - ["text",", "], - ["constant.numeric","50%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json deleted file mode 100644 index 30d003cb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +++ /dev/null @@ -1,551 +0,0 @@ -[[ - "start", - ["text.xml","The following examples can be found in full at http://liquidmarkup.org/"] -],[ - "start" -],[ - "start", - ["text.xml","Liquid is an extraction from the e-commerce system Shopify."] -],[ - "start", - ["text.xml","Shopify powers many thousands of e-commerce stores which all call for unique designs."] -],[ - "start", - ["text.xml","For this we developed Liquid which allows our customers complete design freedom while"] -],[ - "start", - ["text.xml","maintaining the integrity of our servers."] -],[ - "start" -],[ - "start", - ["text.xml","Liquid has been in production use since June 2006 and is now used by many other"] -],[ - "start", - ["text.xml","hosted web applications."] -],[ - "start" -],[ - "start", - ["text.xml","It was developed for usage in Ruby on Rails web applications and integrates seamlessly"] -],[ - "start", - ["text.xml","as a plugin but it also works excellently as a stand alone library."] -],[ - "start" -],[ - "start", - ["text.xml","Here's what it looks like:"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"products\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","product"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","products"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","title"], - ["text"," "], - ["variable","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," Only "], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","price"], - ["text"," | "], - ["identifier","format_as_money"], - ["text"," "], - ["variable","}}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","description"], - ["text"," | "], - ["identifier","prettyprint"], - ["text"," | "], - ["support.function","truncate"], - ["text",": "], - ["constant.numeric","200"], - ["text"," "], - ["variable","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endfor"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["text.xml","Some more features include:"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Filters"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," The word \"tobi\" in uppercase: "], - ["variable","{{"], - ["text"," "], - ["string","'tobi'"], - ["text"," | "], - ["support.function","upcase"], - ["text"," "], - ["variable","}}"], - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","The word \"tobi\" has "], - ["variable","{{"], - ["text"," "], - ["string","'tobi'"], - ["text"," | "], - ["support.function","size"], - ["text"," "], - ["variable","}}"], - ["text.xml"," letters! "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Change \"Hello world\" to \"Hi world\": "], - ["variable","{{"], - ["text"," "], - ["string","'Hello world'"], - ["text"," | "], - ["support.function","replace"], - ["text",": "], - ["string","'Hello'"], - ["text",", "], - ["string","'Hi'"], - ["text"," "], - ["variable","}}"], - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","The date today is "], - ["variable","{{"], - ["text"," "], - ["string","'now'"], - ["text"," | "], - ["support.function","date"], - ["text",": "], - ["string","\"%Y %b %d\""], - ["text"," "], - ["variable","}}"], - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","If"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["identifier","user"], - ["text","."], - ["identifier","name"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["string","'tobi'"], - ["text"," "], - ["identifier","or"], - ["text"," "], - ["identifier","user"], - ["text","."], - ["identifier","name"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["string","'marc'"], - ["text"," "], - ["variable","%}"], - ["text.xml"," "] -],[ - "start", - ["text.xml"," hi marc or tobi"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endif"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Case"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","template"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["string","'index'"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," Welcome"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["string","'product'"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","vendor"], - ["text"," | "], - ["identifier","link_to_vendor"], - ["text"," "], - ["variable","}}"], - ["text.xml"," / "], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","title"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{{"], - ["text"," "], - ["identifier","page_title"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endcase"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","For Loops"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","array"], - ["text"," "], - ["variable","%}"], - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["variable","{{"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endfor"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Tables"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","tablerow"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["identifier","cols"], - ["text",": "], - ["constant.numeric","3"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable.language","tablerowloop"], - ["text","."], - ["identifier","col_first"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," First column: "], - ["variable","{{"], - ["text"," "], - ["identifier","item"], - ["text","."], - ["identifier","variable"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," Different column: "], - ["variable","{{"], - ["text"," "], - ["identifier","item"], - ["text","."], - ["identifier","variable"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endif"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endtablerow"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lisp.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lisp.json deleted file mode 100644 index 2e70a555..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lisp.json +++ /dev/null @@ -1,248 +0,0 @@ -[[ - "start", - ["text","("], - ["storage.type.function-type.lisp","defun"], - ["text"," "], - ["entity.name.function.lisp","prompt-for-cd"], - ["text"," ()"] -],[ - "start", - ["text"," "], - ["string","\"Prompts"] -],[ - "start", - ["text"," "], - ["identifier","for"], - ["text"," "], - ["identifier","CD"], - ["text","\""] -],[ - "start", - ["text"," ("], - ["identifier","prompt"], - ["text","-"], - ["identifier","read"], - ["text"," "], - ["string","\"Title\""], - ["text"," "], - ["constant.numeric","1.53"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text","/"], - ["constant.numeric","4"], - ["text"," "], - ["constant.numeric","1.7"], - ["text"," "], - ["constant.numeric","1.7e0"], - ["text"," "], - ["constant.numeric","2.9E-4"], - ["text"," "], - ["constant.numeric","+42"], - ["text"," "], - ["constant.numeric","-7"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","b001"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","b001/100"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","o777"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","O777"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","xabc55"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","c"], - ["text","("], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","-5.6"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","prompt"], - ["text","-"], - ["identifier","read"], - ["text"," "], - ["string","\"Artist\""], - ["text"," &"], - ["identifier","rest"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.operator","or"], - ["text"," ("], - ["identifier","parse"], - ["text","-"], - ["identifier","integer"], - ["text"," ("], - ["identifier","prompt"], - ["text","-"], - ["identifier","read"], - ["text"," "], - ["string","\"Rating\""], - ["text",") :"], - ["identifier","junk"], - ["text","-"], - ["identifier","allowed"], - ["text"," "], - ["support.function","t"], - ["text",") "], - ["constant.numeric","0"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","if"], - ["text"," "], - ["identifier","x"], - ["text"," ("], - ["support.function","format"], - ["text"," "], - ["support.function","t"], - ["text"," "], - ["string","\"yes\""], - ["text",") ("], - ["support.function","format"], - ["text"," "], - ["support.function","t"], - ["text"," "], - ["string","\"no\""], - ["text"," "], - ["constant.language","nil"], - ["text",") "], - ["comment",";and here comment"] -],[ - "start", - ["text"," ) "], - ["constant.numeric","0xFFLL"], - ["text"," "], - ["constant.numeric","-23ull"] -],[ - "start", - ["text"," "], - ["comment",";; second line comment"] -],[ - "start", - ["text"," '(+ "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["identifier","defvar"], - ["text"," "], - ["punctuation.definition.variable.lisp","*"], - ["variable.other.global.lisp","lines"], - ["punctuation.definition.variable.lisp","*"], - ["text",") "], - ["comment","; list of all lines"] -],[ - "start", - ["text"," ("], - ["identifier","position"], - ["text","-"], - ["keyword.control","if"], - ["text","-"], - ["identifier","not"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","'sys::whitespacep"], - ["text"," "], - ["identifier","line"], - ["text"," :"], - ["identifier","start"], - ["text"," "], - ["identifier","beg"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["support.function","quote"], - ["text"," ("], - ["identifier","privet"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","3"], - ["text","))"] -],[ - "start", - ["text"," '("], - ["identifier","hello"], - ["text"," "], - ["identifier","world"], - ["text",")"] -],[ - "start", - ["text"," (* "], - ["constant.numeric","5"], - ["text"," "], - ["constant.numeric","7"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","34"], - ["text"," "], - ["constant.numeric","5"], - ["text",")"] -],[ - "start", - ["text"," (:"], - ["identifier","use"], - ["text"," "], - ["string","\"aaaa\""], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","let"], - ["text"," (("], - ["identifier","x"], - ["text"," "], - ["constant.numeric","10"], - ["text",") ("], - ["identifier","y"], - ["text"," "], - ["constant.numeric","20"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","print"], - ["text"," (+ "], - ["identifier","x"], - ["text"," "], - ["identifier","y"], - ["text","))"] -],[ - "start", - ["text"," ) "], - ["support.function","LAmbDa"] -],[ - "start" -],[ - "start", - ["text"," "], - ["string","\"asdad"], - ["constant.character.escape.lisp","\\0"], - ["string","eqweqe\""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_livescript.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_livescript.json deleted file mode 100644 index c2bd83df..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_livescript.json +++ /dev/null @@ -1,6 +0,0 @@ -[[ - "start", - ["comment","# comment"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_logiql.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_logiql.json deleted file mode 100644 index 5f7eda49..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_logiql.json +++ /dev/null @@ -1,190 +0,0 @@ -[[ - "start", - ["comment.single","// ancestors"] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"douglas\""], - ["keyword.other",","], - ["text"," "], - ["string","\"john\""], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"john\""], - ["keyword.other",","], - ["text"," "], - ["string","\"bob\""], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"bob\""], - ["keyword.other",","], - ["text"," "], - ["string","\"ebbon\""], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"douglas\""], - ["keyword.other",","], - ["text"," "], - ["string","\"jane\""], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"jane\""], - ["keyword.other",","], - ["text"," "], - ["string","\"jan\""], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","ancestorof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","ancestorof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","C"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","ancestorof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","B"], - ["keyword.other",","], - ["variable.parameter","C"], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","grandparentof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","C"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","C"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","cousins"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","grandparentof"], - ["text","("], - ["variable.parameter","C"], - ["keyword.other",","], - ["variable.parameter","A"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["entity.name","grandparentof"], - ["text","("], - ["variable.parameter","C"], - ["keyword.other",","], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","parentof"], - ["text","["], - ["entity.name.type.logicblox","`arg"], - ["text","]("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","->"], - ["text"," "], - ["entity.name","int"], - ["text","["], - ["constant.numeric","32"], - ["text","]("], - ["variable.parameter","A"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["keyword.other","!"], - ["entity.name","string"], - ["text","("], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lsl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lsl.json deleted file mode 100644 index 2248a607..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lsl.json +++ /dev/null @@ -1,503 +0,0 @@ -[[ - "comment", - ["comment.block.begin.lsl","/*"] -],[ - "comment", - ["comment.block.lsl"," Testing syntax highlighting"] -],[ - "comment", - ["comment.block.lsl"," of Ace Editor"] -],[ - "comment", - ["comment.block.lsl"," for the Linden Scripting Language"] -],[ - "start", - ["comment.block.end.lsl","*/"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","someIntNormal"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","3672"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","someIntHex"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","0x00000000"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","someIntMath"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.float.lsl","PI_BY_TWO"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["invalid.illegal.lsl","event"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","5673"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// invalid.illegal"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","key"], - ["text.lsl"," "], - ["identifier","someKeyTexture"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","TEXTURE_DEFAULT"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","someStringSpecial"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","EOF"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["identifier","some_user_defined_function_without_return_type"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","inputAsString"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llSay"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["identifier","inputAsString"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","user_defined_function_returning_a_string"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","key"], - ["text.lsl"," "], - ["identifier","inputAsKey"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["keyword.control.lsl","return"], - ["text.lsl"," "], - ["paren.lparen.lsl","("], - ["storage.type.lsl","string"], - ["paren.rparen.lsl",")"], - ["identifier","inputAsKey"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["entity.name.state.lsl","default"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","state_entry"], - ["paren.lparen.lsl","("], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","key"], - ["text.lsl"," "], - ["identifier","someKey"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","NULL_KEY"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someKey"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["support.function.lsl","llGetOwner"], - ["paren.lparen.lsl","("], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","someString"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["identifier","user_defined_function_returning_a_string"], - ["paren.lparen.lsl","("], - ["identifier","someKey"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["identifier","some_user_defined_function_without_return_type"], - ["paren.lparen.lsl","("], - ["identifier","someString"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","touch_start"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","num_detected"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","list"], - ["text.lsl"," "], - ["identifier","agentsInRegion"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["support.function.lsl","llGetAgentList"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","AGENT_LIST_REGION"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["paren.lparen.lsl","["], - ["paren.rparen.lsl","])"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","numOfAgents"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["support.function.lsl","llGetListLength"], - ["paren.lparen.lsl","("], - ["identifier","agentsInRegion"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","index"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// defaults to 0"] -],[ - "start", - ["text.lsl"," "], - ["keyword.control.lsl","for"], - ["text.lsl"," "], - ["paren.lparen.lsl","("], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["identifier","index"], - ["text.lsl"," "], - ["keyword.operator.lsl","<="], - ["text.lsl"," "], - ["identifier","numOfAgents"], - ["text.lsl"," "], - ["keyword.operator.lsl","-"], - ["text.lsl"," "], - ["constant.numeric.lsl","1"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["identifier","index"], - ["keyword.operator.lsl","++"], - ["paren.rparen.lsl",")"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// for each agent in region"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llRegionSayTo"], - ["paren.lparen.lsl","("], - ["support.function.lsl","llList2Key"], - ["paren.lparen.lsl","("], - ["identifier","agentsInRegion"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["identifier","index"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","Hello, Avatar!"], - ["string.quoted.double.lsl.end","\""], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","touch_end"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","num_detected"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someIntNormal"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","3672"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someIntHex"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","0x00000000"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someIntMath"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.float.lsl","PI_BY_TWO"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["invalid.illegal.lsl","event"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","5673"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// invalid.illegal"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["identifier","someKeyTexture"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","TEXTURE_DEFAULT"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someStringSpecial"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","EOF"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["reserved.godmode.lsl","llSetInventoryPermMask"], - ["paren.lparen.lsl","("], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","some item"], - ["string.quoted.double.lsl.end","\""], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["constant.language.integer.lsl","MASK_NEXT"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["constant.language.integer.lsl","PERM_ALL"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// reserved.godmode"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llWhisper"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","Leaving "], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl","default"], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl"," now..."], - ["string.quoted.double.lsl.end","\""], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["entity.name.state.lsl","state other"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["entity.name.state.lsl","state other"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","state_entry"], - ["paren.lparen.lsl","("], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llWhisper"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","Entered "], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl","state other"], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl",", returning to "], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl","default"], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl"," again..."], - ["string.quoted.double.lsl.end","\""], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["entity.name.state.lsl","state default"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json deleted file mode 100644 index b60c7cb1..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +++ /dev/null @@ -1,348 +0,0 @@ -[[ - ["bracketedComment",2,"start"], - ["comment","--[[--"] -],[ - ["bracketedComment",2,"start"], - ["comment","num_args takes in 5.1 byte code and extracts the number of arguments"] -],[ - ["bracketedComment",2,"start"], - ["comment","from its function header."] -],[ - "start", - ["comment","--]]--"] -],[ - "start" -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","int"], - ["paren.lparen","("], - ["identifier","t"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t"], - ["keyword","return"], - ["text"," "], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","1"], - ["paren.rparen",")"], - ["keyword.operator","+"], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","2"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","0x100"], - ["keyword.operator","+"], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","3"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","0x10000"], - ["keyword.operator","+"], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","4"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","0x1000000"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","num_args"], - ["paren.lparen","("], - ["identifier","func"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t"], - ["keyword","local"], - ["text"," "], - ["support.function","dump"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.library","string"], - ["text","."], - ["support.function","dump"], - ["paren.lparen","("], - ["identifier","func"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t"], - ["keyword","local"], - ["text"," "], - ["identifier","offset"], - ["text",", "], - ["identifier","cursor"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","int"], - ["paren.lparen","("], - ["support.function","dump"], - ["keyword.operator",":"], - ["support.function","sub"], - ["paren.lparen","("], - ["constant.numeric","13"], - ["paren.rparen","))"], - ["text",", "], - ["identifier","offset"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","26"] -],[ - "start", - ["text","\t"], - ["comment","--Get the params and var flag (whether there's a ... in the param)"] -],[ - "start", - ["text","\t"], - ["keyword","return"], - ["text"," "], - ["support.function","dump"], - ["keyword.operator",":"], - ["support.function","sub"], - ["paren.lparen","("], - ["identifier","cursor"], - ["paren.rparen",")"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text",", "], - ["support.function","dump"], - ["keyword.operator",":"], - ["support.function","sub"], - ["paren.lparen","("], - ["identifier","cursor"], - ["keyword.operator","+"], - ["constant.numeric","1"], - ["paren.rparen",")"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - "start", - ["comment","-- Usage:"] -],[ - "start", - ["identifier","num_args"], - ["paren.lparen","("], - ["keyword","function"], - ["paren.lparen","("], - ["identifier","a"], - ["text",","], - ["identifier","b"], - ["text",","], - ["identifier","c"], - ["text",","], - ["identifier","d"], - ["text",", "], - ["keyword.operator","..."], - ["paren.rparen",")"], - ["text"," "], - ["keyword","end"], - ["paren.rparen",")"], - ["text"," "], - ["comment","-- return 4, 7"] -],[ - "start" -],[ - "start", - ["comment","-- Python styled string format operator"] -],[ - "start", - ["keyword","local"], - ["text"," "], - ["identifier","gm"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.library","debug"], - ["text","."], - ["support.function","getmetatable"], - ["paren.lparen","("], - ["string","\"\""], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["identifier","gm"], - ["text","."], - ["support.function","__mod"], - ["keyword.operator","="], - ["keyword","function"], - ["paren.lparen","("], - ["variable.language","self"], - ["text",", "], - ["identifier","other"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["support.function","type"], - ["paren.lparen","("], - ["identifier","other"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","~="], - ["text"," "], - ["string","\"table\""], - ["text"," "], - ["keyword","then"], - ["text"," "], - ["identifier","other"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["identifier","other"], - ["paren.rparen","}"], - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","i"], - ["text",","], - ["identifier","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["support.function","ipairs"], - ["paren.lparen","("], - ["identifier","other"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","do"], - ["text"," "], - ["identifier","other"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["support.function","tostring"], - ["paren.lparen","("], - ["identifier","v"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["variable.language","self"], - ["keyword.operator",":"], - ["support.function","format"], - ["paren.lparen","("], - ["support.function","unpack"], - ["paren.lparen","("], - ["identifier","other"], - ["paren.rparen","))"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - ["bracketedString",5,"start"], - ["support.function","print"], - ["paren.lparen","("], - ["comment","[===["] -],[ - ["bracketedString",5,"start"], - ["comment"," blah blah %s, (%d %d)"] -],[ - "start", - ["comment","]===]"], - ["keyword.operator","%"], - ["paren.lparen","{"], - ["string","\"blah\""], - ["text",", "], - ["identifier","num_args"], - ["paren.lparen","("], - ["identifier","int"], - ["paren.rparen",")})"] -],[ - "start" -],[ - ["bracketedComment",3,"start"], - ["comment","--[=[--"] -],[ - ["bracketedComment",3,"start"], - ["comment","table.maxn is deprecated, use # instead."] -],[ - "start", - ["comment","--]=]--"] -],[ - "start", - ["support.function","print"], - ["paren.lparen","("], - ["constant.library","table"], - ["text","."], - ["invalid.deprecated","maxn"], - ["paren.lparen","{"], - ["constant.numeric","1"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","["], - ["constant.numeric","4"], - ["paren.rparen","]"], - ["keyword.operator","="], - ["constant.numeric","4"], - ["text",","], - ["paren.lparen","["], - ["constant.numeric","8"], - ["paren.rparen","]"], - ["keyword.operator","="], - ["constant.numeric","8"], - ["paren.rparen",")"], - ["text"," "], - ["comment","-- outputs 8 instead of 2"] -],[ - "start" -],[ - "start", - ["support.function","print"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["text"," "], - ["comment","--[[ blah ]]"], - ["paren.rparen",")"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json deleted file mode 100644 index 1fa765dd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +++ /dev/null @@ -1,633 +0,0 @@ -[[ - "doctype", - ["text.xml",""], - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["lua-bracketedComment",2,"lua-start"], - ["keyword","<%"], - ["text"," "], - ["comment","--[[--"] -],[ - ["lua-bracketedComment",2,"lua-start"], - ["comment"," index.lp from the Kepler Project's LuaDoc HTML doclet."] -],[ - ["lua-bracketedComment",2,"lua-start"], - ["comment"," http://keplerproject.github.com/luadoc/"] -],[ - "start", - ["comment","--]]"], - ["text"," "], - ["keyword","%>"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Reference"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","link"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","rel"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"stylesheet\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","link"], - ["paren.lparen","("], - ["string","\"luadoc.css\""], - ["paren.rparen",")"], - ["keyword","%>"], - ["string.attribute-value.xml","\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"text/css\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml","\t"], - ["comment.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"container\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product_logo\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product_name\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","big"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product_description\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"main\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"navigation\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","include"], - ["paren.lparen","("], - ["string","\"menu.lp\""], - ["text",", "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","doc"], - ["keyword.operator","="], - ["identifier","doc"], - ["text"," "], - ["paren.rparen","})"], - ["keyword","%>"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"content\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","<%if"], - ["text"," "], - ["keyword","not"], - ["text"," "], - ["identifier","options"], - ["text","."], - ["identifier","nomodules"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["keyword.operator","#"], - ["identifier","doc"], - ["text","."], - ["identifier","modules"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["keyword","then%>"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Modules"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"module_list\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["comment.xml",""] -],[ - "start", - ["keyword","<%for"], - ["text"," "], - ["identifier","_"], - ["text",", "], - ["identifier","modulename"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["support.function","ipairs"], - ["paren.lparen","("], - ["identifier","doc"], - ["text","."], - ["identifier","modules"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","do%>"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"name\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","module_link"], - ["paren.lparen","("], - ["identifier","modulename"], - ["text",", "], - ["identifier","doc"], - ["paren.rparen",")"], - ["keyword","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["keyword","<%="], - ["identifier","modulename"], - ["keyword","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"summary\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["keyword","<%="], - ["identifier","doc"], - ["text","."], - ["identifier","modules"], - ["paren.lparen","["], - ["identifier","modulename"], - ["paren.rparen","]"], - ["text","."], - ["identifier","summary"], - ["keyword","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","<%if"], - ["text"," "], - ["keyword","not"], - ["text"," "], - ["identifier","options"], - ["text","."], - ["identifier","nofiles"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["keyword.operator","#"], - ["identifier","doc"], - ["text","."], - ["identifier","files"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["keyword","then%>"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Files"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"file_list\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["comment.xml",""] -],[ - "start", - ["keyword","<%for"], - ["text"," "], - ["identifier","_"], - ["text",", "], - ["identifier","filepath"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["support.function","ipairs"], - ["paren.lparen","("], - ["identifier","doc"], - ["text","."], - ["identifier","files"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","do%>"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"name\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","file_link"], - ["paren.lparen","("], - ["identifier","filepath"], - ["paren.rparen",")"], - ["keyword","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["keyword","<%="], - ["identifier","filepath"], - ["keyword","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"summary\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"about\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"http://validator.w3.org/check?uri=referer\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.image.tag-name.xml","img"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","src"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"http://www.w3.org/Icons/valid-xhtml10\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","alt"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Valid XHTML 1.0!\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","height"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"31\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"88\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""], - ["text.xml","\t"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lucene.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lucene.json deleted file mode 100644 index 1f6d2985..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lucene.json +++ /dev/null @@ -1,92 +0,0 @@ -[[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword.operator","AND"], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword.operator","OR"], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword.operator","NOT"], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\"hello this is dog\""], - ["text"," as string"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["constant.character.negation","-"], - ["string","\"hello this is dog\""], - ["text"," as negation with string"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["constant.character.proximity","~100"], - ["text"," as text with proximity"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\"hello this is dog\""], - ["constant.character.proximity","~100"], - ["text"," as string with proximity"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword","raw:"], - ["string","\"hello this is dog\""], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword","raw:"], - ["text","foo as\"keyword'"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\"(\""], - ["text"," as opening parenthesis"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\")\""], - ["text"," as closing parenthesis"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises foo"], - ["constant.character.asterisk","*"], - ["text"," as text with asterisk"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises foo"], - ["constant.character.interro","?"], - ["text"," as text with interro"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises single word as text"] -],[ - "start", - ["text"," foo"] -],[ - "start", - ["text"," "] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json deleted file mode 100644 index 29e878b2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +++ /dev/null @@ -1,114 +0,0 @@ -[[ - "start", - ["text.xml","test: header 1 "] -],[ - "start", - ["markup.heading.1","#"], - ["heading","f"] -],[ - "start", - ["text.xml","test: header 2"] -],[ - "start", - ["markup.heading.2","##"], - ["heading"," foo"] -],[ - "start", - ["text.xml","test: header ends with ' #'"] -],[ - "start", - ["markup.heading.1","#"], - ["heading"," # # "] -],[ - "start", - ["text.xml","test: header ends with '#'"] -],[ - "start", - ["markup.heading.1","#"], - ["heading","foo# "] -],[ - "start", - ["text.xml","test: 6+ #s is not a valid header"] -],[ - "start", - ["text.xml","####### foo"] -],[ - "start", - ["text.xml","test: # followed be only space is not a valid header"] -],[ - "start", - ["text.xml","# "] -],[ - "start", - ["text.xml","test: only space between #s is not a valid header"] -],[ - "start", - ["text.xml","# #"] -],[ - "allowBlock" -],[ - "start", - ["markup.heading.1","#"], - ["heading"," test links "], - ["text","["], - ["string","Cloud9 IDE"], - ["text","]("], - ["markup.underline","http://www.c9.io/"], - ["text",")"], - ["heading"," #"] -],[ - "listblock", - ["markup.list","* "], - ["text","["], - ["string","demo"], - ["text","]("], - ["markup.underline","http://ajaxorg.github.com/ace/"], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","escape(\\) "], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","a"], - ["string"," \"title\""], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","a"], - ["string"," \"space\" "], - ["text",")"] -],[ - "listblock", - ["markup.list","* "], - ["list","usually "], - ["string.emphasis","*work*"], - ["list"," fine ("], - ["string.emphasis","_em_"], - ["list",")"] -],[ - "listblock", - ["list","in lists"] -],[ - "start" -],[ - "start", - ["text.xml","in plain text "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","http://ace.ajaxorg.com"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "allowBlock" -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mask.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mask.json deleted file mode 100644 index 5f2b9762..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mask.json +++ /dev/null @@ -1,302 +0,0 @@ -[[ - "start", - ["comment","/* Mask Syntax Demo */"] -],[ - "start" -],[ - "start", - ["keyword.support.constant.language","div"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","'"], - ["string"," Test "], - ["paren.lparen.markup.italic","~["], - ["identifier","name"], - ["paren.rparen.markup.italic","]"], - ["string.end","'"], - ["paren.rparen",";"] -],[ - "start" -],[ - "start", - ["keyword","define"], - ["text"," :"], - ["support.variable.class","userProfile"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["keyword.support.constant.language","header"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword.support.constant.language","h4"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["support.function.markup.bold","@title"], - ["paren.lparen",";"] -],[ - "start", - ["text","\t\t"], - ["keyword.support.constant.language","button"], - ["support.variable.class",".close"], - ["paren.lparen",";"] -],[ - "start", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["support.function.markup.bold",":userProfile"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["support.function.markup.bold","@title"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","'"], - ["string"," Hello "], - ["paren.lparen.markup.italic","~["], - ["keyword.control.markup.italic",":"], - ["text"," "], - ["identifier","username"], - ["punctuation.operator","."], - ["support.function","toUpperCase"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.rparen.markup.italic","]"], - ["string.end","'"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - ["paren.lparen52","constant.language40"], - ["constant.language","style"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-block-ruleset","paren.lparen52","paren.lparen52","constant.language40"], - ["text"," "], - ["constant","html"], - ["text",", "], - ["constant","body"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-block-ruleset","paren.lparen52","paren.lparen52","constant.language40"], - ["text"," "], - ["support.type","background"], - ["text",": "], - ["support.function","url("], - ["string","'name.png'"], - ["support.function",")"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["support.constant","no-repeat"], - ["text",";"] -],[ - ["paren.lparen52","constant.language40"], - ["text"," "], - ["paren.rparen","}"] -],[ - ["#tmp","css-block-end","paren.lparen52","constant.language40"], - ["paren.rparen","}"] -],[ - ["#tmp","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","button"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","\t"], - ["constant.language","event"], - ["text"," "], - ["support.variable.class","click"], - ["text"," "], - ["paren.lparen","("], - ["identifier","e"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["#tmp","js-block-start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","\t "], - ["variable.language","this"], - ["punctuation.operator","."], - ["identifier","textContent"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.quasi.start","`"], - ["string.quasi","name "], - ["paren.quasi.start","${"], - ["identifier","e"], - ["punctuation.operator","."], - ["identifier","clientX"], - ["paren.quasi.end","}"], - ["string.quasi"," !"], - ["string.quasi.end","`"], - ["punctuation.operator",";"] -],[ - ["#tmp","js-block-end","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","\t"], - ["paren.rparen","}"] -],[ - ["#tmp","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["paren.rparen","}"] -],[ - ["#tmp","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["constant.language","md"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["paren.lparen","\"\"\""] -],[ - ["#tmp","md-multiline-allowBlock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["markup.list","- "], - ["list","div"] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["markup.list","- "], - ["list","span"] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["list"," "] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["list","Hello"] -],[ - ["#tmp","md-multiline-start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","md-multiline-start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","["], - ["string","one"], - ["text","]("], - ["markup.underline","http://google.com"], - ["text",")"] -],[ - ["#tmp","md-multiline-allowBlock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["paren.rparen","\"\"\";"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","header"], - ["text"," "], - ["support.variable.class",".foo"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","'"], - ["string","Heading"], - ["string.end","'"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","button"], - ["text"," "], - ["support.variable.class",".baz"], - ["text"," "], - ["support.variable.class.markup.bold","x-signal"], - ["keyword.operator","="], - ["string.start","'"], - ["string","click: test"], - ["string.end","'"], - ["text"," "], - ["support.variable.class","disabled"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","\""] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string","\tHello,"] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string","\tworld "] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string","\t"], - ["string.escape","\\\""], - ["string","Buddy"], - ["string.escape","\\\""] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string.end","\""] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","js-statement-start","start","js-statement-no_regex","constant.language53","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["constant.language","var"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren","{"] -],[ - ["#tmp","js-statement-no_regex","start","js-statement-no_regex","constant.language53","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text"," "], - ["identifier","name"], - ["punctuation.operator",":"], - ["text"," "], - ["string.quasi.start","`"], - ["string.quasi","name "], - ["paren.quasi.start","${"], - ["variable.language","window"], - ["punctuation.operator","."], - ["support.constant","innerWidth"], - ["paren.rparen","}"], - ["string.quasi.end","`"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["paren.rparen","};"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","span"], - ["text"," "], - ["support.variable.class",".foo"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","\""], - ["paren.lparen.markup.italic","~["], - ["keyword.control.markup.italic","bind:"], - ["text"," "], - ["identifier","a"], - ["punctuation.operator","."], - ["identifier","name"], - ["paren.rparen.markup.italic","]"], - ["string.end","\""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_matlab.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_matlab.json deleted file mode 100644 index 6b4a8567..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_matlab.json +++ /dev/null @@ -1,90 +0,0 @@ -[[ - ["blockComment","noQstring"], - ["comment.start","%{"] -],[ - ["blockComment","blockComment","blockComment","noQstring"], - ["comment.start"," %{"] -],[ - ["blockComment","blockComment","blockComment","noQstring"], - ["comment"," Ace Matlab demo"] -],[ - ["blockComment","noQstring"], - ["comment.end"," %}"] -],[ - "noQstring", - ["comment.end","%}"] -],[ - "start" -],[ - "start", - ["keyword","classdef"], - ["text"," "], - ["identifier","hello"] -],[ - "start", - ["text"," "], - ["support.function","methods"] -],[ - "start", - ["text"," "], - ["keyword","function"], - ["text"," "], - ["identifier","greet"], - ["paren.lparen","("], - ["identifier","this"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["support.function","disp"], - ["paren.lparen","("], - ["string","'Hello!'"], - ["paren.rparen",")"], - ["text"," "], - ["comment","% say hi"] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["keyword","end"] -],[ - "noQstring" -],[ - "start", - ["comment","% transpose "] -],[ - "qqstring", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["text"," "], - ["string","'x"], - ["constant.language.escape","''"], - ["string","y'"], - ["punctuation.operator",","], - ["text"," "], - ["string","\"x"], - ["constant.language.escape","\\n"], - ["string","\\"] -],[ - "start", - ["string"," y\""], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","1"], - ["text","' "], - ["paren.rparen","]"], - ["text","' "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","2"], - ["text","'"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mel.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mel.json deleted file mode 100644 index a2d618a9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mel.json +++ /dev/null @@ -1,257 +0,0 @@ -[[ - "start", - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," animated duplicates, instances script"] -],[ - "start", - ["meta.function.mel","proc"], - ["keyword.other.mel"," "], - ["storage.type.mel","animatedDuplication"], - ["entity.name.function.mel"," ("], - ["punctuation.section.function.mel","("], - ["meta.function.mel","int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance"], - ["punctuation.section.function.mel",")"], - "proc animatedDuplication (int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance)" -],[ - "start", - ["text","{"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","rangeStart"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_end"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","rangeEnd"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","num_of_duplicates"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","numOfDuplicates"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","step_size"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_end"], - ["text"," "], - ["keyword.operator.symbolic.mel","-"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text",") "], - ["keyword.operator.symbolic.mel","/"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","num_of_duplicates"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["constant.numeric.mel","0"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","temp"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.function.mel","currentTime"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text","; "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," set to range start"] -],[ - "start" -],[ - "start", - ["text"," "], - ["storage.type.mel","string"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text","[]; "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," to store selected objects"] -],[ - "start", - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," `"], - ["support.function.mel","ls"], - ["text"," "], - ["keyword.operator.symbolic.mel","-"], - ["text","sl`; "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," store selected objects"] -],[ - "start", - ["text"," "], - ["support.function.mel","select"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.mel","while"], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["text"," <"], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","num_of_duplicates"], - ["text",")"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","temp"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text"," "], - ["keyword.operator.symbolic.mel","+"], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","step_size"], - ["text"," "], - ["keyword.operator.symbolic.mel","*"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["text",");"] -],[ - "start", - ["text"," "], - ["support.function.mel","currentTime"], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","temp"], - ["text",");"] -],[ - "start", - ["text"," "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," seleced the objects to duplicate or instance"] -],[ - "start", - ["text"," "], - ["support.function.mel","select"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.control.mel","if"], - ["text","("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","duplicateOrInstance"], - ["text"," "], - ["keyword.operator.symbolic.mel","=="], - ["text"," "], - ["constant.numeric.mel","0"], - ["text",")"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["support.function.mel","duplicate"], - ["text",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," "], - ["keyword.control.mel","else"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["support.function.mel","instance"], - ["text",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["keyword.operator.symbolic.mel","++"], - ["text",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mushcode.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mushcode.json deleted file mode 100644 index 9f8e7cc2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mushcode.json +++ /dev/null @@ -1,790 +0,0 @@ -[[ - "start", - ["text","@"], - ["support.function","create"], - ["text"," "], - ["identifier","phone"] -],[ - "start", - ["text","&"], - ["identifier","pickup"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["identifier","$pick"], - ["text"," "], - ["identifier","up"], - ["text",":@"], - ["support.function","ifelse"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","mode"], - ["paren.rparen",")"], - ["text",","], - ["identifier","ICC"], - ["paren.rparen",")]"], - ["keyword.operator","="], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["identifier","You"], - ["text"," "], - ["support.function","pick"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["paren.lparen","["], - ["support.function","fullname"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]"], - ["text","."], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","PHONER"], - ["text",":"], - ["keyword.operator","%#"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","MODE"], - ["text",":"], - ["identifier","CIP"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","(["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","INCOMING"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["paren.lparen","["], - ["support.function","num"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","INCOMING"], - ["paren.rparen",")])]"], - ["variable","%r"], - ["paren.lparen","["], - ["support.function","showpicture"], - ["paren.lparen","("], - ["identifier","PICPICKUP"], - ["paren.rparen",")]"], - ["variable","%r"], - ["identifier","Use"], - ["text"," '"], - ["paren.lparen","["], - ["identifier","color"], - ["paren.lparen","("], - ["identifier","green"], - ["text",","], - ["identifier","black"], - ["text",","], - ["identifier","psay"], - ["text"," "], - ["keyword.operator","<"], - ["identifier","message"], - ["keyword.operator",">"], - ["paren.rparen",")]"], - ["text","' "], - ["paren.lparen","("], - ["support.function","or"], - ["text"," '"], - ["paren.lparen","["], - ["identifier","color"], - ["paren.lparen","("], - ["identifier","green"], - ["text",","], - ["identifier","black"], - ["text",","], - ["identifier","p"], - ["text"," "], - ["keyword.operator","<"], - ["identifier","message"], - ["keyword.operator",">"], - ["paren.rparen",")]"], - ["text","'"], - ["paren.rparen",")"], - ["text"," "], - ["identifier","to"], - ["text"," "], - ["identifier","talk"], - ["text"," "], - ["identifier","into"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","phone"], - ["text",".;@"], - ["support.function","oemit"], - ["text"," "], - ["keyword.operator","%#="], - ["variable","%N"], - ["text"," "], - ["identifier","picks"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["paren.lparen","["], - ["support.function","fullname"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]"], - ["text","."], - ["paren.rparen","}"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["identifier","You"], - ["text"," "], - ["support.function","pick"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","phone"], - ["text"," "], - ["identifier","but"], - ["text"," "], - ["identifier","no"], - ["text"," "], - ["identifier","one"], - ["text"," "], - ["identifier","is"], - ["text"," "], - ["identifier","there"], - ["text",". "], - ["identifier","You"], - ["text"," "], - ["identifier","hear"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["identifier","dialtone"], - ["text"," "], - ["support.function","and"], - ["text"," "], - ["identifier","then"], - ["text"," "], - ["identifier","hang"], - ["text"," "], - ["identifier","up"], - ["text",". "], - ["paren.lparen","["], - ["support.function","play"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","DIALTONE"], - ["paren.rparen","))]"], - ["text",";@"], - ["support.function","oemit"], - ["text"," "], - ["keyword.operator","%#="], - ["variable","%N"], - ["text"," "], - ["identifier","picks"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","phone"], - ["text",", "], - ["identifier","but"], - ["text"," "], - ["identifier","no"], - ["text"," "], - ["identifier","one"], - ["text"," "], - ["identifier","is"], - ["text"," "], - ["identifier","on"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","other"], - ["text"," "], - ["identifier","end"], - ["text","."], - ["paren.rparen","}"] -],[ - "start", - ["text","&"], - ["identifier","ringfun"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["paren.lparen","["], - ["support.function","ifelse"], - ["paren.lparen","("], - ["support.function","eq"], - ["paren.lparen","("], - ["support.function","comp"], - ["paren.lparen","(["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","off"], - ["paren.rparen",")"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text",","], - ["paren.lparen","["], - ["identifier","color"], - ["paren.lparen","("], - ["identifier","black"], - ["text",","], - ["identifier","cyan"], - ["text",","], - ["identifier","INCOMING"], - ["text"," "], - ["identifier","CALL"], - ["text"," "], - ["identifier","FROM"], - ["text"," "], - ["variable","%1"], - ["paren.rparen",")]"], - ["text",","], - ["paren.lparen","["], - ["support.function","play"], - ["paren.lparen","(["], - ["support.function","switch"], - ["paren.lparen","(["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","1"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone1"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone2"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone3"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","4"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone4"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","5"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone5"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","6"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone6"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","7"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone7"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","8"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone8"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","9"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone9"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","custom"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","customtone"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","vibrate"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","vibrate"], - ["paren.rparen",")])])]"] -],[ - "start", - ["text","&"], - ["identifier","ringloop"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["text","@"], - ["support.function","switch"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","ringstate"], - ["paren.rparen",")]"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","emit"], - ["text"," "], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["identifier","q"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","rangs"], - ["text",":"], - ["constant.numeric","0"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","mode"], - ["text",":"], - ["identifier","WFC"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","INCOMING"], - ["text",":"], - ["paren.rparen",")]"], - ["text",";@"], - ["support.function","ifelse"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","HASVMB"], - ["paren.rparen",")]"], - ["keyword.operator","="], - ["paren.lparen","{"], - ["text","@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ROUTEVMB"], - ["keyword.operator","="], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen",")]"], - ["text",";"], - ["paren.rparen","}"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","MSGCNC"], - ["paren.rparen",")]"], - ["text",";"], - ["paren.rparen","}}"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["identifier","The"], - ["text"," "], - ["identifier","call"], - ["text"," "], - ["identifier","is"], - ["text"," "], - ["identifier","connected"], - ["text","."], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["identifier","q"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","CONNECTING"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["variable","%qq"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["paren.lparen","["], - ["support.function","num"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","MODE"], - ["text",":"], - ["identifier","CIP"], - ["paren.rparen",")]"], - ["text",";@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ciploop"], - ["text",";@"], - ["support.function","tr"], - ["text"," "], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","ciploop"], - ["text",";"], - ["paren.rparen","}"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","emit"], - ["text"," "], - ["identifier","On"], - ["text"," "], - ["paren.lparen","["], - ["support.function","fullname"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]"], - ["text","'"], - ["support.function","s"], - ["text"," "], - ["identifier","earpiece"], - ["text"," "], - ["identifier","you"], - ["text"," "], - ["identifier","hear"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["identifier","ringing"], - ["text"," "], - ["identifier","sound"], - ["text","."], - ["paren.lparen","["], - ["support.function","play"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","LINETONE"], - ["paren.rparen","))]"], - ["text",";@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ringhere"], - ["text",";@"], - ["identifier","increment"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen",")]"], - ["keyword.operator","/"], - ["identifier","RANGS"], - ["text",";@"], - ["identifier","wait"], - ["text"," "], - ["constant.numeric","5"], - ["keyword.operator","="], - ["paren.lparen","{"], - ["text","@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ringloop"], - ["paren.rparen","}"], - ["text",";"], - ["paren.rparen","}"], - ["text",","], - ["constant.numeric","4"], - ["text",","], - ["paren.lparen","{"], - ["paren.rparen","}"] -],[ - "start", - ["text","&"], - ["identifier","ringstate"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["identifier","q"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen","))]"], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["constant.numeric","1"], - ["text",","], - ["paren.lparen","["], - ["support.function","gt"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","rangs"], - ["paren.rparen",")"], - ["text",","], - ["support.function","sub"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","rings"], - ["paren.rparen",")"], - ["text",","], - ["constant.numeric","1"], - ["paren.rparen","))])]"], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","["], - ["support.function","and"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","MODE"], - ["paren.rparen",")"], - ["text",","], - ["identifier","CIP"], - ["paren.rparen",")"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","INCOMING"], - ["paren.rparen",")"], - ["text",","], - ["paren.lparen","["], - ["support.function","num"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]))]"], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["constant.numeric","3"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","MODE"], - ["paren.rparen",")"], - ["text",","], - ["identifier","ICC"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","ifelse"], - ["paren.lparen","("], - ["variable","%q1"], - ["text",","], - ["constant.numeric","1"], - ["text",","], - ["support.function","ifelse"], - ["paren.lparen","("], - ["variable","%q2"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["support.function","ifelse"], - ["paren.lparen","("], - ["variable","%q3"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["constant.numeric","4"], - ["paren.rparen",")))]"] -],[ - "start", - ["text",";"], - ["identifier","comment"] -],[ - "start", - ["text","@@"], - ["paren.lparen","("], - ["identifier","comment"], - ["paren.rparen",")"] -],[ - "start", - ["keyword","say"], - ["text"," "], - ["paren.lparen","["], - ["support.function","time"], - ["paren.lparen","("], - ["paren.rparen",")]"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mysql.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mysql.json deleted file mode 100644 index 9909eadd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mysql.json +++ /dev/null @@ -1,4 +0,0 @@ -[[ - "start", - ["identifier","TODO"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_nix.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_nix.json deleted file mode 100644 index b9424456..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_nix.json +++ /dev/null @@ -1,360 +0,0 @@ -[[ - "start", - ["text","{"] -],[ - "start", - ["text"," "], - ["comment","# Name of our deployment"] -],[ - "start", - ["text"," "], - ["identifier","network"], - ["text","."], - ["identifier","description"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"HelloWorld\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# Enable rolling back to previous versions of our infrastructure"] -],[ - "start", - ["text"," "], - ["identifier","network"], - ["text","."], - ["identifier","enableRollback"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["constant.language.nix","true"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# It consists of a single server named 'helloserver'"] -],[ - "start", - ["text"," "], - ["identifier","helloserver"], - ["text"," "], - ["keyword.operator.assignment.nix","="] -],[ - "start", - ["text"," "], - ["comment","# Every server gets passed a few arguments, including a reference"] -],[ - "start", - ["text"," "], - ["comment","# to nixpkgs (pkgs)"] -],[ - "start", - ["text"," { "], - ["identifier","config"], - ["text",", "], - ["identifier","pkgs"], - ["text",", ... }:"] -],[ - "start", - ["text"," "], - ["keyword.declaration.nix","let"] -],[ - "start", - ["text"," "], - ["comment","# We import our custom packages from ./default passing pkgs as argument"] -],[ - "start", - ["text"," "], - ["identifier","packages"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["keyword.control.nix","import"], - ["text"," ./"], - ["identifier","default"], - ["text","."], - ["identifier","nix"], - ["text"," { "], - ["identifier","pkgs"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["identifier","pkgs"], - ["text","; };"] -],[ - "start", - ["text"," "], - ["comment","# This is the nodejs version specified in default.nix"] -],[ - "start", - ["text"," "], - ["identifier","nodejs"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["identifier","packages"], - ["text","."], - ["identifier","nodejs"], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# And this is the application we'd like to deploy"] -],[ - "start", - ["text"," "], - ["identifier","app"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["identifier","packages"], - ["text","."], - ["identifier","app"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.nix","in"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["comment","# We'll be running our application on port 8080, because a regular"] -],[ - "start", - ["text"," "], - ["comment","# user cannot bind to port 80"] -],[ - "start", - ["text"," "], - ["comment","# Then, using some iptables magic we'll forward traffic designated to port 80 to 8080"] -],[ - "start", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","enable"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["constant.language.nix","true"], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# We will open up port 22 (SSH) as well otherwise we're locking ourselves out"] -],[ - "start", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","allowedTCPPorts"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," [ "], - ["constant.numeric","80"], - ["text"," "], - ["constant.numeric","8080"], - ["text"," "], - ["constant.numeric","22"], - ["text"," ];"] -],[ - "start", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","allowPing"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["constant.language.nix","true"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# Port forwarding using iptables"] -],[ - "qqdoc", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","extraCommands"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","''"] -],[ - "qqdoc", - ["string"," iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080"] -],[ - "start", - ["string"," ''"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# To run our node.js program we're going to use a systemd service"] -],[ - "start", - ["text"," "], - ["comment","# We can configure the service to automatically start on boot and to restart"] -],[ - "start", - ["text"," "], - ["comment","# the process in case it crashes"] -],[ - "start", - ["text"," "], - ["identifier","systemd"], - ["text","."], - ["identifier","services"], - ["text","."], - ["identifier","helloserver"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," {"] -],[ - "start", - ["text"," "], - ["identifier","description"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"Hello world application\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# Start the service after the network is available"] -],[ - "start", - ["text"," "], - ["identifier","after"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," [ "], - ["string","\"network.target\""], - ["text"," ];"] -],[ - "start", - ["text"," "], - ["comment","# We're going to run it on port 8080 in production"] -],[ - "start", - ["text"," "], - ["identifier","environment"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," { "], - ["identifier","PORT"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"8080\""], - ["text","; };"] -],[ - "start", - ["text"," "], - ["identifier","serviceConfig"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," {"] -],[ - "start", - ["text"," "], - ["comment","# The actual command to run"] -],[ - "start", - ["text"," "], - ["identifier","ExecStart"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\""], - ["constant.language.escape","${"], - ["identifier","nodejs"], - ["constant.language.escape","}"], - ["string","/bin/node "], - ["constant.language.escape","${"], - ["identifier","app"], - ["constant.language.escape","}"], - ["string","/server.js\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# For security reasons we'll run this process as a special 'nodejs' user"] -],[ - "start", - ["text"," "], - ["identifier","User"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"nodejs\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","Restart"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"always\""], - ["text",";"] -],[ - "start", - ["text"," };"] -],[ - "start", - ["text"," };"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# And lastly we ensure the user we run our application as is created"] -],[ - "start", - ["text"," "], - ["identifier","users"], - ["text","."], - ["identifier","extraUsers"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," {"] -],[ - "start", - ["text"," "], - ["identifier","nodejs"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," { };"] -],[ - "start", - ["text"," };"] -],[ - "start", - ["text"," };"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_objectivec.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_objectivec.json deleted file mode 100644 index cdfd1196..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_objectivec.json +++ /dev/null @@ -1,793 +0,0 @@ -[[ - "start", - ["storage.type.objc","@"], - ["punctuation.definition.storage.type.objc","protocol"], - ["entity.name.type.objc"," Printing"], - ["text",": "], - ["entity.other.inherited-class.objc","someParent"] -],[ - "start", - ["meta.function.objc","-"], - ["paren.lparen","("], - ["storage.type","void"], - ["paren.rparen",")"], - ["text"," "], - ["identifier","print"], - ["punctuation.operator",";"] -],[ - "start", - ["storage.type.objc","@end"] -],[ - "start" -],[ - "start", - ["storage.type.objc","@"], - ["punctuation.definition.storage.type.objc","interface"], - ["entity.name.type.objc"," Fraction"], - ["text",": "], - ["entity.other.inherited-class.objc","NSObject"], - ["text"," "], - ["keyword.operator","<"], - ["identifier","Printing"], - ["punctuation.operator",","], - ["text"," "], - ["support.class.cocoa","NSCopying"], - ["keyword.operator",">"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","numerator"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","denominator"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["storage.type.objc","@end"] -],[ - "start" -],[ - "start", - ["string.begin.objc","@\""], - ["string","blah"], - ["invalid.illegal.unknown-escape.objc","\\8"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["string.begin.objc","@\""], - ["string","a"], - ["constant.character.escape.objc","\\222"], - ["string","sd"], - ["invalid.illegal.unknown-escape.objc","\\d"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["string.begin.objc","@\""], - ["constant.character.escape.objc","\\f"], - ["string","aw"], - ["constant.character.escape.objc","\\\"\\?"], - ["string"," "], - ["constant.character.escape.objc","\\'"], - ["string"," "], - ["constant.character.escape.objc","\\4"], - ["string"," n"], - ["constant.character.escape.objc","\\\\"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["string.begin.objc","@\""], - ["constant.character.escape.objc","\\56"], - ["punctuation.definition.string.end","\""] -],[ - "start", - ["string.begin.objc","@\""], - ["constant.character.escape.objc","\\xSF42"], - ["punctuation.definition.string.end","\""] -],[ - "start" -],[ - "start", - ["meta.function.objc","-"], - ["paren.lparen","("], - ["support.class.cocoa","NSDecimalNumber"], - ["keyword.operator","*"], - ["paren.rparen",")"], - ["identifier","addCount"], - ["punctuation.operator",":"], - ["paren.lparen","("], - ["storage.type.id.objc","id"], - ["paren.rparen",")"], - ["identifier","addObject"], - ["paren.lparen","{"] -],[ - "start" -],[ - "start", - ["keyword.control","return"], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["identifier","count"], - ["text"," "], - ["support.function.any-method.objc","decimalNumberByAdding:"], - ["identifier","addObject"], - ["punctuation.operator","."], - ["identifier","count"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.macro.objc","NS_DURING"], - ["text"," "], - ["keyword.control.macro.objc","NS_HANDLER"], - ["text"," "], - ["keyword.control.macro.objc","NS_ENDHANDLER"] -],[ - "start" -],[ - "start", - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","try"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.control","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","argc"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","1"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","throw"], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSException"], - ["text"," "], - ["support.function.any-method.objc","exceptionWithName:"], - ["string.begin.objc","@\""], - ["string","Throwing a test exception"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","reason"], - ["punctuation.operator",":"], - ["string.begin.objc","@\""], - ["string","Testing the @throw directive."], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","userInfo"], - ["punctuation.operator",":"], - ["constant.language.objc","nil"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"], - ["text"," "] -],[ - "start", - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","catch"], - ["text"," "], - ["paren.lparen","("], - ["storage.type.id.objc","id"], - ["text"," "], - ["identifier","theException"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.cocoa","NSLog"], - ["paren.lparen","("], - ["string.begin.objc","@\""], - ["string","%@"], - ["punctuation.definition.string.end","\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","theException"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","result"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"], - ["text"," "] -],[ - "start", - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","finally"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.cocoa","NSLog"], - ["paren.lparen","("], - ["string.begin.objc","@\""], - ["string","This always happens."], - ["punctuation.definition.string.end","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","result"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","synchronized"], - ["paren.lparen","("], - ["identifier","lock"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.cocoa","NSLog"], - ["paren.lparen","("], - ["string.begin.objc","@\""], - ["string","Hello World"], - ["punctuation.definition.string.end","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["storage.type","struct"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["punctuation.definition.keyword.objc","@"], - ["keyword.other.objc","defs"], - ["paren.lparen","("], - ["text"," "], - ["support.class.cocoa","NSObject"], - ["paren.rparen",")"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["storage.type","char"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","enc1"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.definition.keyword.objc","@"], - ["keyword.other.objc","encode"], - ["paren.lparen","("], - ["storage.type","int"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["storage.type.objc","IBOutlet"], - ["text","|"], - ["storage.type.objc","IBAction"], - ["text","|"], - ["storage.type.objc","BOOL"], - ["text","|"], - ["storage.type.objc","SEL"], - ["text","|"], - ["storage.type.id.objc","id"], - ["text","|"], - ["storage.type.objc","unichar"], - ["text","|"], - ["storage.type.objc","IMP"], - ["text","|"], - ["storage.type.objc","Class"], - ["text"," "] -],[ - "start" -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.storage.type.objc","@"], - ["storage.type.objc","class"], - ["text"," "], - ["punctuation.definition.storage.type.objc","@"], - ["storage.type.objc","protocol"] -],[ - "start" -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","public"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","package"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","protected"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","private"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start" -],[ - "start", - ["text"," "], - ["constant.language.objc","YES"], - ["text"," "], - ["constant.language.objc","NO"], - ["text"," "], - ["constant.language.objc","Nil"], - ["text"," "], - ["constant.language.objc","nil"] -],[ - "start", - ["support.variable.foundation","NSApp"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["support.function.cocoa.leopard","NSRectToCGRect"], - ["text"," "], - ["paren.lparen","("], - ["identifier","Protocol"], - ["text"," "], - ["identifier","ProtocolFromString"], - ["punctuation.operator",":"], - ["string","\"NSTableViewDelegate\""], - ["paren.rparen","))"] -],[ - "start" -],[ - "start", - ["punctuation.section.scope.begin.objc","["], - ["identifier","SPPoint"], - ["text"," "], - ["support.function.any-method.objc","pointFromCGPoint:"], - ["identifier","self"], - ["punctuation.operator","."], - ["identifier","position"], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["support.function.cocoa","NSRoundDownToMultipleOfPageSize"] -],[ - "start" -],[ - "start", - ["keyword","#import"], - ["constant.other"," "] -],[ - "start" -],[ - "start", - ["storage.type","int"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","argc"], - ["punctuation.operator",","], - ["text"," "], - ["storage.modifier","const"], - ["text"," "], - ["storage.type","char"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","argv"], - ["punctuation.section.scope.begin.objc","["], - ["punctuation.section.scope.end.objc","]"], - ["text"," "], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.C99.c","printf"], - ["paren.lparen","("], - ["text"," "], - ["string","\"hello world\\n\""], - ["text"," "], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control","return"], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["support.class.cocoa","NSChangeSpelling"] -],[ - "start" -],[ - "start", - ["string.begin.objc","@\""], - ["string","0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count"], - ["punctuation.definition.string.end","\""] -],[ - "start" -],[ - "start", - ["punctuation.definition.storage.type.objc","@selector"], - ["punctuation","("], - ["support.function.any-method.name-of-parameter.objc","lowercaseString"], - ["punctuation",")"], - ["text"," "], - ["punctuation.definition.storage.type.objc","@selector"], - ["punctuation","("], - ["support.function.any-method.name-of-parameter.objc","uppercaseString:"], - ["punctuation",")"] -],[ - "start" -],[ - "start", - ["identifier","NSFetchRequest"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","localRequest"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","[["], - ["identifier","NSFetchRequest"], - ["text"," "], - ["support.function.any-method.objc","alloc"], - ["paren.rparen","]"], - ["text"," "], - ["identifier","init"], - ["paren.rparen","]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","entity"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["identifier","NSEntityDescription"], - ["text"," "], - ["support.function.any-method.objc","entityForName:"], - ["string.begin.objc","@\""], - ["string","VNSource"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","inManagedObjectContext"], - ["punctuation.operator",":"], - ["identifier","context"], - ["paren.rparen","]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","sortDescriptors"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSArray"], - ["text"," "], - ["support.function.any-method.objc","arrayWithObject:"], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSSortDescriptor"], - ["text"," "], - ["support.function.any-method.objc","sortDescriptorWithKey:"], - ["string.begin.objc","@\""], - ["string","resolution"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","ascending"], - ["punctuation.operator",":"], - ["constant.language.objc","YES"], - ["paren.rparen","]]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start", - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","predicate"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["string.begin.objc","@\""], - ["string","0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count"], - ["punctuation.definition.string.end","\""], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["paren.rparen","]"] -],[ - "start", - ["support.class.cocoa","NSString"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","predicateString"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSString"], - ["text"," "], - ["support.function.any-method.objc","stringWithFormat:"], - ["string.begin.objc","@\""], - ["string","SELF beginsWith[cd] %@"], - ["punctuation.definition.string.end","\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","searchString"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","pred"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["identifier","predicateString"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["support.class.cocoa","NSArray"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","filteredKeys"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","[["], - ["identifier","myMutableDictionary"], - ["text"," "], - ["support.function.any-method.objc","allKeys"], - ["paren.rparen","]"], - ["text"," "], - ["identifier","filteredArrayUsingPredicate"], - ["punctuation.operator",":"], - ["identifier","pred"], - ["paren.rparen","]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start" -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","predicate"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["string.begin.objc","@\""], - ["string","whichChart = %@"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","argumentArray"], - ["punctuation.operator",":"], - ["text"," "], - ["identifier","listChartToDownload"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","fetchBatchSize"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","100"], - ["punctuation.operator",";"] -],[ - "start", - ["identifier","arrayRequest"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["identifier","context"], - ["text"," "], - ["support.function.any-method.objc","executeFetchRequest:"], - ["identifier","localRequest"], - ["text"," "], - ["identifier","error"], - ["punctuation.operator",":"], - ["keyword.operator","&"], - ["identifier","error1"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["punctuation.section.scope.begin.objc","["], - ["identifier","localRequest"], - ["text"," "], - ["support.function.any-method.objc","release"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","#ifndef"], - ["text"," "], - ["constant.language.objc","Nil"] -],[ - "start", - ["keyword","#define"], - ["constant.other"," Nil __DARWIN_NULL "], - ["comment","/* id of Nil class */"] -],[ - "start", - ["keyword","#endif"] -],[ - "start" -],[ - "start", - ["storage.type.objc","@implementation"], - ["entity.name.type.objc"," MyObject"] -],[ - "start", - ["meta.function.objc","- "], - ["paren.lparen","("], - ["storage.type","unsigned"], - ["text"," "], - ["storage.type","int"], - ["paren.rparen",")"], - ["identifier","areaOfWidth"], - ["punctuation.operator",":"], - ["paren.lparen","("], - ["storage.type","unsigned"], - ["text"," "], - ["storage.type","int"], - ["paren.rparen",")"], - ["identifier","width"] -],[ - "start", - ["text"," "], - ["identifier","height"], - ["punctuation.operator",":"], - ["paren.lparen","("], - ["storage.type","unsigned"], - ["text"," "], - ["storage.type","int"], - ["paren.rparen",")"], - ["identifier","height"] -],[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.control","return"], - ["text"," "], - ["identifier","width"], - ["keyword.operator","*"], - ["identifier","height"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["storage.type.objc","@end"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json deleted file mode 100644 index 73e3cfcd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +++ /dev/null @@ -1,200 +0,0 @@ -[[ - "comment", - ["comment","(*"] -],[ - "comment", - ["comment"," * Example of early return implementation taken from"] -],[ - "comment", - ["comment"," * http://ocaml.janestreet.com/?q=node/91"] -],[ - "start", - ["comment"," *)"] -],[ - "start" -],[ - "start", - ["keyword","let"], - ["text"," "], - ["identifier","with_return"], - ["text"," "], - ["paren.lparen","("], - ["keyword","type"], - ["text"," "], - ["identifier","t"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","("], - ["identifier","f"], - ["text"," : "], - ["identifier","_"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","t"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","="] -],[ - "start", - ["text"," "], - ["keyword","let"], - ["text"," "], - ["keyword","module"], - ["text"," "], - ["identifier","M"], - ["text"," "], - ["keyword.operator","="] -],[ - "start", - ["text"," "], - ["keyword","struct"], - ["text"," "], - ["keyword","exception"], - ["text"," "], - ["identifier","Return"], - ["text"," "], - ["keyword","of"], - ["text"," "], - ["identifier","t"], - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","in"] -],[ - "start", - ["text"," "], - ["keyword","let"], - ["text"," "], - ["identifier","return"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","return"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["keyword","fun"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["support.function","raise"], - ["text"," "], - ["paren.lparen","("], - ["identifier","M"], - ["text","."], - ["identifier","Return"], - ["text"," "], - ["identifier","x"], - ["paren.rparen","))"], - ["text","; "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","in"] -],[ - "start", - ["text"," "], - ["keyword","try"], - ["text"," "], - ["identifier","f"], - ["text"," "], - ["identifier","return"], - ["text"," "], - ["keyword","with"], - ["text"," "], - ["identifier","M"], - ["text","."], - ["identifier","Return"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","x"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","(* Function that uses the 'early return' functionality provided by `with_return` *)"] -],[ - "start", - ["keyword","let"], - ["text"," "], - ["identifier","sum_until_first_negative"], - ["text"," "], - ["support.function","list"], - ["text"," "], - ["keyword.operator","="] -],[ - "start", - ["text"," "], - ["identifier","with_return"], - ["text"," "], - ["paren.lparen","("], - ["keyword","fun"], - ["text"," "], - ["identifier","r"], - ["text"," "], - ["keyword.operator","->"] -],[ - "start", - ["text"," "], - ["support.function","List"], - ["text","."], - ["support.function","fold"], - ["text"," "], - ["support.function","list"], - ["text"," "], - ["keyword.operator","~"], - ["support.function","init"], - ["text",":"], - ["constant.numeric","0"], - ["text"," "], - ["keyword.operator","~"], - ["identifier","f"], - ["text",":"], - ["paren.lparen","("], - ["keyword","fun"], - ["text"," "], - ["identifier","acc"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","->"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["keyword","then"], - ["text"," "], - ["identifier","acc"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["identifier","r"], - ["text","."], - ["identifier","return"], - ["text"," "], - ["identifier","acc"], - ["paren.rparen","))"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pascal.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pascal.json deleted file mode 100644 index 22c1f0c4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pascal.json +++ /dev/null @@ -1,297 +0,0 @@ -[[ - "punctuation.definition.comment.pascal", - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one","****************************************************************************"] -],[ - "punctuation.definition.comment.pascal", - ["comment.block.pascal.one"," * A simple bubble sort program. Reads integers, one per line, and prints *"] -],[ - "punctuation.definition.comment.pascal", - ["comment.block.pascal.one"," * them out in sorted order. Blows up if there are more than 49. *"] -],[ - "start", - ["comment.block.pascal.one"," ****************************************************************************"], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["keyword.control.pascal","PROGRAM"], - ["text"," Sort(input"], - ["keyword.operator",","], - ["text"," output)"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","CONST"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Max array size. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," MaxElts "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric.pascal","50"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","TYPE"], - ["text"," "] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Type of the element array. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," IntArrType "], - ["keyword.operator","="], - ["text"," "], - ["keyword.control.pascal","ARRAY"], - ["text"," ["], - ["constant.numeric.pascal","1"], - ["text","..MaxElts] "], - ["keyword.control.pascal","OF"], - ["text"," Integer"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.pascal","VAR"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Indexes, exchange temp, array size. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," i"], - ["keyword.operator",","], - ["text"," j"], - ["keyword.operator",","], - ["text"," tmp"], - ["keyword.operator",","], - ["text"," size: integer"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Array of ints "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," arr: IntArrType"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Read in the integers. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," "], - ["variable.pascal","PROCEDURE"], - ["text"," "], - ["storage.type.function.pascal","ReadArr"], - ["text","("], - ["keyword.control.pascal","VAR"], - ["text"," size: Integer"], - ["keyword.operator",";"], - ["text"," "], - ["keyword.control.pascal","VAR"], - ["text"," a: IntArrType)"], - ["keyword.operator",";"], - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," size "], - ["keyword.operator",":="], - ["text"," "], - ["constant.numeric.pascal","1"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","WHILE"], - ["text"," "], - ["keyword.control.pascal","NOT"], - ["text"," eof "], - ["keyword.control.pascal","DO"], - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," readln(a[size])"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","IF"], - ["text"," "], - ["keyword.control.pascal","NOT"], - ["text"," eof "], - ["keyword.control.pascal","THEN"], - ["text"," "] -],[ - "start", - ["text"," size "], - ["keyword.operator",":="], - ["text"," size "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Read "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," ReadArr(size"], - ["keyword.operator",","], - ["text"," arr)"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Sort using bubble sort. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","FOR"], - ["text"," i "], - ["keyword.operator",":="], - ["text"," size "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text"," DOWNTO "], - ["constant.numeric.pascal","1"], - ["text"," "], - ["keyword.control.pascal","DO"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","FOR"], - ["text"," j "], - ["keyword.operator",":="], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text"," "], - ["keyword.control.pascal","TO"], - ["text"," i "], - ["keyword.control.pascal","DO"], - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","IF"], - ["text"," arr[j] > arr[j "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text","] "], - ["keyword.control.pascal","THEN"], - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," tmp "], - ["keyword.operator",":="], - ["text"," arr[j]"], - ["keyword.operator",";"] -],[ - "start", - ["text"," arr[j] "], - ["keyword.operator",":="], - ["text"," arr[j "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text","]"], - ["keyword.operator",";"] -],[ - "start", - ["text"," arr[j "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text","] "], - ["keyword.operator",":="], - ["text"," tmp"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Print. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","FOR"], - ["text"," i "], - ["keyword.operator",":="], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text"," "], - ["keyword.control.pascal","TO"], - ["text"," size "], - ["keyword.control.pascal","DO"] -],[ - "start", - ["text"," writeln(arr[i])"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"], - ["text","."] -],[ - "start", - ["text"," "] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json deleted file mode 100644 index 30bb39c6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +++ /dev/null @@ -1,227 +0,0 @@ -[[ - "start", - ["comment","#!/usr/bin/perl"] -],[ - "block_comment", - ["comment.doc","=begin"] -],[ - "block_comment", - ["comment.doc"," perl example code for Ace"] -],[ - "start", - ["comment.doc","=cut"] -],[ - "start" -],[ - "start", - ["keyword","use"], - ["text"," "], - ["identifier","strict"], - ["text",";"] -],[ - "start", - ["keyword","use"], - ["text"," "], - ["identifier","warnings"], - ["text",";"] -],[ - "start", - ["keyword","my"], - ["text"," "], - ["identifier","$num_primes"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["text",";"] -],[ - "start", - ["keyword","my"], - ["text"," @"], - ["identifier","primes"], - ["text",";"] -],[ - "start" -],[ - "start", - ["comment","# Put 2 as the first prime so we won't have an empty array"] -],[ - "start", - ["identifier","$primes"], - ["lparen","["], - ["identifier","$num_primes"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["identifier","$num_primes"], - ["keyword.operator","++"], - ["text",";"] -],[ - "start" -],[ - "start", - ["identifier","MAIN_LOOP"], - ["text",":"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["keyword","my"], - ["text"," "], - ["identifier","$number_to_check"], - ["text"," "], - ["lparen","("], - ["constant.numeric","3"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["constant.numeric","200"], - ["rparen",")"] -],[ - "start", - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["keyword","my"], - ["text"," "], - ["identifier","$p"], - ["text"," "], - ["lparen","("], - ["constant.numeric","0"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["lparen","("], - ["identifier","$num_primes"], - ["constant.numeric","-1"], - ["rparen","))"] -],[ - "start", - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["identifier","$number_to_check"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["identifier","$primes"], - ["lparen","["], - ["identifier","$p"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","next"], - ["text"," "], - ["identifier","MAIN_LOOP"], - ["text",";"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# If we reached this point it means $number_to_check is not"] -],[ - "start", - ["text"," "], - ["comment","# divisable by any prime number that came before it."] -],[ - "start", - ["text"," "], - ["identifier","$primes"], - ["lparen","["], - ["identifier","$num_primes"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","$number_to_check"], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","$num_primes"], - ["keyword.operator","++"], - ["text",";"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","for"], - ["text"," "], - ["keyword","my"], - ["text"," "], - ["identifier","$p"], - ["text"," "], - ["lparen","("], - ["constant.numeric","0"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["lparen","("], - ["identifier","$num_primes"], - ["constant.numeric","-1"], - ["rparen","))"] -],[ - "start", - ["lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","print"], - ["text"," "], - ["identifier","$primes"], - ["lparen","["], - ["identifier","$p"], - ["rparen","]"], - ["keyword.operator",","], - ["text"," "], - ["string","\", \""], - ["text",";"] -],[ - "start", - ["rparen","}"] -],[ - "start", - ["support.function","print"], - ["text"," "], - ["string","\"\\n\""], - ["text",";"] -],[ - "start" -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json deleted file mode 100644 index fef23fd2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +++ /dev/null @@ -1,889 +0,0 @@ -[[ - "start" -],[ - "start", - ["keyword.statementBegin","BEGIN"], - ["statementEnd",";"] -],[ - "start" -],[ - "doc-start", - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc","* Samples from PostgreSQL src/tutorial/basics.source"] -],[ - "start", - ["comment.doc","*/"] -],[ - "statement", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","TABLE"], - ["text"," "], - ["identifier","weather"], - ["text"," "], - ["paren.lparen","("] -],[ - "statement", - ["text","\t"], - ["identifier","city"], - ["text","\t\t"], - ["keyword","varchar"], - ["paren.lparen","("], - ["constant.numeric","80"], - ["paren.rparen",")"], - ["text",","] -],[ - "statement", - ["text","\t"], - ["identifier","temp_lo"], - ["text","\t\t"], - ["keyword","int"], - ["text",",\t\t"], - ["comment","-- low temperature"] -],[ - "statement", - ["text","\t"], - ["identifier","temp_hi"], - ["text","\t\t"], - ["keyword","int"], - ["text",",\t\t"], - ["comment","-- high temperature"] -],[ - "statement", - ["text","\t"], - ["identifier","prcp"], - ["text","\t\t"], - ["keyword","real"], - ["text",",\t\t"], - ["comment","-- precipitation"] -],[ - "statement", - ["text","\t"], - ["variable.language","\"date\""], - ["text","\t\t"], - ["keyword","date"] -],[ - "start", - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","TABLE"], - ["text"," "], - ["identifier","cities"], - ["text"," "], - ["paren.lparen","("] -],[ - "statement", - ["text","\t"], - ["keyword","name"], - ["text","\t\t"], - ["keyword","varchar"], - ["paren.lparen","("], - ["constant.numeric","80"], - ["paren.rparen",")"], - ["text",","] -],[ - "statement", - ["text","\t"], - ["keyword","location"], - ["text","\t"], - ["keyword","point"] -],[ - "start", - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","weather"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'San Francisco'"], - ["text",", "], - ["constant.numeric","46"], - ["text",", "], - ["constant.numeric","50"], - ["text",", "], - ["constant.numeric","0.25"], - ["text",", "], - ["string","'1994-11-27'"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","cities"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'San Francisco'"], - ["text",", "], - ["string","'(-194.0, 53.0)'"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","weather"], - ["text"," "], - ["paren.lparen","("], - ["identifier","city"], - ["text",", "], - ["identifier","temp_lo"], - ["text",", "], - ["identifier","temp_hi"], - ["text",", "], - ["identifier","prcp"], - ["text",", "], - ["variable.language","\"date\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'San Francisco'"], - ["text",", "], - ["constant.numeric","43"], - ["text",", "], - ["constant.numeric","57"], - ["text",", "], - ["constant.numeric","0.0"], - ["text",", "], - ["string","'1994-11-29'"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","weather"], - ["text"," "], - ["paren.lparen","("], - ["keyword","date"], - ["text",", "], - ["identifier","city"], - ["text",", "], - ["identifier","temp_hi"], - ["text",", "], - ["identifier","temp_lo"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'1994-11-29'"], - ["text",", "], - ["string","'Hayward'"], - ["text",", "], - ["constant.numeric","54"], - ["text",", "], - ["constant.numeric","37"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword.statementBegin","SELECT"], - ["text"," "], - ["identifier","city"], - ["text",", "], - ["paren.lparen","("], - ["identifier","temp_hi"], - ["keyword.operator","+"], - ["identifier","temp_lo"], - ["paren.rparen",")"], - ["keyword.operator","/"], - ["constant.numeric","2"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["identifier","temp_avg"], - ["text",", "], - ["variable.language","\"date\""], - ["text"," "], - ["keyword","FROM"], - ["text"," "], - ["identifier","weather"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","SELECT"], - ["text"," "], - ["identifier","city"], - ["text",", "], - ["identifier","temp_lo"], - ["text",", "], - ["identifier","temp_hi"], - ["text",", "], - ["identifier","prcp"], - ["text",", "], - ["variable.language","\"date\""], - ["text",", "], - ["keyword","location"] -],[ - "statement", - ["text"," "], - ["keyword","FROM"], - ["text"," "], - ["identifier","weather"], - ["text",", "], - ["identifier","cities"] -],[ - "start", - ["text"," "], - ["keyword","WHERE"], - ["text"," "], - ["identifier","city"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","name"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "doc-start", - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc","* Dollar quotes starting at the end of the line are colored as SQL unless"] -],[ - "doc-start", - ["comment.doc","* a special language tag is used. Dollar quote syntax coloring is implemented"] -],[ - "doc-start", - ["comment.doc","* for Perl, Python, JavaScript, and Json."] -],[ - "start", - ["comment.doc","*/"] -],[ - "statement", - ["keyword.statementBegin","create"], - ["text"," "], - ["keyword","or"], - ["text"," "], - ["keyword","replace"], - ["text"," "], - ["keyword","function"], - ["text"," "], - ["identifier","blob_content_chunked"], - ["paren.lparen","("] -],[ - "statement", - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","p_data"], - ["text"," "], - ["keyword","bytea"], - ["text",", "] -],[ - "statement", - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","p_chunk"], - ["text"," "], - ["keyword","integer"], - ["paren.rparen",")"] -],[ - "dollarSql", - ["keyword","returns"], - ["text"," "], - ["keyword","setof"], - ["text"," "], - ["keyword","bytea"], - ["text"," "], - ["keyword","as"], - ["text"," "], - ["string","$$"] -],[ - "dollarSql", - ["comment","-- Still SQL comments"] -],[ - "dollarSql", - ["keyword","declare"] -],[ - "dollarSql", - ["text","\t"], - ["identifier","v_size"], - ["text"," "], - ["keyword","integer"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["support.function","octet_length"], - ["paren.lparen","("], - ["identifier","p_data"], - ["paren.rparen",")"], - ["text",";"] -],[ - "dollarSql", - ["keyword","begin"] -],[ - "dollarSql", - ["text","\t"], - ["keyword","for"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["constant.numeric","1"], - ["text",".."], - ["identifier","v_size"], - ["text"," "], - ["keyword","by"], - ["text"," "], - ["identifier","p_chunk"], - ["text"," "], - ["identifier","loop"] -],[ - "dollarSql", - ["text","\t\t"], - ["identifier","return"], - ["text"," "], - ["keyword","next"], - ["text"," "], - ["keyword","substring"], - ["paren.lparen","("], - ["identifier","p_data"], - ["text"," "], - ["keyword","from"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","p_chunk"], - ["paren.rparen",")"], - ["text",";"] -],[ - "dollarSql", - ["text","\t"], - ["keyword","end"], - ["text"," "], - ["identifier","loop"], - ["text",";"] -],[ - "dollarSql", - ["keyword","end"], - ["text",";"] -],[ - "start", - ["string","$$"], - ["text"," "], - ["keyword","language"], - ["text"," "], - ["identifier","plpgsql"], - ["text"," "], - ["keyword","stable"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- pl/perl"] -],[ - "perl-start", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","FUNCTION"], - ["text"," "], - ["identifier","perl_max"], - ["text"," "], - ["paren.lparen","("], - ["keyword","integer"], - ["text",", "], - ["keyword","integer"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","RETURNS"], - ["text"," "], - ["keyword","integer"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["string","$perl$"] -],[ - "perl-start", - ["text"," "], - ["comment","# perl comment..."] -],[ - "perl-start", - ["text"," "], - ["keyword","my"], - ["text"," "], - ["lparen","("], - ["identifier","$x"], - ["keyword.operator",","], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["keyword.operator","="], - ["text"," @"], - ["identifier","_"], - ["text",";"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["keyword.operator","!"], - ["text"," "], - ["support.function","defined"], - ["text"," "], - ["identifier","$x"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["keyword.operator","!"], - ["text"," "], - ["support.function","defined"], - ["text"," "], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["support.function","return"], - ["text"," "], - ["support.function","undef"], - ["text","; "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$y"], - ["text",";"] -],[ - "perl-start", - ["text"," "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["keyword.operator","!"], - ["text"," "], - ["support.function","defined"], - ["text"," "], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$x"], - ["text","; "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["identifier","$x"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$x"], - ["text","; "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$y"], - ["text",";"] -],[ - "start", - ["string","$perl$"], - ["text"," "], - ["keyword","LANGUAGE"], - ["text"," "], - ["identifier","plperl"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["comment","-- pl/python"] -],[ - "python-start", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","FUNCTION"], - ["text"," "], - ["identifier","usesavedplan"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["keyword","RETURNS"], - ["text"," "], - ["keyword","trigger"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["string","$python$"] -],[ - "python-start", - ["text"," "], - ["comment","# python comment..."] -],[ - "python-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["identifier","SD"], - ["text","."], - ["identifier","has_key"], - ["paren.lparen","("], - ["string","\"plan\""], - ["paren.rparen",")"], - ["text",":"] -],[ - "python-start", - ["text"," "], - ["identifier","plan"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","SD"], - ["paren.lparen","["], - ["string","\"plan\""], - ["paren.rparen","]"] -],[ - "python-start", - ["text"," "], - ["keyword","else"], - ["text",":"] -],[ - "python-start", - ["text"," "], - ["identifier","plan"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","plpy"], - ["text","."], - ["identifier","prepare"], - ["paren.lparen","("], - ["string","\"SELECT 1\""], - ["paren.rparen",")"] -],[ - "python-start", - ["text"," "], - ["identifier","SD"], - ["paren.lparen","["], - ["string","\"plan\""], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","plan"] -],[ - "start", - ["string","$python$"], - ["text"," "], - ["keyword","LANGUAGE"], - ["text"," "], - ["identifier","plpythonu"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["comment","-- pl/v8 (javascript)"] -],[ - "javascript-start", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","FUNCTION"], - ["text"," "], - ["identifier","plv8_test"], - ["paren.lparen","("], - ["identifier","keys"], - ["text"," "], - ["keyword","text"], - ["text","[], "], - ["identifier","vals"], - ["text"," "], - ["keyword","text"], - ["text","[]"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","RETURNS"], - ["text"," "], - ["keyword","text"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["string","$javascript$"] -],[ - "javascript-start", - ["storage.type","var"], - ["text"," "], - ["identifier","o"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["paren.rparen","}"], - ["punctuation.operator",";"] -],[ - "javascript-start", - ["keyword","for"], - ["paren.lparen","("], - ["storage.type","var"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","="], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","<"], - ["identifier","keys"], - ["punctuation.operator","."], - ["support.constant","length"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","++"], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "javascript-start", - ["text"," "], - ["identifier","o"], - ["paren.lparen","["], - ["identifier","keys"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","vals"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "javascript-no_regex", - ["paren.rparen","}"] -],[ - "javascript-start", - ["keyword","return"], - ["text"," "], - ["variable.language","JSON"], - ["punctuation.operator","."], - ["identifier","stringify"], - ["paren.lparen","("], - ["identifier","o"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["string","$javascript$"], - ["text"," "], - ["keyword","LANGUAGE"], - ["text"," "], - ["identifier","plv8"], - ["text"," "], - ["keyword","IMMUTABLE"], - ["text"," "], - ["keyword","STRICT"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["comment","-- json"] -],[ - "json-start", - ["keyword.statementBegin","select"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["keyword","from"], - ["text"," "], - ["support.function","json_object_keys"], - ["paren.lparen","("], - ["string","$json$"] -],[ - "json-start", - ["paren.lparen","{"] -],[ - "json-start", - ["text"," "], - ["variable","\"f1\""], - ["text",": "], - ["constant.numeric","5"], - ["text",","] -],[ - "json-start", - ["text"," "], - ["variable","\"f2\""], - ["text",": "], - ["string","\"test\""], - ["text",","] -],[ - "json-start", - ["text"," "], - ["variable","\"f3\""], - ["text",": "], - ["paren.lparen","{"], - ["paren.rparen","}"] -],[ - "json-start", - ["paren.rparen","}"] -],[ - "start", - ["string","$json$"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- psql commands"] -],[ - "start", - ["support.buildin","\\df cash*"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- Some string samples."] -],[ - "start", - ["keyword.statementBegin","select"], - ["text"," "], - ["string","'don''t do it now;'"], - ["text"," "], - ["keyword.operator","||"], - ["text"," "], - ["string","'maybe later'"], - ["statementEnd",";"] -],[ - "start", - ["keyword.statementBegin","select"], - ["text"," "], - ["identifier","E"], - ["string","'dont\\'t do it'"], - ["statementEnd",";"] -],[ - "start", - ["keyword.statementBegin","select"], - ["text"," "], - ["support.function","length"], - ["paren.lparen","("], - ["string","'some other''s stuff'"], - ["text"," "], - ["keyword.operator","||"], - ["text"," "], - ["string","$$cat in hat's stuff $$"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "dollarStatementString", - ["keyword.statementBegin","select"], - ["text"," "], - ["string","$$ strings"] -],[ - "dollarStatementString", - ["string","over multiple "] -],[ - "dollarStatementString", - ["string","lines - use dollar quotes"] -],[ - "start", - ["string","$$"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["keyword.statementBegin","END"], - ["statementEnd",";"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json deleted file mode 100644 index 2134dccb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +++ /dev/null @@ -1,171 +0,0 @@ -[[ - "php-start", - ["support.php_tag",""], - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text"," "], - ["support.php_tag",""] -],[ - "js-comment_regex_allowed", - ["comment","/*this is js "], - ["support.php_tag",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," not "], - ["constant.language.escape.reference.xml","&js;"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json deleted file mode 100644 index 43b77db4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +++ /dev/null @@ -1,184 +0,0 @@ -[[ - "start", - ["comment","# This is a simple comment"] -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","Hello"], - ["lparen","("], - ["variable.instance","$name"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","Write-host"], - ["text"," "], - ["string","\"Hello $name\""] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","add"], - ["lparen","("], - ["variable.instance","$left"], - ["text",", "], - ["variable.instance","$right"], - ["keyword.operator","="], - ["constant.numeric","4"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["variable.instance","$right"], - ["text"," "], - ["keyword.operator","-ne"], - ["text"," "], - ["constant.numeric","4"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["variable.instance","$left"] -],[ - "start", - ["text"," "], - ["rparen","}"], - ["text"," "], - ["keyword","elseif"], - ["text"," "], - ["lparen","("], - ["variable.instance","$left"], - ["text"," "], - ["keyword.operator","-eq"], - ["text"," "], - ["constant.language","$null"], - ["text"," "], - ["keyword.operator","-and"], - ["text"," "], - ["variable.instance","$right"], - ["text"," "], - ["keyword.operator","-eq"], - ["text"," "], - ["constant.numeric","2"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["constant.numeric","3"] -],[ - "start", - ["text"," "], - ["rparen","}"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["constant.numeric","2"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["variable.instance","$number"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["variable.instance","$number"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["constant.numeric","3"] -],[ - "start" -],[ - "start", - ["support.function","Write-Host"], - ["text"," "], - ["identifier","Hello"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","name"], - ["text"," "], - ["string","\"World\""] -],[ - "start" -],[ - "start", - ["variable.instance","$an_array"], - ["text"," "], - ["keyword.operator","="], - ["text"," @"], - ["lparen","("], - ["constant.numeric","1"], - ["text",", "], - ["constant.numeric","2"], - ["text",", "], - ["constant.numeric","3"], - ["rparen",")"] -],[ - "start", - ["variable.instance","$a_hash"], - ["text"," "], - ["keyword.operator","="], - ["text"," @"], - ["lparen","{"], - ["string","\"something\""], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"something else\""], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword.operator","&"], - ["text"," "], - ["identifier","notepad"], - ["text"," .\\"], - ["identifier","readme"], - ["text","."], - ["identifier","md"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_prolog.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_prolog.json deleted file mode 100644 index 4c0f5c5c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_prolog.json +++ /dev/null @@ -1,245 +0,0 @@ -[[ - "start", - ["entity.name.function.fact.prolog","partition"], - ["punctuation.begin.fact.parameters.prolog","("], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.language.anonymous.prolog","_"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.end.fact.parameters.prolog",")"], - ["punctuation.end.fact.prolog","."] -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["entity.name.function.rule.prolog","partition"], - ["punctuation.rule.parameters.begin.prolog","("], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Xs"], - ["punctuation.end.list.prolog","]"], - ["punctuation.separator.parameters.prolog",","], - ["meta.rule.parameters.prolog"," "], - ["variable.parameter.prolog","Pivot"], - ["punctuation.separator.parameters.prolog",","], - ["meta.rule.parameters.prolog"," "], - ["variable.parameter.prolog","Smalls"], - ["punctuation.separator.parameters.prolog",","], - ["meta.rule.parameters.prolog"," "], - ["variable.parameter.prolog","Bigs"], - ["punctuation.rule.parameters.end.prolog",")"], - ["meta.rule.signature.prolog"," "], - ["keyword.operator.definition.prolog",":-"] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.rule.definition.prolog"," "], - ["meta.expression.prolog","( "], - ["variable.other.prolog","X"], - ["meta.expression.prolog"," @"], - ["keyword.operator.prolog","<"], - ["meta.expression.prolog"," "], - ["variable.other.prolog","Pivot"], - ["meta.expression.prolog"," "], - ["keyword.operator.prolog","->"] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["variable.other.prolog","Smalls"], - ["meta.expression.prolog"," "], - ["keyword.operator.prolog","="], - ["meta.expression.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Rest"], - ["punctuation.end.list.prolog","]"], - ["punctuation.control.and.prolog",","] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["constant.other.atom.prolog","partition"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","Xs"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Pivot"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Rest"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Bigs"], - ["punctuation.end.statement.parameters.prolog",")"] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["punctuation.control.or.prolog",";"], - ["meta.expression.prolog"," "], - ["variable.other.prolog","Bigs"], - ["meta.expression.prolog"," "], - ["keyword.operator.prolog","="], - ["meta.expression.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Rest"], - ["punctuation.end.list.prolog","]"], - ["punctuation.control.and.prolog",","] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["constant.other.atom.prolog","partition"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","Xs"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Pivot"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Smalls"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Rest"], - ["punctuation.end.statement.parameters.prolog",")"] -],[ - "start", - ["meta.expression.prolog"," )"], - ["punctuation.rule.end.prolog","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text"," --> []."] -],[ - "start", - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Xs"], - ["punctuation.end.list.prolog","]"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text"," -->"] -],[ - "start", - ["text"," { "], - ["entity.name.function.fact.prolog","partition"], - ["punctuation.begin.fact.parameters.prolog","("], - ["variable.parameter.prolog","Xs"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.parameter.prolog","X"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.parameter.prolog","Smaller"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.parameter.prolog","Bigger"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text"," },"] -],[ - "start", - ["text"," "], - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["variable.parameter.prolog","Smaller"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text",", [X], "], - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["variable.parameter.prolog","Bigger"], - ["punctuation.end.fact.parameters.prolog",")"], - ["punctuation.end.fact.prolog","."] -],[ - "start" -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["entity.name.function.rule.prolog","perfect"], - ["punctuation.rule.parameters.begin.prolog","("], - ["variable.parameter.prolog","N"], - ["punctuation.rule.parameters.end.prolog",")"], - ["meta.rule.signature.prolog"," "], - ["keyword.operator.definition.prolog",":-"] -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.rule.definition.prolog"," "], - ["constant.other.atom.prolog","between"], - ["punctuation.begin.statement.parameters.prolog","("], - ["constant.numeric.prolog","1"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["constant.other.atom.prolog","inf"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","N"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.control.and.prolog",","], - ["meta.rule.definition.prolog"," "], - ["variable.other.prolog","U"], - ["meta.rule.definition.prolog"," "], - ["keyword.operator.prolog","is"], - ["meta.rule.definition.prolog"," "], - ["variable.other.prolog","N"], - ["meta.rule.definition.prolog"," // "], - ["constant.numeric.prolog","2"], - ["punctuation.control.and.prolog",","] -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.rule.definition.prolog"," "], - ["constant.other.atom.prolog","findall"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","D"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," ("], - ["constant.other.atom.prolog","between"], - ["punctuation.begin.statement.parameters.prolog","("], - ["constant.numeric.prolog","1"], - ["punctuation.separator.statement.prolog",","], - ["variable.other.prolog","U"], - ["punctuation.separator.statement.prolog",","], - ["variable.other.prolog","D"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","N"], - ["meta.statement.parameters.prolog"," "], - ["constant.other.atom.prolog","mod"], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","D"], - ["meta.statement.parameters.prolog"," "], - ["keyword.operator.prolog","=:="], - ["meta.statement.parameters.prolog"," "], - ["constant.numeric.prolog","0"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.control.and.prolog",","], - ["meta.rule.definition.prolog"," "], - ["variable.other.prolog","Ds"], - ["meta.rule.definition.prolog",")"], - ["punctuation.control.and.prolog",","] -],[ - "start", - ["meta.rule.definition.prolog"," "], - ["constant.other.atom.prolog","sumlist"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","Ds"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","N"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.rule.end.prolog","."] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_properties.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_properties.json deleted file mode 100644 index 8831045e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_properties.json +++ /dev/null @@ -1,68 +0,0 @@ -[[ - "start", - ["comment","# You are reading the \".properties\" entry."] -],[ - "start", - ["comment","! The exclamation mark can also mark text as comments."] -],[ - "start", - ["comment","# The key and element characters #, !, =, and : are written with a preceding backslash to ensure that they are properly loaded."] -],[ - "start", - ["variable","website "], - ["keyword","="], - ["string"," http"], - ["constant.language.escape","\\"], - ["string","://en.wikipedia.org/"] -],[ - "start", - ["variable","language "], - ["keyword","="], - ["string"," English"] -],[ - "start", - ["comment","# The backslash below tells the application to continue reading"] -],[ - "start", - ["comment","# the value onto the next line."] -],[ - "value", - ["variable","message "], - ["keyword","="], - ["string"," Welcome to \\"] -],[ - "start", - ["string"," Wikipedia!"] -],[ - "start", - ["comment","# Add spaces to the key"] -],[ - "start", - ["variable","key"], - ["constant.language.escape","\\"], - ["variable"," with"], - ["constant.language.escape","\\"], - ["variable"," spaces "], - ["keyword","="], - ["string"," This is the value that could be looked up with the key \"key with spaces\"."] -],[ - "start", - ["comment","# Unicode"] -],[ - "start", - ["variable","tab "], - ["keyword",":"], - ["string"," "], - ["constant.language.escape","\\u0009"] -],[ - "start", - ["variable","empty-key"], - ["keyword","="] -],[ - "start", - ["variable","last.line"], - ["keyword","="], - ["string","value"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_protobuf.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_protobuf.json deleted file mode 100644 index 469dba06..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_protobuf.json +++ /dev/null @@ -1,136 +0,0 @@ -[[ - "start", - ["keyword.declaration.protobuf","message"], - ["text"," "], - ["identifier","Point"], - ["text"," {"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["support.type","int32"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","1"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["support.type","int32"], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","optional"], - ["text"," "], - ["support.type","string"], - ["text"," "], - ["identifier","label"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","3"], - ["text",";"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start", - ["keyword.declaration.protobuf","message"], - ["text"," "], - ["identifier","Line"], - ["text"," {"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["identifier","Point"], - ["text"," "], - ["identifier","start"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","1"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["identifier","Point"], - ["text"," "], - ["identifier","end"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","optional"], - ["text"," "], - ["support.type","string"], - ["text"," "], - ["identifier","label"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","3"], - ["text",";"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start", - ["keyword.declaration.protobuf","message"], - ["text"," "], - ["identifier","Polyline"], - ["text"," {"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","repeated"], - ["text"," "], - ["identifier","Point"], - ["text"," "], - ["identifier","point"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","1"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","optional"], - ["text"," "], - ["support.type","string"], - ["text"," "], - ["identifier","label"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json deleted file mode 100644 index 293c8ff2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +++ /dev/null @@ -1,152 +0,0 @@ -[[ - "start", - ["comment","#!/usr/local/bin/python"] -],[ - "start" -],[ - "start", - ["keyword","import"], - ["text"," "], - ["identifier","string"], - ["text",", "], - ["identifier","sys"] -],[ - "start" -],[ - "start", - ["comment","# If no arguments were given, print a helpful message"] -],[ - "start", - ["keyword","if"], - ["text"," "], - ["support.function","len"], - ["paren.lparen","("], - ["identifier","sys"], - ["text","."], - ["identifier","argv"], - ["paren.rparen",")"], - ["keyword.operator","=="], - ["constant.numeric","1"], - ["text",":"] -],[ - "qstring3", - ["text"," "], - ["keyword","print"], - ["text"," "], - ["string","'''Usage:"] -],[ - "start", - ["string","celsius temp1 temp2 ...'''"] -],[ - "start", - ["text"," "], - ["identifier","sys"], - ["text","."], - ["identifier","exit"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["comment","# Loop over the arguments"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","sys"], - ["text","."], - ["identifier","argv"], - ["paren.lparen","["], - ["constant.numeric","1"], - ["text",":"], - ["paren.rparen","]"], - ["text",":"] -],[ - "start", - ["text"," "], - ["keyword","try"], - ["text",":"] -],[ - "start", - ["text"," "], - ["identifier","fahrenheit"], - ["keyword.operator","="], - ["support.function","float"], - ["paren.lparen","("], - ["identifier","string"], - ["text","."], - ["identifier","atoi"], - ["paren.lparen","("], - ["identifier","i"], - ["paren.rparen","))"] -],[ - "start", - ["text"," "], - ["keyword","except"], - ["text"," "], - ["identifier","string"], - ["text","."], - ["identifier","atoi_error"], - ["text",":"] -],[ - "start", - ["text"," "], - ["keyword","print"], - ["text"," "], - ["support.function","repr"], - ["paren.lparen","("], - ["identifier","i"], - ["paren.rparen",")"], - ["text",", "], - ["string","\"not a numeric value\""] -],[ - "start", - ["text"," "], - ["keyword","else"], - ["text",":"] -],[ - "start", - ["text"," "], - ["identifier","celsius"], - ["keyword.operator","="], - ["paren.lparen","("], - ["identifier","fahrenheit"], - ["keyword.operator","-"], - ["constant.numeric","32"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","5.0"], - ["keyword.operator","/"], - ["constant.numeric","9.0"] -],[ - "start", - ["text"," "], - ["keyword","print"], - ["text"," "], - ["string","'%i"], - ["constant.language.escape","\\260"], - ["string","F = %i"], - ["constant.language.escape","\\260"], - ["string","C'"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["paren.lparen","("], - ["support.function","int"], - ["paren.lparen","("], - ["identifier","fahrenheit"], - ["paren.rparen",")"], - ["text",", "], - ["support.function","int"], - ["paren.lparen","("], - ["identifier","celsius"], - ["keyword.operator","+"], - ["constant.numeric",".5"], - ["paren.rparen","))"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_r.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_r.json deleted file mode 100644 index 2d446bce..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_r.json +++ /dev/null @@ -1,235 +0,0 @@ -[[ - "start", - ["identifier","Call"], - ["keyword.operator",":"] -],[ - "start", - ["identifier","lm"], - ["paren.keyword.operator","("], - ["identifier","formula"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator","~"], - ["text"," "], - ["identifier","x"], - ["paren.keyword.operator",")"] -],[ - "start", - ["text"," "] -],[ - "start", - ["identifier","Residuals"], - ["keyword.operator",":"] -],[ - "start", - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","3"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["constant.numeric","5"], - ["text"," "], - ["constant.numeric","6"] -],[ - "start", - ["constant.numeric","3.3333"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","0.6667"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","2.6667"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","2.6667"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","0.6667"], - ["text"," "], - ["constant.numeric","3.3333"] -],[ - "start", - ["text"," "] -],[ - "start", - ["identifier","Coefficients"], - ["keyword.operator",":"] -],[ - "start", - ["text"," "], - ["identifier","Estimate"], - ["text"," "], - ["identifier","Std"], - ["text",". "], - ["identifier","Error"], - ["text"," "], - ["identifier","t"], - ["text"," "], - ["identifier","value"], - ["text"," "], - ["identifier","Pr"], - ["paren.keyword.operator","("], - ["keyword.operator",">|"], - ["identifier","t"], - ["keyword.operator","|"], - ["paren.keyword.operator",")"] -],[ - "start", - ["paren.keyword.operator","("], - ["identifier","Intercept"], - ["paren.keyword.operator",")"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","9.3333"], - ["text"," "], - ["constant.numeric","2.8441"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","3.282"], - ["text"," "], - ["constant.numeric","0.030453"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["identifier","x"], - ["text"," "], - ["constant.numeric","7.0000"], - ["text"," "], - ["constant.numeric","0.7303"], - ["text"," "], - ["constant.numeric","9.585"], - ["text"," "], - ["constant.numeric","0.000662"], - ["text"," "], - ["keyword.operator","***"] -],[ - "start", - ["keyword.operator","---"] -],[ - "start", - ["identifier","Signif"], - ["text",". "], - ["identifier","codes"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0"], - ["text"," ‘"], - ["keyword.operator","***"], - ["text","’ "], - ["constant.numeric","0.001"], - ["text"," ‘"], - ["keyword.operator","**"], - ["text","’ "], - ["constant.numeric","0.01"], - ["text"," ‘"], - ["keyword.operator","*"], - ["text","’ "], - ["constant.numeric","0.05"], - ["text"," ‘.’ "], - ["constant.numeric","0.1"], - ["text"," ‘ ’ "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "] -],[ - "start", - ["identifier","Residual"], - ["text"," "], - ["identifier","standard"], - ["text"," "], - ["identifier","error"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","3.055"], - ["text"," "], - ["identifier","on"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["identifier","degrees"], - ["text"," "], - ["identifier","of"], - ["text"," "], - ["identifier","freedom"] -],[ - "start", - ["identifier","Multiple"], - ["text"," "], - ["identifier","R"], - ["keyword.operator","-"], - ["identifier","squared"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0.9583"], - ["text",", "], - ["identifier","Adjusted"], - ["text"," "], - ["identifier","R"], - ["keyword.operator","-"], - ["identifier","squared"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0.9478"] -],[ - "start", - ["constant.language.boolean","F"], - ["keyword.operator","-"], - ["identifier","statistic"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","91.88"], - ["text"," "], - ["identifier","on"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["identifier","and"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["identifier","DF"], - ["text",", "], - ["identifier","p"], - ["keyword.operator","-"], - ["identifier","value"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0.000662"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword.operator",">"], - ["text"," "], - ["identifier","par"], - ["paren.keyword.operator","("], - ["identifier","mfrow"], - ["keyword.operator","="], - ["identifier","c"], - ["paren.keyword.operator","("], - ["constant.numeric","2"], - ["text",", "], - ["constant.numeric","2"], - ["paren.keyword.operator","))"], - ["text"," "], - ["comment","# Request 2x2 plot layout"] -],[ - "start", - ["keyword.operator",">"], - ["text"," "], - ["identifier","plot"], - ["paren.keyword.operator","("], - ["identifier","lm_1"], - ["paren.keyword.operator",")"], - ["text"," "], - ["comment","# Diagnostic plot of regression model"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rdoc.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rdoc.json deleted file mode 100644 index 0c757438..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rdoc.json +++ /dev/null @@ -1,441 +0,0 @@ -[[ - "start", - ["keyword","\\name"], - ["paren.keyword.operator","{"], - ["nospell.text","picker"], - ["paren.keyword.operator","}"] -],[ - "start", - ["keyword","\\alias"], - ["paren.keyword.operator","{"], - ["nospell.text","picker"], - ["paren.keyword.operator","}"] -],[ - "start", - ["keyword","\\title"], - ["paren.keyword.operator","{"], - ["text","Create a picker control"], - ["paren.keyword.operator","}"] -],[ - "start", - ["keyword","\\description"], - ["paren.keyword.operator","{"] -],[ - "start", - ["text"," Create a picker control to enable manipulation of plot variables based on a set of fixed choices."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "nospell", - ["keyword","\\usage"], - ["paren.keyword.operator","{"] -],[ - "nospell", - ["nospell.text","picker"], - ["paren.keyword.operator","("], - ["text","...,"], - ["nospell.text"," initial "], - ["text","="], - ["nospell.text"," NULL"], - ["text",","], - ["nospell.text"," label "], - ["text","="], - ["nospell.text"," NULL"], - ["paren.keyword.operator",")"] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","\\arguments"], - ["paren.keyword.operator","{"] -],[ - "start", - ["text"," "], - ["keyword","\\item"], - ["paren.keyword.operator","{"], - ["keyword","\\dots"], - ["paren.keyword.operator","}{"] -],[ - "start", - ["text"," Arguments containing objects to be presented as choices for the picker "], - ["paren.keyword.operator","("], - ["text","or a list containing the choices"], - ["paren.keyword.operator",")"], - ["text",". If an element is named then the name is used to display it within the picker. If an element is not named then it is displayed within the picker using "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","as"], - ["text","."], - ["nospell.text","character"], - ["paren.keyword.operator","}}"], - ["text",". "] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\item"], - ["paren.keyword.operator","{"], - ["nospell.text","initial"], - ["paren.keyword.operator","}{"] -],[ - "start", - ["text"," Initial value for picker. Value must be present in the list of choices specified. If not specified defaults to the first choice."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\item"], - ["paren.keyword.operator","{"], - ["nospell.text","label"], - ["paren.keyword.operator","}{"] -],[ - "start", - ["text"," Display label for picker. Defaults to the variable name if not specified."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start", - ["keyword","\\value"], - ["paren.keyword.operator","{"] -],[ - "start", - ["text"," An object of class \"manipulator.picker\" which can be passed to the "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","manipulate"], - ["paren.keyword.operator","}}"], - ["text"," function."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start", - ["keyword","\\seealso"], - ["paren.keyword.operator","{"] -],[ - "start", - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","manipulate"], - ["paren.keyword.operator","}}"], - ["text",", "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","slider"], - ["paren.keyword.operator","}}"], - ["text",", "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","checkbox"], - ["paren.keyword.operator","}}"], - ["text",", "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","button"], - ["paren.keyword.operator","}}"] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start" -],[ - "nospell", - ["keyword","\\examples"], - ["paren.keyword.operator","{"] -],[ - "nospell", - ["keyword","\\dontrun"], - ["paren.keyword.operator","{"] -],[ - "nospell" -],[ - "nospell", - ["text","##"], - ["nospell.text"," Filtering data with a picker"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," barplot"], - ["paren.keyword.operator","("], - ["nospell.text","as"], - ["text","."], - ["nospell.text","matrix"], - ["paren.keyword.operator","("], - ["nospell.text","longley"], - ["paren.keyword.operator","["], - ["text",","], - ["nospell.text","factor"], - ["paren.keyword.operator","])"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," beside "], - ["text","="], - ["nospell.text"," TRUE"], - ["text",","], - ["nospell.text"," main "], - ["text","="], - ["nospell.text"," factor"], - ["paren.keyword.operator",")"], - ["text",","] -],[ - "nospell", - ["nospell.text"," factor "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","GNP"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Unemployed"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Employed"], - ["text","\""], - ["paren.keyword.operator","))"] -],[ - "nospell" -],[ - "nospell", - ["text","##"], - ["nospell.text"," Create a picker with labels"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," plot"], - ["paren.keyword.operator","("], - ["nospell.text","pressure"], - ["text",","], - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," type"], - ["paren.keyword.operator",")"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","points"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","p"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","line"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","l"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","step"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","s"], - ["text","\""], - ["paren.keyword.operator","))"] -],[ - "nospell", - ["nospell.text"," "] -],[ - "nospell", - ["text","##"], - ["nospell.text"," Picker with groups"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," barplot"], - ["paren.keyword.operator","("], - ["nospell.text","as"], - ["text","."], - ["nospell.text","matrix"], - ["paren.keyword.operator","("], - ["nospell.text","mtcars"], - ["paren.keyword.operator","["], - ["nospell.text","group"], - ["text",",\""], - ["nospell.text","mpg"], - ["text","\""], - ["paren.keyword.operator","])"], - ["text",","], - ["nospell.text"," beside"], - ["text","="], - ["nospell.text","TRUE"], - ["paren.keyword.operator",")"], - ["text",","] -],[ - "nospell", - ["nospell.text"," group "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","Group 1"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," 1"], - ["text",":"], - ["nospell.text","11"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Group 2"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," 12"], - ["text",":"], - ["nospell.text","22"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Group 3"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," 23"], - ["text",":"], - ["nospell.text","32"], - ["paren.keyword.operator","))"] -],[ - "nospell" -],[ - "nospell", - ["text","##"], - ["nospell.text"," Histogram w"], - ["text","/"], - ["nospell.text"," picker to select type"] -],[ - "nospell", - ["nospell.text","require"], - ["paren.keyword.operator","("], - ["nospell.text","lattice"], - ["paren.keyword.operator",")"] -],[ - "nospell", - ["nospell.text","require"], - ["paren.keyword.operator","("], - ["nospell.text","stats"], - ["paren.keyword.operator",")"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," histogram"], - ["paren.keyword.operator","("], - ["text","~"], - ["nospell.text"," height "], - ["text","|"], - ["nospell.text"," voice"], - ["text","."], - ["nospell.text","part"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," data "], - ["text","="], - ["nospell.text"," singer"], - ["text",","], - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," type"], - ["paren.keyword.operator",")"], - ["text",","] -],[ - "nospell", - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","percent"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","count"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","density"], - ["text","\""], - ["paren.keyword.operator","))"] -],[ - "nospell" -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["paren.keyword.operator","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rhtml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rhtml.json deleted file mode 100644 index a536f851..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rhtml.json +++ /dev/null @@ -1,106 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Title"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","This is an R HTML document. When you click the "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Knit HTML"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "r-start", - ["support.function.codebegin",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","You can also embed plots, for example:"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "r-start", - ["support.function.codebegin",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json deleted file mode 100644 index f9991e9c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +++ /dev/null @@ -1,242 +0,0 @@ -[[ - "start", - ["text"," "], - ["comment","#test: symbol tokenizer"] -],[ - "start", - ["text"," "], - ["paren.lparen","["], - ["constant.other.symbol.ruby",":@thing"], - ["text",", "], - ["constant.other.symbol.ruby",":$thing"], - ["text",", "], - ["constant.other.symbol.ruby",":_thing"], - ["text",", "], - ["constant.other.symbol.ruby",":thing"], - ["text",", "], - ["constant.other.symbol.ruby",":Thing"], - ["text",", "], - ["constant.other.symbol.ruby",":thing1"], - ["text",", "], - ["constant.other.symbol.ruby",":thing_a"], - ["text",","] -],[ - "start", - ["text"," "], - ["constant.other.symbol.ruby",":THING"], - ["text",", "], - ["constant.other.symbol.ruby",":thing!"], - ["text",", "], - ["constant.other.symbol.ruby",":thing="], - ["text",", "], - ["constant.other.symbol.ruby",":thing?"], - ["text",", "], - ["constant.other.symbol.ruby",":t?"], - ["text",","] -],[ - "start", - ["text"," :, :@, :"], - ["keyword.operator","$"], - ["text",", :"], - ["constant.numeric","1"], - ["text",", :1"], - ["identifier","thing"], - ["text",", "], - ["constant.other.symbol.ruby",":th?"], - ["identifier","ing"], - ["text",", "], - ["constant.other.symbol.ruby",":thi="], - ["identifier","ng"], - ["text",", :1"], - ["identifier","thing"], - ["text",","] -],[ - "start", - ["text"," "], - ["constant.other.symbol.ruby",":th!"], - ["identifier","ing"], - ["text",", "], - ["constant.other.symbol.ruby",":thing"], - ["comment","#"] -],[ - "start", - ["text"," "], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","#test: namespaces aren't symbols\" : function() {"] -],[ - "start", - ["text"," "], - ["support.class","Namespaced"], - ["text","::"], - ["support.class","Class"] -],[ - "start", - ["text"," "], - ["comment","#test: hex tokenizer "] -],[ - "start", - ["text"," "], - ["constant.numeric","0x9a"], - ["text",", "], - ["constant.numeric","0XA1"], - ["text",", "], - ["constant.numeric","0x9_a"], - ["text",", 0"], - ["identifier","x"], - ["text",", 0"], - ["identifier","x_9a"], - ["text",", 0"], - ["identifier","x9a_"], - ["text",","] -],[ - "start", - ["text"," "], - ["comment","#test: float tokenizer"] -],[ - "start", - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["text",", "], - ["constant.numeric","+1"], - ["text",", "], - ["constant.numeric","-1"], - ["text",", "], - ["constant.numeric","12_345"], - ["text",", "], - ["constant.numeric","0.000_1"], - ["text",","] -],[ - "start", - ["text"," "], - ["identifier","_"], - ["text",", "], - ["constant.numeric","3_1"], - ["text",", "], - ["constant.numeric","1_2"], - ["text",", 1"], - ["identifier","_"], - ["text","."], - ["constant.numeric","0"], - ["text",", "], - ["constant.numeric","0"], - ["text","."], - ["identifier","_1"], - ["paren.rparen","]"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["paren.lparen","{"], - ["constant.other.symbol.ruby",":id"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["string.character","?\""], - ["text",", "], - ["constant.other.symbol.ruby",":key"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["string.start","\""], - ["string","value"], - ["string.end","\""], - ["text",", "], - ["identifier","anotherKey"], - ["text",": "], - ["paren.lparen","["], - ["identifier","x"], - ["text",", "], - ["identifier","y"], - ["text","?"], - ["paren.rparen","]}"] -],[ - "start" -],[ - "comment", - ["comment","=begin"] -],[ - "start", - ["comment","=end"] -],[ - "start" -],[ - "comment", - ["comment","=begin x"] -],[ - "comment", - ["comment","=end-"] -],[ - "start", - ["comment","=end x"] -],[ - "start" -],[ - ["heredoc","FOO","heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["text"," "], - ["identifier","herDocs"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["constant","<<"], - ["string","'"], - ["support.class","FOO"], - ["string","'"], - ["text",", "], - ["constant","<<"], - ["string",""], - ["support.class","BAR"], - ["string",""], - ["text",", "], - ["constant","<<-"], - ["string",""], - ["support.class","BAZ"], - ["string",""], - ["text",", "], - ["constant","<<-"], - ["string","`"], - ["support.class","EXEC"], - ["string","`"], - ["paren.rparen","]"], - ["text"," "], - ["comment","#comment"] -],[ - ["heredoc","FOO","heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["string"," FOO #{literal}"] -],[ - ["heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["support.class","FOO"] -],[ - ["heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["string"," BAR #{fact(10)}"] -],[ - ["indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["support.class","BAR"] -],[ - ["indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["string"," BAZ indented"] -],[ - ["indentedHeredoc","EXEC"], - ["string"," "], - ["support.class","BAZ"] -],[ - ["indentedHeredoc","EXEC"], - ["string"," echo hi"] -],[ - "start", - ["string"," "], - ["support.class","EXEC"] -],[ - "start", - ["support.function","puts"], - ["text"," "], - ["identifier","herDocs"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rust.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rust.json deleted file mode 100644 index 6592575b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rust.json +++ /dev/null @@ -1,136 +0,0 @@ -[[ - "start", - ["keyword.source.rust","use"], - ["text"," "], - ["support.constant","core::rand::"], - ["text","RngUtil"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["keyword.source.rust","fn"], - ["meta.function.source.rust"," "], - ["entity.name.function.source.rust","main"], - ["meta.function.source.rust","("], - ["text",") {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","for"], - ["text"," ["], - ["string.quoted.double.source.rust","\"Alice\""], - ["keyword.operator",","], - ["text"," "], - ["string.quoted.double.source.rust","\"Bob\""], - ["keyword.operator",","], - ["text"," "], - ["string.quoted.double.source.rust","\"Carol\""], - ["text","].each |&name| {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","do"], - ["text"," spawn {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","let"], - ["text"," v "], - ["keyword.operator","="], - ["text"," "], - ["support.constant","rand::"], - ["text","Rng().shuffle(["], - ["constant.numeric.integer.source.rust","1"], - ["keyword.operator",","], - ["text"," "], - ["constant.numeric.integer.source.rust","2"], - ["keyword.operator",","], - ["text"," "], - ["constant.numeric.integer.source.rust","3"], - ["text","])"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","for"], - ["text"," v.each |&num| {"] -],[ - "start", - ["text"," print(fmt"], - ["keyword.operator","!"], - ["text","("], - ["string.quoted.double.source.rust","\"%s says: '%d'"], - ["constant.character.escape.source.rust","\\n"], - ["string.quoted.double.source.rust","\""], - ["keyword.operator",","], - ["text"," name"], - ["keyword.operator",","], - ["text"," num "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.integer.source.rust","1"], - ["text","))"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start", - ["keyword.source.rust","fn"], - ["meta.function.source.rust"," "], - ["entity.name.function.source.rust","map"], - ["meta.function.source.rust","("], - ["text","vector: &[T]"], - ["keyword.operator",","], - ["text"," function: &fn(v: &T) "], - ["keyword.operator","->"], - ["text"," U) "], - ["keyword.operator","->"], - ["text"," ~[U] {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","let"], - ["text"," "], - ["keyword.source.rust","mut"], - ["text"," accumulator "], - ["keyword.operator","="], - ["text"," ~[]"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","for"], - ["text"," "], - ["support.constant","vec::"], - ["text","each(vector) |element| {"] -],[ - "start", - ["text"," accumulator.push(function(element))"], - ["keyword.operator",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","return"], - ["text"," accumulator"], - ["keyword.operator",";"] -],[ - "start", - ["text","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sass.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sass.json deleted file mode 100644 index c0b85682..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sass.json +++ /dev/null @@ -1,229 +0,0 @@ -[[ - "start", - ["comment","// sass ace mode;"] -],[ - "start" -],[ - "start", - ["keyword","@import"], - ["text"," "], - ["support.function","url("], - ["string","http://fonts.googleapis.com/css?family=Ace:700"], - ["support.function",")"] -],[ - "start" -],[ - "start", - ["variable.language","html"], - ["text",", "], - ["variable.language","body"] -],[ - "start", - ["support.type"," :background-color "], - ["constant.numeric","#ace"] -],[ - "start", - ["text"," "], - ["support.type","text-align"], - ["text",": "], - ["constant.language","center"] -],[ - "start", - ["text"," "], - ["support.type","height"], - ["text",": "], - ["constant.numeric","100%"] -],[ - ["comment",-1,2,"start"], - ["comment"," /*;*********;"] -],[ - ["comment",3,2,"start"], - ["comment"," ;comment ;"] -],[ - ["comment",3,2,"start"], - ["comment"," ;*********;"] -],[ - "start" -],[ - "start", - ["variable.language",".toggle"] -],[ - "start", - ["text"," "], - ["variable","$size"], - ["text",": "], - ["constant.numeric","14px"] -],[ - "start" -],[ - "start", - ["support.type"," :background "], - ["support.function","url("], - ["string","http://subtlepatterns.com/patterns/dark_stripes.png"], - ["support.function",")"] -],[ - "start", - ["text"," "], - ["support.type","border-radius"], - ["text",": "], - ["constant.numeric","8px"] -],[ - "start", - ["text"," "], - ["support.type","height"], - ["text",": "], - ["variable","$size"] -],[ - "start" -],[ - "start", - ["text"," &"], - ["variable.language",":before"] -],[ - "start", - ["text"," "], - ["variable","$radius"], - ["text",": "], - ["variable","$size"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["constant.numeric","0.845"] -],[ - "start", - ["text"," "], - ["variable","$glow"], - ["text",": "], - ["variable","$size"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["constant.numeric","0.125"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text",": "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["variable","$glow"], - ["text"," "], - ["variable","$glow"], - ["text"," / "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","#fff"] -],[ - "start", - ["text"," "], - ["support.type","border-radius"], - ["text",": "], - ["variable","$radius"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," &"], - ["variable.language",":active"] -],[ - "start", - ["text"," ~ "], - ["variable.language",".button"] -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text",": "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","15px"], - ["text"," "], - ["constant.numeric","25px"], - ["text"," "], - ["constant.numeric","-4px"], - ["text"," "], - ["support.function","rgba"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0.4"], - ["paren.rparen",")"], - ["text"," "] -],[ - "start", - ["text"," ~ "], - ["variable.language",".label"] -],[ - "start", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","40px"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["support.function","rgba"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0.45"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["text"," &"], - ["variable.language",":checked"], - ["text"," "] -],[ - "start", - ["text"," ~ "], - ["variable.language",".button"] -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text",": "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","15px"], - ["text"," "], - ["constant.numeric","25px"], - ["text"," "], - ["constant.numeric","-4px"], - ["text"," "], - ["constant.numeric","#ace"] -],[ - "start", - ["text"," ~ "], - ["variable.language",".label"] -],[ - "start", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","40px"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["constant.numeric","#c9c9c9"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json deleted file mode 100644 index 8f0ff637..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +++ /dev/null @@ -1,194 +0,0 @@ -[[ - "start", - ["comment","// ace can highlight scad!"] -],[ - "start", - ["keyword","module"], - ["text"," "], - ["identifier","Element"], - ["paren.lparen","("], - ["identifier","xpos"], - ["text",", "], - ["identifier","ypos"], - ["text",", "], - ["identifier","zpos"], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["identifier","translate"], - ["paren.lparen","(["], - ["identifier","xpos"], - ["text",","], - ["identifier","ypos"], - ["text",","], - ["identifier","zpos"], - ["paren.rparen","])"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["identifier","union"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","cube"], - ["paren.lparen","(["], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","4"], - ["paren.rparen","]"], - ["text",","], - ["identifier","true"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","cylinder"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","15"], - ["text",","], - ["constant.numeric","5"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","translate"], - ["paren.lparen","(["], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","10"], - ["paren.rparen","])"], - ["identifier","sphere"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t"], - ["paren.rparen","}"] -],[ - "start", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["identifier","union"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["keyword","for"], - ["paren.lparen","("], - ["identifier","i"], - ["keyword.operator","="], - ["paren.lparen","["], - ["constant.numeric","0"], - ["text",":"], - ["constant.numeric","30"], - ["paren.rparen","])"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t# "], - ["identifier","Element"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t"], - ["identifier","Element"], - ["paren.lparen","("], - ["constant.numeric","15"], - ["keyword.operator","*"], - ["identifier","i"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["identifier","i"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","3"], - ["text",", "], - ["constant.numeric","5"], - ["text",", "], - ["constant.numeric","7"], - ["text",", "], - ["constant.numeric","11"], - ["paren.rparen","])"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["identifier","rotate"], - ["paren.lparen","(["], - ["identifier","i"], - ["keyword.operator","*"], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen","])"], - ["identifier","scale"], - ["paren.lparen","(["], - ["constant.numeric","1"], - ["text",","], - ["constant.numeric","1"], - ["text",","], - ["identifier","i"], - ["paren.rparen","])"], - ["identifier","cube"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json deleted file mode 100644 index 01dd3ce3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +++ /dev/null @@ -1,542 +0,0 @@ -[[ - "start", - ["comment","// http://www.scala-lang.org/node/54"] -],[ - "start" -],[ - "start", - ["keyword","package"], - ["text"," "], - ["identifier","examples"], - ["text","."], - ["identifier","actors"] -],[ - "start" -],[ - "start", - ["keyword","import"], - ["text"," "], - ["identifier","scala"], - ["text","."], - ["identifier","actors"], - ["text","."], - ["identifier","Actor"] -],[ - "start", - ["keyword","import"], - ["text"," "], - ["identifier","scala"], - ["text","."], - ["identifier","actors"], - ["text","."], - ["identifier","Actor"], - ["text","."], - ["identifier","_"] -],[ - "start" -],[ - "start", - ["keyword","abstract"], - ["text"," "], - ["keyword","class"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Start"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","SendPing"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Pong"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start" -],[ - "start", - ["keyword","abstract"], - ["text"," "], - ["keyword","class"], - ["text"," "], - ["identifier","PongMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Ping"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PongMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Stop"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PongMessage"] -],[ - "start" -],[ - "start", - ["keyword","object"], - ["text"," "], - ["identifier","pingpong"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Application"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","val"], - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Pong"] -],[ - "start", - ["text"," "], - ["keyword","val"], - ["text"," "], - ["identifier","ping"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Ping"], - ["paren.lparen","("], - ["constant.numeric","100000"], - ["text",", "], - ["identifier","pong"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","ping"], - ["text","."], - ["identifier","start"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text","."], - ["identifier","start"] -],[ - "start", - ["text"," "], - ["identifier","ping"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Start"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Ping"], - ["paren.lparen","("], - ["identifier","count"], - ["text",": "], - ["support.function","Int"], - ["text",", "], - ["identifier","pong"], - ["text",": "], - ["identifier","Actor"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Actor"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","def"], - ["text"," "], - ["identifier","act"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: Initializing with count \""], - ["keyword.operator","+"], - ["identifier","count"], - ["keyword.operator","+"], - ["string","\": \""], - ["keyword.operator","+"], - ["identifier","pong"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","count"] -],[ - "start", - ["text"," "], - ["identifier","loop"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","react"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Start"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: starting.\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Ping"] -],[ - "start", - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","SendPing"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Ping"] -],[ - "start", - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Pong"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["constant.numeric","1000"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: pong from: \""], - ["keyword.operator","+"], - ["identifier","sender"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","self"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","SendPing"] -],[ - "start", - ["text"," "], - ["keyword","else"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: Stop.\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Stop"] -],[ - "start", - ["text"," "], - ["identifier","exit"], - ["paren.lparen","("], - ["symbol.constant","'stop"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Pong"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Actor"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","def"], - ["text"," "], - ["identifier","act"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["identifier","loop"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","react"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Ping"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["constant.numeric","1000"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Pong: ping \""], - ["keyword.operator","+"], - ["identifier","pongCount"], - ["keyword.operator","+"], - ["string","\" from \""], - ["keyword.operator","+"], - ["identifier","sender"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","sender"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Pong"] -],[ - "start", - ["text"," "], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Stop"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Pong: Stop.\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","exit"], - ["paren.lparen","("], - ["symbol.constant","'stop"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scheme.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scheme.json deleted file mode 100644 index 42f4aa65..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scheme.json +++ /dev/null @@ -1,216 +0,0 @@ -[[ - "start", - ["text","("], - ["storage.type.function-type.scheme","define"], - ["text"," "], - ["text","("], - ["identifier","prompt-for-cd"], - ["text",")"] -],[ - "start", - ["text"," "], - ["string","\"Prompts"] -],[ - "start", - ["text"," "], - ["identifier","for"], - ["text"," "], - ["identifier","CD"], - ["text","\""] -],[ - "start", - ["text"," ("], - ["identifier","prompt-read"], - ["text"," "], - ["string","\"Title\""], - ["text"," "], - ["constant.numeric","1.53"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text","/"], - ["constant.numeric","4"], - ["text"," "], - ["constant.numeric","1.7"], - ["text"," "], - ["constant.numeric","1.7e0"], - ["text"," "], - ["constant.numeric","2.9E-4"], - ["text"," "], - ["constant.numeric","+42"], - ["text"," "], - ["constant.numeric","-7"], - ["text"," "], - ["constant.numeric","#b001"], - ["text"," "], - ["constant.numeric","#b001"], - ["text","/"], - ["constant.numeric","100"], - ["text"," "], - ["constant.numeric","#o777"], - ["text"," "], - ["constant.numeric","#O777"], - ["text"," "], - ["constant.numeric","#xabc55"], - ["text"," "], - ["identifier","#c"], - ["text","("], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","-5.6"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","prompt-read"], - ["text"," "], - ["string","\"Artist\""], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.operator","or"], - ["text"," ("], - ["identifier","parse-integer"], - ["text"," ("], - ["identifier","prompt-read"], - ["text"," "], - ["string","\"Rating\""], - ["text",") "], - ["punctuation.definition.constant.character.scheme","#:junk-allowed"], - ["text"," "], - ["constant.language","#t"], - ["text",") "], - ["constant.numeric","0"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","if"], - ["text"," "], - ["identifier","x"], - ["text"," ("], - ["support.function","format"], - ["text"," "], - ["constant.language","#t"], - ["text"," "], - ["string","\"yes\""], - ["text",") ("], - ["support.function","format"], - ["text"," "], - ["constant.language","#f"], - ["text"," "], - ["string","\"no\""], - ["text",") "], - ["comment",";and here comment"] -],[ - "start", - ["text"," ) "] -],[ - "start", - ["text"," "], - ["comment",";; second line comment"] -],[ - "start", - ["text"," '(+ "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["identifier","position-if-not"], - ["text"," "], - ["identifier","char-set"], - ["text",":"], - ["identifier","whitespace"], - ["text"," "], - ["identifier","line"], - ["text"," "], - ["punctuation.definition.constant.character.scheme","#:start"], - ["text"," "], - ["identifier","beg"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["support.function","quote"], - ["text"," ("], - ["identifier","privet"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","3"], - ["text","))"] -],[ - "start", - ["text"," '("], - ["identifier","hello"], - ["text"," "], - ["identifier","world"], - ["text",")"] -],[ - "start", - ["text"," (* "], - ["constant.numeric","5"], - ["text"," "], - ["constant.numeric","7"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","34"], - ["text"," "], - ["constant.numeric","5"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["punctuation.definition.constant.character.scheme","#:use"], - ["text"," "], - ["string","\"aaaa\""], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","let"], - ["text"," (("], - ["identifier","x"], - ["text"," "], - ["constant.numeric","10"], - ["text",") ("], - ["identifier","y"], - ["text"," "], - ["constant.numeric","20"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","display"], - ["text"," (+ "], - ["identifier","x"], - ["text"," "], - ["identifier","y"], - ["text","))"] -],[ - "start", - ["text"," ) "] -],[ - "start" -],[ - "start", - ["text"," "], - ["string","\"asdad"], - ["constant.character.escape.scheme","\\0"], - ["string","eqweqe\""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json deleted file mode 100644 index 7e92f153..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +++ /dev/null @@ -1,123 +0,0 @@ -[[ - "start", - ["comment","/* style.scss */"] -],[ - "start" -],[ - "start", - ["variable.language","#navbar"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","$navbar-width"], - ["text",": "], - ["constant.numeric","800px"], - ["text",";"] -],[ - "start", - ["text"," "], - ["variable","$items"], - ["text",": "], - ["constant.numeric","5"], - ["text",";"] -],[ - "start", - ["text"," "], - ["variable","$navbar-color"], - ["text",": "], - ["constant.numeric","#ce4dd6"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.type","width"], - ["text",": "], - ["variable","$navbar-width"], - ["text",";"] -],[ - "start", - ["text"," "], - ["support.type","border-bottom"], - ["text",": "], - ["constant.numeric","2px"], - ["text"," "], - ["constant.language","solid"], - ["text"," "], - ["variable","$navbar-color"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable.language","li"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","float"], - ["text",": "], - ["support.type","left"], - ["text",";"] -],[ - "start", - ["text"," "], - ["support.type","width"], - ["text",": "], - ["variable","$navbar-width"], - ["text","/"], - ["variable","$items"], - ["text"," "], - ["constant","-"], - ["text"," "], - ["constant.numeric","10px"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.type","background-color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","$navbar-color"], - ["text",", "], - ["constant.numeric","20%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," &"], - ["variable.language",":hover"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","background-color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","$navbar-color"], - ["text",", "], - ["constant.numeric","10%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json deleted file mode 100644 index f2c6b276..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +++ /dev/null @@ -1,334 +0,0 @@ -[[ - "start", - ["comment","#!/bin/sh"] -],[ - "start" -],[ - "start", - ["comment","# Script to open a browser to current branch"] -],[ - "start", - ["comment","# Repo formats:"] -],[ - "start", - ["comment","# ssh git@github.com:richo/gh_pr.git"] -],[ - "start", - ["comment","# http https://richoH@github.com/richo/gh_pr.git"] -],[ - "start", - ["comment","# git git://github.com/richo/gh_pr.git"] -],[ - "start" -],[ - "start", - ["variable","username="], - ["text","`"], - ["identifier","git"], - ["text"," "], - ["identifier","config"], - ["text"," "], - ["keyword.operator","--"], - ["identifier","get"], - ["text"," "], - ["identifier","github"], - ["text","."], - ["identifier","user"], - ["text","`"] -],[ - "start" -],[ - "start", - ["support.function","get_repo()"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","git"], - ["text"," "], - ["identifier","remote"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","v"], - ["text"," | "], - ["identifier","grep"], - ["text"," $"], - ["paren.lparen","{"], - ["text","@:"], - ["keyword.operator","-"], - ["variable","$username"], - ["paren.rparen","}"], - ["text"," | "], - ["keyword","while"], - ["text"," "], - ["keyword","read"], - ["text"," "], - ["identifier","remote"], - ["text","; "], - ["keyword","do"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$remote"], - ["text"," | "], - ["identifier","grep"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","E"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","o"], - ["text"," "], - ["string","\"git@github.com:[^ ]*\""], - ["text","`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$repo"], - ["text"," | "], - ["identifier","sed"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/^git@github\\.com://\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/\\.git$//\""] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$remote"], - ["text"," | "], - ["identifier","grep"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","E"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","o"], - ["text"," "], - ["string","\"https?://([^@]*@)?github.com/[^ ]*\\.git\""], - ["text","`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$repo"], - ["text"," | "], - ["identifier","sed"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s|^https?://||\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/^.*github\\.com\\///\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/\\.git$//\""] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$remote"], - ["text"," | "], - ["identifier","grep"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","E"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","o"], - ["text"," "], - ["string","\"git://github.com/[^ ]*\\.git\""], - ["text","`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$repo"], - ["text"," | "], - ["identifier","sed"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s|^git://github.com/||\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/\\.git$//\""] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["text"," "], - ["keyword","done"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","["], - ["text"," "], - ["variable.language","$?"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","eq"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["paren.rparen","]"], - ["text","; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["string","\"Couldn't find a valid remote\""], - ["text"," "], - ["keyword.operator",">"], - ["support.function","&2"] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["support.function.builtin","echo"], - ["text"," $"], - ["paren.lparen","{"], - ["text","#"], - ["identifier","x"], - ["paren.lparen","["], - ["text","@"], - ["paren.rparen","]}"] -],[ - "start" -],[ - "start", - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["identifier","get_repo"], - ["text"," $@`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["variable","branch="], - ["text","`"], - ["identifier","git"], - ["text"," "], - ["identifier","symbolic"], - ["keyword.operator","-"], - ["identifier","ref"], - ["text"," "], - ["identifier","HEAD"], - ["text"," "], - ["constant.numeric","2"], - ["keyword.operator",">/"], - ["identifier","dev"], - ["keyword.operator","/"], - ["identifier","null"], - ["text","`"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["string","\"http://github.com/"], - ["constant","$repo"], - ["string","/pull/new/${branch##refs/heads/}\""] -],[ - "start", - ["keyword","else"] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["keyword","fi"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sjs.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sjs.json deleted file mode 100644 index 5cd96451..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sjs.json +++ /dev/null @@ -1,276 +0,0 @@ -[[ - "start", - ["storage.type","var"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","each"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","map"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","require"], - ["paren.lparen","("], - ["string","'sjs:sequence'"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["storage.type","var"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["keyword","get"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","require"], - ["paren.lparen","("], - ["string","'sjs:http'"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["entity.name.function","foo"], - ["paren.lparen","("], - ["variable.parameter","items"], - ["punctuation.operator",", "], - ["variable.parameter","nada"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","component"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","name"], - ["punctuation.operator",":"], - ["text"," "], - ["string","\"Ace\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","role"], - ["punctuation.operator",":"], - ["text"," "], - ["string","\"Editor\""], - ["text"," "], - ["paren.rparen","}"], - ["punctuation.operator",";"] -],[ - ["qqstring","no_regex"], - ["text"," "], - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","\""] -],[ - ["qqstring","no_regex"], - ["string"," Welcome, "], - ["paren.lparen","#{"], - ["identifier","component"], - ["text","."], - ["identifier","name"], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["string"," \""], - ["punctuation.operator","."], - ["identifier","trim"], - ["paren.lparen","("], - ["paren.rparen","))"], - ["punctuation.operator",";"] -],[ - ["no_regex"] -],[ - ["no_regex"], - ["text"," "], - ["identifier","logging"], - ["punctuation.operator","."], - ["identifier","debug"], - ["paren.lparen","("], - ["string","`Component added: "], - ["paren.lparen","$"], - ["identifier","String"], - ["paren.lparen","("], - ["identifier","component"], - ["paren.rparen",")"], - ["string"," ("], - ["paren.lparen","${"], - ["identifier","component"], - ["paren.rparen","}"], - ["string",")`"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"] -],[ - ["bstring","no_regex"], - ["text"," "], - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","`"] -],[ - ["string_interp","string_interp","bstring","no_regex"], - ["string"," Welcome, {"], - ["paren.lparen","${"], - ["storage.type","function"], - ["text","() "], - ["paren.lparen","{"] -],[ - ["string_interp","string_interp","bstring","no_regex"], - ["text"," "], - ["keyword","return"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","x"], - ["text",": "], - ["constant.numeric","1"], - ["text",", "], - ["identifier","y"], - ["text",": "], - ["string","\"why?}\""], - ["paren.rparen","}"], - ["text",";"] -],[ - ["bstring","no_regex"], - ["text"," "], - ["paren.rparen","}"], - ["text","()"], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["string"," `"], - ["punctuation.operator","."], - ["identifier","trim"], - ["paren.lparen","("], - ["paren.rparen","))"], - ["punctuation.operator",";"] -],[ - ["no_regex"] -],[ - ["no_regex"], - ["text"," "], - ["keyword","waitfor"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["identifier","each"], - ["punctuation.operator","."], - ["identifier","par"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["paren.rparen","|"], - ["variable.parameter","item"], - ["paren.rparen","|"] -],[ - ["no_regex"], - ["text"," "], - ["keyword","get"], - ["paren.lparen","("], - ["identifier","item"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","lengths"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["identifier","map"], - ["paren.lparen","("], - ["identifier","i"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","i"], - ["punctuation.operator","."], - ["support.constant","length"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","or"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["variable.language","hold"], - ["paren.lparen","("], - ["constant.numeric","1500"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["keyword","throw"], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["variable.language","Error"], - ["paren.lparen","("], - ["string","\"timed out\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["paren.rparen","}"], - ["text","\t"], - ["comment","// Real Tab."] -],[ - ["no_regex"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_smarty.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_smarty.json deleted file mode 100644 index 0f56985d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_smarty.json +++ /dev/null @@ -1,98 +0,0 @@ -[[ - "start", - ["punctuation.section.embedded.begin.smarty","{"], - ["keyword.control.smarty","foreach"], - ["source.smarty"," "], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","foo"], - ["source.smarty"," as "], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["punctuation.section.embedded.end.smarty","}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zig"], - ["punctuation.section.embedded.end.smarty","}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zag"], - ["punctuation.section.embedded.end.smarty","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zig2"], - ["punctuation.section.embedded.end.smarty","}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zag2"], - ["punctuation.section.embedded.end.smarty","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zig3"], - ["punctuation.section.embedded.end.smarty","}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zag3"], - ["punctuation.section.embedded.end.smarty","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["punctuation.section.embedded.begin.smarty","{"], - ["keyword.control.smarty","foreachelse"], - ["punctuation.section.embedded.end.smarty","}"] -],[ - "start", - ["text.xml"," There were no rows found."] -],[ - "start", - ["punctuation.section.embedded.begin.smarty","{"], - ["source.smarty","/"], - ["keyword.control.smarty","foreach"], - ["punctuation.section.embedded.end.smarty","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_snippets.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_snippets.json deleted file mode 100644 index 308683b7..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_snippets.json +++ /dev/null @@ -1,159 +0,0 @@ -[[ - "start", - ["comment","# Function"] -],[ - "start", - ["constant.language.escape","snippet"], - ["text"," fun"] -],[ - "sn-start", - ["text","\tfunction "], - ["markup.list","${"], - ["constant.numeric","1"], - ["text","?:function_name"], - ["markup.list","}"], - ["text","("], - ["markup.list","${"], - ["constant.numeric","2"], - ["punctuation.operator",":"], - ["text","argument"], - ["markup.list","}"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","3"], - ["punctuation.operator",":"], - ["text","// body..."], - ["markup.list","}"] -],[ - "sn-start", - ["text","\t}"] -],[ - "start", - ["comment","# Anonymous Function"] -],[ - "start", - ["constant.language.escape","regex "], - ["keyword","/"], - ["text","((=)\\s*|(:)\\s*|(\\()|\\b)"], - ["keyword","/"], - ["text","f"], - ["keyword","/"], - ["text","(\\))?"], - ["keyword","/"] -],[ - "start", - ["constant.language.escape","name"], - ["text"," f"] -],[ - "sn-start", - ["text","\tfunction"], - ["markup.list","${"], - ["variable","M1"], - ["text","?: "], - ["markup.list","${"], - ["constant.numeric","1"], - ["punctuation.operator",":"], - ["text","functionName"], - ["markup.list","}}"], - ["text","("], - ["variable","$2"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","0"], - ["punctuation.operator",":"], - ["keyword","$TM_SELECTED_TEXT"], - ["markup.list","}"] -],[ - "sn-start", - ["text","\t}"], - ["markup.list","${"], - ["variable","M2"], - ["text","?;"], - ["markup.list","}${"], - ["variable","M3"], - ["text","?,"], - ["markup.list","}${"], - ["variable","M4"], - ["text","?)"], - ["markup.list","}"] -],[ - "start", - ["comment","# Immediate function"] -],[ - "start", - ["constant.language.escape","trigger"], - ["text"," \\(?f\\("] -],[ - "start", - ["constant.language.escape","endTrigger"], - ["text"," \\)?"] -],[ - "start", - ["constant.language.escape","snippet"], - ["text"," f("] -],[ - "sn-start", - ["text","\t(function("], - ["markup.list","${"], - ["constant.numeric","1"], - ["markup.list","}"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","0"], - ["punctuation.operator",":"], - ["markup.list","${"], - ["keyword","TM_SELECTED_TEXT"], - ["punctuation.operator",":"], - ["text","/* code */"], - ["markup.list","}}"] -],[ - "sn-start", - ["text","\t}("], - ["markup.list","${"], - ["constant.numeric","1"], - ["markup.list","}"], - ["text","));"] -],[ - "start", - ["comment","# if"] -],[ - "start", - ["constant.language.escape","snippet"], - ["text"," if"] -],[ - "sn-start", - ["text","\tif ("], - ["markup.list","${"], - ["constant.numeric","1"], - ["punctuation.operator",":"], - ["text","true"], - ["markup.list","}"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","0"], - ["markup.list","}"] -],[ - "sn-start", - ["text","\t}"] -],[ - "sn-start", - ["text","\t"] -],[ - "sn-start", - ["text","\t"] -],[ - "sn-start", - ["text","\t"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_soy_template.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_soy_template.json deleted file mode 100644 index 9ae7c4ed..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_soy_template.json +++ /dev/null @@ -1,286 +0,0 @@ -[[ - "punctuation.definition.comment.begin.soy1", - ["punctuation.definition.comment.begin.soy","/**"] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * Greets a person using \"Hello\" by default."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param"], - ["text"," "], - ["variable.parameter.soy","name"], - ["comment.block.documentation.soy"," The name of the person."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param?"], - ["text"," "], - ["variable.parameter.soy","greetingWord"], - ["comment.block.documentation.soy"," Optional greeting word to use instead of \"Hello\"."] -],[ - "start", - ["comment.block.documentation.soy"," "], - ["punctuation.definition.comment.end.soy","*/"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","template"], - ["text"," "], - ["entity.name.function.soy",".helloName"], - ["meta.tag.template.soy"," #eee"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","if"], - ["meta.tag.if.soy"," "], - ["keyword.operator.soy","not"], - ["meta.tag.if.soy"," "], - ["variable.other.soy","$greetingWord"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," Hello "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$name"], - ["punctuation.definition.tag.end.soy","}"], - ["text.xml","!"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["text","else"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$greetingWord"], - ["punctuation.definition.tag.end.soy","}"], - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$name"], - ["punctuation.definition.tag.end.soy","}"], - ["text.xml","!"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","if"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.template.soy","template"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "punctuation.definition.comment.begin.soy1", - ["punctuation.definition.comment.begin.soy","/**"] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * Greets a person and optionally a list of other people."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param"], - ["text"," "], - ["variable.parameter.soy","name"], - ["comment.block.documentation.soy"," The name of the person."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param"], - ["text"," "], - ["variable.parameter.soy","additionalNames"], - ["comment.block.documentation.soy"," The additional names to greet. May be an empty list."] -],[ - "start", - ["comment.block.documentation.soy"," "], - ["punctuation.definition.comment.end.soy","*/"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","template"], - ["text"," "], - ["entity.name.function.soy",".helloNames"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["comment.line.double-slash.soy"," "], - ["punctuation.definition.comment.soy","//"], - ["comment.line.double-slash.soy"," Greet the person."] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","call"], - ["variable.parameter.soy"," .helloName"], - ["meta.tag.call.soy"," "], - ["entity.other.attribute-name.soy","data"], - ["keyword.operator.soy","="], - ["string.quoted.double","\"all\""], - ["meta.tag.call.soy"," /"], - ["punctuation.definition.tag.end.soy","}"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","br"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["comment.line.double-slash.soy"," "], - ["punctuation.definition.comment.soy","//"], - ["comment.line.double-slash.soy"," Greet the additional people."] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","foreach"], - ["meta.tag.foreach.soy"," "], - ["variable.other.soy","$additionalName"], - ["meta.tag.foreach.soy"," "], - ["keyword.operator.soy","in"], - ["meta.tag.foreach.soy"," "], - ["variable.other.soy","$additionalNames"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","call"], - ["variable.parameter.soy"," .helloName"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","param"], - ["meta.tag.param.soy"," "], - ["entity.other.attribute-name.soy","name"], - ["keyword.operator.soy",":"], - ["meta.tag.param.soy"," "], - ["variable.other.soy","$additionalName"], - ["meta.tag.param.soy"," /"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.call.soy","call"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","if"], - ["meta.tag.if.soy"," "], - ["keyword.operator.soy","not"], - ["meta.tag.if.soy"," "], - ["support.function.soy","isLast"], - ["meta.tag.if.soy","("], - ["variable.other.soy","$additionalName"], - ["meta.tag.if.soy",")"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","br"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["comment.line.double-slash.soy"," "], - ["punctuation.definition.comment.soy","//"], - ["comment.line.double-slash.soy"," break after every line except the last"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","if"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["text","ifempty"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," No additional people to greet."] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","foreach"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.template.soy","template"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","foreach"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","if"], - ["meta.tag.if.soy"," "], - ["support.function.soy","length"], - ["meta.tag.if.soy","("], - ["variable.other.soy","$items"], - ["meta.tag.if.soy",") > 5"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","msg"], - ["meta.tag.msg.soy"," "], - ["entity.other.attribute-name.soy","desc"], - ["keyword.operator.soy","="], - ["string.quoted.double","\"Says hello to the user.\""], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","namespace"], - ["text"," "], - ["variable.parameter.soy","ns"], - ["text"," autoescape=\"contextual\""], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "start", - ["punctuation.definition.comment.begin.soy","/**"], - ["comment.block.documentation.soy"," Example. "], - ["punctuation.definition.comment.end.soy","*/"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","template"], - ["text"," "], - ["entity.name.function.soy",".example"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," foo is "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$ij.foo"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.template.soy","template"], - ["punctuation.definition.tag.end.soy","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_space.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_space.json deleted file mode 100644 index 918b9a67..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_space.json +++ /dev/null @@ -1,322 +0,0 @@ -[[ - "start", - ["variable","query"] -],[ - "start", - ["empty_line"," "], - ["variable","count"], - ["keyword.operator"," "], - ["string","10"] -],[ - "start", - ["empty_line"," "], - ["variable","created"], - ["keyword.operator"," "], - ["string","2011-06-21T08:10:46Z"] -],[ - "start", - ["empty_line"," "], - ["variable","lang"], - ["keyword.operator"," "], - ["string","en-US"] -],[ - "start", - ["empty_line"," "], - ["variable","results"] -],[ - "start", - ["empty_line"," "], - ["variable","photo"] -],[ - "start", - ["empty_line"," "], - ["variable","0"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","6"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5855620975"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","f1f5e8515d"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","5110"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","7087 bandit cat"] -],[ - "start", - ["empty_line"," "], - ["variable","1"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","4"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856170534"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","ff1efb2a6f"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","3217"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","6975 rusty cat"] -],[ - "start", - ["empty_line"," "], - ["variable","2"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","6"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856172972"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","51249875@N03"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","6c6887347c"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","5192"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","watermarked-cats"] -],[ - "start", - ["empty_line"," "], - ["variable","3"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","6"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856168328"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","0c1cfdf64c"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","5078"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","7020 mandy cat"] -],[ - "start", - ["empty_line"," "], - ["variable","4"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","3"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856171774"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","7f5a3180ab"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","2696"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","7448 bobby cat"] -],[ - "key" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json deleted file mode 100644 index 09a3ef99..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +++ /dev/null @@ -1,54 +0,0 @@ -[[ - "start", - ["keyword","SELECT"], - ["text"," "], - ["identifier","city"], - ["text",", "], - ["support.function","COUNT"], - ["paren.lparen","("], - ["identifier","id"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["identifier","users_count"] -],[ - "start", - ["keyword","FROM"], - ["text"," "], - ["identifier","users"] -],[ - "start", - ["keyword","WHERE"], - ["text"," "], - ["identifier","group_name"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'salesman'"] -],[ - "start", - ["keyword","AND"], - ["text"," "], - ["identifier","created"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["string","'2011-05-21'"] -],[ - "start", - ["keyword","GROUP"], - ["text"," "], - ["keyword","BY"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["keyword","ORDER"], - ["text"," "], - ["keyword","BY"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["keyword","DESC"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_stylus.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_stylus.json deleted file mode 100644 index f24993f7..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_stylus.json +++ /dev/null @@ -1,271 +0,0 @@ -[[ - "start", - ["comment","// I'm a comment!"] -],[ - "start" -],[ - "comment", - ["comment","/*"] -],[ - "comment", - ["comment"," * Adds the given numbers together."] -],[ - "start", - ["comment"," */"] -],[ - "start" -],[ - "start" -],[ - "comment", - ["comment","/*!"] -],[ - "comment", - ["comment"," * Adds the given numbers together."] -],[ - "start", - ["comment"," */"] -],[ - "start" -],[ - "start" -],[ - "start", - ["entity.name.function.stylus","asdasdasdad"], - ["text","("], - ["text","df, ad"], - ["keyword.operator.stylus","="], - ["constant.numeric","23"], - ["text",")"] -],[ - "start" -],[ - "start", - ["entity.name.function.stylus","add"], - ["text","("], - ["entity.name.tag.stylus","a"], - ["text",", "], - ["entity.name.tag.stylus","b"], - ["text"," "], - ["keyword.operator.stylus","="], - ["text"," "], - ["entity.name.tag.stylus","a"], - ["text",")"] -],[ - "start", - ["text"," "], - ["entity.name.tag.stylus","a"], - ["text"," "], - ["keyword.operator.stylus","+"], - ["text"," "], - ["entity.name.tag.stylus","b"] -],[ - "start", - ["entity.name.function.stylus","green"], - ["text","("], - ["constant.numeric","#0c0"], - ["text",")"] -],[ - "start", - ["text"," add("], - ["constant.numeric","10"], - ["text",", "], - ["constant.numeric","5"], - ["text",")"] -],[ - "start", - ["text"," "], - ["comment","// => 15"] -],[ - "start" -],[ - "start", - ["text"," add("], - ["constant.numeric","10"], - ["text",")"] -],[ - "start", - ["text"," add("], - ["entity.name.tag.stylus","a"], - ["text",", "], - ["entity.name.tag.stylus","b"], - ["text",")"] -],[ - "start" -],[ - "start", - ["entity.language.stylus"," &"], - ["text","asdasd"] -],[ - "start" -],[ - "start", - ["text"," ("], - ["variable.language.stylus","arguments"], - ["text",")"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.stylus","@sdfsdf"] -],[ - "start", - ["entity.other.attribute-name.class.stylus",".signatures"] -],[ - "start", - ["text"," "], - ["support.type","background-color"], - ["text"," "], - ["constant.numeric","#e0e8e0"] -],[ - "start", - ["text"," "], - ["support.type","border"], - ["text"," "], - ["constant.numeric","1"], - ["keyword","px"], - ["text"," "], - ["support.constant","solid"], - ["text"," grayLighter"] -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","3"], - ["keyword","px"], - ["text"," grayLightest"] -],[ - "start", - ["text"," "], - ["support.type","border-radius"], - ["text"," "], - ["constant.numeric","3"], - ["keyword","px"] -],[ - "start", - ["text"," "], - ["support.type","padding"], - ["text"," "], - ["constant.numeric","3"], - ["keyword","px"], - ["text"," "], - ["constant.numeric","5"], - ["keyword","px"] -],[ - "start", - ["text"," "], - ["string","\"adsads\""] -],[ - "start", - ["text"," "], - ["support.type","margin-left"], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["support.type","list-style"], - ["text"," "], - ["support.constant","none"] -],[ - "start", - ["entity.other.attribute-name.class.stylus",".signature"] -],[ - "start", - ["text"," "], - ["support.type","list-style"], - ["text"," "], - ["support.constant","none"] -],[ - "start", - ["text"," "], - ["support.type","display"], - ["text",": "], - ["support.constant","inline"] -],[ - "start", - ["text"," "], - ["support.type","margin-left"], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["keyword.operator.stylus",">"], - ["text"," "], - ["entity.name.tag.stylus","li"] -],[ - "start", - ["text"," "], - ["support.type","display"], - ["text"," "], - ["support.constant","inline"] -],[ - "start", - ["keyword.operator.stylus","is"], - ["text"," "], - ["keyword.operator.stylus","not"] -],[ - "start", - ["entity.other.attribute-name.class.stylus",".signature-values"] -],[ - "start", - ["text"," "], - ["support.type","list-style"], - ["text"," "], - ["support.constant","none"] -],[ - "start", - ["text"," "], - ["support.type","display"], - ["text"," "], - ["support.constant","inline"] -],[ - "start", - ["text"," "], - ["support.type","margin-left"], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["entity.language.stylus"," &"], - ["punctuation",":"], - ["entity.other.attribute-name.pseudo-element.css","before"] -],[ - "start", - ["text"," "], - ["support.type","content"], - ["text"," "], - ["string","'→'"] -],[ - "start", - ["text"," "], - ["support.type","margin"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","5"], - ["keyword","px"] -],[ - "start", - ["text"," "], - ["keyword.operator.stylus",">"], - ["text"," "], - ["entity.name.tag.stylus","li"] -],[ - "start", - ["text"," "], - ["keyword.control.stylus","!important"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.stylus","unless"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json deleted file mode 100644 index 66ebae75..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +++ /dev/null @@ -1,684 +0,0 @@ -[[ - "meta.tag.punctuation.tag-open.xml1", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","svg"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"800\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","height"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"600\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","xmlns"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"http://www.w3.org/2000/svg\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","onload"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"StartAnimation(evt)\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Test Tube Progress Bar"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","desc"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Created for the Web Directions SVG competition"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "js-no_regex", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"text/ecmascript\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["string.cdata.xml",""], - ["text"," "], - ["identifier","max_time"], - ["paren.rparen",")"] -],[ - "js-start", - ["text"," "], - ["keyword","return"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["comment","// Scale the text string gradually until it is 20 times larger"] -],[ - "js-start", - ["text"," "], - ["identifier","scalefactor"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["constant.numeric","650"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["identifier","max_time"], - ["punctuation.operator",";"] -],[ - "js-start" -],[ - "js-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["constant.numeric","30"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["identifier","hickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"display\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["identifier","hickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"transform\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"translate(\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","600"], - ["keyword.operator","+"], - ["identifier","scalefactor"], - ["keyword.operator","*"], - ["constant.numeric","3"], - ["keyword.operator","*"], - ["constant.numeric","-1"], - ["text"," "], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\", -144 )\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex" -],[ - "js-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","30"], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["constant.numeric","66"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["identifier","dickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"display\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["identifier","dickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"transform\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"translate(\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","-795"], - ["keyword.operator","+"], - ["identifier","scalefactor"], - ["keyword.operator","*"], - ["constant.numeric","2"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\", 0 )\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","66"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["identifier","dock"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"display\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["identifier","dock"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"transform\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"translate(\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","1450"], - ["keyword.operator","+"], - ["identifier","scalefactor"], - ["keyword.operator","*"], - ["constant.numeric","2"], - ["keyword.operator","*"], - ["constant.numeric","-1"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\", 144 )\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex" -],[ - "js-no_regex", - ["text"," "], - ["comment","// Call ShowAndGrowElement again milliseconds later."] -],[ - "js-no_regex", - ["text"," "], - ["identifier","setTimeout"], - ["paren.lparen","("], - ["string","\"ShowAndGrowElement()\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","timer_increment"], - ["paren.rparen",")"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex", - ["text"," "], - ["variable.language","window"], - ["punctuation.operator","."], - ["identifier","ShowAndGrowElement"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","ShowAndGrowElement"] -],[ - "start", - ["text"," "], - ["string.cdata.xml","]]>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","rect"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","fill"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"#2e3436\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","fill-rule"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"nonzero\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","stroke-width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"3\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"0\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"0\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","height"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"600\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"800\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"rect3590\""], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start" -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","text"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","style"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"50\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"350\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"hickory\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","display"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"none\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," Hickory,"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","text"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","style"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"50\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"350\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"dickory\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","display"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"none\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," dickory,"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","text"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","style"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"50\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"350\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"dock\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","display"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"none\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," dock!"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json deleted file mode 100644 index 6a032ddc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +++ /dev/null @@ -1,385 +0,0 @@ -[[ - "commandItem" -],[ - "commandItem", - ["keyword","proc"], - ["text"," "], - ["identifier","dijkstra"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","graph"], - ["text"," "], - ["identifier","origin"], - ["paren.rparen","}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","# Initialize"] -],[ - "commandItem", - ["text"," "], - ["keyword","dict"], - ["text"," "], - ["identifier","for"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","vertex"], - ["text"," "], - ["identifier","distmap"], - ["paren.rparen","}"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","dist"], - ["text"," "], - ["variable.instance","$vertex"], - ["text"," "], - ["identifier","Inf"] -],[ - "commandItem", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","path"], - ["text"," "], - ["variable.instance","$vertex"], - ["text"," "], - ["paren.lparen","{"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","dist"], - ["text"," "], - ["variable.instance","$origin"], - ["text"," 0"] -],[ - "start", - ["text"," "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","path"], - ["text"," "], - ["variable.instance","$origin"], - ["text"," "], - ["paren.lparen","["], - ["keyword","list"], - ["text"," "], - ["variable.instance","$origin"], - ["paren.rparen","]"] -],[ - "commandItem", - ["text"," "] -],[ - "commandItem", - ["text"," "], - ["keyword","while"], - ["text"," "], - ["paren.lparen","{"], - ["text","["], - ["keyword","dict"], - ["text"," "], - ["identifier","size"], - ["text"," "], - ["variable.instance","$graph"], - ["paren.rparen","]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["comment","# Find unhandled node with least weight"] -],[ - "start", - ["text","\t"], - ["keyword","set"], - ["text"," "], - ["identifier","d"], - ["text"," "], - ["identifier","Inf"] -],[ - "commandItem", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","for"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","uu"], - ["text"," "], - ["support.function","-"], - ["paren.rparen","}"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["paren.lparen","{"] -],[ - "commandItem", - ["text","\t "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$d"], - ["text"," "], - ["support.function",">"], - ["text"," "], - ["paren.lparen","["], - ["keyword","set"], - ["text"," "], - ["identifier","dd"], - ["text"," "], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$dist"], - ["text"," "], - ["variable.instance","$uu"], - ["paren.rparen","]]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword","set"], - ["text"," "], - ["identifier","u"], - ["text"," "], - ["variable.instance","$uu"] -],[ - "start", - ["text","\t\t"], - ["keyword","set"], - ["text"," "], - ["identifier","d"], - ["text"," "], - ["variable.instance","$dd"] -],[ - "commandItem", - ["text","\t "], - ["paren.rparen","}"] -],[ - "commandItem", - ["text","\t"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text"," "] -],[ - "start", - ["text","\t"], - ["comment","# No such node; graph must be disconnected"] -],[ - "start", - ["text","\t"], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$d"], - ["text"," "], - ["support.function","=="], - ["text"," "], - ["identifier","Inf"], - ["paren.rparen","}"], - ["text"," "], - ["identifier","break"] -],[ - "commandItem", - ["text"," "] -],[ - "commentfollow", - ["text","\t"], - ["comment","# Update the weights for nodes\\"] -],[ - "start", - ["comment","\t lead to by the node we've picked"] -],[ - "commandItem", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","for"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","v"], - ["text"," "], - ["identifier","dd"], - ["paren.rparen","}"], - ["text"," "], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["variable.instance","$u"], - ["paren.rparen","]"], - ["text"," "], - ["paren.lparen","{"] -],[ - "commandItem", - ["text","\t "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["text","["], - ["keyword","dict"], - ["text"," "], - ["identifier","exists"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["variable.instance","$v"], - ["paren.rparen","]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword","set"], - ["text"," "], - ["identifier","alt"], - ["text"," "], - ["paren.lparen","["], - ["keyword","expr"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$d"], - ["text"," "], - ["support.function","+"], - ["text"," "], - ["variable.instance","$dd"], - ["paren.rparen","}]"] -],[ - "commandItem", - ["text","\t\t"], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$alt"], - ["text"," "], - ["support.function","<"], - ["text"," "], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$dist"], - ["text"," "], - ["variable.instance","$v"], - ["paren.rparen","]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","dist"], - ["text"," "], - ["variable.instance","$v"], - ["text"," "], - ["variable.instance","$alt"] -],[ - "start", - ["text","\t\t "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","path"], - ["text"," "], - ["variable.instance","$v"], - ["text"," "], - ["paren.lparen","["], - ["keyword","list"], - ["text"," "], - ["support.function","{*}"], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$path"], - ["text"," "], - ["variable.instance","$u"], - ["paren.rparen","]"], - ["text"," "], - ["variable.instance","$v"], - ["paren.rparen","]"] -],[ - "commandItem", - ["text","\t\t"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text","\t "], - ["paren.rparen","}"] -],[ - "commandItem", - ["text","\t"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text"," "] -],[ - "start", - ["text","\t"], - ["comment","# Remove chosen node from graph still to be handled"] -],[ - "start", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","unset"], - ["text"," "], - ["identifier","graph"], - ["text"," "], - ["variable.instance","$u"] -],[ - "commandItem", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["paren.lparen","["], - ["keyword","list"], - ["text"," "], - ["variable.instance","$dist"], - ["text"," "], - ["variable.instance","$path"], - ["paren.rparen","]"] -],[ - "commandItem", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tex.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tex.json deleted file mode 100644 index 2d023676..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tex.json +++ /dev/null @@ -1,130 +0,0 @@ -[[ - "start", - ["text","The quadratic formula is $$-b "], - ["keyword","\\pm"], - ["text"," "], - ["keyword","\\sqrt"], - ["paren.keyword.operator","{"], - ["text","b^2 - 4ac"], - ["paren.keyword.operator","}"], - ["text"," "], - ["keyword","\\over"], - ["text"," 2a$$"] -],[ - "start", - ["keyword","\\bye"] -],[ - "start" -],[ - "start", - ["keyword","\\makeatletter"] -],[ - "start", - ["text"," "], - ["keyword","\\newcommand"], - ["paren.keyword.operator","{"], - ["keyword","\\be"], - ["paren.keyword.operator","}{"], - ["comment","%"] -],[ - "start", - ["text"," "], - ["keyword","\\begingroup"] -],[ - "start", - ["text"," "], - ["comment","% \\setlength{\\arraycolsep}{2pt}"] -],[ - "start", - ["text"," "], - ["keyword","\\eqnarray"], - ["comment","%"] -],[ - "start", - ["text"," "], - ["keyword","\\@"], - ["text","ifstar"], - ["paren.keyword.operator","{"], - ["keyword","\\nonumber"], - ["paren.keyword.operator","}{}"], - ["comment","%"] -],[ - "start", - ["text"," "], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\newcommand"], - ["paren.keyword.operator","{"], - ["keyword","\\ee"], - ["paren.keyword.operator","}{"], - ["keyword","\\endeqnarray\\endgroup"], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\makeatother"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","\\begin"], - ["paren.keyword.operator","{"], - ["nospell.text","equation"], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," x="], - ["keyword","\\left\\"], - ["paren.keyword.operator","{"], - ["text"," "], - ["keyword","\\begin"], - ["paren.keyword.operator","{"], - ["nospell.text","array"], - ["paren.keyword.operator","}{"], - ["text","cl"], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," 0 & "], - ["keyword","\\textrm"], - ["paren.keyword.operator","{"], - ["text","if "], - ["paren.keyword.operator","}"], - ["text","A="], - ["keyword","\\ldots\\\\"] -],[ - "start", - ["text"," 1 & "], - ["keyword","\\textrm"], - ["paren.keyword.operator","{"], - ["text","if "], - ["paren.keyword.operator","}"], - ["text","B="], - ["keyword","\\ldots\\\\"] -],[ - "start", - ["text"," x & "], - ["keyword","\\textrm"], - ["paren.keyword.operator","{"], - ["text","this runs with as much text as you like, but without an raggeright text"] -],[ - "start", - ["text","."], - ["paren.keyword.operator","}"], - ["keyword","\\end"], - ["paren.keyword.operator","{"], - ["nospell.text","array"], - ["paren.keyword.operator","}"], - ["keyword","\\right"], - ["text","."] -],[ - "start", - ["text"," "], - ["keyword","\\end"], - ["paren.keyword.operator","{"], - ["nospell.text","equation"], - ["paren.keyword.operator","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json deleted file mode 100644 index fff7ef42..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +++ /dev/null @@ -1,29 +0,0 @@ -[[ - "start", - ["text","Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."] -],[ - "start" -],[ - "start", - ["text","Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."] -],[ - "start" -],[ - "start", - ["text","Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."] -],[ - "start" -],[ - "start", - ["text","Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat."] -],[ - "start" -],[ - "start", - ["text","Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis."] -],[ - "start" -],[ - "start", - ["text","At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json deleted file mode 100644 index 59000ce3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +++ /dev/null @@ -1,113 +0,0 @@ -[[ - "start", - ["markup.heading.1","h1"], - ["keyword",". "], - ["text","Textile document"] -],[ - "start" -],[ - "start", - ["markup.heading.2","h2"], - ["keyword",". "], - ["text","Heading Two"] -],[ - "start" -],[ - "start", - ["markup.heading.3","h3"], - ["keyword",". "], - ["text","A two-line"] -],[ - "start", - ["text"," header"] -],[ - "start" -],[ - "start", - ["markup.heading.2","h2"], - ["keyword",". "], - ["text","Another two-line"] -],[ - "start", - ["text","header"] -],[ - "start" -],[ - "start", - ["text","Paragraph:"] -],[ - "start", - ["text","one, two,"] -],[ - "start", - ["text","thee lines!"] -],[ - "start" -],[ - "start", - ["markup.heading","p"], - ["keyword","("], - ["string","classone"], - ["text"," "], - ["string","two"], - ["text"," "], - ["string","three"], - ["keyword","). "], - ["text","This is a paragraph with classes"] -],[ - "start" -],[ - "start", - ["markup.heading","p"], - ["keyword","(#"], - ["string","id"], - ["keyword","). "], - ["text","(one with an id)"] -],[ - "start" -],[ - "start", - ["markup.heading","p"], - ["keyword","("], - ["string","one"], - ["text"," "], - ["string","two"], - ["text"," "], - ["string","three"], - ["keyword","#"], - ["string","my_id"], - ["keyword","). "], - ["text","..classes + id"] -],[ - "start" -],[ - "start", - ["keyword","*"], - ["text"," Unordered list"] -],[ - "start", - ["keyword","**"], - ["text"," sublist"] -],[ - "start", - ["keyword","*"], - ["text"," back again!"] -],[ - "start", - ["keyword","**"], - ["text"," sublist again.."] -],[ - "start" -],[ - "start", - ["keyword","#"], - ["text"," ordered"] -],[ - "start" -],[ - "start", - ["text","bg. Blockquote!"] -],[ - "start", - ["text"," This is a two-list blockquote..!"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_toml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_toml.json deleted file mode 100644 index ec471f74..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_toml.json +++ /dev/null @@ -1,131 +0,0 @@ -[[ - "start", - ["comment.toml","# This is a TOML document. Boom."] -],[ - "start" -],[ - "start", - ["identifier","title"], - ["text"," = "], - ["string","\"TOML Example\""] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[owner]"] -],[ - "start", - ["identifier","name"], - ["text"," = "], - ["string","\"Tom Preston-Werner\""] -],[ - "start", - ["identifier","organization"], - ["text"," = "], - ["string","\"GitHub\""] -],[ - "start", - ["identifier","bio"], - ["text"," = "], - ["string","\"GitHub Cofounder & CEO"], - ["constant.language.escape","\\n"], - ["string","Likes tater tots and beer.\""] -],[ - "start", - ["identifier","dob"], - ["text"," = "], - ["support.date.toml","1979-05-27T07:32:00Z"], - ["text"," "], - ["comment.toml","# First class dates? Why not?"] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[database]"] -],[ - "start", - ["identifier","server"], - ["text"," = "], - ["string","\"192.168.1.1\""] -],[ - "start", - ["identifier","ports"], - ["text"," = [ "], - ["constant.numeric.toml","8001"], - ["text",", "], - ["constant.numeric.toml","8001"], - ["text",", "], - ["constant.numeric.toml","8002"], - ["text"," ]"] -],[ - "start", - ["identifier","connection_max"], - ["text"," = "], - ["constant.numeric.toml","5000"] -],[ - "start", - ["identifier","enabled"], - ["text"," = "], - ["constant.language.boolean","true"] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[servers]"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment.toml","# You can indent as you please. Tabs or spaces. TOML don't care."] -],[ - "start", - ["variable.keygroup.toml"," [servers.alpha]"] -],[ - "start", - ["text"," "], - ["identifier","ip"], - ["text"," = "], - ["string","\"10.0.0.1\""] -],[ - "start", - ["text"," "], - ["identifier","dc"], - ["text"," = "], - ["string","\"eqdc10\""] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml"," [servers.beta]"] -],[ - "start", - ["text"," "], - ["identifier","ip"], - ["text"," = "], - ["string","\"10.0.0.2\""] -],[ - "start", - ["text"," "], - ["identifier","dc"], - ["text"," = "], - ["string","\"eqdc10\""] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[clients]"] -],[ - "start", - ["identifier","data"], - ["text"," = [ ["], - ["string","\"gamma\""], - ["text",", "], - ["string","\"delta\""], - ["text","], ["], - ["constant.numeric.toml","1"], - ["text",", "], - ["constant.numeric.toml","2"], - ["text","] ] "], - ["comment.toml","# just an update to make sure parsers support it"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_twig.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_twig.json deleted file mode 100644 index ada8b4a7..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_twig.json +++ /dev/null @@ -1,288 +0,0 @@ -[[ - "start", - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","My Webpage"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"navigation\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","for"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["keyword.operator.twig","in"], - ["text"," "], - ["identifier","navigation"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","item"], - ["punctuation.operator","."], - ["identifier","href"], - ["keyword.operator.other","|"], - ["support.function.twig","escape"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","item"], - ["punctuation.operator","."], - ["identifier","caption"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","endfor"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","if"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator.twig","not"], - ["text"," "], - ["keyword.operator.twig","in"], - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","2"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","3"], - ["paren.rparen","]"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["comment.block.twig","{# is equivalent to #}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","if"], - ["text"," "], - ["keyword.operator.twig","not"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator.twig","in"], - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","2"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","3"], - ["paren.rparen","])"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","autoescape"], - ["text"," "], - ["constant.language.boolean","true"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","var"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","var"], - ["keyword.operator.other","|"], - ["support.function.twig","raw"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["text.xml"," "], - ["comment.block.twig","{# var won't be escaped #}"] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","var"], - ["keyword.operator.other","|"], - ["support.function.twig","escape"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["text.xml"," "], - ["comment.block.twig","{# var won't be doubled-escaped #}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","endautoescape"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["keyword.control.twig","include"], - ["paren.lparen","("], - ["string","'twig.html'"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","sandboxed"], - ["text"," "], - ["keyword.operator.assignment","="], - ["text"," "], - ["constant.language.boolean","true"], - ["paren.rparen",")"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["string","\"string "], - ["constant.language.escape","#{with}"], - ["string"," "], - ["constant.language.escape","\\\""], - ["string"," escapes\""], - ["text"," "], - ["string","'another#one'"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h1"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","My Webpage"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","a_variable"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_typescript.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_typescript.json deleted file mode 100644 index 18f2eea6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_typescript.json +++ /dev/null @@ -1,559 +0,0 @@ -[[ - "start", - ["keyword.operator.ts","class"], - ["text"," "], - ["identifier","Greeter"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["variable.parameter.function.ts","greeting"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["punctuation.operator",";"] -],[ - "start", - ["text","\t"], - ["keyword.operator.ts","constructor"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter.function.ts","message"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","message"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["text","\t"], - ["identifier","greet"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword","return"], - ["text"," "], - ["string","\"Hello, \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text","\t"], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"], - ["text"," "] -],[ - "no_regex" -],[ - "start", - ["storage.type","var"], - ["text"," "], - ["identifier","greeter"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Greeter"], - ["paren.lparen","("], - ["string","\"world\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "no_regex", - ["storage.type","var"], - ["text"," "], - ["identifier","button"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["variable.language","document"], - ["punctuation.operator","."], - ["support.function.dom","createElement"], - ["paren.lparen","("], - ["string","'button'"], - ["paren.rparen",")"] -],[ - "no_regex", - ["identifier","button"], - ["punctuation.operator","."], - ["identifier","innerText"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"Say Hello\""] -],[ - "start", - ["storage.type","button"], - ["punctuation.operator","."], - ["entity.name.function","onclick"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","function"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "no_regex", - ["text","\t"], - ["support.function","alert"], - ["paren.lparen","("], - ["entity.name.function.ts","greeter.greet"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.rparen",")"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "no_regex", - ["variable.language","document"], - ["punctuation.operator","."], - ["identifier","body"], - ["punctuation.operator","."], - ["support.function.dom","appendChild"], - ["paren.lparen","("], - ["identifier","button"], - ["paren.rparen",")"] -],[ - "no_regex" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Snake"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Animal"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["entity.name.function.ts","move"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["string","\"Slithering...\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","super"], - ["text","("], - ["keyword.other.ts","5"], - ["text",")"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Horse"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Animal"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["entity.name.function.ts","move"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["string","\"Galloping...\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","super"], - ["punctuation.operator","."], - ["identifier","move"], - ["paren.lparen","("], - ["constant.numeric","45"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "start", - ["identifier","module"], - ["text"," "], - ["identifier","Sayings"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","export"], - ["text"," "], - ["keyword.operator.ts","class"], - ["text"," "], - ["identifier","Greeter"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable.parameter.function.ts","greeting"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","constructor"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter.function.ts","message"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","message"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","greet"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["string","\"Hello, \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "start", - ["identifier","module"], - ["text"," "], - ["identifier","Mankala"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","export"], - ["text"," "], - ["keyword.operator.ts","class"], - ["text"," "], - ["identifier","Features"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","turnContinues"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.language.boolean","false"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","seedStoredCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","spaceCaptured"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","NoSpace"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["entity.name.function.ts","clear"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","turnContinues"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.language.boolean","false"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","seedStoredCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","spaceCaptured"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","NoSpace"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "start", - ["text"," "], - ["keyword","public"], - ["text"," "], - ["identifier","toString"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"\""], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["storage.type.variable.ts","this."], - ["identifier","turnContinues"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["string","\" turn continues,\""], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["string","\" stores \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","seedStoredCount"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["storage.type.variable.ts","this."], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["string","\" captures \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\" from space \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","spaceCaptured"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["identifier","stringBuilder"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vala.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vala.json deleted file mode 100644 index efe6e7c8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vala.json +++ /dev/null @@ -1,158 +0,0 @@ -[[ - "start", - ["meta.using.vala",""], - ["keyword.other.using.vala","using"], - ["meta.using.vala"," "], - ["storage.modifier.using.vala","Gtk"], - ["punctuation.terminator.vala",";"] -],[ - "start", - ["text"," "] -],[ - "text0", - ["storage.type.primitive.array.vala","int"], - ["text"," main ("], - ["storage.type.primitive.array.vala","string"], - ["text","[] args) {"] -],[ - "text0", - ["text"," "], - ["storage.type.vala","Gtk"], - ["keyword.operator.dereference.vala","."], - ["text","init ("], - ["storage.modifier.vala","ref"], - ["text"," args)"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "], - ["storage.type.primitive.vala","var"], - ["text"," foo "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["keyword.control.new.vala","new"], - ["text"," "], - ["storage.type.generic.vala","MyFoo>"], - ["text","()"], - ["punctuation.terminator.vala",";"] -],[ - "text0" -],[ - "text0", - ["text"," "], - ["storage.type.primitive.vala","var"], - ["text"," window "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["keyword.control.new.vala","new"], - ["text"," "], - ["storage.type.vala","Window"], - ["text","()"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","title "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["punctuation.definition.string.begin.vala","\""], - ["string.quoted.double.vala","Hello, World!"], - ["punctuation.definition.string.end.vala","\""], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","border_width "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["constant.numeric.vala","10"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","window_position "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["storage.type.vala","WindowPosition"], - ["keyword.operator.dereference.vala","."], - ["constant.other.vala","CENTER"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","set_default_size("], - ["constant.numeric.vala","350"], - ["text",", "], - ["constant.numeric.vala","70"], - ["text",")"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","destroy"], - ["keyword.operator.dereference.vala","."], - ["text","connect("], - ["storage.type.vala","Gtk"], - ["keyword.operator.dereference.vala","."], - ["text","main_quit)"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "] -],[ - "text0", - ["text"," "], - ["storage.type.primitive.vala","var"], - ["text"," label "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["keyword.control.new.vala","new"], - ["text"," "], - ["storage.type.vala","Label"], - ["text","("], - ["punctuation.definition.string.begin.vala","\""], - ["string.quoted.double.vala","Hello, World!"], - ["punctuation.definition.string.end.vala","\""], - ["text",")"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","add(label)"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","show_all()"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "] -],[ - "text0", - ["text"," "], - ["storage.type.vala","Gtk"], - ["keyword.operator.dereference.vala","."], - ["text","main()"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "], - ["keyword.control.vala","return"], - ["text"," "], - ["constant.numeric.vala","0"], - ["punctuation.terminator.vala",";"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vbscript.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vbscript.json deleted file mode 100644 index a49f976d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vbscript.json +++ /dev/null @@ -1,205 +0,0 @@ -[[ - "start", - ["text","myfilename "], - ["keyword.operator.asp","="], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","C:\\Wikipedia - VBScript - Example - Hello World.txt\""] -],[ - "start", - ["text","MakeHelloWorldFile myfilename"] -],[ - "state_4", - ["meta.leading-space"," "] -],[ - "start", - ["storage.type.function.asp","Sub"], - ["text"," "], - ["entity.name.function.asp","MakeHelloWorldFile"], - ["text"," "], - ["punctuation.definition.parameters.asp","("], - ["variable.parameter.function.asp","FileName"], - ["punctuation.definition.parameters.asp",")"] -],[ - "start", - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","Create a new file in C: drive or overwrite existing file"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["storage.type.asp","Set"], - ["text"," FSO "], - ["keyword.operator.asp","="], - ["text"," "], - ["support.function.asp","CreateObject"], - ["text","("], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","Scripting.FileSystemObject\""], - ["text",")"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["keyword.control.asp","If"], - ["text"," FSO."], - ["entity.name.function.asp","FileExists"], - ["text","(FileName) "], - ["keyword.control.asp","Then"], - ["text"," "] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["text","Answer "], - ["keyword.operator.asp","="], - ["text"," "], - ["support.function.vb.asp","MsgBox"], - ["text"," ("], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","File \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," FileName "], - ["keyword.operator.asp","&"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp"," exists ... OK to overwrite?\""], - ["text",", vbOKCancel)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","If button selected is not OK, then quit now"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","vbOK is a language constant"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["keyword.control.asp","If"], - ["text"," Answer "], - ["keyword.operator.asp","<>"], - ["text"," vbOK "], - ["keyword.control.asp","Then"], - ["text"," "], - ["keyword.control.asp","Exit Sub"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["keyword.control.asp","Else"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","Confirm OK to create"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["text","Answer "], - ["keyword.operator.asp","="], - ["text"," "], - ["support.function.vb.asp","MsgBox"], - ["text"," ("], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","File \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," FileName "], - ["keyword.operator.asp","&"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp"," ... OK to create?\""], - ["text",", vbOKCancel)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["keyword.control.asp","If"], - ["text"," Answer "], - ["keyword.operator.asp","<>"], - ["text"," vbOK "], - ["keyword.control.asp","Then"], - ["text"," "], - ["keyword.control.asp","Exit Sub"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["keyword.control.asp","End If"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","Create new file (or replace an existing file)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["storage.type.asp","Set"], - ["text"," FileObject "], - ["keyword.operator.asp","="], - ["text"," FSO.CreateTextFile (FileName)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["text","FileObject.WriteLine "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","Time ... \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," "], - ["support.function.vb.asp","Now"], - ["text","()"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["text","FileObject.WriteLine "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","Hello World\""] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["text","FileObject."], - ["entity.name.function.asp","Close"], - ["text","()"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["support.function.vb.asp","MsgBox"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","File \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," FileName "], - ["keyword.operator.asp","&"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp"," ... updated.\""] -],[ - "start", - ["support.function.asp","End"], - ["text"," "], - ["storage.type.asp","Sub"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_velocity.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_velocity.json deleted file mode 100644 index ee40761c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_velocity.json +++ /dev/null @@ -1,285 +0,0 @@ -[[ - "vm_comment", - ["comment.block","#*"] -],[ - "vm_comment", - ["comment"," This is a sample comment block that"] -],[ - "vm_comment", - ["comment"," spans multiple lines."] -],[ - "start", - ["comment","*#"] -],[ - "start" -],[ - "start", - ["keyword","#macro"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["identifier","outputItem"], - ["text"," "], - ["variable","$item"], - ["text"," "], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable","${"], - ["identifier","item"], - ["variable","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","#end"] -],[ - "start" -],[ - "start", - ["comment","## Define the items to iterate"] -],[ - "start", - ["keyword","#set"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["variable","$items"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["lparen","["], - ["constant.numeric","1"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","2"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","3"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","4"], - ["rparen","]"], - ["text"," "], - ["rparen",")"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text"," "], - ["comment","## Iterate over the items and output the evens."] -],[ - "start", - ["text"," "], - ["keyword","#foreach"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["variable","$item"], - ["text"," "], - ["identifier","in"], - ["text"," "], - ["variable","$items"], - ["text"," "], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","#if"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["support.function","$_MathTool"], - ["text.xml","."], - ["identifier","mod"], - ["lparen","("], - ["variable","$item"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","2"], - ["rparen",")"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","#outputItem"], - ["text"," "], - ["lparen","("], - ["variable","$item"], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","#end"] -],[ - "start", - ["text"," "], - ["keyword","#end"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "js-start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "js-comment_regex_allowed", - ["text"," "], - ["comment","/*"] -],[ - "js-comment_regex_allowed", - ["comment"," A sample function to decomstrate"] -],[ - "js-comment_regex_allowed", - ["comment"," JavaScript highlighting and folding."] -],[ - "js-start", - ["comment"," */"] -],[ - "js-start", - ["text"," "], - ["storage.type","function"], - ["text"," "], - ["entity.name.function","foo"], - ["paren.lparen","("], - ["variable.parameter","items"], - ["punctuation.operator",", "], - ["variable.parameter","nada"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["storage.type","var"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","="], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","<"], - ["identifier","items"], - ["punctuation.operator","."], - ["support.constant","length"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","++"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["identifier","items"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"juhu"], - ["constant.language.escape","\\n"], - ["string","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "css-start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.style.tag-name.xml","style"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["css-comment","css-start"], - ["text"," "], - ["comment","/*"] -],[ - ["css-comment","css-start"], - ["comment"," A sample style to decomstrate"] -],[ - ["css-comment","css-start"], - ["comment"," CSS highlighting and folding."] -],[ - "css-start", - ["comment"," */"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["variable",".class"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","font-family"], - ["text",": Monaco, "], - ["string","\"Courier New\""], - ["text",", "], - ["support.constant.fonts","monospace"], - ["text",";"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","12"], - ["keyword","px"], - ["text",";"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","cursor"], - ["text",": "], - ["support.constant","text"], - ["text",";"] -],[ - "css-start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_verilog.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_verilog.json deleted file mode 100644 index 9680a964..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_verilog.json +++ /dev/null @@ -1,113 +0,0 @@ -[[ - "start", - ["keyword","always"], - ["text"," @"], - ["paren.lparen","("], - ["keyword","negedge"], - ["text"," "], - ["identifier","reset"], - ["text"," "], - ["keyword","or"], - ["text"," "], - ["keyword","posedge"], - ["text"," "], - ["identifier","clk"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","reset"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["identifier","d_out"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["constant.numeric","16"], - ["text","'"], - ["identifier","h0000"], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","d_out_mem"], - ["text","["], - ["identifier","resetcount"], - ["text","] "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","d_out"], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","laststoredvalue"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","d_out"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["identifier","d_out"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","d_out"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["text","'"], - ["identifier","b1"], - ["text","; "] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - "start", - ["keyword","always"], - ["text"," @"], - ["paren.lparen","("], - ["identifier","bufreadaddr"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","bufreadval"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","d_out_mem"], - ["text","["], - ["identifier","bufreadaddr"], - ["text","];"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vhdl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vhdl.json deleted file mode 100644 index 88c6e222..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vhdl.json +++ /dev/null @@ -1,271 +0,0 @@ -[[ - "start", - ["keyword","library"], - ["text"," "], - ["identifier","IEEE"] -],[ - "start", - ["identifier","user"], - ["text"," "], - ["identifier","IEEE"], - ["punctuation.operator","."], - ["identifier","std_logic_1164"], - ["punctuation.operator","."], - ["keyword","all"], - ["punctuation.operator",";"] -],[ - "start", - ["keyword","use"], - ["text"," "], - ["identifier","IEEE"], - ["punctuation.operator","."], - ["identifier","numeric_std"], - ["punctuation.operator","."], - ["keyword","all"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","entity"], - ["text"," "], - ["identifier","COUNT16"], - ["text"," "], - ["keyword","is"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","port"], - ["text"," "], - ["paren.lparen","("] -],[ - "start", - ["text"," "], - ["identifier","cOut"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","out"], - ["text"," "], - ["storage.type","std_logic_vector"], - ["paren.lparen","("], - ["constant.numeric","15"], - ["text"," "], - ["keyword","downto"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","-- counter output"] -],[ - "start", - ["text"," "], - ["identifier","clkEn"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","in"], - ["text"," "], - ["storage.type","std_logic"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","-- count enable"] -],[ - "start", - ["text"," "], - ["identifier","clk"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","in"], - ["text"," "], - ["storage.type","std_logic"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","-- clock input"] -],[ - "start", - ["text"," "], - ["identifier","rst"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","in"], - ["text"," "], - ["storage.type","std_logic"], - ["text"," "], - ["comment","-- reset input"] -],[ - "start", - ["text"," "], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","end"], - ["text"," "], - ["keyword","entity"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","architecture"], - ["text"," "], - ["identifier","count_rtl"], - ["text"," "], - ["keyword","of"], - ["text"," "], - ["identifier","COUNT16"], - ["text"," "], - ["keyword","is"] -],[ - "start", - ["text"," "], - ["storage.type","signal"], - ["text"," "], - ["identifier","count"], - ["text"," "], - ["punctuation.operator",":"], - ["storage.type","std_logic_vector"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","15"], - ["text"," "], - ["keyword","downto"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["keyword","process"], - ["text"," "], - ["paren.lparen","("], - ["identifier","clk"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","rst"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["paren.lparen","("], - ["identifier","rst"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'1'"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["identifier","count"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["paren.lparen","("], - ["keyword","others"], - ["keyword.operator","=>"], - ["string","'0'"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","elsif"], - ["paren.lparen","("], - ["identifier","rising_edge"], - ["paren.lparen","("], - ["identifier","clk"], - ["paren.rparen","))"], - ["text"," "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["paren.lparen","("], - ["identifier","clkEn"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'1'"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["identifier","count"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","count"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","if"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","if"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","process"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","cOut"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","count"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","end"], - ["text"," "], - ["keyword","architecture"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json deleted file mode 100644 index 728be4db..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +++ /dev/null @@ -1,43 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","Juhu"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","//Juhu Kinners"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","test: two tags in the same lines should be in separate tokens\""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","Juhu"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","Kinners"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","test: multiline attributes\""] -],[ - ["string.attribute-value.xml0","meta.tag.punctuation.tag-open.xml"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","copy"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","set"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"{"] -],[ - ["string.attribute-value.xml0","meta.tag.punctuation.tag-open.xml"], - ["string.attribute-value.xml","}\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","undo"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"{"] -],[ - "start", - ["string.attribute-value.xml","}\""], - ["meta.tag.punctuation.tag-close.xml","/>"] -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json deleted file mode 100644 index aaf9ab9b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +++ /dev/null @@ -1,44 +0,0 @@ -[[ - "[\"start\"]", - ["keyword","xquery"], - ["text"," "], - ["keyword","version"], - ["text"," "], - ["string","\""], - ["string","1.0"], - ["string","\""], - ["text",";"] -],[ - "[\"start\"]" -],[ - "[\"start\"]", - ["keyword","let"], - ["text"," "], - ["variable","$message"], - ["text"," "], - ["keyword.operator",":="], - ["text"," "], - ["string","\""], - ["string","Hello World!"], - ["string","\""] -],[ - "[\"start\",\"StartTag\",\"TagContent\"]", - ["keyword","return"], - ["text"," "], - ["meta.tag",""] -],[ - "[\"start\",\"StartTag\",\"TagContent\"]", - ["text"," "], - ["meta.tag",""], - ["text","{"], - ["variable","$message"], - ["text","}"], - ["meta.tag",""] -],[ - "[\"start\"]", - ["meta.tag",""] -],[ - "[\"start\"]" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json deleted file mode 100644 index 7c9b45f3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +++ /dev/null @@ -1,150 +0,0 @@ -[[ - "start", - ["comment","# This sample document was taken from wikipedia:"] -],[ - "start", - ["comment","# http://en.wikipedia.org/wiki/YAML#Sample_document"] -],[ - "start", - ["list.markup","---"] -],[ - "start", - ["meta.tag","receipt"], - ["keyword",": "], - ["text","Oz-Ware Purchase Invoice"] -],[ - "start", - ["meta.tag","date"], - ["keyword",": "], - ["constant.numeric","2007-08-06"] -],[ - "start", - ["meta.tag","customer"], - ["keyword",":"] -],[ - "start", - ["meta.tag"," given"], - ["keyword",": "], - ["text","Dorothy"] -],[ - "start", - ["meta.tag"," family"], - ["keyword",": "], - ["text","Gale"] -],[ - "start" -],[ - "start", - ["meta.tag","items"], - ["keyword",":"] -],[ - "start", - ["list.markup"," - "], - ["meta.tag","part_no"], - ["keyword",": "], - ["string","'A4786'"] -],[ - "start", - ["meta.tag"," descrip"], - ["keyword",": "], - ["text","Water Bucket "], - ["paren.lparen","("], - ["text","Filled"], - ["paren.rparen",")"] -],[ - "start", - ["meta.tag"," price"], - ["keyword",": "], - ["constant.numeric","1.47"] -],[ - "start", - ["meta.tag"," quantity"], - ["keyword",": "], - ["constant.numeric","4"] -],[ - "start" -],[ - "start", - ["list.markup"," - "], - ["meta.tag","part_no"], - ["keyword",": "], - ["string","'E1628'"] -],[ - "start", - ["meta.tag"," descrip"], - ["keyword",": "], - ["text","High Heeled "], - ["string","\"Ruby\""], - ["text"," Slippers"] -],[ - "start", - ["meta.tag"," size"], - ["keyword",": "], - ["constant.numeric","8"] -],[ - "start", - ["meta.tag"," price"], - ["keyword",": "], - ["constant.numeric","100.27"] -],[ - "start", - ["meta.tag"," quantity"], - ["keyword",": "], - ["constant.numeric","1"] -],[ - "start" -],[ - "start", - ["meta.tag","bill-to"], - ["keyword",": "], - ["constant.language","&id001"] -],[ - "qqstring", - ["meta.tag"," street"], - ["keyword",": "], - ["string","|"] -],[ - "qqstring", - ["string"," 123 Tornado Alley"] -],[ - "qqstring", - ["string"," Suite 16"] -],[ - "start", - ["meta.tag"," city"], - ["keyword",": "], - ["text","East Centerville"] -],[ - "start", - ["meta.tag"," state"], - ["keyword",": "], - ["text","KS"] -],[ - "start" -],[ - "start", - ["meta.tag","ship-to"], - ["keyword",": "], - ["constant.language","*id001"] -],[ - "start" -],[ - "qqstring", - ["meta.tag","specialDelivery"], - ["keyword",": "], - ["string",">"] -],[ - "qqstring", - ["string"," Follow the Yellow Brick"] -],[ - "qqstring", - ["string"," Road to the Emerald City."] -],[ - "qqstring", - ["string"," Pay no attention to the"] -],[ - "qqstring", - ["string"," man behind the curtain."] -],[ - "qqstring" -]] \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js deleted file mode 100644 index c9d5a991..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js +++ /dev/null @@ -1,77 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Rules = require("./abap_highlight_rules").AbapHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; -var Range = require("../range").Range; -var TextMode = require("./text").Mode; -var oop = require("../lib/oop"); - -function Mode() { - this.HighlightRules = Rules; - this.foldingRules = new FoldMode(); -} - -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - return indent; - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow){ - 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.$id = "ace/mode/abap"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js deleted file mode 100644 index bab1e504..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +++ /dev/null @@ -1,134 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * based on - * " Vim ABAP syntax file - * " Language: SAP - ABAP/R4 - * " Revision: 2.1 - * " Maintainer: Marius Piedallu van Wyk - * " Last Change: 2012 Oct 23 - */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AbapHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": - "ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT BACK" + - " CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" + - " DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO" + - " ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" + - " FETCH FIELDS FORM FORMAT FREE FROM FUNCTION" + - " GENERATE GET" + - " HIDE" + - " IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION" + - " LEAVE LIKE LINE LOAD LOCAL LOOP" + - " MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY" + - " ON OVERLAY OPTIONAL OTHERS" + - " PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT" + - " RAISE RANGES READ RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK" + - " SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS" + - " TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES" + - " UNASSIGN ULINE UNPACK UPDATE" + - " WHEN WHILE WINDOW WRITE" + - " OCCURS STRUCTURE OBJECT PROPERTY" + - " CASTING APPEND RAISING VALUE COLOR" + - " CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT" + - " ID NUMBER FOR TITLE OUTPUT" + - " WITH EXIT USING" + - " INTO WHERE GROUP BY HAVING ORDER BY SINGLE" + - " APPENDING CORRESPONDING FIELDS OF TABLE" + - " LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" + - " EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN", - "constant.language": - "TRUE FALSE NULL SPACE", - "support.type": - "c n i p f d t x string xstring decfloat16 decfloat34", - "keyword.operator": - "abs sign ceil floor trunc frac acos asin atan cos sin tan" + - " abapOperator cosh sinh tanh exp log log10 sqrt" + - " strlen xstrlen charlen numofchar dbmaxlen lines" - }, "text", true, " "); - - var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|"+ - "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|"+ - "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|"+ - "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|"+ - "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|"+ - "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)"+ - "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|"+ - "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|"+ - "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|"+ - "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|"+ - "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|"+ - "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|"+ - "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|"+ - "IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)"; - - this.$rules = { - "start" : [ - {token : "string", regex : "`", next : "string"}, - {token : "string", regex : "'", next : "qstring"}, - {token : "doc.comment", regex : /^\*.+/}, - {token : "comment", regex : /".+$/}, - {token : "invalid", regex: "\\.{2,}"}, - {token : "keyword.operator", regex: /\W[\-+\%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/}, - {token : "paren.lparen", regex : "[\\[({]"}, - {token : "paren.rparen", regex : "[\\])}]"}, - {token : "constant.numeric", regex: "[+-]?\\d+\\b"}, - {token : "variable.parameter", regex : /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/}, - {token : "keyword", regex : compoundKeywords}, - {token : "variable.parameter", regex : /\w+-\w+(?:-\w+)*/}, - {token : keywordMapper, regex : "\\b\\w+\\b"}, - {caseInsensitive: true} - ], - "qstring" : [ - {token : "constant.language.escape", regex : "''"}, - {token : "string", regex : "'", next : "start"}, - {defaultToken : "string"} - ], - "string" : [ - {token : "constant.language.escape", regex : "``"}, - {token : "string", regex : "`", next : "start"}, - {defaultToken : "string"} - ] - }; -}; -oop.inherits(AbapHighlightRules, TextHighlightRules); - -exports.AbapHighlightRules = AbapHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc.js deleted file mode 100644 index b6eb237a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc.js +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js - */ - -define(function (require, exports, module) { - "use strict"; - - var oop = require("../lib/oop"); - var TextMode = require("./text").Mode; - var ABCHighlightRules = require("./abc_highlight_rules").ABCHighlightRules; -// TODO: pick appropriate fold mode - var FoldMode = require("./folding/cstyle").FoldMode; - - var Mode = function () { - this.HighlightRules = ABCHighlightRules; - this.foldingRules = new FoldMode(); - }; - oop.inherits(Mode, TextMode); - - (function () { - // this.lineCommentStart = ""%.*""; - // this.blockComment = {start: ""/*"", end: ""*/""}; - // Extra logic goes here. - this.$id = "ace/mode/abc" - }).call(Mode.prototype); - - exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc_highlight_rules.js deleted file mode 100644 index 6ffe9c9b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc_highlight_rules.js +++ /dev/null @@ -1,114 +0,0 @@ -/* This file was partially autogenerated from https://github.com/jimhawkridge/SublimeABC - - Modifications - - - more classes to express the abc semantic - - added syntax highlighting for Zupfnoter conventions (https://github.com/bwl21/zupfnoter) - - separate note pitch and note duration - even if it looks the same - - ***********************************************************************************************/ - - -define(function (require, exports, module) { - "use strict"; - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - var ABCHighlightRules = function () { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - start: [ - { - token: ['zupfnoter.information.comment.line.percentage', 'information.keyword', 'in formation.keyword.embedded'], - regex: '(%%%%)(hn\\.[a-z]*)(.*)', - comment: 'Instruction Comment' - }, - { - token: ['information.comment.line.percentage', 'information.keyword.embedded'], - regex: '(%%)(.*)', - comment: 'Instruction Comment' - }, - - { - token: 'comment.line.percentage', - regex: '%.*', - comment: 'Comments' - }, - - { - token: 'barline.keyword.operator', - regex: '[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+', - comment: 'Bar lines' - }, - { - token: ['information.keyword.embedded', 'information.argument.string.unquoted'], - regex: '(\\[[A-Za-z]:)([^\\]]*\\])', - comment: 'embedded Header lines' - }, - { - token: ['information.keyword', 'information.argument.string.unquoted'], - regex: '^([A-Za-z]:)([^%\\\\]*)', - comment: 'Header lines' - }, - { - token: ['text', 'entity.name.function', 'string.unquoted', 'text'], - regex: '(\\[)([A-Z]:)(.*?)(\\])', - comment: 'Inline fields' - }, - { - token: ['accent.constant.language', 'pitch.constant.numeric', 'duration.constant.numeric'], - regex: '([\\^=_]*)([A-Ga-gz][,\']*)([0-9]*/*[><0-9]*)', - comment: 'Notes' - }, - { - token: 'zupfnoter.jumptarget.string.quoted', - regex: '[\\"!]\\^\\:.*?[\\"!]', - comment: 'Zupfnoter jumptarget' - }, { - token: 'zupfnoter.goto.string.quoted', - regex: '[\\"!]\\^\\@.*?[\\"!]', - comment: 'Zupfnoter goto' - }, - { - token: 'zupfnoter.annotation.string.quoted', - regex: '[\\"!]\\^\\!.*?[\\"!]', - comment: 'Zupfnoter annoation' - }, - { - token: 'zupfnoter.annotationref.string.quoted', - regex: '[\\"!]\\^\\#.*?[\\"!]', - comment: 'Zupfnoter annotation reference' - }, - { - token: 'chordname.string.quoted', - regex: '[\\"!]\\^.*?[\\"!]', - comment: 'abc chord' - }, - { - token: 'string.quoted', - regex: '[\\"!].*?[\\"!]', - comment: 'abc annotation' - } - - ] - }; - - // this.embedRules(JsonHighlightRules, "json-") - - this.normalizeRules(); - }; - - ABCHighlightRules.metaData = { - fileTypes: ['abc'], - name: 'ABC', - scopeName: 'text.abcnotation' - }; - - - oop.inherits(ABCHighlightRules, TextHighlightRules); - - exports.ABCHighlightRules = ABCHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript.js deleted file mode 100644 index 7daf2941..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript.js +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var ActionScriptHighlightRules = require("./actionscript_highlight_rules").ActionScriptHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ActionScriptHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/actionscript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript_highlight_rules.js deleted file mode 100644 index 1f30d9c2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript_highlight_rules.js +++ /dev/null @@ -1,141 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from tm bundles\actionscript.tmbundle\Syntaxes\ActionScript.plist (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ActionScriptHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: 'support.class.actionscript.2', - regex: '\\b(?:R(?:ecordset|DBMSResolver|adioButton(?:Group)?)|X(?:ML(?:Socket|Node|Connector)?|UpdateResolverDataHolder)|M(?:M(?:Save|Execute)|icrophoneMicrophone|o(?:use|vieClip(?:Loader)?)|e(?:nu(?:Bar)?|dia(?:Controller|Display|Playback))|ath)|B(?:yName|inding|utton)|S(?:haredObject|ystem|crollPane|t(?:yleSheet|age|ream)|ound|e(?:ndEvent|rviceObject)|OAPCall|lide)|N(?:umericStepper|et(?:stream|S(?:tream|ervices)|Connection|Debug(?:Config)?))|C(?:heckBox|o(?:ntextMenu(?:Item)?|okie|lor|m(?:ponentMixins|boBox))|ustomActions|lient|amera)|T(?:ypedValue|ext(?:Snapshot|Input|F(?:ield|ormat)|Area)|ree|AB)|Object|D(?:ownload|elta(?:Item|Packet)?|at(?:e(?:Chooser|Field)?|a(?:G(?:lue|rid)|Set|Type)))|U(?:RL|TC|IScrollBar)|P(?:opUpManager|endingCall|r(?:intJob|o(?:duct|gressBar)))|E(?:ndPoint|rror)|Video|Key|F(?:RadioButton|GridColumn|MessageBox|BarChart|S(?:croll(?:Bar|Pane)|tyleFormat|plitView)|orm|C(?:heckbox|omboBox|alendar)|unction|T(?:icker|ooltip(?:Lite)?|ree(?:Node)?)|IconButton|D(?:ataGrid|raggablePane)|P(?:ieChart|ushButton|ro(?:gressBar|mptBox))|L(?:i(?:stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(?:indow|SDLURL|ebService(?:Connector)?)|L(?:ist|o(?:calConnection|ad(?:er|Vars)|g)|a(?:unch|bel))|A(?:sBroadcaster|cc(?:ordion|essibility)|S(?:Set(?:Native|PropFlags)|N(?:ew|ative)|C(?:onstructor|lamp(?:2)?)|InstanceOf)|pplication|lert|rray))\\b' }, - { token: 'support.function.actionscript.2', - regex: '\\b(?:s(?:h(?:ift|ow(?:GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(?:ow|ePane))|c(?:hema|ale(?:X|Mode|Y|Content)|r(?:oll(?:Track|Drag)?|een(?:Resolution|Color|DPI)))|t(?:yleSheet|op(?:Drag|A(?:nimation|llSounds|gent))?|epSize|a(?:tus|rt(?:Drag|A(?:nimation|gent))?))|i(?:n|ze|lence(?:TimeOut|Level))|o(?:ngname|urce|rt(?:Items(?:By)?|On(?:HeaderRelease)?|able(?:Columns)?)?)|u(?:ppressInvalidCalls|bstr(?:ing)?)|p(?:li(?:ce|t)|aceCol(?:umnsEqually|lumnsEqually))|e(?:nd(?:DefaultPushButtonEvent|AndLoad)?|curity|t(?:R(?:GB|o(?:otNode|w(?:Height|Count))|esizable(?:Columns)?|a(?:nge|te))|G(?:ain|roupName)|X(?:AxisTitle)?|M(?:i(?:n(?:imum|utes)|lliseconds)|o(?:nth(?:Names)?|tionLevel|de)|ultilineMode|e(?:ssage|nu(?:ItemEnabled(?:At)?|EnabledAt)|dia)|a(?:sk|ximum))|B(?:u(?:tton(?:s|Width)|fferTime)|a(?:seTabIndex|ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Target|P(?:osition|roperties)|barState|Location)|t(?:yle(?:Property)?|opOnFocus|at(?:us|e))|i(?:ze|lenceLevel)|ort(?:able(?:Columns)?|Function)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)?|Style|Color|ed(?:Node(?:s)?|Cell|I(?:nd(?:ices|ex)|tem(?:s)?))?|able))|kin|m(?:oothness|allScroll))|H(?:ighlight(?:s|Color)|Scroll|o(?:urs|rizontal)|eader(?:Symbol|Height|Text|Property|Format|Width|Location)?|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:ode(?:Properties|ExpansionHandler)|ewTextFormat)|C(?:h(?:ildNodes|a(?:ngeHandler|rt(?:Title|EventHandler)))|o(?:ntent(?:Size)?|okie|lumns)|ell(?:Symbol|Data)|l(?:i(?:ckHandler|pboard)|oseHandler)|redentials)|T(?:ype(?:dVaule)?|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:out(?:Handler)?)?)|oggle|extFormat|ransform)|I(?:s(?:Branch|Open)|n(?:terval|putProperty)|con(?:SymbolName)?|te(?:rator|m(?:ByKey|Symbol)))|Orientation|D(?:i(?:splay(?:Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(?:pth(?:Below|To|Above)|fault(?:GatewayURL|Mappings|NodeIconSymbolName)|l(?:iveryMode|ay)|bug(?:ID)?)|a(?:yOfWeekNames|t(?:e(?:Filter)?|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Provider|All(?:Height|Property|Format|Width))?))|ra(?:wConnectors|gContent))|U(?:se(?:Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(?:osition|ercentComplete|an(?:e(?:M(?:inimumSize|aximumSize)|Size|Title))?|ro(?:pert(?:y(?:Data)?|iesAt)|gress))|E(?:nabled|dit(?:Handler|able)|xpand(?:NodeTrigger|erSymbolName))|V(?:Scroll|olume|alue(?:Source)?)|KeyFrameInterval|Quality|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:opback|adTarget)|a(?:rgeScroll|bel(?:Source|Placement)?))|A(?:s(?:Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:e(?:State(?:Handler)?|Handler)|ateHandler)|utoH(?:ideScrollBar|eight)))?|paratorBefore|ek|lect(?:ion(?:Disabled|Unfocused)?|ed(?:Node(?:s)?|Child|I(?:nd(?:ices|ex)|tem(?:s)?)|Dat(?:e|a))?|able(?:Ranges)?)|rver(?:String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(?:scroll(?:Policy)?|tml(?:Text)?|i(?:t(?:Test(?:TextNearPos)?|Area)|de(?:BuiltInItems|Child)?|ghlight(?:2D|3D)?)|orizontal|e(?:ight|ader(?:Re(?:nderer|lease)|Height|Text))|P(?:osition|ageScrollSize)|a(?:s(?:childNodes|MP3|S(?:creen(?:Broadcast|Playback)|treaming(?:Video|Audio)|ort)|Next|OwnProperty|Pr(?:inting|evious)|EmbeddedVideo|VideoEncoder|A(?:ccesibility|udio(?:Encoder)?))|ndlerName)|LineScrollSize)|ye(?:sLabel|ar)|n(?:o(?:t|de(?:Name|Close|Type|Open|Value)|Label)|u(?:llValue|mChild(?:S(?:creens|lides)|ren|Forms))|e(?:w(?:Item|line|Value|LocationDialog)|xt(?:S(?:cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(?:s)?)|c(?:h(?:ildNodes|eck|a(?:nge(?:sPending)?|r(?:CodeAt|At))|r)|o(?:s|n(?:st(?:ant|ructor)|nect|c(?:urrency|at)|t(?:ent(?:Type|Path)?|ains|rol(?:Placement|lerPolicy))|denseWhite|version)|py|l(?:or|umn(?:Stretch|Name(?:s)?|Count))|m(?:p(?:onent|lete)|ment))|u(?:stomItems|ePoint(?:s)?|r(?:veTo|Value|rent(?:Slide|ChildSlide|Item|F(?:ocused(?:S(?:creen|lide)|Form)|ps))))|e(?:il|ll(?:Renderer|Press|Edit|Focus(?:In|Out)))|l(?:i(?:ck|ents)|o(?:se(?:Button|Pane)?|ne(?:Node)?)|ear(?:S(?:haredObjects|treams)|Timeout|Interval)?)|a(?:ncelLabel|tch|p(?:tion|abilities)|l(?:cFields|l(?:e(?:e|r))?))|reate(?:GatewayConnection|Menu|Se(?:rver|gment)|C(?:hild(?:AtDepth)?|l(?:ient|ass(?:ChildAtDepth|Object(?:AtDepth)?))|all)|Text(?:Node|Field)|Item|Object(?:AtDepth)?|PopUp|E(?:lement|mptyMovieClip)))|t(?:h(?:is|row)|ype(?:of|Name)?|i(?:tle(?:StyleDeclaration)?|me(?:out)?)|o(?:talTime|String|olTipText|p|UpperCase|ggle(?:HighQuality)?|Lo(?:caleString|werCase))|e(?:st|llTarget|xt(?:RightMargin|Bold|S(?:ize|elected)|Height|Color|I(?:ndent|talic)|Disabled|Underline|F(?:ield|ont)|Width|LeftMargin|Align)?)|a(?:n|rget(?:Path)?|b(?:Stops|Children|Index|Enabled|leName))|r(?:y|igger|ac(?:e|k(?:AsMenu)?)))|i(?:s(?:Running|Branch|NaN|Con(?:soleOpen|nected)|Toggled|Installed|Open|D(?:own|ebugger)|P(?:urchased|ro(?:totypeOf|pertyEnumerable))|Empty|F(?:inite|ullyPopulated)|Local|Active)|n(?:s(?:tall|ertBefore)|cludeDeltaPacketInfo|t|it(?:ialize|Component|Pod|A(?:pplication|gent))?|de(?:nt|terminate|x(?:InParent(?:Slide|Form)?|Of)?)|put|validate|finity|LocalInternetCache)?|con(?:F(?:ield|unction))?|t(?:e(?:ratorScrolled|m(?:s|RollO(?:ut|ver)|ClassName))|alic)|d3|p|fFrameLoaded|gnore(?:Case|White))|o(?:s|n(?:R(?:ollO(?:ut|ver)|e(?:s(?:ize|ult)|l(?:ease(?:Outside)?|aseOutside)))|XML|Mouse(?:Move|Down|Up|Wheel)|S(?:ync|croller|tatus|oundComplete|e(?:tFocus|lect(?:edItem)?))|N(?:oticeEvent|etworkChange)|C(?:hanged|onnect|l(?:ipEvent|ose))|ID3|D(?:isconnect|eactivate|ata|ragO(?:ut|ver))|Un(?:install|load)|P(?:aymentResult|ress)|EnterFrame|K(?:illFocus|ey(?:Down|Up))|Fault|Lo(?:ad|g)|A(?:ctiv(?:ity|ate)|ppSt(?:op|art)))?|pe(?:n|ration)|verLayChildren|kLabel|ldValue|r(?:d)?)|d(?:i(?:s(?:connect|play(?:Normal|ed(?:Month|Year)|Full)|able(?:Shader|d(?:Ranges|Days)|CloseBox|Events))|rection)|o(?:cTypeDecl|tall|Decoding|main|LazyDecoding)|u(?:plicateMovieClip|ration)|e(?:stroy(?:ChildAt|Object)|code|fault(?:PushButton(?:Enabled)?|KeydownHandler)?|l(?:ta(?:Packet(?:Changed)?)?|ete(?:PopUp|All)?)|blocking)|a(?:shBoardSave|yNames|ta(?:Provider)?|rkshadow)|r(?:opdown(?:Width)?|a(?:w|gO(?:ut|ver))))|u(?:se(?:Sort|HandCursor|Codepage|EchoSuppression)|n(?:shift|install|derline|escape|format|watch|lo(?:ck|ad(?:Movie(?:Num)?)?))|pdate(?:Results|Mode|I(?:nputProperties|tem(?:ByIndex)?)|P(?:acket|roperties)|View|AfterEvent)|rl)|join|p(?:ixelAspectRatio|o(?:sition|p|w)|u(?:sh|rge|blish)|ercen(?:tComplete|Loaded)|lay(?:head(?:Change|Time)|ing|Hidden|erType)?|a(?:ssword|use|r(?:se(?:XML|CSS|Int|Float)|ent(?:Node|Is(?:S(?:creen|lide)|Form))|ams))|r(?:int(?:Num|AsBitmap(?:Num)?)?|o(?:to(?:type)?|pert(?:y|ies)|gress)|e(?:ss|v(?:ious(?:S(?:ibling|lide)|Value)?|Scene|Frame)|ferred(?:Height|Width))))|e(?:scape|n(?:code(?:r)?|ter(?:Frame)?|dFill|able(?:Shader|d|CloseBox|Events))|dit(?:able|Field|LocationDialog)|v(?:ent|al(?:uate)?)|q|x(?:tended|p|ec(?:ute)?|actSettings)|m(?:phasized(?:StyleDeclaration)?|bedFonts))|v(?:i(?:sible|ewPod)|ScrollPolicy|o(?:id|lume)|ersion|P(?:osition|ageScrollSize)|a(?:l(?:idat(?:ionError|e(?:Property|ActivationKey)?)|ue(?:Of)?)|riable)|LineScrollSize)|k(?:ind|ey(?:Down|Up|Press|FrameInterval))|q(?:sort|uality)|f(?:scommand|i(?:n(?:d(?:Text|First|Last)?|ally)|eldInfo|lter(?:ed|Func)?|rst(?:Slide|Child|DayOfWeek|VisibleNode)?)|o(?:nt|cus(?:In|edCell|Out|Enabled)|r(?:egroundDisabled|mat(?:ter)?))|unctionName|ps|l(?:oor|ush)|ace|romCharCode)|w(?:i(?:th|dth)|ordWrap|atch|riteAccess)|l(?:t|i(?:st(?:Owner)?|ne(?:Style|To))|o(?:c(?:k|a(?:t(?:ion|eByld)|l(?:ToGlobal|FileReadDisable)))|opback|ad(?:Movie(?:Num)?|S(?:crollContent|ound)|ed|Variables(?:Num)?|Application)?|g(?:Changes)?)|e(?:ngth|ft(?:Margin)?|ading)?|a(?:st(?:Slide|Child|Index(?:Of)?)?|nguage|b(?:el(?:Placement|F(?:ield|unction))?|leField)))|a(?:s(?:scociate(?:Controller|Display)|in|pectRatio|function)|nd|c(?:ceptConnection|tiv(?:ityLevel|ePlayControl)|os)|t(?:t(?:ach(?:Movie|Sound|Video|Audio)|ributes)|an(?:2)?)|dd(?:header|RequestHeader|Menu(?:Item(?:At)?|At)?|Sort|Header|No(?:tice|de(?:At)?)|C(?:olumn(?:At)?|uePoint)|T(?:oLocalInternetCache|reeNode(?:At)?)|I(?:con|tem(?:s(?:At)?|At)?)|DeltaItem|P(?:od|age|roperty)|EventListener|View|FieldInfo|Listener|Animation)?|uto(?:Size|Play|KeyNav|Load)|pp(?:endChild|ly(?:Changes|Updates)?)|vHardwareDisable|fterLoaded|l(?:ternateRowColors|ign|l(?:ow(?:InsecureDomain|Domain)|Transitions(?:InDone|OutDone))|bum)|r(?:tist|row|g(?:uments|List))|gent|bs)|r(?:ight(?:Margin)?|o(?:ot(?:S(?:creen|lide)|Form)|und|w(?:Height|Count)|llO(?:ut|ver))|e(?:s(?:yncDepth|t(?:orePane|artAnimation|rict)|iz(?:e|able(?:Columns)?)|olveDelta|ult(?:s)?|ponse)|c(?:o(?:ncile(?:Results|Updates)|rd)|eive(?:Video|Audio))|draw|jectConnection|place(?:Sel|ItemAt|AllItems)?|ve(?:al(?:Child)?|rse)|quest(?:SizeChange|Payment)?|f(?:errer|resh(?:ScrollContent|Destinations|Pane|FromSources)?)|lease(?:Outside)?|ad(?:Only|Access)|gister(?:SkinElement|C(?:olor(?:Style|Name)|lass)|InheritingStyle|Proxy)|move(?:Range|M(?:ovieClip|enu(?:Item(?:At)?|At))|Background|Sort|No(?:tice|de(?:sAt|At)?)|C(?:olum(?:nAt|At)|uePoints)|T(?:extField|reeNode(?:At)?)|Item(?:At)?|Pod|EventListener|FromLocalInternetCache|Listener|All(?:C(?:olumns|uePoints)|Items)?))|a(?:ndom|te|dioDot))|g(?:t|oto(?:Slide|NextSlide|PreviousSlide|FirstSlide|LastSlide|And(?:Stop|Play))|e(?:nre|t(?:R(?:GB|o(?:otNode|wCount)|e(?:sizable|mote))|X(?:AxisTitle)?|M(?:i(?:n(?:imum(?:Size)?|utes)|lliseconds)|onth(?:Names)?|ultilineMode|e(?:ssage|nu(?:ItemAt|EnabledAt|At))|aximum(?:Size)?)|B(?:ytes(?:Total|Loaded)|ounds|utton(?:s|Width)|eginIndex|a(?:ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Position|barState|Location)|t(?:yle(?:Names)?|opOnFocus|ate)|ize|o(?:urce|rtState)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)|Style|ed(?:Node(?:s)?|Cell|Text|I(?:nd(?:ices|ex)|tem(?:s)?))?)|rvice)|moothness|WFVersion)|H(?:ighlight(?:s|Color)|ours|e(?:ight|ader(?:Height|Text|Property|Format|Width|Location)?)|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:o(?:tices|de(?:DisplayedAt|At))|um(?:Children|berAvailable)|e(?:wTextFormat|xtHighestDepth))|C(?:h(?:ild(?:S(?:creen|lide)|Nodes|Form|At)|artTitle)|o(?:n(?:tent|figInfo)|okie|de|unt|lumn(?:Names|Count|Index|At))|uePoint|ellIndex|loseHandler|a(?:ll|retIndex))|T(?:ypedValue|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:stamp|zoneOffset|out(?:State|Handler)|r)?)|oggle|ext(?:Extent|Format)?|r(?:ee(?:NodeAt|Length)|ans(?:form|actionId)))|I(?:s(?:Branch|Open)|n(?:stanceAtDepth|d(?:icesByKey|exByKey))|con(?:SymbolName)?|te(?:rator|m(?:sByKey|By(?:Name|Key)|id|ID|At))|d)|O(?:utput(?:Parameter(?:s|ByName)?|Value(?:s)?)|peration|ri(?:entation|ginalCellData))|D(?:i(?:s(?:play(?:Range|Mode|Clip|Index|edMonth)|kUsage)|rection)|uration|e(?:pth|faultNodeIconSymbolName|l(?:taPacket|ay)|bug(?:Config|ID)?)|a(?:y(?:OfWeekNames)?|t(?:e|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Label|All(?:Height|Property|Format|Width))?))|rawConnectors)|U(?:se(?:Shadow|HandCursor|rInput|Fade)|RL|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear))|P(?:o(?:sition|ds)|ercentComplete|a(?:n(?:e(?:M(?:inimums|aximums)|Height|Title|Width))?|rentNode)|r(?:operty(?:Name|Data)?|efer(?:ences|red(?:Height|Width))))|E(?:n(?:dIndex|abled)|ditingData|x(?:panderSymbolName|andNodeTrigger))|V(?:iewed(?:Pods|Applications)|olume|ersion|alue(?:Source)?)|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|o(?:ntList|cus)|ullYear|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:cal|adTarget)|ength|a(?:stTabIndex|bel(?:Source)?))|A(?:s(?:cii|Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:eState(?:Handler)?|ateHandler)|utoH(?:ideScrollBar|eight)|llItems|gent))?)?|lobal(?:StyleFormat|ToLocal)?|ain|roupName)|x(?:updatePackety|mlDecl)?|m(?:y(?:MethodName|Call)|in(?:imum)?|o(?:nthNames|tion(?:TimeOut|Level)|de(?:lChanged)?|use(?:Move|O(?:ut|ver)|Down(?:Somewhere|Outside)?|Up(?:Somewhere)?|WheelEnabled)|ve(?:To)?)|u(?:ted|lti(?:pleS(?:imultaneousAllowed|elections)|line))|e(?:ssage|nu(?:Show|Hide)?|th(?:od)?|diaType)|a(?:nufacturer|tch|x(?:scroll|hscroll|imum|HPosition|Chars|VPosition)?)|b(?:substring|chr|ord|length))|b(?:ytes(?:Total|Loaded)|indFormat(?:Strings|Function)|o(?:ttom(?:Scroll)?|ld|rder(?:Color)?)|u(?:tton(?:Height|Width)|iltInItems|ffer(?:Time|Length)|llet)|e(?:foreApplyUpdates|gin(?:GradientFill|Fill))|lockIndent|a(?:ndwidth|ckground(?:Style|Color|Disabled)?)|roadcastMessage)|onHTTPStatus)\\b' }, - { token: 'support.constant.actionscript.2', - regex: '\\b(?:__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\\b' }, - { token: 'keyword.control.actionscript.2', - regex: '\\b(?:dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\\b' }, - { token: 'storage.type.actionscript.2', - regex: '\\b(?:Boolean|Number|String|Void)\\b' }, - { token: 'constant.language.actionscript.2', - regex: '\\b(?:null|undefined|true|false)\\b' }, - { token: 'constant.numeric.actionscript.2', - regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, - { token: 'punctuation.definition.string.begin.actionscript.2', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.actionscript.2', - regex: '"', - next: 'pop' }, - { token: 'constant.character.escape.actionscript.2', - regex: '\\\\.' }, - { defaultToken: 'string.quoted.double.actionscript.2' } ] }, - { token: 'punctuation.definition.string.begin.actionscript.2', - regex: '\'', - push: - [ { token: 'punctuation.definition.string.end.actionscript.2', - regex: '\'', - next: 'pop' }, - { token: 'constant.character.escape.actionscript.2', - regex: '\\\\.' }, - { defaultToken: 'string.quoted.single.actionscript.2' } ] }, - { token: 'support.constant.actionscript.2', - regex: '\\b(?:BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\\b' }, - { token: 'punctuation.definition.comment.actionscript.2', - regex: '/\\*', - push: - [ { token: 'punctuation.definition.comment.actionscript.2', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.actionscript.2' } ] }, - { token: 'punctuation.definition.comment.actionscript.2', - regex: '//.*$', - push_: - [ { token: 'comment.line.double-slash.actionscript.2', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-slash.actionscript.2' } ] }, - { token: 'keyword.operator.actionscript.2', - regex: '\\binstanceof\\b' }, - { token: 'keyword.operator.symbolic.actionscript.2', - regex: '[-!%&*+=/?:]' }, - { token: - [ 'meta.preprocessor.actionscript.2', - 'punctuation.definition.preprocessor.actionscript.2', - 'meta.preprocessor.actionscript.2' ], - regex: '^([ \\t]*)(#)([a-zA-Z]+)' }, - { token: - [ 'storage.type.function.actionscript.2', - 'meta.function.actionscript.2', - 'entity.name.function.actionscript.2', - 'meta.function.actionscript.2', - 'punctuation.definition.parameters.begin.actionscript.2' ], - regex: '\\b(function)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()', - push: - [ { token: 'punctuation.definition.parameters.end.actionscript.2', - regex: '\\)', - next: 'pop' }, - { token: 'variable.parameter.function.actionscript.2', - regex: '[^,)$]+' }, - { defaultToken: 'meta.function.actionscript.2' } ] }, - { token: - [ 'storage.type.class.actionscript.2', - 'meta.class.actionscript.2', - 'entity.name.type.class.actionscript.2', - 'meta.class.actionscript.2', - 'storage.modifier.extends.actionscript.2', - 'meta.class.actionscript.2', - 'entity.other.inherited-class.actionscript.2' ], - regex: '\\b(class)(\\s+)([a-zA-Z_](?:\\w|\\.)*)(?:(\\s+)(extends)(\\s+)([a-zA-Z_](?:\\w|\\.)*))?' } ] } - - this.normalizeRules(); -}; - -ActionScriptHighlightRules.metaData = { fileTypes: [ 'as' ], - keyEquivalent: '^~A', - name: 'ActionScript', - scopeName: 'source.actionscript.2' } - - -oop.inherits(ActionScriptHighlightRules, TextHighlightRules); - -exports.ActionScriptHighlightRules = ActionScriptHighlightRules; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada.js deleted file mode 100644 index dc1dfa14..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada.js +++ /dev/null @@ -1,54 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = AdaHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - - this.$id = "ace/mode/ada"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada_highlight_rules.js deleted file mode 100644 index b345966c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada_highlight_rules.js +++ /dev/null @@ -1,93 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AdaHighlightRules = function() { -var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" + -"access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" + -"array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" + -"body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" + -"|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor"; - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce|main" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "--.*$" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(AdaHighlightRules, TextHighlightRules); - -exports.AdaHighlightRules = AdaHighlightRules; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf.js deleted file mode 100644 index 2379b44b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf.js +++ /dev/null @@ -1,62 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ApacheConfHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "#"; - this.$id = "ace/mode/apache_conf"; - // Extra logic goes here. -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf_highlight_rules.js deleted file mode 100644 index c310612d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf_highlight_rules.js +++ /dev/null @@ -1,231 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from https://raw.github.com/colinta/ApacheConf.tmLanguage/master/ApacheConf.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ApacheConfHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: - [ 'punctuation.definition.comment.apacheconf', - 'comment.line.hash.ini', - 'comment.line.hash.ini' ], - regex: '^((?:\\s)*)(#)(.*$)' }, - { token: - [ 'punctuation.definition.tag.apacheconf', - 'entity.tag.apacheconf', - 'text', - 'string.value.apacheconf', - 'punctuation.definition.tag.apacheconf' ], - regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' }, - { token: - [ 'punctuation.definition.tag.apacheconf', - 'entity.tag.apacheconf', - 'punctuation.definition.tag.apacheconf' ], - regex: '()' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.replacement.apacheconf', 'text' ], - regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'entity.status.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'entity.status.apacheconf', 'text', - 'string.path.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.path.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: 'keyword.core.apacheconf', - regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' }, - { token: 'keyword.mpm.apacheconf', - regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' }, - { token: 'keyword.access.apacheconf', - regex: '\\b(?:Allow|Deny|Order)\\b' }, - { token: 'keyword.actions.apacheconf', - regex: '\\b(?:Action|Script)\\b' }, - { token: 'keyword.alias.apacheconf', - regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' }, - { token: 'keyword.auth.apacheconf', - regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' }, - { token: 'keyword.auth_anon.apacheconf', - regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' }, - { token: 'keyword.auth_dbm.apacheconf', - regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' }, - { token: 'keyword.auth_digest.apacheconf', - regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' }, - { token: 'keyword.auth_ldap.apacheconf', - regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' }, - { token: 'keyword.autoindex.apacheconf', - regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' }, - { token: 'keyword.cache.apacheconf', - regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' }, - { token: 'keyword.cern_meta.apacheconf', - regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' }, - { token: 'keyword.cgi.apacheconf', - regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' }, - { token: 'keyword.cgid.apacheconf', - regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' }, - { token: 'keyword.charset_lite.apacheconf', - regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' }, - { token: 'keyword.dav.apacheconf', - regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' }, - { token: 'keyword.deflate.apacheconf', - regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' }, - { token: 'keyword.dir.apacheconf', - regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' }, - { token: 'keyword.disk_cache.apacheconf', - regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' }, - { token: 'keyword.dumpio.apacheconf', - regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' }, - { token: 'keyword.env.apacheconf', - regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' }, - { token: 'keyword.expires.apacheconf', - regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' }, - { token: 'keyword.ext_filter.apacheconf', - regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' }, - { token: 'keyword.file_cache.apacheconf', - regex: '\\b(?:CacheFile|MMapFile)\\b' }, - { token: 'keyword.headers.apacheconf', - regex: '\\b(?:Header|RequestHeader)\\b' }, - { token: 'keyword.imap.apacheconf', - regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' }, - { token: 'keyword.include.apacheconf', - regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' }, - { token: 'keyword.isapi.apacheconf', - regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' }, - { token: 'keyword.ldap.apacheconf', - regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' }, - { token: 'keyword.log.apacheconf', - regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' }, - { token: 'keyword.mem_cache.apacheconf', - regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' }, - { token: 'keyword.mime.apacheconf', - regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' }, - { token: 'keyword.misc.apacheconf', - regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' }, - { token: 'keyword.negotiation.apacheconf', - regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' }, - { token: 'keyword.nw_ssl.apacheconf', - regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' }, - { token: 'keyword.proxy.apacheconf', - regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' }, - { token: 'keyword.rewrite.apacheconf', - regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' }, - { token: 'keyword.setenvif.apacheconf', - regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' }, - { token: 'keyword.so.apacheconf', - regex: '\\b(?:LoadFile|LoadModule)\\b' }, - { token: 'keyword.ssl.apacheconf', - regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' }, - { token: 'keyword.usertrack.apacheconf', - regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' }, - { token: 'keyword.vhost_alias.apacheconf', - regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' }, - { token: - [ 'keyword.php.apacheconf', - 'text', - 'entity.property.apacheconf', - 'text', - 'string.value.apacheconf', - 'text' ], - regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' }, - { token: - [ 'punctuation.variable.apacheconf', - 'variable.env.apacheconf', - 'variable.misc.apacheconf', - 'punctuation.variable.apacheconf' ], - regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' }, - { token: [ 'entity.mime-type.apacheconf', 'text' ], - regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' }, - { token: 'entity.helper.apacheconf', - regex: '\\b(?:from|unset|set|on|off)\\b', - caseInsensitive: true }, - { token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' }, - { token: - [ 'text', - 'punctuation.definition.flag.apacheconf', - 'string.flag.apacheconf', - 'punctuation.definition.flag.apacheconf', - 'text' ], - regex: '(\\s)(\\[)(.*?)(\\])(\\s)' } ] } - - this.normalizeRules(); -}; - -ApacheConfHighlightRules.metaData = { fileTypes: - [ 'conf', - 'CONF', - 'htaccess', - 'HTACCESS', - 'htgroups', - 'HTGROUPS', - 'htpasswd', - 'HTPASSWD', - '.htaccess', - '.HTACCESS', - '.htgroups', - '.HTGROUPS', - '.htpasswd', - '.HTPASSWD' ], - name: 'Apache Conf', - scopeName: 'source.apacheconf' } - - -oop.inherits(ApacheConfHighlightRules, TextHighlightRules); - -exports.ApacheConfHighlightRules = ApacheConfHighlightRules; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript.js deleted file mode 100644 index 81bc3533..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript.js +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var AppleScriptHighlightRules = require("./applescript_highlight_rules").AppleScriptHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = AppleScriptHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "--"; - this.blockComment = {start: "(*", end: "*)"}; - this.$id = "ace/mode/applescript"; - // Extra logic goes here. -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript_highlight_rules.js deleted file mode 100644 index d830d780..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript_highlight_rules.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AppleScriptHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - var keywords = ( - "about|above|after|against|and|around|as|at|back|before|beginning|" + - "behind|below|beneath|beside|between|but|by|considering|" + - "contain|contains|continue|copy|div|does|eighth|else|end|equal|" + - "equals|error|every|exit|fifth|first|for|fourth|from|front|" + - "get|given|global|if|ignoring|in|into|is|it|its|last|local|me|" + - "middle|mod|my|ninth|not|of|on|onto|or|over|prop|property|put|ref|" + - "reference|repeat|returning|script|second|set|seventh|since|" + - "sixth|some|tell|tenth|that|the|then|third|through|thru|" + - "timeout|times|to|transaction|try|until|where|while|whose|with|without" - ); - - var builtinConstants = ( - "AppleScript|false|linefeed|return|pi|quote|result|space|tab|true" - ); - - var builtinFunctions = ( - "activate|beep|count|delay|launch|log|offset|read|round|run|say|" + - "summarize|write" - ); - - var builtinTypes = ( - "alias|application|boolean|class|constant|date|file|integer|list|" + - "number|real|record|string|text|character|characters|contents|day|" + - "frontmost|id|item|length|month|name|paragraph|paragraphs|rest|" + - "reverse|running|time|version|weekday|word|words|year" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "constant.language": builtinConstants, - "support.type": builtinTypes, - "keyword": keywords - }, "identifier"); - - this.$rules = { - "start": [ - { - token: "comment", - regex: "--.*$" - }, - { - token : "comment", // multi line comment - regex : "\\(\\*", - next : "comment" - }, - { - token: "string", // " string - regex: '".*?"' - }, - { - token: "support.type", - regex: '\\b(POSIX file|POSIX path|(date|time) string|quoted form)\\b' - }, - { - token: "support.function", - regex: '\\b(clipboard info|the clipboard|info for|list (disks|folder)|' + - 'mount volume|path to|(close|open for) access|(get|set) eof|' + - 'current date|do shell script|get volume settings|random number|' + - 'set volume|system attribute|system info|time to GMT|' + - '(load|run|store) script|scripting components|' + - 'ASCII (character|number)|localized string|' + - 'choose (application|color|file|file name|' + - 'folder|from list|remote application|URL)|' + - 'display (alert|dialog))\\b|^\\s*return\\b' - }, - { - token: "constant.language", - regex: '\\b(text item delimiters|current application|missing value)\\b' - }, - { - token: "keyword", - regex: '\\b(apart from|aside from|instead of|out of|greater than|' + - "isn't|(doesn't|does not) (equal|come before|come after|contain)|" + - '(greater|less) than( or equal)?|(starts?|ends|begins?) with|' + - 'contained by|comes (before|after)|a (ref|reference))\\b' - }, - { - token: keywordMapper, - regex: "[a-zA-Z][a-zA-Z0-9_]*\\b" - } - ], - "comment": [ - { - token: "comment", // closing comment - regex: "\\*\\)", - next: "start" - }, { - defaultToken: "comment" - } - ] - } - - this.normalizeRules(); -}; - -oop.inherits(AppleScriptHighlightRules, TextHighlightRules); - -exports.AppleScriptHighlightRules = AppleScriptHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js deleted file mode 100644 index 894d9763..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +++ /dev/null @@ -1,64 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules; -var AsciidocFoldMode = require("./folding/asciidoc").FoldMode; - -var Mode = function() { - this.HighlightRules = AsciidocHighlightRules; - - this.foldingRules = new AsciidocFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.type = "text"; - this.getNextLineIndent = function(state, line, tab) { - if (state == "listblock") { - var match = /^((?:.+)?)([-+*][ ]+)/.exec(line); - if (match) { - return new Array(match[1].length + 1).join(" ") + match[2]; - } else { - return ""; - } - } else { - return this.$getIndent(line); - } - }; - this.$id = "ace/mode/asciidoc"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js deleted file mode 100644 index c0d1a305..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +++ /dev/null @@ -1,234 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AsciidocHighlightRules = function() { - var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b"; - - this.$rules = { - "start": [ - {token: "empty", regex: /$/}, - {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, - {token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock"}, - {token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock"}, - {token: "keyword", regex: /^={4,}\s*$/}, - {token: "text", regex: /^\s*$/}, - // immediately return to the start mode without matching anything - {token: "empty", regex: "", next: "dissallowDelimitedBlock"} - ], - - "dissallowDelimitedBlock": [ - {include: "paragraphEnd"}, - {token: "comment", regex: '^//.+$'}, - {token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"}, - - {include: "listStart"}, - {token: "literal", regex: /^\s+.+$/, next: "indentedBlock"}, - {token: "empty", regex: "", next: "text"} - ], - - "paragraphEnd": [ - {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock"}, - {token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock"}, - // open block, ruller - {token: "keyword", regex: /^(?:--|''')\s*$/, next: "start"}, - {token: "option", regex: /^\[.*\]\s*$/, next: "start"}, - {token: "pageBreak", regex: /^>{3,}$/, next: "start"}, - {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, - {token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start"}, - {token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start"}, - - {token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start"}, - // .optional title - {token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start"} - ], - - "listStart": [ - {token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText"}, - {token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText"}, - {token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text"}, - // continuation - {token: "keyword", regex: /^\+\s*$/, next: "start"} - ], - - "text": [ - {token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/}, - {token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/}, - {token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/}, - {include: "macros"}, - {include: "paragraphEnd"}, - {token: "literal", regex:/\+{3,}/, next:"smallPassthrough"}, - {token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/}, - {token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/}, - {token: "keyword", regex: /\s\+$/}, - // any word - {token: "text", regex: identifierRe}, - {token: ["keyword", "string", "keyword"], - regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/}, - {token: "keyword", regex: /<<[\w\d\-$]+,?|>>/}, - {token: "constant.character", regex: /\({2,3}.*?\){2,3}/}, - // Anchor - {token: "keyword", regex: /\[\[.+?\]\]/}, - // bibliography - {token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/}, - - {include: "quotes"}, - // text block end - {token: "empty", regex: /^\s*$/, next: "start"} - ], - - "listText": [ - {include: "listStart"}, - {include: "text"} - ], - - "indentedBlock": [ - {token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock"}, - {token: "literal", regex: "", next: "start"} - ], - - "listingBlock": [ - {token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} - ], - "literalBlock": [ - {token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} - ], - "passthroughBlock": [ - {token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, - {include: "macros"}, - {token: "literal", regex: "."} - ], - - "smallPassthrough": [ - {token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, - {include: "macros"} - ], - - "commentBlock": [ - {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "doc.comment", regex: '^.*$'} - ], - "tableBlock": [ - {token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock"}, - {token: "tableBlock", regex: /\|/}, - {include: "text", noEscape: true} - ], - "innerTableBlock": [ - {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock"}, - {token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "tableBlock", regex: /\!/} - ], - "macros": [ - {token: "macro", regex: /{[\w\-$]+}/}, - {token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/}, - {token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/}, - {token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/}, - {token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/}, - {token: "keyword", regex: /^:.+?:(?= |$)/} - ], - - "quotes": [ - {token: "string.italic", regex: /__[^_\s].*?__/}, - {token: "string.italic", regex: quoteRule("_")}, - - {token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/}, - {token: "keyword.bold", regex: quoteRule("\\*")}, - - {token: "literal", regex: quoteRule("\\+")}, - {token: "literal", regex: /\+\+[^+\s].*?\+\+/}, - {token: "literal", regex: /\$\$.+?\$\$/}, - {token: "literal", regex: quoteRule("`")}, - - {token: "keyword", regex: quoteRule("^")}, - {token: "keyword", regex: quoteRule("~")}, - {token: "keyword", regex: /##?/}, - {token: "keyword", regex: /(?:\B|^)``|\b''/} - ] - - }; - - function quoteRule(ch) { - var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)"; - return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])"; - } - - //addQuoteBlock("text") - - var tokenMap = { - macro: "constant.character", - tableBlock: "doc.comment", - titleUnderline: "markup.heading", - singleLineTitle: "markup.heading", - pageBreak: "string", - option: "string.regexp", - otherBlock: "markup.list", - literal: "support.function", - optionalTitle: "constant.numeric", - escape: "constant.language.escape", - link: "markup.underline.list" - }; - - for (var state in this.$rules) { - var stateRules = this.$rules[state]; - for (var i = stateRules.length; i--; ) { - var rule = stateRules[i]; - if (rule.include || typeof rule == "string") { - var args = [i, 1].concat(this.$rules[rule.include || rule]); - if (rule.noEscape) { - args = args.filter(function(x) { - return !x.next; - }); - } - stateRules.splice.apply(stateRules, args); - } else if (rule.token in tokenMap) { - rule.token = tokenMap[rule.token]; - } - } - } -}; -oop.inherits(AsciidocHighlightRules, TextHighlightRules); - -exports.AsciidocHighlightRules = AsciidocHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86.js deleted file mode 100644 index d6343e80..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86.js +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").AssemblyX86HighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = AssemblyX86HighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ";"; - this.$id = "ace/mode/assembly_x86"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86_highlight_rules.js deleted file mode 100644 index 247d1d0c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86_highlight_rules.js +++ /dev/null @@ -1,114 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from Assembly x86.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AssemblyX86HighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: 'keyword.control.assembly', - regex: '\\b(?:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vtestps|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(?:n?e|n?z)?|call|j(?:mp|n?e|ge?|ae?|le?|be?|n?o|n?z))\\b', - caseInsensitive: true }, - { token: 'variable.parameter.register.assembly', - regex: '\\b(?:CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RCX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R8-15|(?:Y|X)MM(?:[0-9]|10|11|12|13|14|15)|(?:A|B|C|D)(?:X|H|L)|CR(?:[0-4]|DR(?:[0-7]|TR6|TR7|EFER)))\\b', - caseInsensitive: true }, - { token: 'constant.character.decimal.assembly', - regex: '\\b[0-9]+\\b' }, - { token: 'constant.character.hexadecimal.assembly', - regex: '\\b0x[A-F0-9]+\\b', - caseInsensitive: true }, - { token: 'constant.character.hexadecimal.assembly', - regex: '\\b[A-F0-9]+h\\b', - caseInsensitive: true }, - { token: 'string.assembly', regex: /'([^\\']|\\.)*'/ }, - { token: 'string.assembly', regex: /"([^\\"]|\\.)*"/ }, - { token: 'support.function.directive.assembly', - regex: '^\\[', - push: - [ { token: 'support.function.directive.assembly', - regex: '\\]$', - next: 'pop' }, - { defaultToken: 'support.function.directive.assembly' } ] }, - { token: - [ 'support.function.directive.assembly', - 'support.function.directive.assembly', - 'entity.name.function.assembly' ], - regex: '(^struc)( )([_a-zA-Z][_a-zA-Z0-9]*)' }, - { token: 'support.function.directive.assembly', - regex: '^endstruc\\b' }, - { token: - [ 'support.function.directive.assembly', - 'entity.name.function.assembly', - 'support.function.directive.assembly', - 'constant.character.assembly' ], - regex: '^(%macro )([_a-zA-Z][_a-zA-Z0-9]*)( )([0-9]+)' }, - { token: 'support.function.directive.assembly', - regex: '^%endmacro' }, - { token: - [ 'text', - 'support.function.directive.assembly', - 'text', - 'entity.name.function.assembly' ], - regex: '(\\s*)(%define|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(?:el)?ifdef|%(?:el)?ifmacro|%(?:el)?ifctx|%(?:el)?ifidn|%(?:el)?ifidni|%(?:el)?ifid|%(?:el)?ifnum|%(?:el)?ifstr|%(?:el)?iftoken|%(?:el)?ifempty|%(?:el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b( ?)((?:[_a-zA-Z][_a-zA-Z0-9]*)?)', - caseInsensitive: true }, - { token: 'support.function.directive.assembly', - regex: '\\b(?:d[bwdqtoy]|res[bwdqto]|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin)\\b', - caseInsensitive: true }, - { token: 'entity.name.function.assembly', regex: '^\\s*%%[\\w.]+?:$' }, - { token: 'entity.name.function.assembly', regex: '^\\s*%\\$[\\w.]+?:$' }, - { token: 'entity.name.function.assembly', regex: '^[\\w.]+?:' }, - { token: 'entity.name.function.assembly', regex: '^[\\w.]+?\\b' }, - { token: 'comment.assembly', regex: ';.*$' } ] - } - - this.normalizeRules(); -}; - -AssemblyX86HighlightRules.metaData = { fileTypes: [ 'asm' ], - name: 'Assembly x86', - scopeName: 'source.assembly' } - - -oop.inherits(AssemblyX86HighlightRules, TextHighlightRules); - -exports.AssemblyX86HighlightRules = AssemblyX86HighlightRules; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey.js deleted file mode 100644 index d7093fd5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey.js +++ /dev/null @@ -1,57 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AutoHotKeyHighlightRules = require("./autohotkey_highlight_rules").AutoHotKeyHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = AutoHotKeyHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ";"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/autohotkey"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey_highlight_rules.js deleted file mode 100644 index 45193996..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey_highlight_rules.js +++ /dev/null @@ -1,107 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from C:\Users\LED\Desktop\AutoHotKey.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AutoHotKeyHighlightRules = function() { - var autoItKeywords = 'And|ByRef|Case|Const|ContinueCase|ContinueLoop|Default|Dim|Do|Else|ElseIf|EndFunc|EndIf|EndSelect|EndSwitch|EndWith|Enum|Exit|ExitLoop|False|For|Func|Global|If|In|Local|Next|Not|Or|ReDim|Return|Select|Step|Switch|Then|To|True|Until|WEnd|While|With|' + - 'Abs|ACos|AdlibDisable|AdlibEnable|Asc|AscW|ASin|Assign|ATan|AutoItSetOption|AutoItWinGetTitle|AutoItWinSetTitle|Beep|Binary|BinaryLen|BinaryMid|BinaryToString|BitAND|BitNOT|BitOR|BitRotate|BitShift|BitXOR|BlockInput|Break|Call|CDTray|Ceiling|Chr|ChrW|ClipGet|ClipPut|ConsoleRead|ConsoleWrite|ConsoleWriteError|ControlClick|ControlCommand|ControlDisable|ControlEnable|ControlFocus|ControlGetFocus|ControlGetHandle|ControlGetPos|ControlGetText|ControlHide|ControlListView|ControlMove|ControlSend|ControlSetText|ControlShow|ControlTreeView|Cos|Dec|DirCopy|DirCreate|DirGetSize|DirMove|DirRemove|DllCall|DllCallbackFree|DllCallbackGetPtr|DllCallbackRegister|DllClose|DllOpen|DllStructCreate|DllStructGetData|DllStructGetPtr|DllStructGetSize|DllStructSetData|DriveGetDrive|DriveGetFileSystem|DriveGetLabel|DriveGetSerial|DriveGetType|DriveMapAdd|DriveMapDel|DriveMapGet|DriveSetLabel|DriveSpaceFree|DriveSpaceTotal|DriveStatus|EnvGet|EnvSet|EnvUpdate|Eval|Execute|Exp|FileChangeDir|FileClose|FileCopy|FileCreateNTFSLink|FileCreateShortcut|FileDelete|FileExists|FileFindFirstFile|FileFindNextFile|FileGetAttrib|FileGetLongName|FileGetShortcut|FileGetShortName|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileOpen|FileOpenDialog|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileSaveDialog|FileSelectFolder|FileSetAttrib|FileSetTime|FileWrite|FileWriteLine|Floor|FtpSetProxy|GUICreate|GUICtrlCreateAvi|GUICtrlCreateButton|GUICtrlCreateCheckbox|GUICtrlCreateCombo|GUICtrlCreateContextMenu|GUICtrlCreateDate|GUICtrlCreateDummy|GUICtrlCreateEdit|GUICtrlCreateGraphic|GUICtrlCreateGroup|GUICtrlCreateIcon|GUICtrlCreateInput|GUICtrlCreateLabel|GUICtrlCreateList|GUICtrlCreateListView|GUICtrlCreateListViewItem|GUICtrlCreateMenu|GUICtrlCreateMenuItem|GUICtrlCreateMonthCal|GUICtrlCreateObj|GUICtrlCreatePic|GUICtrlCreateProgress|GUICtrlCreateRadio|GUICtrlCreateSlider|GUICtrlCreateTab|GUICtrlCreateTabItem|GUICtrlCreateTreeView|GUICtrlCreateTreeViewItem|GUICtrlCreateUpdown|GUICtrlDelete|GUICtrlGetHandle|GUICtrlGetState|GUICtrlRead|GUICtrlRecvMsg|GUICtrlRegisterListViewSort|GUICtrlSendMsg|GUICtrlSendToDummy|GUICtrlSetBkColor|GUICtrlSetColor|GUICtrlSetCursor|GUICtrlSetData|GUICtrlSetFont|GUICtrlSetDefColor|GUICtrlSetDefBkColor|GUICtrlSetGraphic|GUICtrlSetImage|GUICtrlSetLimit|GUICtrlSetOnEvent|GUICtrlSetPos|GUICtrlSetResizing|GUICtrlSetState|GUICtrlSetStyle|GUICtrlSetTip|GUIDelete|GUIGetCursorInfo|GUIGetMsg|GUIGetStyle|GUIRegisterMsg|GUISetAccelerators()|GUISetBkColor|GUISetCoord|GUISetCursor|GUISetFont|GUISetHelp|GUISetIcon|GUISetOnEvent|GUISetState|GUISetStyle|GUIStartGroup|GUISwitch|Hex|HotKeySet|HttpSetProxy|HWnd|InetGet|InetGetSize|IniDelete|IniRead|IniReadSection|IniReadSectionNames|IniRenameSection|IniWrite|IniWriteSection|InputBox|Int|IsAdmin|IsArray|IsBinary|IsBool|IsDeclared|IsDllStruct|IsFloat|IsHWnd|IsInt|IsKeyword|IsNumber|IsObj|IsPtr|IsString|Log|MemGetStats|Mod|MouseClick|MouseClickDrag|MouseDown|MouseGetCursor|MouseGetPos|MouseMove|MouseUp|MouseWheel|MsgBox|Number|ObjCreate|ObjEvent|ObjGet|ObjName|Opt|Ping|PixelChecksum|PixelGetColor|PixelSearch|PluginClose|PluginOpen|ProcessClose|ProcessExists|ProcessGetStats|ProcessList|ProcessSetPriority|ProcessWait|ProcessWaitClose|ProgressOff|ProgressOn|ProgressSet|Ptr|Random|RegDelete|RegEnumKey|RegEnumVal|RegRead|RegWrite|Round|Run|RunAs|RunAsWait|RunWait|Send|SendKeepActive|SetError|SetExtended|ShellExecute|ShellExecuteWait|Shutdown|Sin|Sleep|SoundPlay|SoundSetWaveVolume|SplashImageOn|SplashOff|SplashTextOn|Sqrt|SRandom|StatusbarGetText|StderrRead|StdinWrite|StdioClose|StdoutRead|String|StringAddCR|StringCompare|StringFormat|StringInStr|StringIsAlNum|StringIsAlpha|StringIsASCII|StringIsDigit|StringIsFloat|StringIsInt|StringIsLower|StringIsSpace|StringIsUpper|StringIsXDigit|StringLeft|StringLen|StringLower|StringMid|StringRegExp|StringRegExpReplace|StringReplace|StringRight|StringSplit|StringStripCR|StringStripWS|StringToBinary|StringTrimLeft|StringTrimRight|StringUpper|Tan|TCPAccept|TCPCloseSocket|TCPConnect|TCPListen|TCPNameToIP|TCPRecv|TCPSend|TCPShutdown|TCPStartup|TimerDiff|TimerInit|ToolTip|TrayCreateItem|TrayCreateMenu|TrayGetMsg|TrayItemDelete|TrayItemGetHandle|TrayItemGetState|TrayItemGetText|TrayItemSetOnEvent|TrayItemSetState|TrayItemSetText|TraySetClick|TraySetIcon|TraySetOnEvent|TraySetPauseIcon|TraySetState|TraySetToolTip|TrayTip|UBound|UDPBind|UDPCloseSocket|UDPOpen|UDPRecv|UDPSend|UDPShutdown|UDPStartup|VarGetType|WinActivate|WinActive|WinClose|WinExists|WinFlash|WinGetCaretPos|WinGetClassList|WinGetClientSize|WinGetHandle|WinGetPos|WinGetProcess|WinGetState|WinGetText|WinGetTitle|WinKill|WinList|WinMenuSelectItem|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinSetOnTop|WinSetState|WinSetTitle|WinSetTrans|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive|' + - 'ArrayAdd|ArrayBinarySearch|ArrayConcatenate|ArrayDelete|ArrayDisplay|ArrayFindAll|ArrayInsert|ArrayMax|ArrayMaxIndex|ArrayMin|ArrayMinIndex|ArrayPop|ArrayPush|ArrayReverse|ArraySearch|ArraySort|ArraySwap|ArrayToClip|ArrayToString|ArrayTrim|ChooseColor|ChooseFont|ClipBoard_ChangeChain|ClipBoard_Close|ClipBoard_CountFormats|ClipBoard_Empty|ClipBoard_EnumFormats|ClipBoard_FormatStr|ClipBoard_GetData|ClipBoard_GetDataEx|ClipBoard_GetFormatName|ClipBoard_GetOpenWindow|ClipBoard_GetOwner|ClipBoard_GetPriorityFormat|ClipBoard_GetSequenceNumber|ClipBoard_GetViewer|ClipBoard_IsFormatAvailable|ClipBoard_Open|ClipBoard_RegisterFormat|ClipBoard_SetData|ClipBoard_SetDataEx|ClipBoard_SetViewer|ClipPutFile|ColorConvertHSLtoRGB|ColorConvertRGBtoHSL|ColorGetBlue|ColorGetGreen|ColorGetRed|Date_Time_CompareFileTime|Date_Time_DOSDateTimeToArray|Date_Time_DOSDateTimeToFileTime|Date_Time_DOSDateTimeToStr|Date_Time_DOSDateToArray|Date_Time_DOSDateToStr|Date_Time_DOSTimeToArray|Date_Time_DOSTimeToStr|Date_Time_EncodeFileTime|Date_Time_EncodeSystemTime|Date_Time_FileTimeToArray|Date_Time_FileTimeToDOSDateTime|Date_Time_FileTimeToLocalFileTime|Date_Time_FileTimeToStr|Date_Time_FileTimeToSystemTime|Date_Time_GetFileTime|Date_Time_GetLocalTime|Date_Time_GetSystemTime|Date_Time_GetSystemTimeAdjustment|Date_Time_GetSystemTimeAsFileTime|Date_Time_GetSystemTimes|Date_Time_GetTickCount|Date_Time_GetTimeZoneInformation|Date_Time_LocalFileTimeToFileTime|Date_Time_SetFileTime|Date_Time_SetLocalTime|Date_Time_SetSystemTime|Date_Time_SetSystemTimeAdjustment|Date_Time_SetTimeZoneInformation|Date_Time_SystemTimeToArray|Date_Time_SystemTimeToDateStr|Date_Time_SystemTimeToDateTimeStr|Date_Time_SystemTimeToFileTime|Date_Time_SystemTimeToTimeStr|Date_Time_SystemTimeToTzSpecificLocalTime|Date_Time_TzSpecificLocalTimeToSystemTime|DateAdd|DateDayOfWeek|DateDaysInMonth|DateDiff|DateIsLeapYear|DateIsValid|DateTimeFormat|DateTimeSplit|DateToDayOfWeek|DateToDayOfWeekISO|DateToDayValue|DateToMonth|DayValueToDate|DebugBugReportEnv|DebugOut|DebugSetup|Degree|EventLog__Backup|EventLog__Clear|EventLog__Close|EventLog__Count|EventLog__DeregisterSource|EventLog__Full|EventLog__Notify|EventLog__Oldest|EventLog__Open|EventLog__OpenBackup|EventLog__Read|EventLog__RegisterSource|EventLog__Report|FileCountLines|FileCreate|FileListToArray|FilePrint|FileReadToArray|FileWriteFromArray|FileWriteLog|FileWriteToLine|GDIPlus_ArrowCapCreate|GDIPlus_ArrowCapDispose|GDIPlus_ArrowCapGetFillState|GDIPlus_ArrowCapGetHeight|GDIPlus_ArrowCapGetMiddleInset|GDIPlus_ArrowCapGetWidth|GDIPlus_ArrowCapSetFillState|GDIPlus_ArrowCapSetHeight|GDIPlus_ArrowCapSetMiddleInset|GDIPlus_ArrowCapSetWidth|GDIPlus_BitmapCloneArea|GDIPlus_BitmapCreateFromFile|GDIPlus_BitmapCreateFromGraphics|GDIPlus_BitmapCreateFromHBITMAP|GDIPlus_BitmapCreateHBITMAPFromBitmap|GDIPlus_BitmapDispose|GDIPlus_BitmapLockBits|GDIPlus_BitmapUnlockBits|GDIPlus_BrushClone|GDIPlus_BrushCreateSolid|GDIPlus_BrushDispose|GDIPlus_BrushGetType|GDIPlus_CustomLineCapDispose|GDIPlus_Decoders|GDIPlus_DecodersGetCount|GDIPlus_DecodersGetSize|GDIPlus_Encoders|GDIPlus_EncodersGetCLSID|GDIPlus_EncodersGetCount|GDIPlus_EncodersGetParamList|GDIPlus_EncodersGetParamListSize|GDIPlus_EncodersGetSize|GDIPlus_FontCreate|GDIPlus_FontDispose|GDIPlus_FontFamilyCreate|GDIPlus_FontFamilyDispose|GDIPlus_GraphicsClear|GDIPlus_GraphicsCreateFromHDC|GDIPlus_GraphicsCreateFromHWND|GDIPlus_GraphicsDispose|GDIPlus_GraphicsDrawArc|GDIPlus_GraphicsDrawBezier|GDIPlus_GraphicsDrawClosedCurve|GDIPlus_GraphicsDrawCurve|GDIPlus_GraphicsDrawEllipse|GDIPlus_GraphicsDrawImage|GDIPlus_GraphicsDrawImageRect|GDIPlus_GraphicsDrawImageRectRect|GDIPlus_GraphicsDrawLine|GDIPlus_GraphicsDrawPie|GDIPlus_GraphicsDrawPolygon|GDIPlus_GraphicsDrawRect|GDIPlus_GraphicsDrawString|GDIPlus_GraphicsDrawStringEx|GDIPlus_GraphicsFillClosedCurve|GDIPlus_GraphicsFillEllipse|GDIPlus_GraphicsFillPie|GDIPlus_GraphicsFillRect|GDIPlus_GraphicsGetDC|GDIPlus_GraphicsGetSmoothingMode|GDIPlus_GraphicsMeasureString|GDIPlus_GraphicsReleaseDC|GDIPlus_GraphicsSetSmoothingMode|GDIPlus_GraphicsSetTransform|GDIPlus_ImageDispose|GDIPlus_ImageGetGraphicsContext|GDIPlus_ImageGetHeight|GDIPlus_ImageGetWidth|GDIPlus_ImageLoadFromFile|GDIPlus_ImageSaveToFile|GDIPlus_ImageSaveToFileEx|GDIPlus_MatrixCreate|GDIPlus_MatrixDispose|GDIPlus_MatrixRotate|GDIPlus_ParamAdd|GDIPlus_ParamInit|GDIPlus_PenCreate|GDIPlus_PenDispose|GDIPlus_PenGetAlignment|GDIPlus_PenGetColor|GDIPlus_PenGetCustomEndCap|GDIPlus_PenGetDashCap|GDIPlus_PenGetDashStyle|GDIPlus_PenGetEndCap|GDIPlus_PenGetWidth|GDIPlus_PenSetAlignment|GDIPlus_PenSetColor|GDIPlus_PenSetCustomEndCap|GDIPlus_PenSetDashCap|GDIPlus_PenSetDashStyle|GDIPlus_PenSetEndCap|GDIPlus_PenSetWidth|GDIPlus_RectFCreate|GDIPlus_Shutdown|GDIPlus_Startup|GDIPlus_StringFormatCreate|GDIPlus_StringFormatDispose|GetIP|GUICtrlAVI_Close|GUICtrlAVI_Create|GUICtrlAVI_Destroy|GUICtrlAVI_Open|GUICtrlAVI_OpenEx|GUICtrlAVI_Play|GUICtrlAVI_Seek|GUICtrlAVI_Show|GUICtrlAVI_Stop|GUICtrlButton_Click|GUICtrlButton_Create|GUICtrlButton_Destroy|GUICtrlButton_Enable|GUICtrlButton_GetCheck|GUICtrlButton_GetFocus|GUICtrlButton_GetIdealSize|GUICtrlButton_GetImage|GUICtrlButton_GetImageList|GUICtrlButton_GetState|GUICtrlButton_GetText|GUICtrlButton_GetTextMargin|GUICtrlButton_SetCheck|GUICtrlButton_SetFocus|GUICtrlButton_SetImage|GUICtrlButton_SetImageList|GUICtrlButton_SetSize|GUICtrlButton_SetState|GUICtrlButton_SetStyle|GUICtrlButton_SetText|GUICtrlButton_SetTextMargin|GUICtrlButton_Show|GUICtrlComboBox_AddDir|GUICtrlComboBox_AddString|GUICtrlComboBox_AutoComplete|GUICtrlComboBox_BeginUpdate|GUICtrlComboBox_Create|GUICtrlComboBox_DeleteString|GUICtrlComboBox_Destroy|GUICtrlComboBox_EndUpdate|GUICtrlComboBox_FindString|GUICtrlComboBox_FindStringExact|GUICtrlComboBox_GetComboBoxInfo|GUICtrlComboBox_GetCount|GUICtrlComboBox_GetCurSel|GUICtrlComboBox_GetDroppedControlRect|GUICtrlComboBox_GetDroppedControlRectEx|GUICtrlComboBox_GetDroppedState|GUICtrlComboBox_GetDroppedWidth|GUICtrlComboBox_GetEditSel|GUICtrlComboBox_GetEditText|GUICtrlComboBox_GetExtendedUI|GUICtrlComboBox_GetHorizontalExtent|GUICtrlComboBox_GetItemHeight|GUICtrlComboBox_GetLBText|GUICtrlComboBox_GetLBTextLen|GUICtrlComboBox_GetList|GUICtrlComboBox_GetListArray|GUICtrlComboBox_GetLocale|GUICtrlComboBox_GetLocaleCountry|GUICtrlComboBox_GetLocaleLang|GUICtrlComboBox_GetLocalePrimLang|GUICtrlComboBox_GetLocaleSubLang|GUICtrlComboBox_GetMinVisible|GUICtrlComboBox_GetTopIndex|GUICtrlComboBox_InitStorage|GUICtrlComboBox_InsertString|GUICtrlComboBox_LimitText|GUICtrlComboBox_ReplaceEditSel|GUICtrlComboBox_ResetContent|GUICtrlComboBox_SelectString|GUICtrlComboBox_SetCurSel|GUICtrlComboBox_SetDroppedWidth|GUICtrlComboBox_SetEditSel|GUICtrlComboBox_SetEditText|GUICtrlComboBox_SetExtendedUI|GUICtrlComboBox_SetHorizontalExtent|GUICtrlComboBox_SetItemHeight|GUICtrlComboBox_SetMinVisible|GUICtrlComboBox_SetTopIndex|GUICtrlComboBox_ShowDropDown|GUICtrlComboBoxEx_AddDir|GUICtrlComboBoxEx_AddString|GUICtrlComboBoxEx_BeginUpdate|GUICtrlComboBoxEx_Create|GUICtrlComboBoxEx_CreateSolidBitMap|GUICtrlComboBoxEx_DeleteString|GUICtrlComboBoxEx_Destroy|GUICtrlComboBoxEx_EndUpdate|GUICtrlComboBoxEx_FindStringExact|GUICtrlComboBoxEx_GetComboBoxInfo|GUICtrlComboBoxEx_GetComboControl|GUICtrlComboBoxEx_GetCount|GUICtrlComboBoxEx_GetCurSel|GUICtrlComboBoxEx_GetDroppedControlRect|GUICtrlComboBoxEx_GetDroppedControlRectEx|GUICtrlComboBoxEx_GetDroppedState|GUICtrlComboBoxEx_GetDroppedWidth|GUICtrlComboBoxEx_GetEditControl|GUICtrlComboBoxEx_GetEditSel|GUICtrlComboBoxEx_GetEditText|GUICtrlComboBoxEx_GetExtendedStyle|GUICtrlComboBoxEx_GetExtendedUI|GUICtrlComboBoxEx_GetImageList|GUICtrlComboBoxEx_GetItem|GUICtrlComboBoxEx_GetItemEx|GUICtrlComboBoxEx_GetItemHeight|GUICtrlComboBoxEx_GetItemImage|GUICtrlComboBoxEx_GetItemIndent|GUICtrlComboBoxEx_GetItemOverlayImage|GUICtrlComboBoxEx_GetItemParam|GUICtrlComboBoxEx_GetItemSelectedImage|GUICtrlComboBoxEx_GetItemText|GUICtrlComboBoxEx_GetItemTextLen|GUICtrlComboBoxEx_GetList|GUICtrlComboBoxEx_GetListArray|GUICtrlComboBoxEx_GetLocale|GUICtrlComboBoxEx_GetLocaleCountry|GUICtrlComboBoxEx_GetLocaleLang|GUICtrlComboBoxEx_GetLocalePrimLang|GUICtrlComboBoxEx_GetLocaleSubLang|GUICtrlComboBoxEx_GetMinVisible|GUICtrlComboBoxEx_GetTopIndex|GUICtrlComboBoxEx_InitStorage|GUICtrlComboBoxEx_InsertString|GUICtrlComboBoxEx_LimitText|GUICtrlComboBoxEx_ReplaceEditSel|GUICtrlComboBoxEx_ResetContent|GUICtrlComboBoxEx_SetCurSel|GUICtrlComboBoxEx_SetDroppedWidth|GUICtrlComboBoxEx_SetEditSel|GUICtrlComboBoxEx_SetEditText|GUICtrlComboBoxEx_SetExtendedStyle|GUICtrlComboBoxEx_SetExtendedUI|GUICtrlComboBoxEx_SetImageList|GUICtrlComboBoxEx_SetItem|GUICtrlComboBoxEx_SetItemEx|GUICtrlComboBoxEx_SetItemHeight|GUICtrlComboBoxEx_SetItemImage|GUICtrlComboBoxEx_SetItemIndent|GUICtrlComboBoxEx_SetItemOverlayImage|GUICtrlComboBoxEx_SetItemParam|GUICtrlComboBoxEx_SetItemSelectedImage|GUICtrlComboBoxEx_SetMinVisible|GUICtrlComboBoxEx_SetTopIndex|GUICtrlComboBoxEx_ShowDropDown|GUICtrlDTP_Create|GUICtrlDTP_Destroy|GUICtrlDTP_GetMCColor|GUICtrlDTP_GetMCFont|GUICtrlDTP_GetMonthCal|GUICtrlDTP_GetRange|GUICtrlDTP_GetRangeEx|GUICtrlDTP_GetSystemTime|GUICtrlDTP_GetSystemTimeEx|GUICtrlDTP_SetFormat|GUICtrlDTP_SetMCColor|GUICtrlDTP_SetMCFont|GUICtrlDTP_SetRange|GUICtrlDTP_SetRangeEx|GUICtrlDTP_SetSystemTime|GUICtrlDTP_SetSystemTimeEx|GUICtrlEdit_AppendText|GUICtrlEdit_BeginUpdate|GUICtrlEdit_CanUndo|GUICtrlEdit_CharFromPos|GUICtrlEdit_Create|GUICtrlEdit_Destroy|GUICtrlEdit_EmptyUndoBuffer|GUICtrlEdit_EndUpdate|GUICtrlEdit_Find|GUICtrlEdit_FmtLines|GUICtrlEdit_GetFirstVisibleLine|GUICtrlEdit_GetLimitText|GUICtrlEdit_GetLine|GUICtrlEdit_GetLineCount|GUICtrlEdit_GetMargins|GUICtrlEdit_GetModify|GUICtrlEdit_GetPasswordChar|GUICtrlEdit_GetRECT|GUICtrlEdit_GetRECTEx|GUICtrlEdit_GetSel|GUICtrlEdit_GetText|GUICtrlEdit_GetTextLen|GUICtrlEdit_HideBalloonTip|GUICtrlEdit_InsertText|GUICtrlEdit_LineFromChar|GUICtrlEdit_LineIndex|GUICtrlEdit_LineLength|GUICtrlEdit_LineScroll|GUICtrlEdit_PosFromChar|GUICtrlEdit_ReplaceSel|GUICtrlEdit_Scroll|GUICtrlEdit_SetLimitText|GUICtrlEdit_SetMargins|GUICtrlEdit_SetModify|GUICtrlEdit_SetPasswordChar|GUICtrlEdit_SetReadOnly|GUICtrlEdit_SetRECT|GUICtrlEdit_SetRECTEx|GUICtrlEdit_SetRECTNP|GUICtrlEdit_SetRectNPEx|GUICtrlEdit_SetSel|GUICtrlEdit_SetTabStops|GUICtrlEdit_SetText|GUICtrlEdit_ShowBalloonTip|GUICtrlEdit_Undo|GUICtrlHeader_AddItem|GUICtrlHeader_ClearFilter|GUICtrlHeader_ClearFilterAll|GUICtrlHeader_Create|GUICtrlHeader_CreateDragImage|GUICtrlHeader_DeleteItem|GUICtrlHeader_Destroy|GUICtrlHeader_EditFilter|GUICtrlHeader_GetBitmapMargin|GUICtrlHeader_GetImageList|GUICtrlHeader_GetItem|GUICtrlHeader_GetItemAlign|GUICtrlHeader_GetItemBitmap|GUICtrlHeader_GetItemCount|GUICtrlHeader_GetItemDisplay|GUICtrlHeader_GetItemFlags|GUICtrlHeader_GetItemFormat|GUICtrlHeader_GetItemImage|GUICtrlHeader_GetItemOrder|GUICtrlHeader_GetItemParam|GUICtrlHeader_GetItemRect|GUICtrlHeader_GetItemRectEx|GUICtrlHeader_GetItemText|GUICtrlHeader_GetItemWidth|GUICtrlHeader_GetOrderArray|GUICtrlHeader_GetUnicodeFormat|GUICtrlHeader_HitTest|GUICtrlHeader_InsertItem|GUICtrlHeader_Layout|GUICtrlHeader_OrderToIndex|GUICtrlHeader_SetBitmapMargin|GUICtrlHeader_SetFilterChangeTimeout|GUICtrlHeader_SetHotDivider|GUICtrlHeader_SetImageList|GUICtrlHeader_SetItem|GUICtrlHeader_SetItemAlign|GUICtrlHeader_SetItemBitmap|GUICtrlHeader_SetItemDisplay|GUICtrlHeader_SetItemFlags|GUICtrlHeader_SetItemFormat|GUICtrlHeader_SetItemImage|GUICtrlHeader_SetItemOrder|GUICtrlHeader_SetItemParam|GUICtrlHeader_SetItemText|GUICtrlHeader_SetItemWidth|GUICtrlHeader_SetOrderArray|GUICtrlHeader_SetUnicodeFormat|GUICtrlIpAddress_ClearAddress|GUICtrlIpAddress_Create|GUICtrlIpAddress_Destroy|GUICtrlIpAddress_Get|GUICtrlIpAddress_GetArray|GUICtrlIpAddress_GetEx|GUICtrlIpAddress_IsBlank|GUICtrlIpAddress_Set|GUICtrlIpAddress_SetArray|GUICtrlIpAddress_SetEx|GUICtrlIpAddress_SetFocus|GUICtrlIpAddress_SetFont|GUICtrlIpAddress_SetRange|GUICtrlIpAddress_ShowHide|GUICtrlListBox_AddFile|GUICtrlListBox_AddString|GUICtrlListBox_BeginUpdate|GUICtrlListBox_Create|GUICtrlListBox_DeleteString|GUICtrlListBox_Destroy|GUICtrlListBox_Dir|GUICtrlListBox_EndUpdate|GUICtrlListBox_FindInText|GUICtrlListBox_FindString|GUICtrlListBox_GetAnchorIndex|GUICtrlListBox_GetCaretIndex|GUICtrlListBox_GetCount|GUICtrlListBox_GetCurSel|GUICtrlListBox_GetHorizontalExtent|GUICtrlListBox_GetItemData|GUICtrlListBox_GetItemHeight|GUICtrlListBox_GetItemRect|GUICtrlListBox_GetItemRectEx|GUICtrlListBox_GetListBoxInfo|GUICtrlListBox_GetLocale|GUICtrlListBox_GetLocaleCountry|GUICtrlListBox_GetLocaleLang|GUICtrlListBox_GetLocalePrimLang|GUICtrlListBox_GetLocaleSubLang|GUICtrlListBox_GetSel|GUICtrlListBox_GetSelCount|GUICtrlListBox_GetSelItems|GUICtrlListBox_GetSelItemsText|GUICtrlListBox_GetText|GUICtrlListBox_GetTextLen|GUICtrlListBox_GetTopIndex|GUICtrlListBox_InitStorage|GUICtrlListBox_InsertString|GUICtrlListBox_ItemFromPoint|GUICtrlListBox_ReplaceString|GUICtrlListBox_ResetContent|GUICtrlListBox_SelectString|GUICtrlListBox_SelItemRange|GUICtrlListBox_SelItemRangeEx|GUICtrlListBox_SetAnchorIndex|GUICtrlListBox_SetCaretIndex|GUICtrlListBox_SetColumnWidth|GUICtrlListBox_SetCurSel|GUICtrlListBox_SetHorizontalExtent|GUICtrlListBox_SetItemData|GUICtrlListBox_SetItemHeight|GUICtrlListBox_SetLocale|GUICtrlListBox_SetSel|GUICtrlListBox_SetTabStops|GUICtrlListBox_SetTopIndex|GUICtrlListBox_Sort|GUICtrlListBox_SwapString|GUICtrlListBox_UpdateHScroll|GUICtrlListView_AddArray|GUICtrlListView_AddColumn|GUICtrlListView_AddItem|GUICtrlListView_AddSubItem|GUICtrlListView_ApproximateViewHeight|GUICtrlListView_ApproximateViewRect|GUICtrlListView_ApproximateViewWidth|GUICtrlListView_Arrange|GUICtrlListView_BeginUpdate|GUICtrlListView_CancelEditLabel|GUICtrlListView_ClickItem|GUICtrlListView_CopyItems|GUICtrlListView_Create|GUICtrlListView_CreateDragImage|GUICtrlListView_CreateSolidBitMap|GUICtrlListView_DeleteAllItems|GUICtrlListView_DeleteColumn|GUICtrlListView_DeleteItem|GUICtrlListView_DeleteItemsSelected|GUICtrlListView_Destroy|GUICtrlListView_DrawDragImage|GUICtrlListView_EditLabel|GUICtrlListView_EnableGroupView|GUICtrlListView_EndUpdate|GUICtrlListView_EnsureVisible|GUICtrlListView_FindInText|GUICtrlListView_FindItem|GUICtrlListView_FindNearest|GUICtrlListView_FindParam|GUICtrlListView_FindText|GUICtrlListView_GetBkColor|GUICtrlListView_GetBkImage|GUICtrlListView_GetCallbackMask|GUICtrlListView_GetColumn|GUICtrlListView_GetColumnCount|GUICtrlListView_GetColumnOrder|GUICtrlListView_GetColumnOrderArray|GUICtrlListView_GetColumnWidth|GUICtrlListView_GetCounterPage|GUICtrlListView_GetEditControl|GUICtrlListView_GetExtendedListViewStyle|GUICtrlListView_GetGroupInfo|GUICtrlListView_GetGroupViewEnabled|GUICtrlListView_GetHeader|GUICtrlListView_GetHotCursor|GUICtrlListView_GetHotItem|GUICtrlListView_GetHoverTime|GUICtrlListView_GetImageList|GUICtrlListView_GetISearchString|GUICtrlListView_GetItem|GUICtrlListView_GetItemChecked|GUICtrlListView_GetItemCount|GUICtrlListView_GetItemCut|GUICtrlListView_GetItemDropHilited|GUICtrlListView_GetItemEx|GUICtrlListView_GetItemFocused|GUICtrlListView_GetItemGroupID|GUICtrlListView_GetItemImage|GUICtrlListView_GetItemIndent|GUICtrlListView_GetItemParam|GUICtrlListView_GetItemPosition|GUICtrlListView_GetItemPositionX|GUICtrlListView_GetItemPositionY|GUICtrlListView_GetItemRect|GUICtrlListView_GetItemRectEx|GUICtrlListView_GetItemSelected|GUICtrlListView_GetItemSpacing|GUICtrlListView_GetItemSpacingX|GUICtrlListView_GetItemSpacingY|GUICtrlListView_GetItemState|GUICtrlListView_GetItemStateImage|GUICtrlListView_GetItemText|GUICtrlListView_GetItemTextArray|GUICtrlListView_GetItemTextString|GUICtrlListView_GetNextItem|GUICtrlListView_GetNumberOfWorkAreas|GUICtrlListView_GetOrigin|GUICtrlListView_GetOriginX|GUICtrlListView_GetOriginY|GUICtrlListView_GetOutlineColor|GUICtrlListView_GetSelectedColumn|GUICtrlListView_GetSelectedCount|GUICtrlListView_GetSelectedIndices|GUICtrlListView_GetSelectionMark|GUICtrlListView_GetStringWidth|GUICtrlListView_GetSubItemRect|GUICtrlListView_GetTextBkColor|GUICtrlListView_GetTextColor|GUICtrlListView_GetToolTips|GUICtrlListView_GetTopIndex|GUICtrlListView_GetUnicodeFormat|GUICtrlListView_GetView|GUICtrlListView_GetViewDetails|GUICtrlListView_GetViewLarge|GUICtrlListView_GetViewList|GUICtrlListView_GetViewRect|GUICtrlListView_GetViewSmall|GUICtrlListView_GetViewTile|GUICtrlListView_HideColumn|GUICtrlListView_HitTest|GUICtrlListView_InsertColumn|GUICtrlListView_InsertGroup|GUICtrlListView_InsertItem|GUICtrlListView_JustifyColumn|GUICtrlListView_MapIDToIndex|GUICtrlListView_MapIndexToID|GUICtrlListView_RedrawItems|GUICtrlListView_RegisterSortCallBack|GUICtrlListView_RemoveAllGroups|GUICtrlListView_RemoveGroup|GUICtrlListView_Scroll|GUICtrlListView_SetBkColor|GUICtrlListView_SetBkImage|GUICtrlListView_SetCallBackMask|GUICtrlListView_SetColumn|GUICtrlListView_SetColumnOrder|GUICtrlListView_SetColumnOrderArray|GUICtrlListView_SetColumnWidth|GUICtrlListView_SetExtendedListViewStyle|GUICtrlListView_SetGroupInfo|GUICtrlListView_SetHotItem|GUICtrlListView_SetHoverTime|GUICtrlListView_SetIconSpacing|GUICtrlListView_SetImageList|GUICtrlListView_SetItem|GUICtrlListView_SetItemChecked|GUICtrlListView_SetItemCount|GUICtrlListView_SetItemCut|GUICtrlListView_SetItemDropHilited|GUICtrlListView_SetItemEx|GUICtrlListView_SetItemFocused|GUICtrlListView_SetItemGroupID|GUICtrlListView_SetItemImage|GUICtrlListView_SetItemIndent|GUICtrlListView_SetItemParam|GUICtrlListView_SetItemPosition|GUICtrlListView_SetItemPosition32|GUICtrlListView_SetItemSelected|GUICtrlListView_SetItemState|GUICtrlListView_SetItemStateImage|GUICtrlListView_SetItemText|GUICtrlListView_SetOutlineColor|GUICtrlListView_SetSelectedColumn|GUICtrlListView_SetSelectionMark|GUICtrlListView_SetTextBkColor|GUICtrlListView_SetTextColor|GUICtrlListView_SetToolTips|GUICtrlListView_SetUnicodeFormat|GUICtrlListView_SetView|GUICtrlListView_SetWorkAreas|GUICtrlListView_SimpleSort|GUICtrlListView_SortItems|GUICtrlListView_SubItemHitTest|GUICtrlListView_UnRegisterSortCallBack|GUICtrlMenu_AddMenuItem|GUICtrlMenu_AppendMenu|GUICtrlMenu_CheckMenuItem|GUICtrlMenu_CheckRadioItem|GUICtrlMenu_CreateMenu|GUICtrlMenu_CreatePopup|GUICtrlMenu_DeleteMenu|GUICtrlMenu_DestroyMenu|GUICtrlMenu_DrawMenuBar|GUICtrlMenu_EnableMenuItem|GUICtrlMenu_FindItem|GUICtrlMenu_FindParent|GUICtrlMenu_GetItemBmp|GUICtrlMenu_GetItemBmpChecked|GUICtrlMenu_GetItemBmpUnchecked|GUICtrlMenu_GetItemChecked|GUICtrlMenu_GetItemCount|GUICtrlMenu_GetItemData|GUICtrlMenu_GetItemDefault|GUICtrlMenu_GetItemDisabled|GUICtrlMenu_GetItemEnabled|GUICtrlMenu_GetItemGrayed|GUICtrlMenu_GetItemHighlighted|GUICtrlMenu_GetItemID|GUICtrlMenu_GetItemInfo|GUICtrlMenu_GetItemRect|GUICtrlMenu_GetItemRectEx|GUICtrlMenu_GetItemState|GUICtrlMenu_GetItemStateEx|GUICtrlMenu_GetItemSubMenu|GUICtrlMenu_GetItemText|GUICtrlMenu_GetItemType|GUICtrlMenu_GetMenu|GUICtrlMenu_GetMenuBackground|GUICtrlMenu_GetMenuBarInfo|GUICtrlMenu_GetMenuContextHelpID|GUICtrlMenu_GetMenuData|GUICtrlMenu_GetMenuDefaultItem|GUICtrlMenu_GetMenuHeight|GUICtrlMenu_GetMenuInfo|GUICtrlMenu_GetMenuStyle|GUICtrlMenu_GetSystemMenu|GUICtrlMenu_InsertMenuItem|GUICtrlMenu_InsertMenuItemEx|GUICtrlMenu_IsMenu|GUICtrlMenu_LoadMenu|GUICtrlMenu_MapAccelerator|GUICtrlMenu_MenuItemFromPoint|GUICtrlMenu_RemoveMenu|GUICtrlMenu_SetItemBitmaps|GUICtrlMenu_SetItemBmp|GUICtrlMenu_SetItemBmpChecked|GUICtrlMenu_SetItemBmpUnchecked|GUICtrlMenu_SetItemChecked|GUICtrlMenu_SetItemData|GUICtrlMenu_SetItemDefault|GUICtrlMenu_SetItemDisabled|GUICtrlMenu_SetItemEnabled|GUICtrlMenu_SetItemGrayed|GUICtrlMenu_SetItemHighlighted|GUICtrlMenu_SetItemID|GUICtrlMenu_SetItemInfo|GUICtrlMenu_SetItemState|GUICtrlMenu_SetItemSubMenu|GUICtrlMenu_SetItemText|GUICtrlMenu_SetItemType|GUICtrlMenu_SetMenu|GUICtrlMenu_SetMenuBackground|GUICtrlMenu_SetMenuContextHelpID|GUICtrlMenu_SetMenuData|GUICtrlMenu_SetMenuDefaultItem|GUICtrlMenu_SetMenuHeight|GUICtrlMenu_SetMenuInfo|GUICtrlMenu_SetMenuStyle|GUICtrlMenu_TrackPopupMenu|GUICtrlMonthCal_Create|GUICtrlMonthCal_Destroy|GUICtrlMonthCal_GetColor|GUICtrlMonthCal_GetColorArray|GUICtrlMonthCal_GetCurSel|GUICtrlMonthCal_GetCurSelStr|GUICtrlMonthCal_GetFirstDOW|GUICtrlMonthCal_GetFirstDOWStr|GUICtrlMonthCal_GetMaxSelCount|GUICtrlMonthCal_GetMaxTodayWidth|GUICtrlMonthCal_GetMinReqHeight|GUICtrlMonthCal_GetMinReqRect|GUICtrlMonthCal_GetMinReqRectArray|GUICtrlMonthCal_GetMinReqWidth|GUICtrlMonthCal_GetMonthDelta|GUICtrlMonthCal_GetMonthRange|GUICtrlMonthCal_GetMonthRangeMax|GUICtrlMonthCal_GetMonthRangeMaxStr|GUICtrlMonthCal_GetMonthRangeMin|GUICtrlMonthCal_GetMonthRangeMinStr|GUICtrlMonthCal_GetMonthRangeSpan|GUICtrlMonthCal_GetRange|GUICtrlMonthCal_GetRangeMax|GUICtrlMonthCal_GetRangeMaxStr|GUICtrlMonthCal_GetRangeMin|GUICtrlMonthCal_GetRangeMinStr|GUICtrlMonthCal_GetSelRange|GUICtrlMonthCal_GetSelRangeMax|GUICtrlMonthCal_GetSelRangeMaxStr|GUICtrlMonthCal_GetSelRangeMin|GUICtrlMonthCal_GetSelRangeMinStr|GUICtrlMonthCal_GetToday|GUICtrlMonthCal_GetTodayStr|GUICtrlMonthCal_GetUnicodeFormat|GUICtrlMonthCal_HitTest|GUICtrlMonthCal_SetColor|GUICtrlMonthCal_SetCurSel|GUICtrlMonthCal_SetDayState|GUICtrlMonthCal_SetFirstDOW|GUICtrlMonthCal_SetMaxSelCount|GUICtrlMonthCal_SetMonthDelta|GUICtrlMonthCal_SetRange|GUICtrlMonthCal_SetSelRange|GUICtrlMonthCal_SetToday|GUICtrlMonthCal_SetUnicodeFormat|GUICtrlRebar_AddBand|GUICtrlRebar_AddToolBarBand|GUICtrlRebar_BeginDrag|GUICtrlRebar_Create|GUICtrlRebar_DeleteBand|GUICtrlRebar_Destroy|GUICtrlRebar_DragMove|GUICtrlRebar_EndDrag|GUICtrlRebar_GetBandBackColor|GUICtrlRebar_GetBandBorders|GUICtrlRebar_GetBandBordersEx|GUICtrlRebar_GetBandChildHandle|GUICtrlRebar_GetBandChildSize|GUICtrlRebar_GetBandCount|GUICtrlRebar_GetBandForeColor|GUICtrlRebar_GetBandHeaderSize|GUICtrlRebar_GetBandID|GUICtrlRebar_GetBandIdealSize|GUICtrlRebar_GetBandLength|GUICtrlRebar_GetBandLParam|GUICtrlRebar_GetBandMargins|GUICtrlRebar_GetBandMarginsEx|GUICtrlRebar_GetBandRect|GUICtrlRebar_GetBandRectEx|GUICtrlRebar_GetBandStyle|GUICtrlRebar_GetBandStyleBreak|GUICtrlRebar_GetBandStyleChildEdge|GUICtrlRebar_GetBandStyleFixedBMP|GUICtrlRebar_GetBandStyleFixedSize|GUICtrlRebar_GetBandStyleGripperAlways|GUICtrlRebar_GetBandStyleHidden|GUICtrlRebar_GetBandStyleHideTitle|GUICtrlRebar_GetBandStyleNoGripper|GUICtrlRebar_GetBandStyleTopAlign|GUICtrlRebar_GetBandStyleUseChevron|GUICtrlRebar_GetBandStyleVariableHeight|GUICtrlRebar_GetBandText|GUICtrlRebar_GetBarHeight|GUICtrlRebar_GetBKColor|GUICtrlRebar_GetColorScheme|GUICtrlRebar_GetRowCount|GUICtrlRebar_GetRowHeight|GUICtrlRebar_GetTextColor|GUICtrlRebar_GetToolTips|GUICtrlRebar_GetUnicodeFormat|GUICtrlRebar_HitTest|GUICtrlRebar_IDToIndex|GUICtrlRebar_MaximizeBand|GUICtrlRebar_MinimizeBand|GUICtrlRebar_MoveBand|GUICtrlRebar_SetBandBackColor|GUICtrlRebar_SetBandForeColor|GUICtrlRebar_SetBandHeaderSize|GUICtrlRebar_SetBandID|GUICtrlRebar_SetBandIdealSize|GUICtrlRebar_SetBandLength|GUICtrlRebar_SetBandLParam|GUICtrlRebar_SetBandStyle|GUICtrlRebar_SetBandStyleBreak|GUICtrlRebar_SetBandStyleChildEdge|GUICtrlRebar_SetBandStyleFixedBMP|GUICtrlRebar_SetBandStyleFixedSize|GUICtrlRebar_SetBandStyleGripperAlways|GUICtrlRebar_SetBandStyleHidden|GUICtrlRebar_SetBandStyleHideTitle|GUICtrlRebar_SetBandStyleNoGripper|GUICtrlRebar_SetBandStyleTopAlign|GUICtrlRebar_SetBandStyleUseChevron|GUICtrlRebar_SetBandStyleVariableHeight|GUICtrlRebar_SetBandText|GUICtrlRebar_SetBKColor|GUICtrlRebar_SetColorScheme|GUICtrlRebar_SetTextColor|GUICtrlRebar_SetToolTips|GUICtrlRebar_SetUnicodeFormat|GUICtrlRebar_ShowBand|GUICtrlSlider_ClearSel|GUICtrlSlider_ClearTics|GUICtrlSlider_Create|GUICtrlSlider_Destroy|GUICtrlSlider_GetBuddy|GUICtrlSlider_GetChannelRect|GUICtrlSlider_GetLineSize|GUICtrlSlider_GetNumTics|GUICtrlSlider_GetPageSize|GUICtrlSlider_GetPos|GUICtrlSlider_GetPTics|GUICtrlSlider_GetRange|GUICtrlSlider_GetRangeMax|GUICtrlSlider_GetRangeMin|GUICtrlSlider_GetSel|GUICtrlSlider_GetSelEnd|GUICtrlSlider_GetSelStart|GUICtrlSlider_GetThumbLength|GUICtrlSlider_GetThumbRect|GUICtrlSlider_GetThumbRectEx|GUICtrlSlider_GetTic|GUICtrlSlider_GetTicPos|GUICtrlSlider_GetToolTips|GUICtrlSlider_GetUnicodeFormat|GUICtrlSlider_SetBuddy|GUICtrlSlider_SetLineSize|GUICtrlSlider_SetPageSize|GUICtrlSlider_SetPos|GUICtrlSlider_SetRange|GUICtrlSlider_SetRangeMax|GUICtrlSlider_SetRangeMin|GUICtrlSlider_SetSel|GUICtrlSlider_SetSelEnd|GUICtrlSlider_SetSelStart|GUICtrlSlider_SetThumbLength|GUICtrlSlider_SetTic|GUICtrlSlider_SetTicFreq|GUICtrlSlider_SetTipSide|GUICtrlSlider_SetToolTips|GUICtrlSlider_SetUnicodeFormat|GUICtrlStatusBar_Create|GUICtrlStatusBar_Destroy|GUICtrlStatusBar_EmbedControl|GUICtrlStatusBar_GetBorders|GUICtrlStatusBar_GetBordersHorz|GUICtrlStatusBar_GetBordersRect|GUICtrlStatusBar_GetBordersVert|GUICtrlStatusBar_GetCount|GUICtrlStatusBar_GetHeight|GUICtrlStatusBar_GetIcon|GUICtrlStatusBar_GetParts|GUICtrlStatusBar_GetRect|GUICtrlStatusBar_GetRectEx|GUICtrlStatusBar_GetText|GUICtrlStatusBar_GetTextFlags|GUICtrlStatusBar_GetTextLength|GUICtrlStatusBar_GetTextLengthEx|GUICtrlStatusBar_GetTipText|GUICtrlStatusBar_GetUnicodeFormat|GUICtrlStatusBar_GetWidth|GUICtrlStatusBar_IsSimple|GUICtrlStatusBar_Resize|GUICtrlStatusBar_SetBkColor|GUICtrlStatusBar_SetIcon|GUICtrlStatusBar_SetMinHeight|GUICtrlStatusBar_SetParts|GUICtrlStatusBar_SetSimple|GUICtrlStatusBar_SetText|GUICtrlStatusBar_SetTipText|GUICtrlStatusBar_SetUnicodeFormat|GUICtrlStatusBar_ShowHide|GUICtrlTab_Create|GUICtrlTab_DeleteAllItems|GUICtrlTab_DeleteItem|GUICtrlTab_DeselectAll|GUICtrlTab_Destroy|GUICtrlTab_FindTab|GUICtrlTab_GetCurFocus|GUICtrlTab_GetCurSel|GUICtrlTab_GetDisplayRect|GUICtrlTab_GetDisplayRectEx|GUICtrlTab_GetExtendedStyle|GUICtrlTab_GetImageList|GUICtrlTab_GetItem|GUICtrlTab_GetItemCount|GUICtrlTab_GetItemImage|GUICtrlTab_GetItemParam|GUICtrlTab_GetItemRect|GUICtrlTab_GetItemRectEx|GUICtrlTab_GetItemState|GUICtrlTab_GetItemText|GUICtrlTab_GetRowCount|GUICtrlTab_GetToolTips|GUICtrlTab_GetUnicodeFormat|GUICtrlTab_HighlightItem|GUICtrlTab_HitTest|GUICtrlTab_InsertItem|GUICtrlTab_RemoveImage|GUICtrlTab_SetCurFocus|GUICtrlTab_SetCurSel|GUICtrlTab_SetExtendedStyle|GUICtrlTab_SetImageList|GUICtrlTab_SetItem|GUICtrlTab_SetItemImage|GUICtrlTab_SetItemParam|GUICtrlTab_SetItemSize|GUICtrlTab_SetItemState|GUICtrlTab_SetItemText|GUICtrlTab_SetMinTabWidth|GUICtrlTab_SetPadding|GUICtrlTab_SetToolTips|GUICtrlTab_SetUnicodeFormat|GUICtrlToolbar_AddBitmap|GUICtrlToolbar_AddButton|GUICtrlToolbar_AddButtonSep|GUICtrlToolbar_AddString|GUICtrlToolbar_ButtonCount|GUICtrlToolbar_CheckButton|GUICtrlToolbar_ClickAccel|GUICtrlToolbar_ClickButton|GUICtrlToolbar_ClickIndex|GUICtrlToolbar_CommandToIndex|GUICtrlToolbar_Create|GUICtrlToolbar_Customize|GUICtrlToolbar_DeleteButton|GUICtrlToolbar_Destroy|GUICtrlToolbar_EnableButton|GUICtrlToolbar_FindToolbar|GUICtrlToolbar_GetAnchorHighlight|GUICtrlToolbar_GetBitmapFlags|GUICtrlToolbar_GetButtonBitmap|GUICtrlToolbar_GetButtonInfo|GUICtrlToolbar_GetButtonInfoEx|GUICtrlToolbar_GetButtonParam|GUICtrlToolbar_GetButtonRect|GUICtrlToolbar_GetButtonRectEx|GUICtrlToolbar_GetButtonSize|GUICtrlToolbar_GetButtonState|GUICtrlToolbar_GetButtonStyle|GUICtrlToolbar_GetButtonText|GUICtrlToolbar_GetColorScheme|GUICtrlToolbar_GetDisabledImageList|GUICtrlToolbar_GetExtendedStyle|GUICtrlToolbar_GetHotImageList|GUICtrlToolbar_GetHotItem|GUICtrlToolbar_GetImageList|GUICtrlToolbar_GetInsertMark|GUICtrlToolbar_GetInsertMarkColor|GUICtrlToolbar_GetMaxSize|GUICtrlToolbar_GetMetrics|GUICtrlToolbar_GetPadding|GUICtrlToolbar_GetRows|GUICtrlToolbar_GetString|GUICtrlToolbar_GetStyle|GUICtrlToolbar_GetStyleAltDrag|GUICtrlToolbar_GetStyleCustomErase|GUICtrlToolbar_GetStyleFlat|GUICtrlToolbar_GetStyleList|GUICtrlToolbar_GetStyleRegisterDrop|GUICtrlToolbar_GetStyleToolTips|GUICtrlToolbar_GetStyleTransparent|GUICtrlToolbar_GetStyleWrapable|GUICtrlToolbar_GetTextRows|GUICtrlToolbar_GetToolTips|GUICtrlToolbar_GetUnicodeFormat|GUICtrlToolbar_HideButton|GUICtrlToolbar_HighlightButton|GUICtrlToolbar_HitTest|GUICtrlToolbar_IndexToCommand|GUICtrlToolbar_InsertButton|GUICtrlToolbar_InsertMarkHitTest|GUICtrlToolbar_IsButtonChecked|GUICtrlToolbar_IsButtonEnabled|GUICtrlToolbar_IsButtonHidden|GUICtrlToolbar_IsButtonHighlighted|GUICtrlToolbar_IsButtonIndeterminate|GUICtrlToolbar_IsButtonPressed|GUICtrlToolbar_LoadBitmap|GUICtrlToolbar_LoadImages|GUICtrlToolbar_MapAccelerator|GUICtrlToolbar_MoveButton|GUICtrlToolbar_PressButton|GUICtrlToolbar_SetAnchorHighlight|GUICtrlToolbar_SetBitmapSize|GUICtrlToolbar_SetButtonBitMap|GUICtrlToolbar_SetButtonInfo|GUICtrlToolbar_SetButtonInfoEx|GUICtrlToolbar_SetButtonParam|GUICtrlToolbar_SetButtonSize|GUICtrlToolbar_SetButtonState|GUICtrlToolbar_SetButtonStyle|GUICtrlToolbar_SetButtonText|GUICtrlToolbar_SetButtonWidth|GUICtrlToolbar_SetCmdID|GUICtrlToolbar_SetColorScheme|GUICtrlToolbar_SetDisabledImageList|GUICtrlToolbar_SetDrawTextFlags|GUICtrlToolbar_SetExtendedStyle|GUICtrlToolbar_SetHotImageList|GUICtrlToolbar_SetHotItem|GUICtrlToolbar_SetImageList|GUICtrlToolbar_SetIndent|GUICtrlToolbar_SetIndeterminate|GUICtrlToolbar_SetInsertMark|GUICtrlToolbar_SetInsertMarkColor|GUICtrlToolbar_SetMaxTextRows|GUICtrlToolbar_SetMetrics|GUICtrlToolbar_SetPadding|GUICtrlToolbar_SetParent|GUICtrlToolbar_SetRows|GUICtrlToolbar_SetStyle|GUICtrlToolbar_SetStyleAltDrag|GUICtrlToolbar_SetStyleCustomErase|GUICtrlToolbar_SetStyleFlat|GUICtrlToolbar_SetStyleList|GUICtrlToolbar_SetStyleRegisterDrop|GUICtrlToolbar_SetStyleToolTips|GUICtrlToolbar_SetStyleTransparent|GUICtrlToolbar_SetStyleWrapable|GUICtrlToolbar_SetToolTips|GUICtrlToolbar_SetUnicodeFormat|GUICtrlToolbar_SetWindowTheme|GUICtrlTreeView_Add|GUICtrlTreeView_AddChild|GUICtrlTreeView_AddChildFirst|GUICtrlTreeView_AddFirst|GUICtrlTreeView_BeginUpdate|GUICtrlTreeView_ClickItem|GUICtrlTreeView_Create|GUICtrlTreeView_CreateDragImage|GUICtrlTreeView_CreateSolidBitMap|GUICtrlTreeView_Delete|GUICtrlTreeView_DeleteAll|GUICtrlTreeView_DeleteChildren|GUICtrlTreeView_Destroy|GUICtrlTreeView_DisplayRect|GUICtrlTreeView_DisplayRectEx|GUICtrlTreeView_EditText|GUICtrlTreeView_EndEdit|GUICtrlTreeView_EndUpdate|GUICtrlTreeView_EnsureVisible|GUICtrlTreeView_Expand|GUICtrlTreeView_ExpandedOnce|GUICtrlTreeView_FindItem|GUICtrlTreeView_FindItemEx|GUICtrlTreeView_GetBkColor|GUICtrlTreeView_GetBold|GUICtrlTreeView_GetChecked|GUICtrlTreeView_GetChildCount|GUICtrlTreeView_GetChildren|GUICtrlTreeView_GetCount|GUICtrlTreeView_GetCut|GUICtrlTreeView_GetDropTarget|GUICtrlTreeView_GetEditControl|GUICtrlTreeView_GetExpanded|GUICtrlTreeView_GetFirstChild|GUICtrlTreeView_GetFirstItem|GUICtrlTreeView_GetFirstVisible|GUICtrlTreeView_GetFocused|GUICtrlTreeView_GetHeight|GUICtrlTreeView_GetImageIndex|GUICtrlTreeView_GetImageListIconHandle|GUICtrlTreeView_GetIndent|GUICtrlTreeView_GetInsertMarkColor|GUICtrlTreeView_GetISearchString|GUICtrlTreeView_GetItemByIndex|GUICtrlTreeView_GetItemHandle|GUICtrlTreeView_GetItemParam|GUICtrlTreeView_GetLastChild|GUICtrlTreeView_GetLineColor|GUICtrlTreeView_GetNext|GUICtrlTreeView_GetNextChild|GUICtrlTreeView_GetNextSibling|GUICtrlTreeView_GetNextVisible|GUICtrlTreeView_GetNormalImageList|GUICtrlTreeView_GetParentHandle|GUICtrlTreeView_GetParentParam|GUICtrlTreeView_GetPrev|GUICtrlTreeView_GetPrevChild|GUICtrlTreeView_GetPrevSibling|GUICtrlTreeView_GetPrevVisible|GUICtrlTreeView_GetScrollTime|GUICtrlTreeView_GetSelected|GUICtrlTreeView_GetSelectedImageIndex|GUICtrlTreeView_GetSelection|GUICtrlTreeView_GetSiblingCount|GUICtrlTreeView_GetState|GUICtrlTreeView_GetStateImageIndex|GUICtrlTreeView_GetStateImageList|GUICtrlTreeView_GetText|GUICtrlTreeView_GetTextColor|GUICtrlTreeView_GetToolTips|GUICtrlTreeView_GetTree|GUICtrlTreeView_GetUnicodeFormat|GUICtrlTreeView_GetVisible|GUICtrlTreeView_GetVisibleCount|GUICtrlTreeView_HitTest|GUICtrlTreeView_HitTestEx|GUICtrlTreeView_HitTestItem|GUICtrlTreeView_Index|GUICtrlTreeView_InsertItem|GUICtrlTreeView_IsFirstItem|GUICtrlTreeView_IsParent|GUICtrlTreeView_Level|GUICtrlTreeView_SelectItem|GUICtrlTreeView_SelectItemByIndex|GUICtrlTreeView_SetBkColor|GUICtrlTreeView_SetBold|GUICtrlTreeView_SetChecked|GUICtrlTreeView_SetCheckedByIndex|GUICtrlTreeView_SetChildren|GUICtrlTreeView_SetCut|GUICtrlTreeView_SetDropTarget|GUICtrlTreeView_SetFocused|GUICtrlTreeView_SetHeight|GUICtrlTreeView_SetIcon|GUICtrlTreeView_SetImageIndex|GUICtrlTreeView_SetIndent|GUICtrlTreeView_SetInsertMark|GUICtrlTreeView_SetInsertMarkColor|GUICtrlTreeView_SetItemHeight|GUICtrlTreeView_SetItemParam|GUICtrlTreeView_SetLineColor|GUICtrlTreeView_SetNormalImageList|GUICtrlTreeView_SetScrollTime|GUICtrlTreeView_SetSelected|GUICtrlTreeView_SetSelectedImageIndex|GUICtrlTreeView_SetState|GUICtrlTreeView_SetStateImageIndex|GUICtrlTreeView_SetStateImageList|GUICtrlTreeView_SetText|GUICtrlTreeView_SetTextColor|GUICtrlTreeView_SetToolTips|GUICtrlTreeView_SetUnicodeFormat|GUICtrlTreeView_Sort|GUIImageList_Add|GUIImageList_AddBitmap|GUIImageList_AddIcon|GUIImageList_AddMasked|GUIImageList_BeginDrag|GUIImageList_Copy|GUIImageList_Create|GUIImageList_Destroy|GUIImageList_DestroyIcon|GUIImageList_DragEnter|GUIImageList_DragLeave|GUIImageList_DragMove|GUIImageList_Draw|GUIImageList_DrawEx|GUIImageList_Duplicate|GUIImageList_EndDrag|GUIImageList_GetBkColor|GUIImageList_GetIcon|GUIImageList_GetIconHeight|GUIImageList_GetIconSize|GUIImageList_GetIconSizeEx|GUIImageList_GetIconWidth|GUIImageList_GetImageCount|GUIImageList_GetImageInfoEx|GUIImageList_Remove|GUIImageList_ReplaceIcon|GUIImageList_SetBkColor|GUIImageList_SetIconSize|GUIImageList_SetImageCount|GUIImageList_Swap|GUIScrollBars_EnableScrollBar|GUIScrollBars_GetScrollBarInfoEx|GUIScrollBars_GetScrollBarRect|GUIScrollBars_GetScrollBarRGState|GUIScrollBars_GetScrollBarXYLineButton|GUIScrollBars_GetScrollBarXYThumbBottom|GUIScrollBars_GetScrollBarXYThumbTop|GUIScrollBars_GetScrollInfo|GUIScrollBars_GetScrollInfoEx|GUIScrollBars_GetScrollInfoMax|GUIScrollBars_GetScrollInfoMin|GUIScrollBars_GetScrollInfoPage|GUIScrollBars_GetScrollInfoPos|GUIScrollBars_GetScrollInfoTrackPos|GUIScrollBars_GetScrollPos|GUIScrollBars_GetScrollRange|GUIScrollBars_Init|GUIScrollBars_ScrollWindow|GUIScrollBars_SetScrollInfo|GUIScrollBars_SetScrollInfoMax|GUIScrollBars_SetScrollInfoMin|GUIScrollBars_SetScrollInfoPage|GUIScrollBars_SetScrollInfoPos|GUIScrollBars_SetScrollRange|GUIScrollBars_ShowScrollBar|GUIToolTip_Activate|GUIToolTip_AddTool|GUIToolTip_AdjustRect|GUIToolTip_BitsToTTF|GUIToolTip_Create|GUIToolTip_DelTool|GUIToolTip_Destroy|GUIToolTip_EnumTools|GUIToolTip_GetBubbleHeight|GUIToolTip_GetBubbleSize|GUIToolTip_GetBubbleWidth|GUIToolTip_GetCurrentTool|GUIToolTip_GetDelayTime|GUIToolTip_GetMargin|GUIToolTip_GetMarginEx|GUIToolTip_GetMaxTipWidth|GUIToolTip_GetText|GUIToolTip_GetTipBkColor|GUIToolTip_GetTipTextColor|GUIToolTip_GetTitleBitMap|GUIToolTip_GetTitleText|GUIToolTip_GetToolCount|GUIToolTip_GetToolInfo|GUIToolTip_HitTest|GUIToolTip_NewToolRect|GUIToolTip_Pop|GUIToolTip_PopUp|GUIToolTip_SetDelayTime|GUIToolTip_SetMargin|GUIToolTip_SetMaxTipWidth|GUIToolTip_SetTipBkColor|GUIToolTip_SetTipTextColor|GUIToolTip_SetTitle|GUIToolTip_SetToolInfo|GUIToolTip_SetWindowTheme|GUIToolTip_ToolExists|GUIToolTip_ToolToArray|GUIToolTip_TrackActivate|GUIToolTip_TrackPosition|GUIToolTip_TTFToBits|GUIToolTip_Update|GUIToolTip_UpdateTipText|HexToString|IE_Example|IE_Introduction|IE_VersionInfo|IEAction|IEAttach|IEBodyReadHTML|IEBodyReadText|IEBodyWriteHTML|IECreate|IECreateEmbedded|IEDocGetObj|IEDocInsertHTML|IEDocInsertText|IEDocReadHTML|IEDocWriteHTML|IEErrorHandlerDeRegister|IEErrorHandlerRegister|IEErrorNotify|IEFormElementCheckBoxSelect|IEFormElementGetCollection|IEFormElementGetObjByName|IEFormElementGetValue|IEFormElementOptionSelect|IEFormElementRadioSelect|IEFormElementSetValue|IEFormGetCollection|IEFormGetObjByName|IEFormImageClick|IEFormReset|IEFormSubmit|IEFrameGetCollection|IEFrameGetObjByName|IEGetObjById|IEGetObjByName|IEHeadInsertEventScript|IEImgClick|IEImgGetCollection|IEIsFrameSet|IELinkClickByIndex|IELinkClickByText|IELinkGetCollection|IELoadWait|IELoadWaitTimeout|IENavigate|IEPropertyGet|IEPropertySet|IEQuit|IETableGetCollection|IETableWriteToArray|IETagNameAllGetCollection|IETagNameGetCollection|Iif|INetExplorerCapable|INetGetSource|INetMail|INetSmtpMail|IsPressed|MathCheckDiv|Max|MemGlobalAlloc|MemGlobalFree|MemGlobalLock|MemGlobalSize|MemGlobalUnlock|MemMoveMemory|MemMsgBox|MemShowError|MemVirtualAlloc|MemVirtualAllocEx|MemVirtualFree|MemVirtualFreeEx|Min|MouseTrap|NamedPipes_CallNamedPipe|NamedPipes_ConnectNamedPipe|NamedPipes_CreateNamedPipe|NamedPipes_CreatePipe|NamedPipes_DisconnectNamedPipe|NamedPipes_GetNamedPipeHandleState|NamedPipes_GetNamedPipeInfo|NamedPipes_PeekNamedPipe|NamedPipes_SetNamedPipeHandleState|NamedPipes_TransactNamedPipe|NamedPipes_WaitNamedPipe|Net_Share_ConnectionEnum|Net_Share_FileClose|Net_Share_FileEnum|Net_Share_FileGetInfo|Net_Share_PermStr|Net_Share_ResourceStr|Net_Share_SessionDel|Net_Share_SessionEnum|Net_Share_SessionGetInfo|Net_Share_ShareAdd|Net_Share_ShareCheck|Net_Share_ShareDel|Net_Share_ShareEnum|Net_Share_ShareGetInfo|Net_Share_ShareSetInfo|Net_Share_StatisticsGetSvr|Net_Share_StatisticsGetWrk|Now|NowCalc|NowCalcDate|NowDate|NowTime|PathFull|PathMake|PathSplit|ProcessGetName|ProcessGetPriority|Radian|ReplaceStringInFile|RunDOS|ScreenCapture_Capture|ScreenCapture_CaptureWnd|ScreenCapture_SaveImage|ScreenCapture_SetBMPFormat|ScreenCapture_SetJPGQuality|ScreenCapture_SetTIFColorDepth|ScreenCapture_SetTIFCompression|Security__AdjustTokenPrivileges|Security__GetAccountSid|Security__GetLengthSid|Security__GetTokenInformation|Security__ImpersonateSelf|Security__IsValidSid|Security__LookupAccountName|Security__LookupAccountSid|Security__LookupPrivilegeValue|Security__OpenProcessToken|Security__OpenThreadToken|Security__OpenThreadTokenEx|Security__SetPrivilege|Security__SidToStringSid|Security__SidTypeStr|Security__StringSidToSid|SendMessage|SendMessageA|SetDate|SetTime|Singleton|SoundClose|SoundLength|SoundOpen|SoundPause|SoundPlay|SoundPos|SoundResume|SoundSeek|SoundStatus|SoundStop|SQLite_Changes|SQLite_Close|SQLite_Display2DResult|SQLite_Encode|SQLite_ErrCode|SQLite_ErrMsg|SQLite_Escape|SQLite_Exec|SQLite_FetchData|SQLite_FetchNames|SQLite_GetTable|SQLite_GetTable2d|SQLite_LastInsertRowID|SQLite_LibVersion|SQLite_Open|SQLite_Query|SQLite_QueryFinalize|SQLite_QueryReset|SQLite_QuerySingleRow|SQLite_SaveMode|SQLite_SetTimeout|SQLite_Shutdown|SQLite_SQLiteExe|SQLite_Startup|SQLite_TotalChanges|StringAddComma|StringBetween|StringEncrypt|StringInsert|StringProper|StringRepeat|StringReverse|StringSplit|StringToHex|TCPIpToName|TempFile|TicksToTime|Timer_Diff|Timer_GetTimerID|Timer_Init|Timer_KillAllTimers|Timer_KillTimer|Timer_SetTimer|TimeToTicks|VersionCompare|viClose|viExecCommand|viFindGpib|viGpibBusReset|viGTL|viOpen|viSetAttribute|viSetTimeout|WeekNumberISO|WinAPI_AttachConsole|WinAPI_AttachThreadInput|WinAPI_Beep|WinAPI_BitBlt|WinAPI_CallNextHookEx|WinAPI_Check|WinAPI_ClientToScreen|WinAPI_CloseHandle|WinAPI_CommDlgExtendedError|WinAPI_CopyIcon|WinAPI_CreateBitmap|WinAPI_CreateCompatibleBitmap|WinAPI_CreateCompatibleDC|WinAPI_CreateEvent|WinAPI_CreateFile|WinAPI_CreateFont|WinAPI_CreateFontIndirect|WinAPI_CreateProcess|WinAPI_CreateSolidBitmap|WinAPI_CreateSolidBrush|WinAPI_CreateWindowEx|WinAPI_DefWindowProc|WinAPI_DeleteDC|WinAPI_DeleteObject|WinAPI_DestroyIcon|WinAPI_DestroyWindow|WinAPI_DrawEdge|WinAPI_DrawFrameControl|WinAPI_DrawIcon|WinAPI_DrawIconEx|WinAPI_DrawText|WinAPI_EnableWindow|WinAPI_EnumDisplayDevices|WinAPI_EnumWindows|WinAPI_EnumWindowsPopup|WinAPI_EnumWindowsTop|WinAPI_ExpandEnvironmentStrings|WinAPI_ExtractIconEx|WinAPI_FatalAppExit|WinAPI_FillRect|WinAPI_FindExecutable|WinAPI_FindWindow|WinAPI_FlashWindow|WinAPI_FlashWindowEx|WinAPI_FloatToInt|WinAPI_FlushFileBuffers|WinAPI_FormatMessage|WinAPI_FrameRect|WinAPI_FreeLibrary|WinAPI_GetAncestor|WinAPI_GetAsyncKeyState|WinAPI_GetClassName|WinAPI_GetClientHeight|WinAPI_GetClientRect|WinAPI_GetClientWidth|WinAPI_GetCurrentProcess|WinAPI_GetCurrentProcessID|WinAPI_GetCurrentThread|WinAPI_GetCurrentThreadId|WinAPI_GetCursorInfo|WinAPI_GetDC|WinAPI_GetDesktopWindow|WinAPI_GetDeviceCaps|WinAPI_GetDIBits|WinAPI_GetDlgCtrlID|WinAPI_GetDlgItem|WinAPI_GetFileSizeEx|WinAPI_GetFocus|WinAPI_GetForegroundWindow|WinAPI_GetIconInfo|WinAPI_GetLastError|WinAPI_GetLastErrorMessage|WinAPI_GetModuleHandle|WinAPI_GetMousePos|WinAPI_GetMousePosX|WinAPI_GetMousePosY|WinAPI_GetObject|WinAPI_GetOpenFileName|WinAPI_GetOverlappedResult|WinAPI_GetParent|WinAPI_GetProcessAffinityMask|WinAPI_GetSaveFileName|WinAPI_GetStdHandle|WinAPI_GetStockObject|WinAPI_GetSysColor|WinAPI_GetSysColorBrush|WinAPI_GetSystemMetrics|WinAPI_GetTextExtentPoint32|WinAPI_GetWindow|WinAPI_GetWindowDC|WinAPI_GetWindowHeight|WinAPI_GetWindowLong|WinAPI_GetWindowRect|WinAPI_GetWindowText|WinAPI_GetWindowThreadProcessId|WinAPI_GetWindowWidth|WinAPI_GetXYFromPoint|WinAPI_GlobalMemStatus|WinAPI_GUIDFromString|WinAPI_GUIDFromStringEx|WinAPI_HiWord|WinAPI_InProcess|WinAPI_IntToFloat|WinAPI_InvalidateRect|WinAPI_IsClassName|WinAPI_IsWindow|WinAPI_IsWindowVisible|WinAPI_LoadBitmap|WinAPI_LoadImage|WinAPI_LoadLibrary|WinAPI_LoadLibraryEx|WinAPI_LoadShell32Icon|WinAPI_LoadString|WinAPI_LocalFree|WinAPI_LoWord|WinAPI_MakeDWord|WinAPI_MAKELANGID|WinAPI_MAKELCID|WinAPI_MakeLong|WinAPI_MessageBeep|WinAPI_Mouse_Event|WinAPI_MoveWindow|WinAPI_MsgBox|WinAPI_MulDiv|WinAPI_MultiByteToWideChar|WinAPI_MultiByteToWideCharEx|WinAPI_OpenProcess|WinAPI_PointFromRect|WinAPI_PostMessage|WinAPI_PrimaryLangId|WinAPI_PtInRect|WinAPI_ReadFile|WinAPI_ReadProcessMemory|WinAPI_RectIsEmpty|WinAPI_RedrawWindow|WinAPI_RegisterWindowMessage|WinAPI_ReleaseCapture|WinAPI_ReleaseDC|WinAPI_ScreenToClient|WinAPI_SelectObject|WinAPI_SetBkColor|WinAPI_SetCapture|WinAPI_SetCursor|WinAPI_SetDefaultPrinter|WinAPI_SetDIBits|WinAPI_SetEvent|WinAPI_SetFocus|WinAPI_SetFont|WinAPI_SetHandleInformation|WinAPI_SetLastError|WinAPI_SetParent|WinAPI_SetProcessAffinityMask|WinAPI_SetSysColors|WinAPI_SetTextColor|WinAPI_SetWindowLong|WinAPI_SetWindowPos|WinAPI_SetWindowsHookEx|WinAPI_SetWindowText|WinAPI_ShowCursor|WinAPI_ShowError|WinAPI_ShowMsg|WinAPI_ShowWindow|WinAPI_StringFromGUID|WinAPI_SubLangId|WinAPI_SystemParametersInfo|WinAPI_TwipsPerPixelX|WinAPI_TwipsPerPixelY|WinAPI_UnhookWindowsHookEx|WinAPI_UpdateLayeredWindow|WinAPI_UpdateWindow|WinAPI_ValidateClassName|WinAPI_WaitForInputIdle|WinAPI_WaitForMultipleObjects|WinAPI_WaitForSingleObject|WinAPI_WideCharToMultiByte|WinAPI_WindowFromPoint|WinAPI_WriteConsole|WinAPI_WriteFile|WinAPI_WriteProcessMemory|WinNet_AddConnection|WinNet_AddConnection2|WinNet_AddConnection3|WinNet_CancelConnection|WinNet_CancelConnection2|WinNet_CloseEnum|WinNet_ConnectionDialog|WinNet_ConnectionDialog1|WinNet_DisconnectDialog|WinNet_DisconnectDialog1|WinNet_EnumResource|WinNet_GetConnection|WinNet_GetConnectionPerformance|WinNet_GetLastError|WinNet_GetNetworkInformation|WinNet_GetProviderName|WinNet_GetResourceInformation|WinNet_GetResourceParent|WinNet_GetUniversalName|WinNet_GetUser|WinNet_OpenEnum|WinNet_RestoreConnection|WinNet_UseConnection|Word_VersionInfo|WordAttach|WordCreate|WordDocAdd|WordDocAddLink|WordDocAddPicture|WordDocClose|WordDocFindReplace|WordDocGetCollection|WordDocLinkGetCollection|WordDocOpen|WordDocPrint|WordDocPropertyGet|WordDocPropertySet|WordDocSave|WordDocSaveAs|WordErrorHandlerDeRegister|WordErrorHandlerRegister|WordErrorNotify|WordMacroRun|WordPropertyGet|WordPropertySet|WordQuit|' + - 'ce|comments-end|comments-start|cs|include|include-once|NoTrayIcon|RequireAdmin|' + - 'AutoIt3Wrapper_Au3Check_Parameters|AutoIt3Wrapper_Au3Check_Stop_OnWarning|AutoIt3Wrapper_Change2CUI|AutoIt3Wrapper_Compression|AutoIt3Wrapper_cvsWrapper_Parameters|AutoIt3Wrapper_Icon|AutoIt3Wrapper_Outfile|AutoIt3Wrapper_Outfile_Type|AutoIt3Wrapper_Plugin_Funcs|AutoIt3Wrapper_Res_Comment|AutoIt3Wrapper_Res_Description|AutoIt3Wrapper_Res_Field|AutoIt3Wrapper_Res_File_Add|AutoIt3Wrapper_Res_Fileversion|AutoIt3Wrapper_Res_FileVersion_AutoIncrement|AutoIt3Wrapper_Res_Icon_Add|AutoIt3Wrapper_Res_Language|AutoIt3Wrapper_Res_LegalCopyright|AutoIt3Wrapper_res_requestedExecutionLevel|AutoIt3Wrapper_Res_SaveSource|AutoIt3Wrapper_Run_After|AutoIt3Wrapper_Run_Au3check|AutoIt3Wrapper_Run_Before|AutoIt3Wrapper_Run_cvsWrapper|AutoIt3Wrapper_Run_Debug_Mode|AutoIt3Wrapper_Run_Obfuscator|AutoIt3Wrapper_Run_Tidy|AutoIt3Wrapper_Tidy_Stop_OnError|AutoIt3Wrapper_UseAnsi|AutoIt3Wrapper_UseUpx|AutoIt3Wrapper_UseX64|AutoIt3Wrapper_Version|EndRegion|forceref|Obfuscator_Ignore_Funcs|Obfuscator_Ignore_Variables|Obfuscator_Parameters|Region|Tidy_Parameters' - var atKeywords = 'AppDataCommonDir|AppDataDir|AutoItExe|AutoItPID|AutoItUnicode|AutoItVersion|AutoItX64|COM_EventObj|CommonFilesDir|Compiled|ComputerName|ComSpec|CR|CRLF|DesktopCommonDir|DesktopDepth|DesktopDir|DesktopHeight|DesktopRefresh|DesktopWidth|DocumentsCommonDir|error|exitCode|exitMethod|extended|FavoritesCommonDir|FavoritesDir|GUI_CtrlHandle|GUI_CtrlId|GUI_DragFile|GUI_DragId|GUI_DropId|GUI_WinHandle|HomeDrive|HomePath|HomeShare|HotKeyPressed|HOUR|InetGetActive|InetGetBytesRead|IPAddress1|IPAddress2|IPAddress3|IPAddress4|KBLayout|LF|LogonDNSDomain|LogonDomain|LogonServer|MDAY|MIN|MON|MyDocumentsDir|NumParams|OSBuild|OSLang|OSServicePack|OSTYPE|OSVersion|ProcessorArch|ProgramFilesDir|ProgramsCommonDir|ProgramsDir|ScriptDir|ScriptFullPath|ScriptLineNumber|ScriptName|SEC|StartMenuCommonDir|StartMenuDir|StartupCommonDir|StartupDir|SW_DISABLE|SW_ENABLE|SW_HIDE|SW_LOCK|SW_MAXIMIZE|SW_MINIMIZE|SW_RESTORE|SW_SHOW|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWMINNOACTIVE|SW_SHOWNA|SW_SHOWNOACTIVATE|SW_SHOWNORMAL|SW_UNLOCK|SystemDir|TAB|TempDir|TRAY_ID|TrayIconFlashing|TrayIconVisible|UserName|UserProfileDir|WDAY|WindowsDir|WorkingDir|YDAY|YEAR' - - this.$rules = { start: - [ { token: 'comment.line.ahk', regex: '(?:^| );.*$' }, - { token: 'comment.block.ahk', - regex: '/\\*', push: - [ { token: 'comment.block.ahk', regex: '\\*/', next: 'pop' }, - { defaultToken: 'comment.block.ahk' } ] }, - { token: 'doc.comment.ahk', - regex: '#cs', push: - [ { token: 'doc.comment.ahk', regex: '#ce', next: 'pop' }, - { defaultToken: 'doc.comment.ahk' } ] }, - { token: 'keyword.command.ahk', - regex: '(?:\\b|^)(?:allowsamelinecomments|clipboardtimeout|commentflag|errorstdout|escapechar|hotkeyinterval|hotkeymodifiertimeout|hotstring|include|includeagain|installkeybdhook|installmousehook|keyhistory|ltrim|maxhotkeysperinterval|maxmem|maxthreads|maxthreadsbuffer|maxthreadsperhotkey|noenv|notrayicon|persistent|singleinstance|usehook|winactivateforce|autotrim|blockinput|click|clipwait|continue|control|controlclick|controlfocus|controlget|controlgetfocus|controlgetpos|controlgettext|controlmove|controlsend|controlsendraw|controlsettext|coordmode|critical|detecthiddentext|detecthiddenwindows|drive|driveget|drivespacefree|edit|endrepeat|envadd|envdiv|envget|envmult|envset|envsub|envupdate|exit|exitapp|fileappend|filecopy|filecopydir|filecreatedir|filecreateshortcut|filedelete|filegetattrib|filegetshortcut|filegetsize|filegettime|filegetversion|fileinstall|filemove|filemovedir|fileread|filereadline|filerecycle|filerecycleempty|fileremovedir|fileselectfile|fileselectfolder|filesetattrib|filesettime|formattime|getkeystate|gosub|goto|groupactivate|groupadd|groupclose|groupdeactivate|gui|guicontrol|guicontrolget|hideautoitwin|hotkey|ifequal|ifexist|ifgreater|ifgreaterorequal|ifinstring|ifless|iflessorequal|ifmsgbox|ifnotequal|ifnotexist|ifnotinstring|ifwinactive|ifwinexist|ifwinnotactive|ifwinnotexist|imagesearch|inidelete|iniread|iniwrite|input|inputbox|keyhistory|keywait|listhotkeys|listlines|listvars|menu|mouseclick|mouseclickdrag|mousegetpos|mousemove|msgbox|onexit|outputdebug|pause|pixelgetcolor|pixelsearch|postmessage|process|progress|random|regdelete|regread|regwrite|reload|repeat|run|runas|runwait|send|sendevent|sendinput|sendmode|sendplay|sendmessage|sendraw|setbatchlines|setcapslockstate|setcontroldelay|setdefaultmousespeed|setenv|setformat|setkeydelay|setmousedelay|setnumlockstate|setscrolllockstate|setstorecapslockmode|settimer|settitlematchmode|setwindelay|setworkingdir|shutdown|sleep|sort|soundbeep|soundget|soundgetwavevolume|soundplay|soundset|soundsetwavevolume|splashimage|splashtextoff|splashtexton|splitpath|statusbargettext|statusbarwait|stringcasesense|stringgetpos|stringleft|stringlen|stringlower|stringmid|stringreplace|stringright|stringsplit|stringtrimleft|stringtrimright|stringupper|suspend|sysget|thread|tooltip|transform|traytip|urldownloadtofile|while|winactivate|winactivatebottom|winclose|winget|wingetactivestats|wingetactivetitle|wingetclass|wingetpos|wingettext|wingettitle|winhide|winkill|winmaximize|winmenuselectitem|winminimize|winminimizeall|winminimizeallundo|winmove|winrestore|winset|winsettitle|winshow|winwait|winwaitactive|winwaitclose|winwaitnotactive)\\b', - caseInsensitive: true }, - { token: 'keyword.control.ahk', - regex: '(?:\\b|^)(?:if|else|return|loop|break|for|while|global|local|byref)\\b', - caseInsensitive: true }, - { token: 'support.function.ahk', - regex: '(?:\\b|^)(?:abs|acos|asc|asin|atan|ceil|chr|cos|dllcall|exp|fileexist|floor|getkeystate|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist)\\b', - caseInsensitive: true }, - { token: 'variable.predefined.ahk', - regex: '(?:\\b|^)(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\\b', - caseInsensitive: true }, - { token: 'support.constant.ahk', - regex: '(?:\\b|^)(?:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|altdown|altup|shiftdown|shiftup|ctrldown|ctrlup|lwindown|lwinup|rwindown|rwinup|lbutton|rbutton|mbutton|wheelup|wheelleft|wheelright|wheeldown|xbutton1|xbutton2|joy1|joy2|joy3|joy4|joy5|joy6|joy7|joy8|joy9|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy30|joy31|joy32|joyx|joyy|joyz|joyr|joyu|joyv|joypov|joyname|joybuttons|joyaxes|joyinfo|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgup|pgdn|home|end|up|down|left|right|printscreen|ctrlbreak|pause|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadup|numpaddown|numpadleft|numpadright|numpadhome|numpadend|numpadpgup|numpadpgdn|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2)\\b', - caseInsensitive: true }, - { token: 'variable.parameter', - regex: '(?:\\b|^)(?:pixel|mouse|screen|relative|rgb|ltrim|rtrim|join|low|belownormal|normal|abovenormal|high|realtime|ahk_id|ahk_pid|ahk_class|ahk_group|between|contains|in|is|integer|float|integerfast|floatfast|number|digit|xdigit|alpha|upper|lower|alnum|time|date|not|or|and|alwaysontop|topmost|top|bottom|transparent|transcolor|redraw|region|id|idlast|processname|minmax|controllist|count|list|capacity|statuscd|eject|lock|unlock|label|filesystem|label|setlabel|serial|type|status|static|seconds|minutes|hours|days|read|parse|logoff|close|error|single|tray|add|rename|check|uncheck|togglecheck|enable|disable|toggleenable|default|nodefault|standard|nostandard|color|delete|deleteall|icon|noicon|tip|click|show|mainwindow|nomainwindow|useerrorlevel|text|picture|pic|groupbox|button|checkbox|radio|dropdownlist|ddl|combobox|listbox|listview|datetime|monthcal|updown|slider|tab|tab2|statusbar|treeview|iconsmall|tile|report|sortdesc|nosort|nosorthdr|grid|hdr|autosize|range|xm|ym|ys|xs|xp|yp|font|resize|owner|submit|nohide|minimize|maximize|restore|noactivate|na|cancel|destroy|center|margin|maxsize|minsize|owndialogs|guiescape|guiclose|guisize|guicontextmenu|guidropfiles|tabstop|section|altsubmit|wrap|hscroll|vscroll|border|top|bottom|buttons|expand|first|imagelist|lines|wantctrla|wantf2|vis|visfirst|number|uppercase|lowercase|limit|password|multi|wantreturn|group|background|bold|italic|strike|underline|norm|backgroundtrans|theme|caption|delimiter|minimizebox|maximizebox|sysmenu|toolwindow|flash|style|exstyle|check3|checked|checkedgray|readonly|password|hidden|left|right|center|notab|section|move|focus|hide|choose|choosestring|text|pos|enabled|disabled|visible|lastfound|lastfoundexist|alttab|shiftalttab|alttabmenu|alttabandmenu|alttabmenudismiss|notimers|interrupt|priority|waitclose|blind|raw|unicode|deref|pow|bitnot|bitand|bitor|bitxor|bitshiftleft|bitshiftright|yes|no|ok|cancel|abort|retry|ignore|tryagain|on|off|all|hkey_local_machine|hkey_users|hkey_current_user|hkey_classes_root|hkey_current_config|hklm|hku|hkcu|hkcr|hkcc|reg_sz|reg_expand_sz|reg_multi_sz|reg_dword|reg_qword|reg_binary|reg_link|reg_resource_list|reg_full_resource_descriptor|reg_resource_requirements_list|reg_dword_big_endian)\\b', - caseInsensitive: true }, - { keywordMap: {"constant.language": autoItKeywords}, regex: '\\w+\\b'}, - { keywordMap: {"variable.function": atKeywords}, regex: '@\\w+\\b'}, - { token : "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, - { token: 'keyword.operator.ahk', - regex: '=|==|<>|:=|<|>|\\*|\\/|\\+|:|\\?|\\-' }, - { token: 'punctuation.ahk', - regex: '#|`|::|,|\\{|\\}|\\(|\\)|\\%' }, - { token: - [ 'punctuation.quote.double', - 'string.quoted.ahk', - 'punctuation.quote.double' ], - regex: '(")((?:[^"]|"")*)(")' }, - { token: [ 'label.ahk', 'punctuation.definition.label.ahk' ], - regex: '^([^: ]+)(:)(?!:)' } ] } - - this.normalizeRules(); -}; - -AutoHotKeyHighlightRules.metaData = { name: 'AutoHotKey', - scopeName: 'source.ahk', - fileTypes: [ 'ahk' ], - foldingStartMarker: '^\\s*/\\*|^(?![^{]*?;|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|;|/\\*(?!.*?\\*/.*\\S))', - foldingStopMarker: '^\\s*\\*/|^\\s*\\}' } - - -oop.inherits(AutoHotKeyHighlightRules, TextHighlightRules); - -exports.AutoHotKeyHighlightRules = AutoHotKeyHighlightRules; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile.js deleted file mode 100644 index e080464c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile.js +++ /dev/null @@ -1,61 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = BatchFileHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "::"; - this.blockComment = ""; - this.$id = "ace/mode/batchfile"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile_highlight_rules.js deleted file mode 100644 index be0380d8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile_highlight_rules.js +++ /dev/null @@ -1,97 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from C:\Users\LED\AppData\Roaming\Sublime Text 2\Packages\Batch File\Batch File.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var BatchFileHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: 'keyword.command.dosbatch', - regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b', - caseInsensitive: true }, - { token: 'keyword.control.statement.dosbatch', - regex: '\\b(?:goto|call|exit)\\b', - caseInsensitive: true }, - { token: 'keyword.control.conditional.if.dosbatch', - regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b', - caseInsensitive: true }, - { token: 'keyword.control.conditional.dosbatch', - regex: '\\b(?:if|else)\\b', - caseInsensitive: true }, - { token: 'keyword.control.repeat.dosbatch', - regex: '\\bfor\\b', - caseInsensitive: true }, - { token: 'keyword.operator.dosbatch', - regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' }, - { token: ['doc.comment', 'comment'], - regex: '(?:^|\\b)(rem)($|\\s.*$)', - caseInsensitive: true }, - { token: 'comment.line.colons.dosbatch', - regex: '::.*$' }, - { include: 'variable' }, - { token: 'punctuation.definition.string.begin.shell', - regex: '"', - push: [ - { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' }, - { include: 'variable' }, - { defaultToken: 'string.quoted.double.dosbatch' } ] }, - { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' }, - { token: 'keyword.operator.redirect.shell', - regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' } ], - variable: [ - { token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%'}, - { token: 'constant.numeric', regex: '%~\\d+'}, - { token: ['markup.list', 'constant.other', 'markup.list'], - regex: '(%)(\\w+)(%?)' }]} - - this.normalizeRules(); -}; - -BatchFileHighlightRules.metaData = { name: 'Batch File', - scopeName: 'source.dosbatch', - fileTypes: [ 'bat' ] } - - -oop.inherits(BatchFileHighlightRules, TextHighlightRules); - -exports.BatchFileHighlightRules = BatchFileHighlightRules; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js deleted file mode 100644 index c1c6cb15..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +++ /dev/null @@ -1,90 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Behaviour = function() { - this.$behaviours = {}; -}; - -(function () { - - this.add = function (name, action, callback) { - switch (undefined) { - case this.$behaviours: - this.$behaviours = {}; - case this.$behaviours[name]: - this.$behaviours[name] = {}; - } - this.$behaviours[name][action] = callback; - } - - this.addBehaviours = function (behaviours) { - for (var key in behaviours) { - for (var action in behaviours[key]) { - this.add(key, action, behaviours[key][action]); - } - } - } - - this.remove = function (name) { - if (this.$behaviours && this.$behaviours[name]) { - delete this.$behaviours[name]; - } - } - - this.inherit = function (mode, filter) { - if (typeof mode === "function") { - var behaviours = new mode().getBehaviours(filter); - } else { - var behaviours = mode.getBehaviours(filter); - } - this.addBehaviours(behaviours); - } - - this.getBehaviours = function (filter) { - if (!filter) { - return this.$behaviours; - } else { - var ret = {} - for (var i = 0; i < filter.length; i++) { - if (this.$behaviours[filter[i]]) { - ret[filter[i]] = this.$behaviours[filter[i]]; - } - } - return ret; - } - } - -}).call(Behaviour.prototype); - -exports.Behaviour = Behaviour; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/behaviour_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/behaviour_test.js deleted file mode 100644 index ba0a5041..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/behaviour_test.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -require("../../multi_select"); -var assert = require("../../test/assertions"); -var Range = require("../../range").Range; -var Editor = require("../../editor").Editor; -var EditSession = require("../../edit_session").EditSession; -var MockRenderer = require("../../test/mockrenderer").MockRenderer; -var JavaScriptMode = require("../javascript").Mode; -var editor; -var exec = function(name, times, args) { - do { - editor.commands.exec(name, editor, args); - } while(times --> 1); -}; -var testRanges = function(str) { - assert.equal(editor.selection.getAllRanges() + "", str + ""); -}; - -module.exports = { - "test: cstyle": function() { - function testValue(line) { - assert.equal(editor.getValue(), Array(4).join(line + "\n")); - } - function testSelection(line, col, inc) { - editor.selection.rangeList.ranges.forEach(function(r) { - assert.range(r, line, col, line, col); - line += (inc || 1); - }); - } - var doc = new EditSession([ - "", - "", - "", - "" - ], new JavaScriptMode()); - editor = new Editor(new MockRenderer(), doc); - editor.setOption("behavioursEnabled", true); - - editor.navigateFileStart(); - exec("addCursorBelow", 2); - - exec("insertstring", 1, "if "); - - // pairing ( - exec("insertstring", 1, "("); - testValue("if ()"); - testSelection(0, 4); - exec("insertstring", 1, ")"); - testValue("if ()"); - testSelection(0, 5); - - // pairing [ - exec("gotoleft", 1); - exec("insertstring", 1, "["); - testValue("if ([])"); - testSelection(0, 5); - - exec("insertstring", 1, "]"); - testValue("if ([])"); - testSelection(0, 6); - - // test deletion - exec("gotoleft", 1); - exec("backspace", 1); - testValue("if ()"); - testSelection(0, 4); - - exec("gotolineend", 1); - exec("insertstring", 1, "{"); - testValue("if (){}"); - testSelection(0, 6); - - exec("insertstring", 1, "}"); - testValue("if (){}"); - testSelection(0, 7); - - exec("gotolinestart", 1); - exec("insertstring", 1, "("); - testValue("(if (){}"); - exec("backspace", 1); - - editor.setValue(""); - exec("insertstring", 1, "{"); - assert.equal(editor.getValue(), "{") - exec("insertstring", 1, "\n"); - assert.equal(editor.getValue(), "{\n \n}") - - editor.setValue(""); - exec("insertstring", 1, "("); - exec("insertstring", 1, '"'); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '("")'); - exec("backspace", 1); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '("")'); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/css.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/css.js deleted file mode 100644 index 1c35f744..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/css.js +++ /dev/null @@ -1,108 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - 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("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js deleted file mode 100644 index 5abf08fd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +++ /dev/null @@ -1,392 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {}; -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.index; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return { - text: '{' + selected + '}', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - 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 && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - 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 next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - 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; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '(' + selected + ')', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - 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 && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - 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 == '(') { - initContext(editor); - 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("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return { - text: '[' + selected + ']', - selection: false - }; - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - 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 && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - 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 == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } else { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - var rightChar = line.substring(cursor.column, cursor.column + 1); - - var token = session.getTokenAt(cursor.row, cursor.column); - var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); - // We're escaped. - if (leftChar == "\\" && token && /escape/.test(token.type)) - return null; - - var stringBefore = token && /string/.test(token.type); - var stringAfter = !rightToken || /string/.test(rightToken.type); - - var pair; - if (rightChar == quote) { - pair = stringBefore !== stringAfter; - } else { - if (stringBefore && !stringAfter) - return null; // wrap string with different quote - if (stringBefore && stringAfter) - return null; // do not pair quotes inside strings - var wordRe = session.$mode.tokenRe; - wordRe.lastIndex = 0; - var isWordBefore = wordRe.test(leftChar); - wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) - return null; // before or after alphanumeric - if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) - return null; // there is rightChar and it isn't closing - pair = true; - } - return { - text: pair ? quote + quote : "", - selection: [1,1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - - // Don't insert in the middle of a keyword/identifier/lexical - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - // Look ahead in case we're at the end of a token - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - - // Only insert in front of whitespace/comments - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - // Reset previous state if text or context changed too much - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js deleted file mode 100644 index 181655c0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +++ /dev/null @@ -1,46 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; - -var HtmlBehaviour = function () { - - XmlBehaviour.call(this); - -}; - -oop.inherits(HtmlBehaviour, XmlBehaviour); - -exports.HtmlBehaviour = HtmlBehaviour; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js deleted file mode 100644 index fc46a240..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +++ /dev/null @@ -1,202 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -function is(token, type) { - return token.type.lastIndexOf(type + ".xml") > -1; -} - -var XmlBehaviour = function () { - - this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { - if (text == '"' || text == "'") { - var quote = text; - var selected = session.doc.getTextRange(editor.getSelectionRange()); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } - - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - - if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { - // Ignore input and move right one if we're typing over the closing quote. - return { - text: "", - selection: [1, 1] - }; - } - - if (!token) - token = iterator.stepBackward(); - - if (!token) - return; - - while (is(token, "tag-whitespace") || is(token, "whitespace")) { - token = iterator.stepBackward(); - } - var rightSpace = !rightChar || rightChar.match(/\s/); - if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { - return { - text: quote + quote, - selection: [1, 1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - - this.add("autoclosing", "insertion", function (state, action, editor, session, text) { - if (text == '>') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken() || iterator.stepBackward(); - - // exit if we're not in a tag - if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) - return; - - // exit if we're inside of a quoted attribute value - if (is(token, "reference.attribute-value")) - return; - if (is(token, "attribute-value")) { - var firstChar = token.value.charAt(0); - if (firstChar == '"' || firstChar == "'") { - var lastChar = token.value.charAt(token.value.length - 1); - var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; - if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) - return; - } - } - - // find tag name - while (!is(token, "tag-name")) { - token = iterator.stepBackward(); - } - - var tokenRow = iterator.getCurrentTokenRow(); - var tokenColumn = iterator.getCurrentTokenColumn(); - - // exit if the tag is ending - if (is(iterator.stepBackward(), "end-tag-open")) - return; - - var element = token.value; - if (tokenRow == position.row) - element = element.substring(0, position.column - tokenColumn); - - if (this.voidElements.hasOwnProperty(element.toLowerCase())) - return; - - return { - text: ">" + "", - selection: [1, 1] - }; - } - }); - - this.add("autoindent", "insertion", function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - - if (token && token.type.indexOf("tag-close") !== -1) { - //get tag name - while (token && token.type.indexOf("tag-name") === -1) { - token = iterator.stepBackward(); - } - - if (!token) { - return; - } - - var tag = token.value; - var row = iterator.getCurrentTokenRow(); - - //don't indent after closing tag - token = iterator.stepBackward(); - if (!token || token.type.indexOf("end-tag") !== -1) { - return; - } - - if (this.voidElements && !this.voidElements[tag]) { - var nextToken = session.getTokenAt(cursor.row, cursor.column+1); - var line = session.getLine(row); - var nextIndent = this.$getIndent(line); - var indent = nextIndent + session.getTabString(); - - if (nextToken && nextToken.value === "') { - var position = editor.getCursorPosition(); - var iterator = new TokenIterator(session, position.row, position.column); - var token = iterator.getCurrentToken(); - var atCursor = false; - var state = JSON.parse(state).pop(); - if ((token && token.value === '>') || state !== "StartTag") return; - if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ - do { - token = iterator.stepBackward(); - } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text'))); - } else { - atCursor = true; - } - var previous = iterator.stepBackward(); - if (!token || !hasType(token, 'meta.tag') || (previous !== null && previous.value.match('/'))) { - return - } - var tag = token.value.substring(1); - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); - - } - oop.inherits(XQueryBehaviour, Behaviour); - - exports.XQueryBehaviour = XQueryBehaviour; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js deleted file mode 100644 index 3286456a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +++ /dev/null @@ -1,67 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var C9StyleFoldMode = require("./folding/c9search").FoldMode; - -var Mode = function() { - this.HighlightRules = C9SearchHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new C9StyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - 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); - }; - - this.$id = "ace/mode/c9search"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js deleted file mode 100644 index 43ec4bf8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +++ /dev/null @@ -1,182 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -function safeCreateRegexp(source, flag) { - try { - return new RegExp(source, flag); - } catch(e) {} -} - -var C9SearchHighlightRules = function() { - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - this.$rules = { - "start" : [ - { - tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"], - regex : "(^\\s+[0-9]+)(:\\s)(.+)", - onMatch : function(val, state, stack) { - var values = this.splitRegex.exec(val); - var types = this.tokenNames; - var tokens = [{ - type: types[0], - value: values[1] - },{ - type: types[1], - value: values[2] - }]; - - var regex = stack[1]; - var str = values[3]; - - var m; - var last = 0; - if (regex && regex.exec) { - regex.lastIndex = 0; - while (m = regex.exec(str)) { - var skipped = str.substring(last, m.index); - last = regex.lastIndex; - if (skipped) - tokens.push({type: types[2], value: skipped}); - if (m[0]) - tokens.push({type: types[3], value: m[0]}); - else if (!skipped) - break; - } - } - if (last < str.length) - tokens.push({type: types[2], value: str.substr(last)}); - return tokens; - } - }, - { - token : ["string", "text"], // single line - regex : "(\\S.*)(:$)" - }, - { - regex : "Searching for .*$", - onMatch: function(val, state, stack) { - var parts = val.split("\x01"); - if (parts.length < 3) - return "text"; - - var options, search, replace; - - var i = 0; - var tokens = [{ - value: parts[i++] + "'", - type: "text" - }, { - value: search = parts[i++], - type: "text" // "c9searchresults.keyword" - }, { - value: "'" + parts[i++], - type: "text" - }]; - - // replaced - if (parts[2] !== " in") { - replace = parts[i]; - tokens.push({ - value: "'" + parts[i++] + "'", - type: "text" - }, { - value: parts[i++], - type: "text" - }); - } - // path - tokens.push({ - value: " " + parts[i++] + " ", - type: "text" - }); - // options - if (parts[i+1]) { - options = parts[i+1]; - tokens.push({ - value: "(" + parts[i+1] + ")", - type: "text" - }); - i += 1; - } else { - i -= 1; - } - while (i++ < parts.length) { - parts[i] && tokens.push({ - value: parts[i], - type: "text" - }); - } - - if (replace) { - search = replace; - options = ""; - } - - if (search) { - if (!/regex/.test(options)) - search = lang.escapeRegExp(search); - if (/whole/.test(options)) - search = "\\b" + search + "\\b"; - } - - var regex = search && safeCreateRegexp( - "(" + search + ")", - / sensitive/.test(options) ? "g" : "ig" - ); - if (regex) { - stack[0] = state; - stack[1] = regex; - } - - return tokens; - } - }, - { - regex : "\\d+", - token: "constant.numeric" - } - ] - }; -}; - -oop.inherits(C9SearchHighlightRules, TextHighlightRules); - -exports.C9SearchHighlightRules = C9SearchHighlightRules; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js deleted file mode 100644 index a2dc133f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +++ /dev/null @@ -1,101 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = c_cppHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - 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); - }; - - this.$id = "ace/mode/c_cpp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js deleted file mode 100644 index b5a29799..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +++ /dev/null @@ -1,196 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -// used by objective-c -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - -var c_cppHighlightRules = function() { - - var keywordControls = ( - "break|case|continue|default|do|else|for|goto|if|_Pragma|" + - "return|switch|while|catch|operator|try|throw|using" - ); - - var storageType = ( - "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" + - "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" + - "class|wchar_t|template" - ); - - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private|" + - "protected|public|friend|explicit|virtual|export|mutable|typename|" + - "constexpr|new|delete" - ); - - var keywordOperators = ( - "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" + - "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace" - ); - - var builtinConstants = ( - "NULL|true|false|TRUE|FALSE" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "//", - next : "singleLineComment" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // single line - regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' - }, { - token : "string", // multi line string start - regex : '["].*\\\\$', - next : "qqstring" - }, { - token : "string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" - }, { - token : "string", // multi line string start - regex : "['].*\\\\$", - next : "qstring" - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", - next : "directive" - }, { - token : "keyword", // special case pre-compiler directive - regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, - 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 - regex : ".+" - } - ], - "singleLineComment" : [ - { - token : "comment", - regex : /\\$/, - next : "singleLineComment" - }, { - token : "comment", - regex : /$/, - next : "start" - }, { - defaultToken: "comment" - } - ], - "qqstring" : [ - { - token : "string", - regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', - next : "start" - }, { - defaultToken : "string" - } - ], - "qstring" : [ - { - token : "string", - regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", - next : "start" - }, { - defaultToken : "string" - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - // "\" implies multiline, while "/" implies comment - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(c_cppHighlightRules, TextHighlightRules); - -exports.c_cppHighlightRules = c_cppHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru.js deleted file mode 100644 index 5f1c4d9e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru.js +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules; -var CoffeeFoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = CirruHighlightRules; - this.foldingRules = new CoffeeFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "--"; - this.$id = "ace/mode/cirru"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru_highlight_rules.js deleted file mode 100644 index 737ec0be..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru_highlight_rules.js +++ /dev/null @@ -1,125 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -// see http://cirru.org for more about this language -var CirruHighlightRules = function() { - this.$rules = { - start: [{ - token: 'constant.numeric', - regex: /[\d\.]+/ - }, { - token: 'comment.line.double-dash', - regex: /--/, - next: 'comment', - }, { - token: 'storage.modifier', - regex: /\(/, - }, { - token: 'storage.modifier', - regex: /\,/, - next: 'line', - }, { - token: 'support.function', - regex: /[^\(\)\"\s]+/, - next: 'line' - }, { - token: 'string.quoted.double', - regex: /"/, - next: 'string', - }, { - token: 'storage.modifier', - regex: /\)/, - }], - comment: [{ - token: 'comment.line.double-dash', - regex: /\ +[^\n]+/, - next: 'start', - }], - string: [{ - token: 'string.quoted.double', - regex: /"/, - next: 'line', - }, { - token: 'constant.character.escape', - regex: /\\/, - next: 'escape', - }, { - token: 'string.quoted.double', - regex: /[^\\\"]+/, - }], - escape: [{ - token: 'constant.character.escape', - regex: /./, - next: 'string', - }], - line: [{ - token: 'constant.numeric', - regex: /[\d\.]+/ - }, { - token: 'markup.raw', - regex: /^\s*/, - next: 'start', - }, { - token: 'storage.modifier', - regex: /\$/, - next: 'start', - }, { - token: 'variable.parameter', - regex: /[^\(\)\"\s]+/ - }, { - token: 'storage.modifier', - regex: /\(/, - next: 'start' - }, { - token: 'storage.modifier', - regex: /\)/, - }, { - token: 'markup.raw', - regex: /^\ */, - next: 'start', - }, { - token: 'string.quoted.double', - regex: /"/, - next: 'string', - }] - } - -}; - -oop.inherits(CirruHighlightRules, TextHighlightRules); - -exports.CirruHighlightRules = CirruHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js deleted file mode 100644 index ee44ac3e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +++ /dev/null @@ -1,128 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var ClojureHighlightRules = require("./clojure_highlight_rules").ClojureHighlightRules; -var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent; - -var Mode = function() { - this.HighlightRules = ClojureHighlightRules; - this.$outdent = new MatchingParensOutdent(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ";"; - this.minorIndentFunctions = ["defn", "defn-", "defmacro", "def", "deftest", "testing"]; - - this.$toIndent = function(str) { - return str.split('').map(function(ch) { - if (/\s/.exec(ch)) { - return ch; - } else { - return ' '; - } - }).join(''); - }; - - this.$calculateIndent = function(line, tab) { - var baseIndent = this.$getIndent(line); - var delta = 0; - var isParen, ch; - // Walk back from end of line, find matching braces - for (var i = line.length - 1; i >= 0; i--) { - ch = line[i]; - if (ch === '(') { - delta--; - isParen = true; - } else if (ch === '(' || ch === '[' || ch === '{') { - delta--; - isParen = false; - } else if (ch === ')' || ch === ']' || ch === '}') { - delta++; - } - if (delta < 0) { - break; - } - } - if (delta < 0 && isParen) { - // Were more brackets opened than closed and was a ( left open? - i += 1; - var iBefore = i; - var fn = ''; - while (true) { - ch = line[i]; - if (ch === ' ' || ch === '\t') { - if(this.minorIndentFunctions.indexOf(fn) !== -1) { - return this.$toIndent(line.substring(0, iBefore - 1) + tab); - } else { - return this.$toIndent(line.substring(0, i + 1)); - } - } else if (ch === undefined) { - return this.$toIndent(line.substring(0, iBefore - 1) + tab); - } - fn += line[i]; - i++; - } - } else if(delta < 0 && !isParen) { - // Were more brackets openend than closed and was it not a (? - return this.$toIndent(line.substring(0, i+1)); - } else if(delta > 0) { - // Mere more brackets closed than opened? Outdent. - baseIndent = baseIndent.substring(0, baseIndent.length - tab.length); - return baseIndent; - } else { - // Were they nicely matched? Just indent like line before. - return baseIndent; - } - }; - - this.getNextLineIndent = function(state, line, tab) { - return this.$calculateIndent(line, tab); - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/clojure"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js deleted file mode 100644 index f7e28d87..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +++ /dev/null @@ -1,200 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - - -var ClojureHighlightRules = function() { - - var builtinFunctions = ( - '* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' + - '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' + - '*flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* ' + - '*print-dup* *print-length* *print-level* *print-meta* *print-readably* ' + - '*read-eval* *source-path* *use-context-classloader* ' + - '*warn-on-reflection* + - -> ->> .. / < <= = ' + - '== > > >= >= accessor aclone ' + - 'add-classpath add-watch agent agent-errors aget alength alias all-ns ' + - 'alter alter-meta! alter-var-root amap ancestors and apply areduce ' + - 'array-map aset aset-boolean aset-byte aset-char aset-double aset-float ' + - 'aset-int aset-long aset-short assert assoc assoc! assoc-in associative? ' + - 'atom await await-for await1 bases bean bigdec bigint binding bit-and ' + - 'bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left ' + - 'bit-shift-right bit-test bit-xor boolean boolean-array booleans ' + - 'bound-fn bound-fn* butlast byte byte-array bytes cast char char-array ' + - 'char-escape-string char-name-string char? chars chunk chunk-append ' + - 'chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? ' + - 'class class? clear-agent-errors clojure-version coll? comment commute ' + - 'comp comparator compare compare-and-set! compile complement concat cond ' + - 'condp conj conj! cons constantly construct-proxy contains? count ' + - 'counted? create-ns create-struct cycle dec decimal? declare definline ' + - 'defmacro defmethod defmulti defn defn- defonce defstruct delay delay? ' + - 'deliver deref derive descendants destructure disj disj! dissoc dissoc! ' + - 'distinct distinct? doall doc dorun doseq dosync dotimes doto double ' + - 'double-array doubles drop drop-last drop-while empty empty? ensure ' + - 'enumeration-seq eval even? every? false? ffirst file-seq filter find ' + - 'find-doc find-ns find-var first float float-array float? floats flush ' + - 'fn fn? fnext for force format future future-call future-cancel ' + - 'future-cancelled? future-done? future? gen-class gen-interface gensym ' + - 'get get-in get-method get-proxy-class get-thread-bindings get-validator ' + - 'hash hash-map hash-set identical? identity if-let if-not ifn? import ' + - 'in-ns inc init-proxy instance? int int-array integer? interleave intern ' + - 'interpose into into-array ints io! isa? iterate iterator-seq juxt key ' + - 'keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list ' + - 'list* list? load load-file load-reader load-string loaded-libs locking ' + - 'long long-array longs loop macroexpand macroexpand-1 make-array ' + - 'make-hierarchy map map? mapcat max max-key memfn memoize merge ' + - 'merge-with meta method-sig methods min min-key mod name namespace neg? ' + - 'newline next nfirst nil? nnext not not-any? not-empty not-every? not= ' + - 'ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ' + - 'ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? ' + - 'or parents partial partition pcalls peek persistent! pmap pop pop! ' + - 'pop-thread-bindings pos? pr pr-str prefer-method prefers ' + - 'primitives-classnames print print-ctor print-doc print-dup print-method ' + - 'print-namespace-doc print-simple print-special-doc print-str printf ' + - 'println println-str prn prn-str promise proxy proxy-call-with-super ' + - 'proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot ' + - 'rand rand-int range ratio? rational? rationalize re-find re-groups ' + - 're-matcher re-matches re-pattern re-seq read read-line read-string ' + - 'reduce ref ref-history-count ref-max-history ref-min-history ref-set ' + - 'refer refer-clojure release-pending-sends rem remove remove-method ' + - 'remove-ns remove-watch repeat repeatedly replace replicate require ' + - 'reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq ' + - 'rsubseq second select-keys send send-off seq seq? seque sequence ' + - 'sequential? set set-validator! set? short short-array shorts ' + - 'shutdown-agents slurp some sort sort-by sorted-map sorted-map-by ' + - 'sorted-set sorted-set-by sorted? special-form-anchor special-symbol? ' + - 'split-at split-with str stream? string? struct struct-map subs subseq ' + - 'subvec supers swap! symbol symbol? sync syntax-symbol-anchor take ' + - 'take-last take-nth take-while test the-ns time to-array to-array-2d ' + - 'trampoline transient tree-seq true? type unchecked-add unchecked-dec ' + - 'unchecked-divide unchecked-inc unchecked-multiply unchecked-negate ' + - 'unchecked-remainder unchecked-subtract underive unquote ' + - 'unquote-splicing update-in update-proxy use val vals var-get var-set ' + - 'var? vary-meta vec vector vector? when when-first when-let when-not ' + - 'while with-bindings with-bindings* with-in-str with-loading-context ' + - 'with-local-vars with-meta with-open with-out-str with-precision xml-seq ' + - 'zero? zipmap' - ); - - var keywords = ('throw try var ' + - 'def do fn if let loop monitor-enter monitor-exit new quote recur set!' - ); - - var buildinConstants = ("true false nil"); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": buildinConstants, - "support.function": builtinFunctions - }, "identifier", false, " "); - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ - { - token : "comment", - regex : ";.*$" - }, { - token : "keyword", //parens - regex : "[\\(|\\)]" - }, { - token : "keyword", //lists - regex : "[\\'\\(]" - }, { - token : "keyword", //vectors - regex : "[\\[|\\]]" - }, { - token : "keyword", //sets and maps - regex : "[\\{|\\}|\\#\\{|\\#\\}]" - }, { - token : "keyword", // ampersands - regex : '[\\&]' - }, { - token : "keyword", // metadata - regex : '[\\#\\^\\{]' - }, { - token : "keyword", // anonymous fn syntactic sugar - regex : '[\\%]' - }, { - token : "keyword", // deref reader macro - 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", - regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]' - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b" - }, { - token : "string", // single line - regex : '"', - next: "string" - }, { - token : "constant", // symbol - regex : /:[^()\[\]{}'"\^%`,;\s]+/ - }, { - token : "string.regexp", //Regular Expressions - regex : '/#"(?:\\.|(?:\\\")|[^\""\n])*"/g' - } - - ], - "string" : [ - { - token : "constant.language.escape", - regex : "\\\\.|\\\\$" - }, { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : '"', - next : "start" - } - ] - }; -}; - -oop.inherits(ClojureHighlightRules, TextHighlightRules); - -exports.ClojureHighlightRules = ClojureHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol.js deleted file mode 100644 index 91713bd0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol.js +++ /dev/null @@ -1,53 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = CobolHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "*"; - - this.$id = "ace/mode/cobol"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol_highlight_rules.js deleted file mode 100644 index 36335c93..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol_highlight_rules.js +++ /dev/null @@ -1,100 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var CobolHighlightRules = function() { -var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" + -"AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" + -"ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" + -"TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" + -"UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" + -"PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" + -"CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" + -"COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" + -"RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" + -"DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" + -"ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" + -"EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT"; - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce|main" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - "start" : [ { - token : "comment", - regex : "\\*.*$" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "string", // ' string - regex : "'.*?'" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ] - }; -}; - -oop.inherits(CobolHighlightRules, TextHighlightRules); - -exports.CobolHighlightRules = CobolHighlightRules; -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js deleted file mode 100644 index e866f2b0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +++ /dev/null @@ -1,135 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules; -var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var FoldMode = require("./folding/coffee").FoldMode; -var Range = require("../range").Range; -var TextMode = require("./text").Mode; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var oop = require("../lib/oop"); - -function Mode() { - this.HighlightRules = Rules; - this.$outdent = new Outdent(); - this.foldingRules = new FoldMode(); -} - -oop.inherits(Mode, TextMode); - -(function() { - - /*: - [({[=:] # Opening parentheses or brackets - |[-=]> # OR single or double arrow - |\b(?: # OR one of these words: - else # else - |try # OR try - |(?:swi|ca)tch # OR catch, optionally followed by: - (?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)? # a variable - |finally # OR finally - ))\s*$ # all as the last thing on a line (allowing trailing space) - | # ---- OR ---- : - ^\s* # a line starting with optional space - (else\b\s*)? # followed by an optional "else" - (?: # followed by one of the following: - if # if - |for # OR for - |while # OR while - |loop # OR loop - )\b # (as a word) - (?!.*\bthen\b) # ... but NOT followed by "then" on the line - */ - var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/; - var commentLine = /^(\s*)#/; - var hereComment = /^\s*###(?!#)/; - var indentation = /^\s*/; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - var tokens = this.getTokenizer().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); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("annotate", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/coffee"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js deleted file mode 100644 index 9e9719f7..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +++ /dev/null @@ -1,62 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - - var Lexer = require("./lexer").Lexer; - var parser = require("./parser"); - - var lexer = new Lexer(); - parser.lexer = { - lex: function() { - var tag, token; - token = this.tokens[this.pos++]; - if (token) { - tag = token[0], this.yytext = token[1], this.yylloc = token[2]; - this.yylineno = this.yylloc.first_line; - } else { - tag = ''; - } - return tag; - }, - setInput: function(tokens) { - this.tokens = tokens; - return this.pos = 0; - }, - upcomingInput: function() { - return ""; - } - }; - parser.yy = require('./nodes'); - - exports.parse = function(code) { - return parser.parse(lexer.tokenize(code)); - }; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js deleted file mode 100644 index 60412fc6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +++ /dev/null @@ -1,271 +0,0 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 - - var buildLocationData, extend, flatten, last, repeat, syntaxErrorToString, _ref; - - exports.starts = function(string, literal, start) { - return literal === string.substr(start, literal.length); - }; - - exports.ends = function(string, literal, back) { - var len; - len = literal.length; - return literal === string.substr(string.length - len - (back || 0), len); - }; - - exports.repeat = repeat = function(str, n) { - var res; - res = ''; - while (n > 0) { - if (n & 1) { - res += str; - } - n >>>= 1; - str += str; - } - return res; - }; - - exports.compact = function(array) { - var item, _i, _len, _results; - _results = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - item = array[_i]; - if (item) { - _results.push(item); - } - } - return _results; - }; - - exports.count = function(string, substr) { - var num, pos; - num = pos = 0; - if (!substr.length) { - return 1 / 0; - } - while (pos = 1 + string.indexOf(substr, pos)) { - num++; - } - return num; - }; - - exports.merge = function(options, overrides) { - return extend(extend({}, options), overrides); - }; - - extend = exports.extend = function(object, properties) { - var key, val; - for (key in properties) { - val = properties[key]; - object[key] = val; - } - return object; - }; - - exports.flatten = flatten = function(array) { - var element, flattened, _i, _len; - flattened = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - element = array[_i]; - if (element instanceof Array) { - flattened = flattened.concat(flatten(element)); - } else { - flattened.push(element); - } - } - return flattened; - }; - - exports.del = function(obj, key) { - var val; - val = obj[key]; - delete obj[key]; - return val; - }; - - exports.last = last = function(array, back) { - return array[array.length - (back || 0) - 1]; - }; - - exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) { - var e, _i, _len; - for (_i = 0, _len = this.length; _i < _len; _i++) { - e = this[_i]; - if (fn(e)) { - return true; - } - } - return false; - }; - - exports.invertLiterate = function(code) { - var line, lines, maybe_code; - maybe_code = true; - lines = (function() { - var _i, _len, _ref1, _results; - _ref1 = code.split('\n'); - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - line = _ref1[_i]; - if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) { - _results.push(line); - } else if (maybe_code = /^\s*$/.test(line)) { - _results.push(line); - } else { - _results.push('# ' + line); - } - } - return _results; - })(); - return lines.join('\n'); - }; - - buildLocationData = function(first, last) { - if (!last) { - return first; - } else { - return { - first_line: first.first_line, - first_column: first.first_column, - last_line: last.last_line, - last_column: last.last_column - }; - } - }; - - exports.addLocationDataFn = function(first, last) { - return function(obj) { - if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) { - obj.updateLocationDataIfMissing(buildLocationData(first, last)); - } - return obj; - }; - }; - - exports.locationDataToString = function(obj) { - var locationData; - if (("2" in obj) && ("first_line" in obj[2])) { - locationData = obj[2]; - } else if ("first_line" in obj) { - locationData = obj; - } - if (locationData) { - return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1)); - } else { - return "No location data"; - } - }; - - exports.baseFileName = function(file, stripExt, useWinPathSep) { - var parts, pathSep; - if (stripExt == null) { - stripExt = false; - } - if (useWinPathSep == null) { - useWinPathSep = false; - } - pathSep = useWinPathSep ? /\\|\// : /\//; - parts = file.split(pathSep); - file = parts[parts.length - 1]; - if (!(stripExt && file.indexOf('.') >= 0)) { - return file; - } - parts = file.split('.'); - parts.pop(); - if (parts[parts.length - 1] === 'coffee' && parts.length > 1) { - parts.pop(); - } - return parts.join('.'); - }; - - exports.isCoffee = function(file) { - return /\.((lit)?coffee|coffee\.md)$/.test(file); - }; - - exports.isLiterate = function(file) { - return /\.(litcoffee|coffee\.md)$/.test(file); - }; - - exports.throwSyntaxError = function(message, location) { - var error; - if (location.last_line == null) { - location.last_line = location.first_line; - } - if (location.last_column == null) { - location.last_column = location.first_column; - } - error = new SyntaxError(message); - error.location = location; - error.toString = syntaxErrorToString; - error.stack = error.toString(); - throw error; - }; - - exports.updateSyntaxError = function(error, code, filename) { - if (error.toString === syntaxErrorToString) { - error.code || (error.code = code); - error.filename || (error.filename = filename); - error.stack = error.toString(); - } - return error; - }; - - syntaxErrorToString = function() { - var codeLine, colorize, colorsEnabled, end, filename, first_column, first_line, last_column, last_line, marker, start, _ref1, _ref2; - if (!(this.code && this.location)) { - return Error.prototype.toString.call(this); - } - _ref1 = this.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column; - if (last_line == null) { - last_line = first_line; - } - if (last_column == null) { - last_column = first_column; - } - filename = this.filename || '[stdin]'; - codeLine = this.code.split('\n')[first_line]; - start = first_column; - end = first_line === last_line ? last_column + 1 : codeLine.length; - marker = repeat(' ', start) + repeat('^', end - start); - if (typeof process !== "undefined" && process !== null) { - colorsEnabled = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS; - } - if ((_ref2 = this.colorful) != null ? _ref2 : colorsEnabled) { - colorize = function(str) { - return "\x1B[1;31m" + str + "\x1B[0m"; - }; - codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end); - marker = colorize(marker); - } - return "" + filename + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + this.message + "\n" + codeLine + "\n" + marker; - }; - - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js deleted file mode 100644 index 05d85236..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +++ /dev/null @@ -1,935 +0,0 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 - - var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, invertLiterate, key, last, locationDataToString, repeat, starts, throwSyntaxError, _ref, _ref1, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES; - - _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last, repeat = _ref1.repeat, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError; - - exports.Lexer = Lexer = (function() { - function Lexer() {} - - Lexer.prototype.tokenize = function(code, opts) { - var consumed, i, tag, _ref2; - if (opts == null) { - opts = {}; - } - this.literate = opts.literate; - this.indent = 0; - this.baseIndent = 0; - this.indebt = 0; - this.outdebt = 0; - this.indents = []; - this.ends = []; - this.tokens = []; - this.chunkLine = opts.line || 0; - this.chunkColumn = opts.column || 0; - code = this.clean(code); - i = 0; - while (this.chunk = code.slice(i)) { - consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken(); - _ref2 = this.getLineAndColumnFromChunk(consumed), this.chunkLine = _ref2[0], this.chunkColumn = _ref2[1]; - i += consumed; - } - this.closeIndentation(); - if (tag = this.ends.pop()) { - this.error("missing " + tag); - } - if (opts.rewrite === false) { - return this.tokens; - } - return (new Rewriter).rewrite(this.tokens); - }; - - Lexer.prototype.clean = function(code) { - if (code.charCodeAt(0) === BOM) { - code = code.slice(1); - } - code = code.replace(/\r/g, '').replace(TRAILING_SPACES, ''); - if (WHITESPACE.test(code)) { - code = "\n" + code; - this.chunkLine--; - } - if (this.literate) { - code = invertLiterate(code); - } - return code; - }; - - Lexer.prototype.identifierToken = function() { - var colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, tag, tagToken, _ref2, _ref3, _ref4; - if (!(match = IDENTIFIER.exec(this.chunk))) { - return 0; - } - input = match[0], id = match[1], colon = match[2]; - idLength = id.length; - poppedToken = void 0; - if (id === 'own' && this.tag() === 'FOR') { - this.token('OWN', id); - return id.length; - } - forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::' || _ref2 === '?::') || !prev.spaced && prev[0] === '@'); - tag = 'IDENTIFIER'; - if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) { - tag = id.toUpperCase(); - if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) { - tag = 'LEADING_WHEN'; - } else if (tag === 'FOR') { - this.seenFor = true; - } else if (tag === 'UNLESS') { - tag = 'IF'; - } else if (__indexOf.call(UNARY, tag) >= 0) { - tag = 'UNARY'; - } else if (__indexOf.call(RELATION, tag) >= 0) { - if (tag !== 'INSTANCEOF' && this.seenFor) { - tag = 'FOR' + tag; - this.seenFor = false; - } else { - tag = 'RELATION'; - if (this.value() === '!') { - poppedToken = this.tokens.pop(); - id = '!' + id; - } - } - } - } - if (__indexOf.call(JS_FORBIDDEN, id) >= 0) { - if (forcedIdentifier) { - tag = 'IDENTIFIER'; - id = new String(id); - id.reserved = true; - } else if (__indexOf.call(RESERVED, id) >= 0) { - this.error("reserved word \"" + id + "\""); - } - } - if (!forcedIdentifier) { - if (__indexOf.call(COFFEE_ALIASES, id) >= 0) { - id = COFFEE_ALIAS_MAP[id]; - } - tag = (function() { - switch (id) { - case '!': - return 'UNARY'; - case '==': - case '!=': - return 'COMPARE'; - case '&&': - case '||': - return 'LOGIC'; - case 'true': - case 'false': - return 'BOOL'; - case 'break': - case 'continue': - return 'STATEMENT'; - default: - return tag; - } - })(); - } - tagToken = this.token(tag, id, 0, idLength); - if (poppedToken) { - _ref4 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = _ref4[0], tagToken[2].first_column = _ref4[1]; - } - if (colon) { - colonOffset = input.lastIndexOf(':'); - this.token(':', ':', colonOffset, colon.length); - } - return input.length; - }; - - Lexer.prototype.numberToken = function() { - var binaryLiteral, lexedLength, match, number, octalLiteral; - if (!(match = NUMBER.exec(this.chunk))) { - return 0; - } - number = match[0]; - if (/^0[BOX]/.test(number)) { - this.error("radix prefix '" + number + "' must be lowercase"); - } else if (/E/.test(number) && !/^0x/.test(number)) { - this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'"); - } else if (/^0\d*[89]/.test(number)) { - this.error("decimal literal '" + number + "' must not be prefixed with '0'"); - } else if (/^0\d+/.test(number)) { - this.error("octal literal '" + number + "' must be prefixed with '0o'"); - } - lexedLength = number.length; - if (octalLiteral = /^0o([0-7]+)/.exec(number)) { - number = '0x' + parseInt(octalLiteral[1], 8).toString(16); - } - if (binaryLiteral = /^0b([01]+)/.exec(number)) { - number = '0x' + parseInt(binaryLiteral[1], 2).toString(16); - } - this.token('NUMBER', number, 0, lexedLength); - return lexedLength; - }; - - Lexer.prototype.stringToken = function() { - var octalEsc, quote, string, trimmed; - switch (quote = this.chunk.charAt(0)) { - case "'": - string = SIMPLESTR.exec(this.chunk)[0]; - break; - case '"': - string = this.balancedString(this.chunk, '"'); - } - if (!string) { - return 0; - } - trimmed = this.removeNewlines(string.slice(1, -1)); - if (quote === '"' && 0 < string.indexOf('#{', 1)) { - this.interpolateString(trimmed, { - strOffset: 1, - lexedLength: string.length - }); - } else { - this.token('STRING', quote + this.escapeLines(trimmed) + quote, 0, string.length); - } - if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) { - this.error("octal escape sequences " + string + " are not allowed"); - } - return string.length; - }; - - Lexer.prototype.heredocToken = function() { - var doc, heredoc, match, quote; - if (!(match = HEREDOC.exec(this.chunk))) { - return 0; - } - heredoc = match[0]; - quote = heredoc.charAt(0); - doc = this.sanitizeHeredoc(match[2], { - quote: quote, - indent: null - }); - if (quote === '"' && 0 <= doc.indexOf('#{')) { - this.interpolateString(doc, { - heredoc: true, - strOffset: 3, - lexedLength: heredoc.length - }); - } else { - this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length); - } - return heredoc.length; - }; - - Lexer.prototype.commentToken = function() { - var comment, here, match; - if (!(match = this.chunk.match(COMMENT))) { - return 0; - } - comment = match[0], here = match[1]; - if (here) { - this.token('HERECOMMENT', this.sanitizeHeredoc(here, { - herecomment: true, - indent: repeat(' ', this.indent) - }), 0, comment.length); - } - return comment.length; - }; - - Lexer.prototype.jsToken = function() { - var match, script; - if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) { - return 0; - } - this.token('JS', (script = match[0]).slice(1, -1), 0, script.length); - return script.length; - }; - - Lexer.prototype.regexToken = function() { - var flags, length, match, prev, regex, _ref2, _ref3; - if (this.chunk.charAt(0) !== '/') { - return 0; - } - if (match = HEREGEX.exec(this.chunk)) { - length = this.heregexToken(match); - return length; - } - prev = last(this.tokens); - if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) { - return 0; - } - if (!(match = REGEX.exec(this.chunk))) { - return 0; - } - _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2]; - if (regex.slice(0, 2) === '/*') { - this.error('regular expressions cannot begin with `*`'); - } - if (regex === '//') { - regex = '/(?:)/'; - } - this.token('REGEX', "" + regex + flags, 0, match.length); - return match.length; - }; - - Lexer.prototype.heregexToken = function(match) { - var body, flags, flagsOffset, heregex, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; - heregex = match[0], body = match[1], flags = match[2]; - if (0 > body.indexOf('#{')) { - re = this.escapeLines(body.replace(HEREGEX_OMIT, '$1$2').replace(/\//g, '\\/'), true); - if (re.match(/^\*/)) { - this.error('regular expressions cannot begin with `*`'); - } - this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length); - return heregex.length; - } - this.token('IDENTIFIER', 'RegExp', 0, 0); - this.token('CALL_START', '(', 0, 0); - tokens = []; - _ref2 = this.interpolateString(body, { - regex: true - }); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - token = _ref2[_i]; - tag = token[0], value = token[1]; - if (tag === 'TOKENS') { - tokens.push.apply(tokens, value); - } else if (tag === 'NEOSTRING') { - if (!(value = value.replace(HEREGEX_OMIT, '$1$2'))) { - continue; - } - value = value.replace(/\\/g, '\\\\'); - token[0] = 'STRING'; - token[1] = this.makeString(value, '"', true); - tokens.push(token); - } else { - this.error("Unexpected " + tag); - } - prev = last(this.tokens); - plusToken = ['+', '+']; - plusToken[2] = prev[2]; - tokens.push(plusToken); - } - tokens.pop(); - if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') { - this.token('STRING', '""', 0, 0); - this.token('+', '+', 0, 0); - } - (_ref4 = this.tokens).push.apply(_ref4, tokens); - if (flags) { - flagsOffset = heregex.lastIndexOf(flags); - this.token(',', ',', flagsOffset, 0); - this.token('STRING', '"' + flags + '"', flagsOffset, flags.length); - } - this.token(')', ')', heregex.length - 1, 0); - return heregex.length; - }; - - Lexer.prototype.lineToken = function() { - var diff, indent, match, noNewlines, size; - if (!(match = MULTI_DENT.exec(this.chunk))) { - return 0; - } - indent = match[0]; - this.seenFor = false; - size = indent.length - 1 - indent.lastIndexOf('\n'); - noNewlines = this.unfinished(); - if (size - this.indebt === this.indent) { - if (noNewlines) { - this.suppressNewlines(); - } else { - this.newlineToken(0); - } - return indent.length; - } - if (size > this.indent) { - if (noNewlines) { - this.indebt = size - this.indent; - this.suppressNewlines(); - return indent.length; - } - if (!this.tokens.length) { - this.baseIndent = this.indent = size; - return indent.length; - } - diff = size - this.indent + this.outdebt; - this.token('INDENT', diff, indent.length - size, size); - this.indents.push(diff); - this.ends.push('OUTDENT'); - this.outdebt = this.indebt = 0; - } else if (size < this.baseIndent) { - this.error('missing indentation', indent.length); - } else { - this.indebt = 0; - this.outdentToken(this.indent - size, noNewlines, indent.length); - } - this.indent = size; - return indent.length; - }; - - Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) { - var dent, len; - while (moveOut > 0) { - len = this.indents.length - 1; - if (this.indents[len] === void 0) { - moveOut = 0; - } else if (this.indents[len] === this.outdebt) { - moveOut -= this.outdebt; - this.outdebt = 0; - } else if (this.indents[len] < this.outdebt) { - this.outdebt -= this.indents[len]; - moveOut -= this.indents[len]; - } else { - dent = this.indents.pop() + this.outdebt; - moveOut -= dent; - this.outdebt = 0; - this.pair('OUTDENT'); - this.token('OUTDENT', dent, 0, outdentLength); - } - } - if (dent) { - this.outdebt -= moveOut; - } - while (this.value() === ';') { - this.tokens.pop(); - } - if (!(this.tag() === 'TERMINATOR' || noNewlines)) { - this.token('TERMINATOR', '\n', outdentLength, 0); - } - return this; - }; - - Lexer.prototype.whitespaceToken = function() { - var match, nline, prev; - if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) { - return 0; - } - prev = last(this.tokens); - if (prev) { - prev[match ? 'spaced' : 'newLine'] = true; - } - if (match) { - return match[0].length; - } else { - return 0; - } - }; - - Lexer.prototype.newlineToken = function(offset) { - while (this.value() === ';') { - this.tokens.pop(); - } - if (this.tag() !== 'TERMINATOR') { - this.token('TERMINATOR', '\n', offset, 0); - } - return this; - }; - - Lexer.prototype.suppressNewlines = function() { - if (this.value() === '\\') { - this.tokens.pop(); - } - return this; - }; - - Lexer.prototype.literalToken = function() { - var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5; - if (match = OPERATOR.exec(this.chunk)) { - value = match[0]; - if (CODE.test(value)) { - this.tagParameters(); - } - } else { - value = this.chunk.charAt(0); - } - tag = value; - prev = last(this.tokens); - if (value === '=' && prev) { - if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) { - this.error("reserved word \"" + (this.value()) + "\" can't be assigned"); - } - if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') { - prev[0] = 'COMPOUND_ASSIGN'; - prev[1] += '='; - return value.length; - } - } - if (value === ';') { - this.seenFor = false; - tag = 'TERMINATOR'; - } else if (__indexOf.call(MATH, value) >= 0) { - tag = 'MATH'; - } else if (__indexOf.call(COMPARE, value) >= 0) { - tag = 'COMPARE'; - } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) { - tag = 'COMPOUND_ASSIGN'; - } else if (__indexOf.call(UNARY, value) >= 0) { - tag = 'UNARY'; - } else if (__indexOf.call(SHIFT, value) >= 0) { - tag = 'SHIFT'; - } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) { - tag = 'LOGIC'; - } else if (prev && !prev.spaced) { - if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) { - if (prev[0] === '?') { - prev[0] = 'FUNC_EXIST'; - } - tag = 'CALL_START'; - } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) { - tag = 'INDEX_START'; - switch (prev[0]) { - case '?': - prev[0] = 'INDEX_SOAK'; - } - } - } - switch (value) { - case '(': - case '{': - case '[': - this.ends.push(INVERSES[value]); - break; - case ')': - case '}': - case ']': - this.pair(value); - } - this.token(tag, value); - return value.length; - }; - - Lexer.prototype.sanitizeHeredoc = function(doc, options) { - var attempt, herecomment, indent, match, _ref2; - indent = options.indent, herecomment = options.herecomment; - if (herecomment) { - if (HEREDOC_ILLEGAL.test(doc)) { - this.error("block comment cannot contain \"*/\", starting"); - } - if (doc.indexOf('\n') < 0) { - return doc; - } - } else { - while (match = HEREDOC_INDENT.exec(doc)) { - attempt = match[1]; - if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) { - indent = attempt; - } - } - } - if (indent) { - doc = doc.replace(RegExp("\\n" + indent, "g"), '\n'); - } - if (!herecomment) { - doc = doc.replace(/^\n/, ''); - } - return doc; - }; - - Lexer.prototype.tagParameters = function() { - var i, stack, tok, tokens; - if (this.tag() !== ')') { - return this; - } - stack = []; - tokens = this.tokens; - i = tokens.length; - tokens[--i][0] = 'PARAM_END'; - while (tok = tokens[--i]) { - switch (tok[0]) { - case ')': - stack.push(tok); - break; - case '(': - case 'CALL_START': - if (stack.length) { - stack.pop(); - } else if (tok[0] === '(') { - tok[0] = 'PARAM_START'; - return this; - } else { - return this; - } - } - } - return this; - }; - - Lexer.prototype.closeIndentation = function() { - return this.outdentToken(this.indent); - }; - - Lexer.prototype.balancedString = function(str, end) { - var continueCount, i, letter, match, prev, stack, _i, _ref2; - continueCount = 0; - stack = [end]; - for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) { - if (continueCount) { - --continueCount; - continue; - } - switch (letter = str.charAt(i)) { - case '\\': - ++continueCount; - continue; - case end: - stack.pop(); - if (!stack.length) { - return str.slice(0, +i + 1 || 9e9); - } - end = stack[stack.length - 1]; - continue; - } - if (end === '}' && (letter === '"' || letter === "'")) { - stack.push(end = letter); - } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) { - continueCount += match[0].length - 1; - } else if (end === '}' && letter === '{') { - stack.push(end = '}'); - } else if (end === '"' && prev === '#' && letter === '{') { - stack.push(end = '}'); - } - prev = letter; - } - return this.error("missing " + (stack.pop()) + ", starting"); - }; - - Lexer.prototype.interpolateString = function(str, options) { - var column, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, rparen, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; - if (options == null) { - options = {}; - } - heredoc = options.heredoc, regex = options.regex, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength; - offsetInChunk = offsetInChunk || 0; - strOffset = strOffset || 0; - lexedLength = lexedLength || str.length; - tokens = []; - pi = 0; - i = -1; - while (letter = str.charAt(i += 1)) { - if (letter === '\\') { - i += 1; - continue; - } - if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) { - continue; - } - if (pi < i) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi)); - } - inner = expr.slice(1, -1); - if (inner.length) { - _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 1), line = _ref2[0], column = _ref2[1]; - nested = new Lexer().tokenize(inner, { - line: line, - column: column, - rewrite: false - }); - popped = nested.pop(); - if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') { - popped = nested.shift(); - } - if (len = nested.length) { - if (len > 1) { - nested.unshift(this.makeToken('(', '(', strOffset + i + 1, 0)); - nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0)); - } - tokens.push(['TOKENS', nested]); - } - } - i += expr.length; - pi = i + 1; - } - if ((i > pi && pi < str.length)) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi)); - } - if (regex) { - return tokens; - } - if (!tokens.length) { - return this.token('STRING', '""', offsetInChunk, lexedLength); - } - if (tokens[0][0] !== 'NEOSTRING') { - tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk)); - } - if (interpolated = tokens.length > 1) { - this.token('(', '(', offsetInChunk, 0); - } - for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) { - token = tokens[i]; - tag = token[0], value = token[1]; - if (i) { - if (i) { - plusToken = this.token('+', '+'); - } - locationToken = tag === 'TOKENS' ? value[0] : token; - plusToken[2] = { - first_line: locationToken[2].first_line, - first_column: locationToken[2].first_column, - last_line: locationToken[2].first_line, - last_column: locationToken[2].first_column - }; - } - if (tag === 'TOKENS') { - (_ref4 = this.tokens).push.apply(_ref4, value); - } else if (tag === 'NEOSTRING') { - token[0] = 'STRING'; - token[1] = this.makeString(value, '"', heredoc); - this.tokens.push(token); - } else { - this.error("Unexpected " + tag); - } - } - if (interpolated) { - rparen = this.makeToken(')', ')', offsetInChunk + lexedLength, 0); - rparen.stringEnd = true; - this.tokens.push(rparen); - } - return tokens; - }; - - Lexer.prototype.pair = function(tag) { - var size, wanted; - if (tag !== (wanted = last(this.ends))) { - if ('OUTDENT' !== wanted) { - this.error("unmatched " + tag); - } - this.indent -= size = last(this.indents); - this.outdentToken(size, true); - return this.pair(tag); - } - return this.ends.pop(); - }; - - Lexer.prototype.getLineAndColumnFromChunk = function(offset) { - var column, lineCount, lines, string; - if (offset === 0) { - return [this.chunkLine, this.chunkColumn]; - } - if (offset >= this.chunk.length) { - string = this.chunk; - } else { - string = this.chunk.slice(0, +(offset - 1) + 1 || 9e9); - } - lineCount = count(string, '\n'); - column = this.chunkColumn; - if (lineCount > 0) { - lines = string.split('\n'); - column = last(lines).length; - } else { - column += string.length; - } - return [this.chunkLine + lineCount, column]; - }; - - Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) { - var lastCharacter, locationData, token, _ref2, _ref3; - if (offsetInChunk == null) { - offsetInChunk = 0; - } - if (length == null) { - length = value.length; - } - locationData = {}; - _ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = _ref2[0], locationData.first_column = _ref2[1]; - lastCharacter = Math.max(0, length - 1); - _ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = _ref3[0], locationData.last_column = _ref3[1]; - token = [tag, value, locationData]; - return token; - }; - - Lexer.prototype.token = function(tag, value, offsetInChunk, length) { - var token; - token = this.makeToken(tag, value, offsetInChunk, length); - this.tokens.push(token); - return token; - }; - - Lexer.prototype.tag = function(index, tag) { - var tok; - return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]); - }; - - Lexer.prototype.value = function(index, val) { - var tok; - return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]); - }; - - Lexer.prototype.unfinished = function() { - var _ref2; - return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS'); - }; - - Lexer.prototype.removeNewlines = function(str) { - return str.replace(/^\s*\n\s*/, '').replace(/([^\\]|\\\\)\s*\n\s*$/, '$1'); - }; - - Lexer.prototype.escapeLines = function(str, heredoc) { - str = str.replace(/\\[^\S\n]*(\n|\\)\s*/g, function(escaped, character) { - if (character === '\n') { - return ''; - } else { - return escaped; - } - }); - if (heredoc) { - return str.replace(MULTILINER, '\\n'); - } else { - return str.replace(/\s*\n\s*/g, ' '); - } - }; - - Lexer.prototype.makeString = function(body, quote, heredoc) { - if (!body) { - return quote + quote; - } - body = body.replace(RegExp("\\\\(" + quote + "|\\\\)", "g"), function(match, contents) { - if (contents === quote) { - return contents; - } else { - return match; - } - }); - body = body.replace(RegExp("" + quote, "g"), '\\$&'); - return quote + this.escapeLines(body, heredoc) + quote; - }; - - Lexer.prototype.error = function(message, offset) { - var first_column, first_line, _ref2; - if (offset == null) { - offset = 0; - } - _ref2 = this.getLineAndColumnFromChunk(offset), first_line = _ref2[0], first_column = _ref2[1]; - return throwSyntaxError(message, { - first_line: first_line, - first_column: first_column - }); - }; - - return Lexer; - - })(); - - JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super']; - - COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when']; - - COFFEE_ALIAS_MAP = { - and: '&&', - or: '||', - is: '==', - isnt: '!=', - not: '!', - yes: 'true', - no: 'false', - on: 'true', - off: 'false' - }; - - COFFEE_ALIASES = (function() { - var _results; - _results = []; - for (key in COFFEE_ALIAS_MAP) { - _results.push(key); - } - return _results; - })(); - - COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES); - - RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield']; - - STRICT_PROSCRIBED = ['arguments', 'eval']; - - JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED); - - exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED); - - exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED; - - BOM = 65279; - - IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/; - - NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i; - - HEREDOC = /^("""|''')((?:\\[\s\S]|[^\\])*?)(?:\n[^\n\S]*)?\1/; - - OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?(\.|::)|\.{2,3})/; - - WHITESPACE = /^[^\n\S]+/; - - COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/; - - CODE = /^[-=]>/; - - MULTI_DENT = /^(?:\n[^\n\S]*)+/; - - SIMPLESTR = /^'[^\\']*(?:\\[\s\S][^\\']*)*'/; - - JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/; - - REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/; - - HEREGEX = /^\/{3}((?:\\?[\s\S])+?)\/{3}([imgy]{0,4})(?!\w)/; - - HEREGEX_OMIT = /((?:\\\\)+)|\\(\s|\/)|\s+(?:#.*)?/g; - - MULTILINER = /\n/g; - - HEREDOC_INDENT = /\n+([^\n\S]*)/g; - - HEREDOC_ILLEGAL = /\*\//; - - LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/; - - TRAILING_SPACES = /\s+$/; - - COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=']; - - UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO']; - - LOGIC = ['&&', '||', '&', '|', '^']; - - SHIFT = ['<<', '>>', '>>>']; - - COMPARE = ['==', '!=', '<', '>', '<=', '>=']; - - MATH = ['*', '/', '%']; - - RELATION = ['IN', 'OF', 'INSTANCEOF']; - - BOOL = ['TRUE', 'FALSE']; - - NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--']; - - NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']'); - - CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; - - INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED'); - - LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; - - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js deleted file mode 100644 index 52afdf2c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +++ /dev/null @@ -1,3106 +0,0 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 - - var Access, Arr, Assign, Base, Block, Call, Class, Code, CodeFragment, Comment, Existence, Extends, For, HEXNUM, IDENTIFIER, IDENTIFIER_STR, IS_REGEX, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, NUMBER, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, isLiteralArguments, isLiteralThis, last, locationDataToString, merge, multident, parseNum, some, starts, throwSyntaxError, unfoldSoak, utility, _ref, _ref1, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice; - - Error.stackTraceLimit = Infinity; - - Scope = require('./scope').Scope; - - _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED; - - _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError; - - exports.extend = extend; - - exports.addLocationDataFn = addLocationDataFn; - - YES = function() { - return true; - }; - - NO = function() { - return false; - }; - - THIS = function() { - return this; - }; - - NEGATE = function() { - this.negated = !this.negated; - return this; - }; - - exports.CodeFragment = CodeFragment = (function() { - function CodeFragment(parent, code) { - var _ref2; - this.code = "" + code; - this.locationData = parent != null ? parent.locationData : void 0; - this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown'; - } - - CodeFragment.prototype.toString = function() { - return "" + this.code + (this.locationData ? ": " + locationDataToString(this.locationData) : ''); - }; - - return CodeFragment; - - })(); - - fragmentsToText = function(fragments) { - var fragment; - return ((function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = fragments.length; _i < _len; _i++) { - fragment = fragments[_i]; - _results.push(fragment.code); - } - return _results; - })()).join(''); - }; - - exports.Base = Base = (function() { - function Base() {} - - Base.prototype.compile = function(o, lvl) { - return fragmentsToText(this.compileToFragments(o, lvl)); - }; - - Base.prototype.compileToFragments = function(o, lvl) { - var node; - o = extend({}, o); - if (lvl) { - o.level = lvl; - } - node = this.unfoldSoak(o) || this; - node.tab = o.indent; - if (o.level === LEVEL_TOP || !node.isStatement(o)) { - return node.compileNode(o); - } else { - return node.compileClosure(o); - } - }; - - Base.prototype.compileClosure = function(o) { - var args, argumentsNode, func, jumpNode, meth; - if (jumpNode = this.jumps()) { - jumpNode.error('cannot use a pure statement in an expression'); - } - o.sharedScope = true; - func = new Code([], Block.wrap([this])); - args = []; - if ((argumentsNode = this.contains(isLiteralArguments)) || this.contains(isLiteralThis)) { - args = [new Literal('this')]; - if (argumentsNode) { - meth = 'apply'; - args.push(new Literal('arguments')); - } else { - meth = 'call'; - } - func = new Value(func, [new Access(new Literal(meth))]); - } - return (new Call(func, args)).compileNode(o); - }; - - Base.prototype.cache = function(o, level, reused) { - var ref, sub; - if (!this.isComplex()) { - ref = level ? this.compileToFragments(o, level) : this; - return [ref, ref]; - } else { - ref = new Literal(reused || o.scope.freeVariable('ref')); - sub = new Assign(ref, this); - if (level) { - return [sub.compileToFragments(o, level), [this.makeCode(ref.value)]]; - } else { - return [sub, ref]; - } - } - }; - - Base.prototype.cacheToCodeFragments = function(cacheValues) { - return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])]; - }; - - Base.prototype.makeReturn = function(res) { - var me; - me = this.unwrapAll(); - if (res) { - return new Call(new Literal("" + res + ".push"), [me]); - } else { - return new Return(me); - } - }; - - Base.prototype.contains = function(pred) { - var node; - node = void 0; - this.traverseChildren(false, function(n) { - if (pred(n)) { - node = n; - return false; - } - }); - return node; - }; - - Base.prototype.lastNonComment = function(list) { - var i; - i = list.length; - while (i--) { - if (!(list[i] instanceof Comment)) { - return list[i]; - } - } - return null; - }; - - Base.prototype.toString = function(idt, name) { - var tree; - if (idt == null) { - idt = ''; - } - if (name == null) { - name = this.constructor.name; - } - tree = '\n' + idt + name; - if (this.soak) { - tree += '?'; - } - this.eachChild(function(node) { - return tree += node.toString(idt + TAB); - }); - return tree; - }; - - Base.prototype.eachChild = function(func) { - var attr, child, _i, _j, _len, _len1, _ref2, _ref3; - if (!this.children) { - return this; - } - _ref2 = this.children; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - attr = _ref2[_i]; - if (this[attr]) { - _ref3 = flatten([this[attr]]); - for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { - child = _ref3[_j]; - if (func(child) === false) { - return this; - } - } - } - } - return this; - }; - - Base.prototype.traverseChildren = function(crossScope, func) { - return this.eachChild(function(child) { - var recur; - recur = func(child); - if (recur !== false) { - return child.traverseChildren(crossScope, func); - } - }); - }; - - Base.prototype.invert = function() { - return new Op('!', this); - }; - - Base.prototype.unwrapAll = function() { - var node; - node = this; - while (node !== (node = node.unwrap())) { - continue; - } - return node; - }; - - Base.prototype.children = []; - - Base.prototype.isStatement = NO; - - Base.prototype.jumps = NO; - - Base.prototype.isComplex = YES; - - Base.prototype.isChainable = NO; - - Base.prototype.isAssignable = NO; - - Base.prototype.unwrap = THIS; - - Base.prototype.unfoldSoak = NO; - - Base.prototype.assigns = NO; - - Base.prototype.updateLocationDataIfMissing = function(locationData) { - if (this.locationData) { - return this; - } - this.locationData = locationData; - return this.eachChild(function(child) { - return child.updateLocationDataIfMissing(locationData); - }); - }; - - Base.prototype.error = function(message) { - return throwSyntaxError(message, this.locationData); - }; - - Base.prototype.makeCode = function(code) { - return new CodeFragment(this, code); - }; - - Base.prototype.wrapInBraces = function(fragments) { - return [].concat(this.makeCode('('), fragments, this.makeCode(')')); - }; - - Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) { - var answer, fragments, i, _i, _len; - answer = []; - for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) { - fragments = fragmentsList[i]; - if (i) { - answer.push(this.makeCode(joinStr)); - } - answer = answer.concat(fragments); - } - return answer; - }; - - return Base; - - })(); - - exports.Block = Block = (function(_super) { - __extends(Block, _super); - - function Block(nodes) { - this.expressions = compact(flatten(nodes || [])); - } - - Block.prototype.children = ['expressions']; - - Block.prototype.push = function(node) { - this.expressions.push(node); - return this; - }; - - Block.prototype.pop = function() { - return this.expressions.pop(); - }; - - Block.prototype.unshift = function(node) { - this.expressions.unshift(node); - return this; - }; - - Block.prototype.unwrap = function() { - if (this.expressions.length === 1) { - return this.expressions[0]; - } else { - return this; - } - }; - - Block.prototype.isEmpty = function() { - return !this.expressions.length; - }; - - Block.prototype.isStatement = function(o) { - var exp, _i, _len, _ref2; - _ref2 = this.expressions; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - exp = _ref2[_i]; - if (exp.isStatement(o)) { - return true; - } - } - return false; - }; - - Block.prototype.jumps = function(o) { - var exp, jumpNode, _i, _len, _ref2; - _ref2 = this.expressions; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - exp = _ref2[_i]; - if (jumpNode = exp.jumps(o)) { - return jumpNode; - } - } - }; - - Block.prototype.makeReturn = function(res) { - var expr, len; - len = this.expressions.length; - while (len--) { - expr = this.expressions[len]; - if (!(expr instanceof Comment)) { - this.expressions[len] = expr.makeReturn(res); - if (expr instanceof Return && !expr.expression) { - this.expressions.splice(len, 1); - } - break; - } - } - return this; - }; - - Block.prototype.compileToFragments = function(o, level) { - if (o == null) { - o = {}; - } - if (o.scope) { - return Block.__super__.compileToFragments.call(this, o, level); - } else { - return this.compileRoot(o); - } - }; - - Block.prototype.compileNode = function(o) { - var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2; - this.tab = o.indent; - top = o.level === LEVEL_TOP; - compiledNodes = []; - _ref2 = this.expressions; - for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) { - node = _ref2[index]; - node = node.unwrapAll(); - node = node.unfoldSoak(o) || node; - if (node instanceof Block) { - compiledNodes.push(node.compileNode(o)); - } else if (top) { - node.front = true; - fragments = node.compileToFragments(o); - if (!node.isStatement(o)) { - fragments.unshift(this.makeCode("" + this.tab)); - fragments.push(this.makeCode(";")); - } - compiledNodes.push(fragments); - } else { - compiledNodes.push(node.compileToFragments(o, LEVEL_LIST)); - } - } - if (top) { - if (this.spaced) { - return [].concat(this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n")); - } else { - return this.joinFragmentArrays(compiledNodes, '\n'); - } - } - if (compiledNodes.length) { - answer = this.joinFragmentArrays(compiledNodes, ', '); - } else { - answer = [this.makeCode("void 0")]; - } - if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - Block.prototype.compileRoot = function(o) { - var exp, fragments, i, name, prelude, preludeExps, rest, _i, _len, _ref2; - o.indent = o.bare ? '' : TAB; - o.level = LEVEL_TOP; - this.spaced = true; - o.scope = new Scope(null, this, null); - _ref2 = o.locals || []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - name = _ref2[_i]; - o.scope.parameter(name); - } - prelude = []; - if (!o.bare) { - preludeExps = (function() { - var _j, _len1, _ref3, _results; - _ref3 = this.expressions; - _results = []; - for (i = _j = 0, _len1 = _ref3.length; _j < _len1; i = ++_j) { - exp = _ref3[i]; - if (!(exp.unwrap() instanceof Comment)) { - break; - } - _results.push(exp); - } - return _results; - }).call(this); - rest = this.expressions.slice(preludeExps.length); - this.expressions = preludeExps; - if (preludeExps.length) { - prelude = this.compileNode(merge(o, { - indent: '' - })); - prelude.push(this.makeCode("\n")); - } - this.expressions = rest; - } - fragments = this.compileWithDeclarations(o); - if (o.bare) { - return fragments; - } - return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n")); - }; - - Block.prototype.compileWithDeclarations = function(o) { - var assigns, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4; - fragments = []; - post = []; - _ref2 = this.expressions; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - exp = _ref2[i]; - exp = exp.unwrap(); - if (!(exp instanceof Comment || exp instanceof Literal)) { - break; - } - } - o = merge(o, { - level: LEVEL_TOP - }); - if (i) { - rest = this.expressions.splice(i, 9e9); - _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1]; - _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1]; - this.expressions = rest; - } - post = this.compileNode(o); - scope = o.scope; - if (scope.expressions === this) { - declars = o.scope.hasDeclarations(); - assigns = scope.hasAssignments; - if (declars || assigns) { - if (i) { - fragments.push(this.makeCode('\n')); - } - fragments.push(this.makeCode("" + this.tab + "var ")); - if (declars) { - fragments.push(this.makeCode(scope.declaredVariables().join(', '))); - } - if (assigns) { - if (declars) { - fragments.push(this.makeCode(",\n" + (this.tab + TAB))); - } - fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB)))); - } - fragments.push(this.makeCode(";\n" + (this.spaced ? '\n' : ''))); - } else if (fragments.length && post.length) { - fragments.push(this.makeCode("\n")); - } - } - return fragments.concat(post); - }; - - Block.wrap = function(nodes) { - if (nodes.length === 1 && nodes[0] instanceof Block) { - return nodes[0]; - } - return new Block(nodes); - }; - - return Block; - - })(Base); - - exports.Literal = Literal = (function(_super) { - __extends(Literal, _super); - - function Literal(value) { - this.value = value; - } - - Literal.prototype.makeReturn = function() { - if (this.isStatement()) { - return this; - } else { - return Literal.__super__.makeReturn.apply(this, arguments); - } - }; - - Literal.prototype.isAssignable = function() { - return IDENTIFIER.test(this.value); - }; - - Literal.prototype.isStatement = function() { - var _ref2; - return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger'; - }; - - Literal.prototype.isComplex = NO; - - Literal.prototype.assigns = function(name) { - return name === this.value; - }; - - Literal.prototype.jumps = function(o) { - if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) { - return this; - } - if (this.value === 'continue' && !(o != null ? o.loop : void 0)) { - return this; - } - }; - - Literal.prototype.compileNode = function(o) { - var answer, code, _ref2; - code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value; - answer = this.isStatement() ? "" + this.tab + code + ";" : code; - return [this.makeCode(answer)]; - }; - - Literal.prototype.toString = function() { - return ' "' + this.value + '"'; - }; - - return Literal; - - })(Base); - - exports.Undefined = (function(_super) { - __extends(Undefined, _super); - - function Undefined() { - return Undefined.__super__.constructor.apply(this, arguments); - } - - Undefined.prototype.isAssignable = NO; - - Undefined.prototype.isComplex = NO; - - Undefined.prototype.compileNode = function(o) { - return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')]; - }; - - return Undefined; - - })(Base); - - exports.Null = (function(_super) { - __extends(Null, _super); - - function Null() { - return Null.__super__.constructor.apply(this, arguments); - } - - Null.prototype.isAssignable = NO; - - Null.prototype.isComplex = NO; - - Null.prototype.compileNode = function() { - return [this.makeCode("null")]; - }; - - return Null; - - })(Base); - - exports.Bool = (function(_super) { - __extends(Bool, _super); - - Bool.prototype.isAssignable = NO; - - Bool.prototype.isComplex = NO; - - Bool.prototype.compileNode = function() { - return [this.makeCode(this.val)]; - }; - - function Bool(val) { - this.val = val; - } - - return Bool; - - })(Base); - - exports.Return = Return = (function(_super) { - __extends(Return, _super); - - function Return(expr) { - if (expr && !expr.unwrap().isUndefined) { - this.expression = expr; - } - } - - Return.prototype.children = ['expression']; - - Return.prototype.isStatement = YES; - - Return.prototype.makeReturn = THIS; - - Return.prototype.jumps = THIS; - - Return.prototype.compileToFragments = function(o, level) { - var expr, _ref2; - expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0; - if (expr && !(expr instanceof Return)) { - return expr.compileToFragments(o, level); - } else { - return Return.__super__.compileToFragments.call(this, o, level); - } - }; - - Return.prototype.compileNode = function(o) { - var answer; - answer = []; - answer.push(this.makeCode(this.tab + ("return" + (this.expression ? " " : "")))); - if (this.expression) { - answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN)); - } - answer.push(this.makeCode(";")); - return answer; - }; - - return Return; - - })(Base); - - exports.Value = Value = (function(_super) { - __extends(Value, _super); - - function Value(base, props, tag) { - if (!props && base instanceof Value) { - return base; - } - this.base = base; - this.properties = props || []; - if (tag) { - this[tag] = true; - } - return this; - } - - Value.prototype.children = ['base', 'properties']; - - Value.prototype.add = function(props) { - this.properties = this.properties.concat(props); - return this; - }; - - Value.prototype.hasProperties = function() { - return !!this.properties.length; - }; - - Value.prototype.bareLiteral = function(type) { - return !this.properties.length && this.base instanceof type; - }; - - Value.prototype.isArray = function() { - return this.bareLiteral(Arr); - }; - - Value.prototype.isRange = function() { - return this.bareLiteral(Range); - }; - - Value.prototype.isComplex = function() { - return this.hasProperties() || this.base.isComplex(); - }; - - Value.prototype.isAssignable = function() { - return this.hasProperties() || this.base.isAssignable(); - }; - - Value.prototype.isSimpleNumber = function() { - return this.bareLiteral(Literal) && SIMPLENUM.test(this.base.value); - }; - - Value.prototype.isString = function() { - return this.bareLiteral(Literal) && IS_STRING.test(this.base.value); - }; - - Value.prototype.isRegex = function() { - return this.bareLiteral(Literal) && IS_REGEX.test(this.base.value); - }; - - Value.prototype.isAtomic = function() { - var node, _i, _len, _ref2; - _ref2 = this.properties.concat(this.base); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - node = _ref2[_i]; - if (node.soak || node instanceof Call) { - return false; - } - } - return true; - }; - - Value.prototype.isNotCallable = function() { - return this.isSimpleNumber() || this.isString() || this.isRegex() || this.isArray() || this.isRange() || this.isSplice() || this.isObject(); - }; - - Value.prototype.isStatement = function(o) { - return !this.properties.length && this.base.isStatement(o); - }; - - Value.prototype.assigns = function(name) { - return !this.properties.length && this.base.assigns(name); - }; - - Value.prototype.jumps = function(o) { - return !this.properties.length && this.base.jumps(o); - }; - - Value.prototype.isObject = function(onlyGenerated) { - if (this.properties.length) { - return false; - } - return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated); - }; - - Value.prototype.isSplice = function() { - return last(this.properties) instanceof Slice; - }; - - Value.prototype.looksStatic = function(className) { - var _ref2; - return this.base.value === className && this.properties.length && ((_ref2 = this.properties[0].name) != null ? _ref2.value : void 0) !== 'prototype'; - }; - - Value.prototype.unwrap = function() { - if (this.properties.length) { - return this; - } else { - return this.base; - } - }; - - Value.prototype.cacheReference = function(o) { - var base, bref, name, nref; - name = last(this.properties); - if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) { - return [this, this]; - } - base = new Value(this.base, this.properties.slice(0, -1)); - if (base.isComplex()) { - bref = new Literal(o.scope.freeVariable('base')); - base = new Value(new Parens(new Assign(bref, base))); - } - if (!name) { - return [base, bref]; - } - if (name.isComplex()) { - nref = new Literal(o.scope.freeVariable('name')); - name = new Index(new Assign(nref, name.index)); - nref = new Index(nref); - } - return [base.add(name), new Value(bref || base.base, [nref || name])]; - }; - - Value.prototype.compileNode = function(o) { - var fragments, prop, props, _i, _len; - this.base.front = this.front; - props = this.properties; - fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null)); - if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) { - fragments.push(this.makeCode('.')); - } - for (_i = 0, _len = props.length; _i < _len; _i++) { - prop = props[_i]; - fragments.push.apply(fragments, prop.compileToFragments(o)); - } - return fragments; - }; - - Value.prototype.unfoldSoak = function(o) { - return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) { - return function() { - var fst, i, ifn, prop, ref, snd, _i, _len, _ref2, _ref3; - if (ifn = _this.base.unfoldSoak(o)) { - (_ref2 = ifn.body.properties).push.apply(_ref2, _this.properties); - return ifn; - } - _ref3 = _this.properties; - for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) { - prop = _ref3[i]; - if (!prop.soak) { - continue; - } - prop.soak = false; - fst = new Value(_this.base, _this.properties.slice(0, i)); - snd = new Value(_this.base, _this.properties.slice(i)); - if (fst.isComplex()) { - ref = new Literal(o.scope.freeVariable('ref')); - fst = new Parens(new Assign(ref, fst)); - snd.base = ref; - } - return new If(new Existence(fst), snd, { - soak: true - }); - } - return false; - }; - })(this)(); - }; - - return Value; - - })(Base); - - exports.Comment = Comment = (function(_super) { - __extends(Comment, _super); - - function Comment(comment) { - this.comment = comment; - } - - Comment.prototype.isStatement = YES; - - Comment.prototype.makeReturn = THIS; - - Comment.prototype.compileNode = function(o, level) { - var code, comment; - comment = this.comment.replace(/^(\s*)#/gm, "$1 *"); - code = "/*" + (multident(comment, this.tab)) + (__indexOf.call(comment, '\n') >= 0 ? "\n" + this.tab : '') + " */"; - if ((level || o.level) === LEVEL_TOP) { - code = o.indent + code; - } - return [this.makeCode("\n"), this.makeCode(code)]; - }; - - return Comment; - - })(Base); - - exports.Call = Call = (function(_super) { - __extends(Call, _super); - - function Call(variable, args, soak) { - this.args = args != null ? args : []; - this.soak = soak; - this.isNew = false; - this.isSuper = variable === 'super'; - this.variable = this.isSuper ? null : variable; - if (variable instanceof Value && variable.isNotCallable()) { - variable.error("literal is not a function"); - } - } - - Call.prototype.children = ['variable', 'args']; - - Call.prototype.newInstance = function() { - var base, _ref2; - base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable; - if (base instanceof Call && !base.isNew) { - base.newInstance(); - } else { - this.isNew = true; - } - return this; - }; - - Call.prototype.superReference = function(o) { - var accesses, method; - method = o.scope.namedMethod(); - if (method != null ? method.klass : void 0) { - accesses = [new Access(new Literal('__super__'))]; - if (method["static"]) { - accesses.push(new Access(new Literal('constructor'))); - } - accesses.push(new Access(new Literal(method.name))); - return (new Value(new Literal(method.klass), accesses)).compile(o); - } else if (method != null ? method.ctor : void 0) { - return "" + method.name + ".__super__.constructor"; - } else { - return this.error('cannot call super outside of an instance method.'); - } - }; - - Call.prototype.superThis = function(o) { - var method; - method = o.scope.method; - return (method && !method.klass && method.context) || "this"; - }; - - Call.prototype.unfoldSoak = function(o) { - var call, ifn, left, list, rite, _i, _len, _ref2, _ref3; - if (this.soak) { - if (this.variable) { - if (ifn = unfoldSoak(o, this, 'variable')) { - return ifn; - } - _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1]; - } else { - left = new Literal(this.superReference(o)); - rite = new Value(left); - } - rite = new Call(rite, this.args); - rite.isNew = this.isNew; - left = new Literal("typeof " + (left.compile(o)) + " === \"function\""); - return new If(left, new Value(rite), { - soak: true - }); - } - call = this; - list = []; - while (true) { - if (call.variable instanceof Call) { - list.push(call); - call = call.variable; - continue; - } - if (!(call.variable instanceof Value)) { - break; - } - list.push(call); - if (!((call = call.variable.base) instanceof Call)) { - break; - } - } - _ref3 = list.reverse(); - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - call = _ref3[_i]; - if (ifn) { - if (call.variable instanceof Call) { - call.variable = ifn; - } else { - call.variable.base = ifn; - } - } - ifn = unfoldSoak(o, call, 'variable'); - } - return ifn; - }; - - Call.prototype.compileNode = function(o) { - var arg, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref2, _ref3; - if ((_ref2 = this.variable) != null) { - _ref2.front = this.front; - } - compiledArray = Splat.compileSplattedArray(o, this.args, true); - if (compiledArray.length) { - return this.compileSplat(o, compiledArray); - } - compiledArgs = []; - _ref3 = this.args; - for (argIndex = _i = 0, _len = _ref3.length; _i < _len; argIndex = ++_i) { - arg = _ref3[argIndex]; - if (argIndex) { - compiledArgs.push(this.makeCode(", ")); - } - compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST)); - } - fragments = []; - if (this.isSuper) { - preface = this.superReference(o) + (".call(" + (this.superThis(o))); - if (compiledArgs.length) { - preface += ", "; - } - fragments.push(this.makeCode(preface)); - } else { - if (this.isNew) { - fragments.push(this.makeCode('new ')); - } - fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS)); - fragments.push(this.makeCode("(")); - } - fragments.push.apply(fragments, compiledArgs); - fragments.push(this.makeCode(")")); - return fragments; - }; - - Call.prototype.compileSplat = function(o, splatArgs) { - var answer, base, fun, idt, name, ref; - if (this.isSuper) { - return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")")); - } - if (this.isNew) { - idt = this.tab + TAB; - return [].concat(this.makeCode("(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})("), this.variable.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})")); - } - answer = []; - base = new Value(this.variable); - if ((name = base.properties.pop()) && base.isComplex()) { - ref = o.scope.freeVariable('ref'); - answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o)); - } else { - fun = base.compileToFragments(o, LEVEL_ACCESS); - if (SIMPLENUM.test(fragmentsToText(fun))) { - fun = this.wrapInBraces(fun); - } - if (name) { - ref = fragmentsToText(fun); - fun.push.apply(fun, name.compileToFragments(o)); - } else { - ref = 'null'; - } - answer = answer.concat(fun); - } - return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")")); - }; - - return Call; - - })(Base); - - exports.Extends = Extends = (function(_super) { - __extends(Extends, _super); - - function Extends(child, parent) { - this.child = child; - this.parent = parent; - } - - Extends.prototype.children = ['child', 'parent']; - - Extends.prototype.compileToFragments = function(o) { - return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o); - }; - - return Extends; - - })(Base); - - exports.Access = Access = (function(_super) { - __extends(Access, _super); - - function Access(name, tag) { - this.name = name; - this.name.asKey = true; - this.soak = tag === 'soak'; - } - - Access.prototype.children = ['name']; - - Access.prototype.compileToFragments = function(o) { - var name; - name = this.name.compileToFragments(o); - if (IDENTIFIER.test(fragmentsToText(name))) { - name.unshift(this.makeCode(".")); - } else { - name.unshift(this.makeCode("[")); - name.push(this.makeCode("]")); - } - return name; - }; - - Access.prototype.isComplex = NO; - - return Access; - - })(Base); - - exports.Index = Index = (function(_super) { - __extends(Index, _super); - - function Index(index) { - this.index = index; - } - - Index.prototype.children = ['index']; - - Index.prototype.compileToFragments = function(o) { - return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]")); - }; - - Index.prototype.isComplex = function() { - return this.index.isComplex(); - }; - - return Index; - - })(Base); - - exports.Range = Range = (function(_super) { - __extends(Range, _super); - - Range.prototype.children = ['from', 'to']; - - function Range(from, to, tag) { - this.from = from; - this.to = to; - this.exclusive = tag === 'exclusive'; - this.equals = this.exclusive ? '' : '='; - } - - Range.prototype.compileVariables = function(o) { - var step, _ref2, _ref3, _ref4, _ref5; - o = merge(o, { - top: true - }); - _ref2 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref2[0], this.fromVar = _ref2[1]; - _ref3 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref3[0], this.toVar = _ref3[1]; - if (step = del(o, 'step')) { - _ref4 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref4[0], this.stepVar = _ref4[1]; - } - _ref5 = [this.fromVar.match(NUMBER), this.toVar.match(NUMBER)], this.fromNum = _ref5[0], this.toNum = _ref5[1]; - if (this.stepVar) { - return this.stepNum = this.stepVar.match(NUMBER); - } - }; - - Range.prototype.compileNode = function(o) { - var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3; - if (!this.fromVar) { - this.compileVariables(o); - } - if (!o.index) { - return this.compileArray(o); - } - known = this.fromNum && this.toNum; - idx = del(o, 'index'); - idxName = del(o, 'name'); - namedIndex = idxName && idxName !== idx; - varPart = "" + idx + " = " + this.fromC; - if (this.toC !== this.toVar) { - varPart += ", " + this.toC; - } - if (this.step !== this.stepVar) { - varPart += ", " + this.step; - } - _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1]; - condPart = this.stepNum ? parseNum(this.stepNum[0]) > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [parseNum(this.fromNum[0]), parseNum(this.toNum[0])], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar); - stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--"; - if (namedIndex) { - varPart = "" + idxName + " = " + varPart; - } - if (namedIndex) { - stepPart = "" + idxName + " = " + stepPart; - } - return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)]; - }; - - Range.prototype.compileArray = function(o) { - var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results; - if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) { - range = (function() { - _results = []; - for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); } - return _results; - }).apply(this); - if (this.exclusive) { - range.pop(); - } - return [this.makeCode("[" + (range.join(', ')) + "]")]; - } - idt = this.tab + TAB; - i = o.scope.freeVariable('i'); - result = o.scope.freeVariable('results'); - pre = "\n" + idt + result + " = [];"; - if (this.fromNum && this.toNum) { - o.index = i; - body = fragmentsToText(this.compileNode(o)); - } else { - vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : ''); - cond = "" + this.fromVar + " <= " + this.toVar; - body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--"; - } - post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent; - hasArgs = function(node) { - return node != null ? node.contains(isLiteralArguments) : void 0; - }; - if (hasArgs(this.from) || hasArgs(this.to)) { - args = ', arguments'; - } - return [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")]; - }; - - return Range; - - })(Base); - - exports.Slice = Slice = (function(_super) { - __extends(Slice, _super); - - Slice.prototype.children = ['range']; - - function Slice(range) { - this.range = range; - Slice.__super__.constructor.call(this); - } - - Slice.prototype.compileNode = function(o) { - var compiled, compiledText, from, fromCompiled, to, toStr, _ref2; - _ref2 = this.range, to = _ref2.to, from = _ref2.from; - fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')]; - if (to) { - compiled = to.compileToFragments(o, LEVEL_PAREN); - compiledText = fragmentsToText(compiled); - if (!(!this.range.exclusive && +compiledText === -1)) { - toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9")); - } - } - return [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")]; - }; - - return Slice; - - })(Base); - - exports.Obj = Obj = (function(_super) { - __extends(Obj, _super); - - function Obj(props, generated) { - this.generated = generated != null ? generated : false; - this.objects = this.properties = props || []; - } - - Obj.prototype.children = ['properties']; - - Obj.prototype.compileNode = function(o) { - var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1; - props = this.properties; - if (!props.length) { - return [this.makeCode(this.front ? '({})' : '{}')]; - } - if (this.generated) { - for (_i = 0, _len = props.length; _i < _len; _i++) { - node = props[_i]; - if (node instanceof Value) { - node.error('cannot have an implicit value in an implicit object'); - } - } - } - idt = o.indent += TAB; - lastNoncom = this.lastNonComment(this.properties); - answer = []; - for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) { - prop = props[i]; - join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; - indent = prop instanceof Comment ? '' : idt; - if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) { - prop.variable.error('Invalid object key'); - } - if (prop instanceof Value && prop["this"]) { - prop = new Assign(prop.properties[0].name, prop, 'object'); - } - if (!(prop instanceof Comment)) { - if (!(prop instanceof Assign)) { - prop = new Assign(prop, prop, 'object'); - } - (prop.variable.base || prop.variable).asKey = true; - } - if (indent) { - answer.push(this.makeCode(indent)); - } - answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP)); - if (join) { - answer.push(this.makeCode(join)); - } - } - answer.unshift(this.makeCode("{" + (props.length && '\n'))); - answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}")); - if (this.front) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - Obj.prototype.assigns = function(name) { - var prop, _i, _len, _ref2; - _ref2 = this.properties; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - prop = _ref2[_i]; - if (prop.assigns(name)) { - return true; - } - } - return false; - }; - - return Obj; - - })(Base); - - exports.Arr = Arr = (function(_super) { - __extends(Arr, _super); - - function Arr(objs) { - this.objects = objs || []; - } - - Arr.prototype.children = ['objects']; - - Arr.prototype.compileNode = function(o) { - var answer, compiledObjs, fragments, index, obj, _i, _len; - if (!this.objects.length) { - return [this.makeCode('[]')]; - } - o.indent += TAB; - answer = Splat.compileSplattedArray(o, this.objects); - if (answer.length) { - return answer; - } - answer = []; - compiledObjs = (function() { - var _i, _len, _ref2, _results; - _ref2 = this.objects; - _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - _results.push(obj.compileToFragments(o, LEVEL_LIST)); - } - return _results; - }).call(this); - for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) { - fragments = compiledObjs[index]; - if (index) { - answer.push(this.makeCode(", ")); - } - answer.push.apply(answer, fragments); - } - if (fragmentsToText(answer).indexOf('\n') >= 0) { - answer.unshift(this.makeCode("[\n" + o.indent)); - answer.push(this.makeCode("\n" + this.tab + "]")); - } else { - answer.unshift(this.makeCode("[")); - answer.push(this.makeCode("]")); - } - return answer; - }; - - Arr.prototype.assigns = function(name) { - var obj, _i, _len, _ref2; - _ref2 = this.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (obj.assigns(name)) { - return true; - } - } - return false; - }; - - return Arr; - - })(Base); - - exports.Class = Class = (function(_super) { - __extends(Class, _super); - - function Class(variable, parent, body) { - this.variable = variable; - this.parent = parent; - this.body = body != null ? body : new Block; - this.boundFuncs = []; - this.body.classBody = true; - } - - Class.prototype.children = ['variable', 'parent', 'body']; - - Class.prototype.determineName = function() { - var decl, tail; - if (!this.variable) { - return null; - } - decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value; - if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) { - this.variable.error("class variable name may not be " + decl); - } - return decl && (decl = IDENTIFIER.test(decl) && decl); - }; - - Class.prototype.setContext = function(name) { - return this.body.traverseChildren(false, function(node) { - if (node.classBody) { - return false; - } - if (node instanceof Literal && node.value === 'this') { - return node.value = name; - } else if (node instanceof Code) { - node.klass = name; - if (node.bound) { - return node.context = name; - } - } - }); - }; - - Class.prototype.addBoundFunctions = function(o) { - var bvar, lhs, _i, _len, _ref2; - _ref2 = this.boundFuncs; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - bvar = _ref2[_i]; - lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o); - this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")); - } - }; - - Class.prototype.addProperties = function(node, name, o) { - var assign, base, exprs, func, props; - props = node.base.properties.slice(0); - exprs = (function() { - var _results; - _results = []; - while (assign = props.shift()) { - if (assign instanceof Assign) { - base = assign.variable.base; - delete assign.context; - func = assign.value; - if (base.value === 'constructor') { - if (this.ctor) { - assign.error('cannot define more than one constructor in a class'); - } - if (func.bound) { - assign.error('cannot define a constructor as a bound function'); - } - if (func instanceof Code) { - assign = this.ctor = func; - } else { - this.externalCtor = o.classScope.freeVariable('class'); - assign = new Assign(new Literal(this.externalCtor), func); - } - } else { - if (assign.variable["this"]) { - func["static"] = true; - } else { - assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]); - if (func instanceof Code && func.bound) { - this.boundFuncs.push(base); - func.bound = false; - } - } - } - } - _results.push(assign); - } - return _results; - }).call(this); - return compact(exprs); - }; - - Class.prototype.walkBody = function(name, o) { - return this.traverseChildren(false, (function(_this) { - return function(child) { - var cont, exps, i, node, _i, _len, _ref2; - cont = true; - if (child instanceof Class) { - return false; - } - if (child instanceof Block) { - _ref2 = exps = child.expressions; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - node = _ref2[i]; - if (node instanceof Assign && node.variable.looksStatic(name)) { - node.value["static"] = true; - } else if (node instanceof Value && node.isObject(true)) { - cont = false; - exps[i] = _this.addProperties(node, name, o); - } - } - child.expressions = exps = flatten(exps); - } - return cont && !(child instanceof Class); - }; - })(this)); - }; - - Class.prototype.hoistDirectivePrologue = function() { - var expressions, index, node; - index = 0; - expressions = this.body.expressions; - while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) { - ++index; - } - return this.directives = expressions.splice(0, index); - }; - - Class.prototype.ensureConstructor = function(name) { - if (!this.ctor) { - this.ctor = new Code; - if (this.externalCtor) { - this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)")); - } else if (this.parent) { - this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)")); - } - this.ctor.body.makeReturn(); - this.body.expressions.unshift(this.ctor); - } - this.ctor.ctor = this.ctor.name = name; - this.ctor.klass = null; - return this.ctor.noReturn = true; - }; - - Class.prototype.compileNode = function(o) { - var args, argumentsNode, func, jumpNode, klass, lname, name, superClass, _ref2; - if (jumpNode = this.body.jumps()) { - jumpNode.error('Class bodies cannot contain pure statements'); - } - if (argumentsNode = this.body.contains(isLiteralArguments)) { - argumentsNode.error("Class bodies shouldn't reference arguments"); - } - name = this.determineName() || '_Class'; - if (name.reserved) { - name = "_" + name; - } - lname = new Literal(name); - func = new Code([], Block.wrap([this.body])); - args = []; - o.classScope = func.makeScope(o.scope); - this.hoistDirectivePrologue(); - this.setContext(name); - this.walkBody(name, o); - this.ensureConstructor(name); - this.addBoundFunctions(o); - this.body.spaced = true; - this.body.expressions.push(lname); - if (this.parent) { - superClass = new Literal(o.classScope.freeVariable('super', false)); - this.body.expressions.unshift(new Extends(lname, superClass)); - func.params.push(new Param(superClass)); - args.push(this.parent); - } - (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives); - klass = new Parens(new Call(func, args)); - if (this.variable) { - klass = new Assign(this.variable, klass); - } - return klass.compileToFragments(o); - }; - - return Class; - - })(Base); - - exports.Assign = Assign = (function(_super) { - __extends(Assign, _super); - - function Assign(variable, value, context, options) { - var forbidden, name, _ref2; - this.variable = variable; - this.value = value; - this.context = context; - this.param = options && options.param; - this.subpattern = options && options.subpattern; - forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0); - if (forbidden && this.context !== 'object') { - this.variable.error("variable name may not be \"" + name + "\""); - } - } - - Assign.prototype.children = ['variable', 'value']; - - Assign.prototype.isStatement = function(o) { - return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0; - }; - - Assign.prototype.assigns = function(name) { - return this[this.context === 'object' ? 'value' : 'variable'].assigns(name); - }; - - Assign.prototype.unfoldSoak = function(o) { - return unfoldSoak(o, this, 'variable'); - }; - - Assign.prototype.compileNode = function(o) { - var answer, compiledName, isValue, match, name, val, varBase, _ref2, _ref3, _ref4; - if (isValue = this.variable instanceof Value) { - if (this.variable.isArray() || this.variable.isObject()) { - return this.compilePatternMatch(o); - } - if (this.variable.isSplice()) { - return this.compileSplice(o); - } - if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') { - return this.compileConditional(o); - } - } - compiledName = this.variable.compileToFragments(o, LEVEL_LIST); - name = fragmentsToText(compiledName); - if (!this.context) { - varBase = this.variable.unwrapAll(); - if (!varBase.isAssignable()) { - this.variable.error("\"" + (this.variable.compile(o)) + "\" cannot be assigned"); - } - if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) { - if (this.param) { - o.scope.add(name, 'var'); - } else { - o.scope.find(name); - } - } - } - if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { - if (match[2]) { - this.value.klass = match[1]; - } - this.value.name = (_ref3 = (_ref4 = match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; - } - val = this.value.compileToFragments(o, LEVEL_LIST); - if (this.context === 'object') { - return compiledName.concat(this.makeCode(": "), val); - } - answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val); - if (o.level <= LEVEL_LIST) { - return answer; - } else { - return this.wrapInBraces(answer); - } - }; - - Assign.prototype.compilePatternMatch = function(o) { - var acc, assigns, code, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, vvarText, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; - top = o.level === LEVEL_TOP; - value = this.value; - objects = this.variable.base.objects; - if (!(olen = objects.length)) { - code = value.compileToFragments(o); - if (o.level >= LEVEL_OP) { - return this.wrapInBraces(code); - } else { - return code; - } - } - isObject = this.variable.isObject(); - if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) { - if (obj instanceof Assign) { - _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value; - } else { - idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0); - } - acc = IDENTIFIER.test(idx.unwrap().value || 0); - value = new Value(value); - value.properties.push(new (acc ? Access : Index)(idx)); - if (_ref4 = obj.unwrap().value, __indexOf.call(RESERVED, _ref4) >= 0) { - obj.error("assignment to a reserved word: " + (obj.compile(o))); - } - return new Assign(obj, value, null, { - param: this.param - }).compileToFragments(o, LEVEL_TOP); - } - vvar = value.compileToFragments(o, LEVEL_LIST); - vvarText = fragmentsToText(vvar); - assigns = []; - splat = false; - if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) { - assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar))); - vvar = [this.makeCode(ref)]; - vvarText = ref; - } - for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) { - obj = objects[i]; - idx = i; - if (isObject) { - if (obj instanceof Assign) { - _ref5 = obj, (_ref6 = _ref5.variable, idx = _ref6.base), obj = _ref5.value; - } else { - if (obj.base instanceof Parens) { - _ref7 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref7[0], idx = _ref7[1]; - } else { - idx = obj["this"] ? obj.properties[0].name : obj; - } - } - } - if (!splat && obj instanceof Splat) { - name = obj.name.unwrap().value; - obj = obj.unwrap(); - val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i; - if (rest = olen - i - 1) { - ivar = o.scope.freeVariable('i'); - val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; - } else { - val += ") : []"; - } - val = new Literal(val); - splat = "" + ivar + "++"; - } else { - name = obj.unwrap().value; - if (obj instanceof Splat) { - obj.error("multiple splats are disallowed in an assignment"); - } - if (typeof idx === 'number') { - idx = new Literal(splat || idx); - acc = false; - } else { - acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0); - } - val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]); - } - if ((name != null) && __indexOf.call(RESERVED, name) >= 0) { - obj.error("assignment to a reserved word: " + (obj.compile(o))); - } - assigns.push(new Assign(obj, val, null, { - param: this.param, - subpattern: true - }).compileToFragments(o, LEVEL_LIST)); - } - if (!(top || this.subpattern)) { - assigns.push(vvar); - } - fragments = this.joinFragmentArrays(assigns, ', '); - if (o.level < LEVEL_LIST) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - }; - - Assign.prototype.compileConditional = function(o) { - var fragments, left, right, _ref2; - _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1]; - if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) { - this.variable.error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been declared before"); - } - if (__indexOf.call(this.context, "?") >= 0) { - o.isExistentialEquals = true; - return new If(new Existence(left), right, { - type: 'if' - }).addElse(new Assign(right, this.value, '=')).compileToFragments(o); - } else { - fragments = new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o); - if (o.level <= LEVEL_LIST) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - } - }; - - Assign.prototype.compileSplice = function(o) { - var answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4; - _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive; - name = this.variable.compile(o); - if (from) { - _ref3 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref3[0], fromRef = _ref3[1]; - } else { - fromDecl = fromRef = '0'; - } - if (to) { - if (from instanceof Value && from.isSimpleNumber() && to instanceof Value && to.isSimpleNumber()) { - to = to.compile(o) - fromRef; - if (!exclusive) { - to += 1; - } - } else { - to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef; - if (!exclusive) { - to += ' + 1'; - } - } - } else { - to = "9e9"; - } - _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1]; - answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef); - if (o.level > LEVEL_TOP) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - return Assign; - - })(Base); - - exports.Code = Code = (function(_super) { - __extends(Code, _super); - - function Code(params, body, tag) { - this.params = params || []; - this.body = body || new Block; - this.bound = tag === 'boundfunc'; - } - - Code.prototype.children = ['params', 'body']; - - Code.prototype.isStatement = function() { - return !!this.ctor; - }; - - Code.prototype.jumps = NO; - - Code.prototype.makeScope = function(parentScope) { - return new Scope(parentScope, this.body, this); - }; - - Code.prototype.compileNode = function(o) { - var answer, boundfunc, code, exprs, i, lit, p, param, params, ref, splats, uniqs, val, wasEmpty, wrapper, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; - if (this.bound && ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0)) { - this.context = o.scope.method.context; - } - if (this.bound && !this.context) { - this.context = '_this'; - wrapper = new Code([new Param(new Literal(this.context))], new Block([this])); - boundfunc = new Call(wrapper, [new Literal('this')]); - boundfunc.updateLocationDataIfMissing(this.locationData); - return boundfunc.compileNode(o); - } - o.scope = del(o, 'classScope') || this.makeScope(o.scope); - o.scope.shared = del(o, 'sharedScope'); - o.indent += TAB; - delete o.bare; - delete o.isExistentialEquals; - params = []; - exprs = []; - _ref3 = this.params; - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - param = _ref3[_i]; - o.scope.parameter(param.asReference(o)); - } - _ref4 = this.params; - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - param = _ref4[_j]; - if (!param.splat) { - continue; - } - _ref5 = this.params; - for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) { - p = _ref5[_k].name; - if (p["this"]) { - p = p.properties[0].name; - } - if (p.value) { - o.scope.add(p.value, 'var', true); - } - } - splats = new Assign(new Value(new Arr((function() { - var _l, _len3, _ref6, _results; - _ref6 = this.params; - _results = []; - for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { - p = _ref6[_l]; - _results.push(p.asReference(o)); - } - return _results; - }).call(this))), new Value(new Literal('arguments'))); - break; - } - _ref6 = this.params; - for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { - param = _ref6[_l]; - if (param.isComplex()) { - val = ref = param.asReference(o); - if (param.value) { - val = new Op('?', ref, param.value); - } - exprs.push(new Assign(new Value(param.name), val, '=', { - param: true - })); - } else { - ref = param; - if (param.value) { - lit = new Literal(ref.name.value + ' == null'); - val = new Assign(new Value(param.name), param.value, '='); - exprs.push(new If(lit, val)); - } - } - if (!splats) { - params.push(ref); - } - } - wasEmpty = this.body.isEmpty(); - if (splats) { - exprs.unshift(splats); - } - if (exprs.length) { - (_ref7 = this.body.expressions).unshift.apply(_ref7, exprs); - } - for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) { - p = params[i]; - params[i] = p.compileToFragments(o); - o.scope.parameter(fragmentsToText(params[i])); - } - uniqs = []; - this.eachParamName(function(name, node) { - if (__indexOf.call(uniqs, name) >= 0) { - node.error("multiple parameters named '" + name + "'"); - } - return uniqs.push(name); - }); - if (!(wasEmpty || this.noReturn)) { - this.body.makeReturn(); - } - code = 'function'; - if (this.ctor) { - code += ' ' + this.name; - } - code += '('; - answer = [this.makeCode(code)]; - for (i = _n = 0, _len5 = params.length; _n < _len5; i = ++_n) { - p = params[i]; - if (i) { - answer.push(this.makeCode(", ")); - } - answer.push.apply(answer, p); - } - answer.push(this.makeCode(') {')); - if (!this.body.isEmpty()) { - answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab)); - } - answer.push(this.makeCode('}')); - if (this.ctor) { - return [this.makeCode(this.tab)].concat(__slice.call(answer)); - } - if (this.front || (o.level >= LEVEL_ACCESS)) { - return this.wrapInBraces(answer); - } else { - return answer; - } - }; - - Code.prototype.eachParamName = function(iterator) { - var param, _i, _len, _ref2, _results; - _ref2 = this.params; - _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - param = _ref2[_i]; - _results.push(param.eachName(iterator)); - } - return _results; - }; - - Code.prototype.traverseChildren = function(crossScope, func) { - if (crossScope) { - return Code.__super__.traverseChildren.call(this, crossScope, func); - } - }; - - return Code; - - })(Base); - - exports.Param = Param = (function(_super) { - __extends(Param, _super); - - function Param(name, value, splat) { - var _ref2; - this.name = name; - this.value = value; - this.splat = splat; - if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { - this.name.error("parameter name \"" + name + "\" is not allowed"); - } - } - - Param.prototype.children = ['name', 'value']; - - Param.prototype.compileToFragments = function(o) { - return this.name.compileToFragments(o, LEVEL_LIST); - }; - - Param.prototype.asReference = function(o) { - var node; - if (this.reference) { - return this.reference; - } - node = this.name; - if (node["this"]) { - node = node.properties[0].name; - if (node.value.reserved) { - node = new Literal(o.scope.freeVariable(node.value)); - } - } else if (node.isComplex()) { - node = new Literal(o.scope.freeVariable('arg')); - } - node = new Value(node); - if (this.splat) { - node = new Splat(node); - } - node.updateLocationDataIfMissing(this.locationData); - return this.reference = node; - }; - - Param.prototype.isComplex = function() { - return this.name.isComplex(); - }; - - Param.prototype.eachName = function(iterator, name) { - var atParam, node, obj, _i, _len, _ref2; - if (name == null) { - name = this.name; - } - atParam = function(obj) { - var node; - node = obj.properties[0].name; - if (!node.value.reserved) { - return iterator(node.value, node); - } - }; - if (name instanceof Literal) { - return iterator(name.value, name); - } - if (name instanceof Value) { - return atParam(name); - } - _ref2 = name.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (obj instanceof Assign) { - this.eachName(iterator, obj.value.unwrap()); - } else if (obj instanceof Splat) { - node = obj.name.unwrap(); - iterator(node.value, node); - } else if (obj instanceof Value) { - if (obj.isArray() || obj.isObject()) { - this.eachName(iterator, obj.base); - } else if (obj["this"]) { - atParam(obj); - } else { - iterator(obj.base.value, obj.base); - } - } else { - obj.error("illegal parameter " + (obj.compile())); - } - } - }; - - return Param; - - })(Base); - - exports.Splat = Splat = (function(_super) { - __extends(Splat, _super); - - Splat.prototype.children = ['name']; - - Splat.prototype.isAssignable = YES; - - function Splat(name) { - this.name = name.compile ? name : new Literal(name); - } - - Splat.prototype.assigns = function(name) { - return this.name.assigns(name); - }; - - Splat.prototype.compileToFragments = function(o) { - return this.name.compileToFragments(o); - }; - - Splat.prototype.unwrap = function() { - return this.name; - }; - - Splat.compileSplattedArray = function(o, list, apply) { - var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len; - index = -1; - while ((node = list[++index]) && !(node instanceof Splat)) { - continue; - } - if (index >= list.length) { - return []; - } - if (list.length === 1) { - node = list[0]; - fragments = node.compileToFragments(o, LEVEL_LIST); - if (apply) { - return fragments; - } - return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")")); - } - args = list.slice(index); - for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { - node = args[i]; - compiledNode = node.compileToFragments(o, LEVEL_LIST); - args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]")); - } - if (index === 0) { - node = list[0]; - concatPart = node.joinFragmentArrays(args.slice(1), ', '); - return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")")); - } - base = (function() { - var _j, _len1, _ref2, _results; - _ref2 = list.slice(0, index); - _results = []; - for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { - node = _ref2[_j]; - _results.push(node.compileToFragments(o, LEVEL_LIST)); - } - return _results; - })(); - base = list[0].joinFragmentArrays(base, ', '); - concatPart = list[index].joinFragmentArrays(args, ', '); - return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")")); - }; - - return Splat; - - })(Base); - - exports.While = While = (function(_super) { - __extends(While, _super); - - function While(condition, options) { - this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition; - this.guard = options != null ? options.guard : void 0; - } - - While.prototype.children = ['condition', 'guard', 'body']; - - While.prototype.isStatement = YES; - - While.prototype.makeReturn = function(res) { - if (res) { - return While.__super__.makeReturn.apply(this, arguments); - } else { - this.returns = !this.jumps({ - loop: true - }); - return this; - } - }; - - While.prototype.addBody = function(body) { - this.body = body; - return this; - }; - - While.prototype.jumps = function() { - var expressions, jumpNode, node, _i, _len; - expressions = this.body.expressions; - if (!expressions.length) { - return false; - } - for (_i = 0, _len = expressions.length; _i < _len; _i++) { - node = expressions[_i]; - if (jumpNode = node.jumps({ - loop: true - })) { - return jumpNode; - } - } - return false; - }; - - While.prototype.compileNode = function(o) { - var answer, body, rvar, set; - o.indent += TAB; - set = ''; - body = this.body; - if (body.isEmpty()) { - body = this.makeCode(''); - } else { - if (this.returns) { - body.makeReturn(rvar = o.scope.freeVariable('results')); - set = "" + this.tab + rvar + " = [];\n"; - } - if (this.guard) { - if (body.expressions.length > 1) { - body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); - } else { - if (this.guard) { - body = Block.wrap([new If(this.guard, body)]); - } - } - } - body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab)); - } - answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}")); - if (this.returns) { - answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";")); - } - return answer; - }; - - return While; - - })(Base); - - exports.Op = Op = (function(_super) { - var CONVERSIONS, INVERSIONS; - - __extends(Op, _super); - - function Op(op, first, second, flip) { - if (op === 'in') { - return new In(first, second); - } - if (op === 'do') { - return this.generateDo(first); - } - if (op === 'new') { - if (first instanceof Call && !first["do"] && !first.isNew) { - return first.newInstance(); - } - if (first instanceof Code && first.bound || first["do"]) { - first = new Parens(first); - } - } - this.operator = CONVERSIONS[op] || op; - this.first = first; - this.second = second; - this.flip = !!flip; - return this; - } - - CONVERSIONS = { - '==': '===', - '!=': '!==', - 'of': 'in' - }; - - INVERSIONS = { - '!==': '===', - '===': '!==' - }; - - Op.prototype.children = ['first', 'second']; - - Op.prototype.isSimpleNumber = NO; - - Op.prototype.isUnary = function() { - return !this.second; - }; - - Op.prototype.isComplex = function() { - var _ref2; - return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex(); - }; - - Op.prototype.isChainable = function() { - var _ref2; - return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!=='; - }; - - Op.prototype.invert = function() { - var allInvertable, curr, fst, op, _ref2; - if (this.isChainable() && this.first.isChainable()) { - allInvertable = true; - curr = this; - while (curr && curr.operator) { - allInvertable && (allInvertable = curr.operator in INVERSIONS); - curr = curr.first; - } - if (!allInvertable) { - return new Parens(this).invert(); - } - curr = this; - while (curr && curr.operator) { - curr.invert = !curr.invert; - curr.operator = INVERSIONS[curr.operator]; - curr = curr.first; - } - return this; - } else if (op = INVERSIONS[this.operator]) { - this.operator = op; - if (this.first.unwrap() instanceof Op) { - this.first.invert(); - } - return this; - } else if (this.second) { - return new Parens(this).invert(); - } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) { - return fst; - } else { - return new Op('!', this); - } - }; - - Op.prototype.unfoldSoak = function(o) { - var _ref2; - return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first'); - }; - - Op.prototype.generateDo = function(exp) { - var call, func, param, passedParams, ref, _i, _len, _ref2; - passedParams = []; - func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp; - _ref2 = func.params || []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - param = _ref2[_i]; - if (param.value) { - passedParams.push(param.value); - delete param.value; - } else { - passedParams.push(param); - } - } - call = new Call(exp, passedParams); - call["do"] = true; - return call; - }; - - Op.prototype.compileNode = function(o) { - var answer, isChain, _ref2, _ref3; - isChain = this.isChainable() && this.first.isChainable(); - if (!isChain) { - this.first.front = this.front; - } - if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) { - this.error('delete operand may not be argument or var'); - } - if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) { - this.error("cannot increment/decrement \"" + (this.first.unwrapAll().value) + "\""); - } - if (this.isUnary()) { - return this.compileUnary(o); - } - if (isChain) { - return this.compileChain(o); - } - if (this.operator === '?') { - return this.compileExistence(o); - } - answer = [].concat(this.first.compileToFragments(o, LEVEL_OP), this.makeCode(' ' + this.operator + ' '), this.second.compileToFragments(o, LEVEL_OP)); - if (o.level <= LEVEL_OP) { - return answer; - } else { - return this.wrapInBraces(answer); - } - }; - - Op.prototype.compileChain = function(o) { - var fragments, fst, shared, _ref2; - _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1]; - fst = this.first.compileToFragments(o, LEVEL_OP); - fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP)); - return this.wrapInBraces(fragments); - }; - - Op.prototype.compileExistence = function(o) { - var fst, ref; - if (this.first.isComplex()) { - ref = new Literal(o.scope.freeVariable('ref')); - fst = new Parens(new Assign(ref, this.first)); - } else { - fst = this.first; - ref = fst; - } - return new If(new Existence(fst), ref, { - type: 'if' - }).addElse(this.second).compileToFragments(o); - }; - - Op.prototype.compileUnary = function(o) { - var op, parts, plusMinus; - parts = []; - op = this.operator; - parts.push([this.makeCode(op)]); - if (op === '!' && this.first instanceof Existence) { - this.first.negated = !this.first.negated; - return this.first.compileToFragments(o); - } - if (o.level >= LEVEL_ACCESS) { - return (new Parens(this)).compileToFragments(o); - } - plusMinus = op === '+' || op === '-'; - if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) { - parts.push([this.makeCode(' ')]); - } - if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) { - this.first = new Parens(this.first); - } - parts.push(this.first.compileToFragments(o, LEVEL_OP)); - if (this.flip) { - parts.reverse(); - } - return this.joinFragmentArrays(parts, ''); - }; - - Op.prototype.toString = function(idt) { - return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator); - }; - - return Op; - - })(Base); - - exports.In = In = (function(_super) { - __extends(In, _super); - - function In(object, array) { - this.object = object; - this.array = array; - } - - In.prototype.children = ['object', 'array']; - - In.prototype.invert = NEGATE; - - In.prototype.compileNode = function(o) { - var hasSplat, obj, _i, _len, _ref2; - if (this.array instanceof Value && this.array.isArray()) { - _ref2 = this.array.base.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (!(obj instanceof Splat)) { - continue; - } - hasSplat = true; - break; - } - if (!hasSplat) { - return this.compileOrTest(o); - } - } - return this.compileLoopTest(o); - }; - - In.prototype.compileOrTest = function(o) { - var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4; - if (this.array.base.objects.length === 0) { - return [this.makeCode("" + (!!this.negated))]; - } - _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1]; - _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1]; - tests = []; - _ref4 = this.array.base.objects; - for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) { - item = _ref4[i]; - if (i) { - tests.push(this.makeCode(cnj)); - } - tests = tests.concat((i ? ref : sub), this.makeCode(cmp), item.compileToFragments(o, LEVEL_ACCESS)); - } - if (o.level < LEVEL_OP) { - return tests; - } else { - return this.wrapInBraces(tests); - } - }; - - In.prototype.compileLoopTest = function(o) { - var fragments, ref, sub, _ref2; - _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1]; - fragments = [].concat(this.makeCode(utility('indexOf') + ".call("), this.array.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), ref, this.makeCode(") " + (this.negated ? '< 0' : '>= 0'))); - if (fragmentsToText(sub) === fragmentsToText(ref)) { - return fragments; - } - fragments = sub.concat(this.makeCode(', '), fragments); - if (o.level < LEVEL_LIST) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - }; - - In.prototype.toString = function(idt) { - return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : '')); - }; - - return In; - - })(Base); - - exports.Try = Try = (function(_super) { - __extends(Try, _super); - - function Try(attempt, errorVariable, recovery, ensure) { - this.attempt = attempt; - this.errorVariable = errorVariable; - this.recovery = recovery; - this.ensure = ensure; - } - - Try.prototype.children = ['attempt', 'recovery', 'ensure']; - - Try.prototype.isStatement = YES; - - Try.prototype.jumps = function(o) { - var _ref2; - return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0); - }; - - Try.prototype.makeReturn = function(res) { - if (this.attempt) { - this.attempt = this.attempt.makeReturn(res); - } - if (this.recovery) { - this.recovery = this.recovery.makeReturn(res); - } - return this; - }; - - Try.prototype.compileNode = function(o) { - var catchPart, ensurePart, placeholder, tryPart; - o.indent += TAB; - tryPart = this.attempt.compileToFragments(o, LEVEL_TOP); - catchPart = this.recovery ? (placeholder = new Literal('_error'), this.errorVariable ? this.recovery.unshift(new Assign(this.errorVariable, placeholder)) : void 0, [].concat(this.makeCode(" catch ("), placeholder.compileToFragments(o), this.makeCode(") {\n"), this.recovery.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}"))) : !(this.ensure || this.recovery) ? [this.makeCode(' catch (_error) {}')] : []; - ensurePart = this.ensure ? [].concat(this.makeCode(" finally {\n"), this.ensure.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")) : []; - return [].concat(this.makeCode("" + this.tab + "try {\n"), tryPart, this.makeCode("\n" + this.tab + "}"), catchPart, ensurePart); - }; - - return Try; - - })(Base); - - exports.Throw = Throw = (function(_super) { - __extends(Throw, _super); - - function Throw(expression) { - this.expression = expression; - } - - Throw.prototype.children = ['expression']; - - Throw.prototype.isStatement = YES; - - Throw.prototype.jumps = NO; - - Throw.prototype.makeReturn = THIS; - - Throw.prototype.compileNode = function(o) { - return [].concat(this.makeCode(this.tab + "throw "), this.expression.compileToFragments(o), this.makeCode(";")); - }; - - return Throw; - - })(Base); - - exports.Existence = Existence = (function(_super) { - __extends(Existence, _super); - - function Existence(expression) { - this.expression = expression; - } - - Existence.prototype.children = ['expression']; - - Existence.prototype.invert = NEGATE; - - Existence.prototype.compileNode = function(o) { - var cmp, cnj, code, _ref2; - this.expression.front = this.front; - code = this.expression.compile(o, LEVEL_OP); - if (IDENTIFIER.test(code) && !o.scope.check(code)) { - _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1]; - code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null"; - } else { - code = "" + code + " " + (this.negated ? '==' : '!=') + " null"; - } - return [this.makeCode(o.level <= LEVEL_COND ? code : "(" + code + ")")]; - }; - - return Existence; - - })(Base); - - exports.Parens = Parens = (function(_super) { - __extends(Parens, _super); - - function Parens(body) { - this.body = body; - } - - Parens.prototype.children = ['body']; - - Parens.prototype.unwrap = function() { - return this.body; - }; - - Parens.prototype.isComplex = function() { - return this.body.isComplex(); - }; - - Parens.prototype.compileNode = function(o) { - var bare, expr, fragments; - expr = this.body.unwrap(); - if (expr instanceof Value && expr.isAtomic()) { - expr.front = this.front; - return expr.compileToFragments(o); - } - fragments = expr.compileToFragments(o, LEVEL_PAREN); - bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns)); - if (bare) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } - }; - - return Parens; - - })(Base); - - exports.For = For = (function(_super) { - __extends(For, _super); - - function For(body, source) { - var _ref2; - this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index; - this.body = Block.wrap([body]); - this.own = !!source.own; - this.object = !!source.object; - if (this.object) { - _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1]; - } - if (this.index instanceof Value) { - this.index.error('index cannot be a pattern matching expression'); - } - this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length; - this.pattern = this.name instanceof Value; - if (this.range && this.index) { - this.index.error('indexes do not apply to range loops'); - } - if (this.range && this.pattern) { - this.name.error('cannot pattern match over range loops'); - } - if (this.own && !this.object) { - this.name.error('cannot use own with for-in'); - } - this.returns = false; - } - - For.prototype.children = ['body', 'source', 'guard', 'step']; - - For.prototype.compileNode = function(o) { - var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart, _ref2, _ref3; - body = Block.wrap([this.body]); - lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0; - if (lastJumps && lastJumps instanceof Return) { - this.returns = false; - } - source = this.range ? this.source.base : this.source; - scope = o.scope; - name = this.name && (this.name.compile(o, LEVEL_LIST)); - index = this.index && (this.index.compile(o, LEVEL_LIST)); - if (name && !this.pattern) { - scope.find(name); - } - if (index) { - scope.find(index); - } - if (this.returns) { - rvar = scope.freeVariable('results'); - } - ivar = (this.object && index) || scope.freeVariable('i'); - kvar = (this.range && name) || index || ivar; - kvarAssign = kvar !== ivar ? "" + kvar + " = " : ""; - if (this.step && !this.range) { - _ref3 = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST)), step = _ref3[0], stepVar = _ref3[1]; - stepNum = stepVar.match(NUMBER); - } - if (this.pattern) { - name = ivar; - } - varPart = ''; - guardPart = ''; - defPart = ''; - idt1 = this.tab + TAB; - if (this.range) { - forPartFragments = source.compileToFragments(merge(o, { - index: ivar, - name: name, - step: this.step - })); - } else { - svar = this.source.compile(o, LEVEL_LIST); - if ((name || this.own) && !IDENTIFIER.test(svar)) { - defPart += "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; - svar = ref; - } - if (name && !this.pattern) { - namePart = "" + name + " = " + svar + "[" + kvar + "]"; - } - if (!this.object) { - if (step !== stepVar) { - defPart += "" + this.tab + step + ";\n"; - } - if (!(this.step && stepNum && (down = parseNum(stepNum[0]) < 0))) { - lvar = scope.freeVariable('len'); - } - declare = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length"; - declareDown = "" + kvarAssign + ivar + " = " + svar + ".length - 1"; - compare = "" + ivar + " < " + lvar; - compareDown = "" + ivar + " >= 0"; - if (this.step) { - if (stepNum) { - if (down) { - compare = compareDown; - declare = declareDown; - } - } else { - compare = "" + stepVar + " > 0 ? " + compare + " : " + compareDown; - declare = "(" + stepVar + " > 0 ? (" + declare + ") : " + declareDown + ")"; - } - increment = "" + ivar + " += " + stepVar; - } else { - increment = "" + (kvar !== ivar ? "++" + ivar : "" + ivar + "++"); - } - forPartFragments = [this.makeCode("" + declare + "; " + compare + "; " + kvarAssign + increment)]; - } - } - if (this.returns) { - resultPart = "" + this.tab + rvar + " = [];\n"; - returnResult = "\n" + this.tab + "return " + rvar + ";"; - body.makeReturn(rvar); - } - if (this.guard) { - if (body.expressions.length > 1) { - body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); - } else { - if (this.guard) { - body = Block.wrap([new If(this.guard, body)]); - } - } - } - if (this.pattern) { - body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]"))); - } - defPartFragments = [].concat(this.makeCode(defPart), this.pluckDirectCall(o, body)); - if (namePart) { - varPart = "\n" + idt1 + namePart + ";"; - } - if (this.object) { - forPartFragments = [this.makeCode("" + kvar + " in " + svar)]; - if (this.own) { - guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;"; - } - } - bodyFragments = body.compileToFragments(merge(o, { - indent: idt1 - }), LEVEL_TOP); - if (bodyFragments && (bodyFragments.length > 0)) { - bodyFragments = [].concat(this.makeCode("\n"), bodyFragments, this.makeCode("\n")); - } - return [].concat(defPartFragments, this.makeCode("" + (resultPart || '') + this.tab + "for ("), forPartFragments, this.makeCode(") {" + guardPart + varPart), bodyFragments, this.makeCode("" + this.tab + "}" + (returnResult || ''))); - }; - - For.prototype.pluckDirectCall = function(o, body) { - var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; - defs = []; - _ref2 = body.expressions; - for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) { - expr = _ref2[idx]; - expr = expr.unwrapAll(); - if (!(expr instanceof Call)) { - continue; - } - val = (_ref3 = expr.variable) != null ? _ref3.unwrapAll() : void 0; - if (!((val instanceof Code) || (val instanceof Value && ((_ref4 = val.base) != null ? _ref4.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref5 = (_ref6 = val.properties[0].name) != null ? _ref6.value : void 0) === 'call' || _ref5 === 'apply')))) { - continue; - } - fn = ((_ref7 = val.base) != null ? _ref7.unwrapAll() : void 0) || val; - ref = new Literal(o.scope.freeVariable('fn')); - base = new Value(ref); - if (val.base) { - _ref8 = [base, val], val.base = _ref8[0], base = _ref8[1]; - } - body.expressions[idx] = new Call(base, expr.args); - defs = defs.concat(this.makeCode(this.tab), new Assign(ref, fn).compileToFragments(o, LEVEL_TOP), this.makeCode(';\n')); - } - return defs; - }; - - return For; - - })(While); - - exports.Switch = Switch = (function(_super) { - __extends(Switch, _super); - - function Switch(subject, cases, otherwise) { - this.subject = subject; - this.cases = cases; - this.otherwise = otherwise; - } - - Switch.prototype.children = ['subject', 'cases', 'otherwise']; - - Switch.prototype.isStatement = YES; - - Switch.prototype.jumps = function(o) { - var block, conds, jumpNode, _i, _len, _ref2, _ref3, _ref4; - if (o == null) { - o = { - block: true - }; - } - _ref2 = this.cases; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1]; - if (jumpNode = block.jumps(o)) { - return jumpNode; - } - } - return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0; - }; - - Switch.prototype.makeReturn = function(res) { - var pair, _i, _len, _ref2, _ref3; - _ref2 = this.cases; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - pair = _ref2[_i]; - pair[1].makeReturn(res); - } - if (res) { - this.otherwise || (this.otherwise = new Block([new Literal('void 0')])); - } - if ((_ref3 = this.otherwise) != null) { - _ref3.makeReturn(res); - } - return this; - }; - - Switch.prototype.compileNode = function(o) { - var block, body, cond, conditions, expr, fragments, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4; - idt1 = o.indent + TAB; - idt2 = o.indent = idt1 + TAB; - fragments = [].concat(this.makeCode(this.tab + "switch ("), (this.subject ? this.subject.compileToFragments(o, LEVEL_PAREN) : this.makeCode("false")), this.makeCode(") {\n")); - _ref2 = this.cases; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - _ref3 = _ref2[i], conditions = _ref3[0], block = _ref3[1]; - _ref4 = flatten([conditions]); - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - cond = _ref4[_j]; - if (!this.subject) { - cond = cond.invert(); - } - fragments = fragments.concat(this.makeCode(idt1 + "case "), cond.compileToFragments(o, LEVEL_PAREN), this.makeCode(":\n")); - } - if ((body = block.compileToFragments(o, LEVEL_TOP)).length > 0) { - fragments = fragments.concat(body, this.makeCode('\n')); - } - if (i === this.cases.length - 1 && !this.otherwise) { - break; - } - expr = this.lastNonComment(block.expressions); - if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) { - continue; - } - fragments.push(cond.makeCode(idt2 + 'break;\n')); - } - if (this.otherwise && this.otherwise.expressions.length) { - fragments.push.apply(fragments, [this.makeCode(idt1 + "default:\n")].concat(__slice.call(this.otherwise.compileToFragments(o, LEVEL_TOP)), [this.makeCode("\n")])); - } - fragments.push(this.makeCode(this.tab + '}')); - return fragments; - }; - - return Switch; - - })(Base); - - exports.If = If = (function(_super) { - __extends(If, _super); - - function If(condition, body, options) { - this.body = body; - if (options == null) { - options = {}; - } - this.condition = options.type === 'unless' ? condition.invert() : condition; - this.elseBody = null; - this.isChain = false; - this.soak = options.soak; - } - - If.prototype.children = ['condition', 'body', 'elseBody']; - - If.prototype.bodyNode = function() { - var _ref2; - return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0; - }; - - If.prototype.elseBodyNode = function() { - var _ref2; - return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0; - }; - - If.prototype.addElse = function(elseBody) { - if (this.isChain) { - this.elseBodyNode().addElse(elseBody); - } else { - this.isChain = elseBody instanceof If; - this.elseBody = this.ensureBlock(elseBody); - this.elseBody.updateLocationDataIfMissing(elseBody.locationData); - } - return this; - }; - - If.prototype.isStatement = function(o) { - var _ref2; - return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0); - }; - - If.prototype.jumps = function(o) { - var _ref2; - return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0); - }; - - If.prototype.compileNode = function(o) { - if (this.isStatement(o)) { - return this.compileStatement(o); - } else { - return this.compileExpression(o); - } - }; - - If.prototype.makeReturn = function(res) { - if (res) { - this.elseBody || (this.elseBody = new Block([new Literal('void 0')])); - } - this.body && (this.body = new Block([this.body.makeReturn(res)])); - this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)])); - return this; - }; - - If.prototype.ensureBlock = function(node) { - if (node instanceof Block) { - return node; - } else { - return new Block([node]); - } - }; - - If.prototype.compileStatement = function(o) { - var answer, body, child, cond, exeq, ifPart, indent; - child = del(o, 'chainChild'); - exeq = del(o, 'isExistentialEquals'); - if (exeq) { - return new If(this.condition.invert(), this.elseBodyNode(), { - type: 'if' - }).compileToFragments(o); - } - indent = o.indent + TAB; - cond = this.condition.compileToFragments(o, LEVEL_PAREN); - body = this.ensureBlock(this.body).compileToFragments(merge(o, { - indent: indent - })); - ifPart = [].concat(this.makeCode("if ("), cond, this.makeCode(") {\n"), body, this.makeCode("\n" + this.tab + "}")); - if (!child) { - ifPart.unshift(this.makeCode(this.tab)); - } - if (!this.elseBody) { - return ifPart; - } - answer = ifPart.concat(this.makeCode(' else ')); - if (this.isChain) { - o.chainChild = true; - answer = answer.concat(this.elseBody.unwrap().compileToFragments(o, LEVEL_TOP)); - } else { - answer = answer.concat(this.makeCode("{\n"), this.elseBody.compileToFragments(merge(o, { - indent: indent - }), LEVEL_TOP), this.makeCode("\n" + this.tab + "}")); - } - return answer; - }; - - If.prototype.compileExpression = function(o) { - var alt, body, cond, fragments; - cond = this.condition.compileToFragments(o, LEVEL_COND); - body = this.bodyNode().compileToFragments(o, LEVEL_LIST); - alt = this.elseBodyNode() ? this.elseBodyNode().compileToFragments(o, LEVEL_LIST) : [this.makeCode('void 0')]; - fragments = cond.concat(this.makeCode(" ? "), body, this.makeCode(" : "), alt); - if (o.level >= LEVEL_COND) { - return this.wrapInBraces(fragments); - } else { - return fragments; - } - }; - - If.prototype.unfoldSoak = function() { - return this.soak && this; - }; - - return If; - - })(Base); - - UTILITIES = { - "extends": function() { - return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"; - }, - bind: function() { - return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }'; - }, - indexOf: function() { - return "[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"; - }, - hasProp: function() { - return '{}.hasOwnProperty'; - }, - slice: function() { - return '[].slice'; - } - }; - - LEVEL_TOP = 1; - - LEVEL_PAREN = 2; - - LEVEL_LIST = 3; - - LEVEL_COND = 4; - - LEVEL_OP = 5; - - LEVEL_ACCESS = 6; - - TAB = ' '; - - IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; - - IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$"); - - SIMPLENUM = /^[+-]?\d+$/; - - HEXNUM = /^[+-]?0x[\da-f]+/i; - - NUMBER = /^[+-]?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)$/i; - - METHOD_DEF = RegExp("^(" + IDENTIFIER_STR + ")(\\.prototype)?(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\])$"); - - IS_STRING = /^['"]/; - - IS_REGEX = /^\//; - - utility = function(name) { - var ref; - ref = "__" + name; - Scope.root.assign(ref, UTILITIES[name]()); - return ref; - }; - - multident = function(code, tab) { - code = code.replace(/\n/g, '$&' + tab); - return code.replace(/\s+$/, ''); - }; - - parseNum = function(x) { - if (x == null) { - return 0; - } else if (x.match(HEXNUM)) { - return parseInt(x, 16); - } else { - return parseFloat(x); - } - }; - - isLiteralArguments = function(node) { - return node instanceof Literal && node.value === 'arguments' && !node.asKey; - }; - - isLiteralThis = function(node) { - return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper); - }; - - unfoldSoak = function(o, parent, name) { - var ifn; - if (!(ifn = parent[name].unfoldSoak(o))) { - return; - } - parent[name] = ifn.body; - ifn.body = new Value(parent); - return ifn; - }; - - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js deleted file mode 100644 index 00d1b723..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +++ /dev/null @@ -1,724 +0,0 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -define(function(require, exports, module) { -/* parser generated by jison 0.4.4 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ - -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"Root":3,"Body":4,"Line":5,"TERMINATOR":6,"Expression":7,"Statement":8,"Return":9,"Comment":10,"STATEMENT":11,"Value":12,"Invocation":13,"Code":14,"Operation":15,"Assign":16,"If":17,"Try":18,"While":19,"For":20,"Switch":21,"Class":22,"Throw":23,"Block":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"?::":69,"Index":70,"INDEX_START":71,"IndexValue":72,"INDEX_END":73,"INDEX_SOAK":74,"Slice":75,"{":76,"AssignList":77,"}":78,"CLASS":79,"EXTENDS":80,"OptFuncExist":81,"Arguments":82,"SUPER":83,"FUNC_EXIST":84,"CALL_START":85,"CALL_END":86,"ArgList":87,"THIS":88,"@":89,"[":90,"]":91,"RangeDots":92,"..":93,"Arg":94,"SimpleArgs":95,"TRY":96,"Catch":97,"FINALLY":98,"CATCH":99,"THROW":100,"(":101,")":102,"WhileSource":103,"WHILE":104,"WHEN":105,"UNTIL":106,"Loop":107,"LOOP":108,"ForBody":109,"FOR":110,"ForStart":111,"ForSource":112,"ForVariables":113,"OWN":114,"ForValue":115,"FORIN":116,"FOROF":117,"BY":118,"SWITCH":119,"Whens":120,"ELSE":121,"When":122,"LEADING_WHEN":123,"IfBlock":124,"IF":125,"POST_IF":126,"UNARY":127,"-":128,"+":129,"--":130,"++":131,"?":132,"MATH":133,"SHIFT":134,"COMPARE":135,"LOGIC":136,"RELATION":137,"COMPOUND_ASSIGN":138,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"TERMINATOR",11:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",69:"?::",71:"INDEX_START",73:"INDEX_END",74:"INDEX_SOAK",76:"{",78:"}",79:"CLASS",80:"EXTENDS",83:"SUPER",84:"FUNC_EXIST",85:"CALL_START",86:"CALL_END",88:"THIS",89:"@",90:"[",91:"]",93:"..",96:"TRY",98:"FINALLY",99:"CATCH",100:"THROW",101:"(",102:")",104:"WHILE",105:"WHEN",106:"UNTIL",108:"LOOP",110:"FOR",114:"OWN",116:"FORIN",117:"FOROF",118:"BY",119:"SWITCH",121:"ELSE",123:"LEADING_WHEN",125:"IF",126:"POST_IF",127:"UNARY",128:"-",129:"+",130:"--",131:"++",132:"?",133:"MATH",134:"SHIFT",135:"COMPARE",136:"LOGIC",137:"RELATION",138:"COMPOUND_ASSIGN"}, -productions_: [0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[24,2],[24,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[16,3],[16,4],[16,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[9,2],[9,1],[10,1],[14,5],[14,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[12,1],[12,1],[12,1],[12,1],[12,1],[62,2],[62,2],[62,2],[62,2],[62,1],[62,1],[70,3],[70,2],[72,1],[72,1],[59,4],[77,0],[77,1],[77,3],[77,4],[77,6],[22,1],[22,2],[22,3],[22,4],[22,2],[22,3],[22,4],[22,5],[13,3],[13,3],[13,1],[13,2],[81,0],[81,1],[82,2],[82,4],[65,1],[65,1],[44,2],[58,2],[58,4],[92,1],[92,1],[64,5],[75,3],[75,2],[75,2],[75,1],[87,1],[87,3],[87,4],[87,4],[87,6],[94,1],[94,1],[95,1],[95,3],[18,2],[18,3],[18,4],[18,5],[97,3],[97,3],[97,2],[23,2],[63,3],[63,5],[103,2],[103,4],[103,2],[103,4],[19,2],[19,2],[19,2],[19,1],[107,2],[107,2],[20,2],[20,2],[20,2],[109,2],[109,2],[111,2],[111,3],[115,1],[115,1],[115,1],[115,1],[113,1],[113,3],[112,2],[112,2],[112,4],[112,4],[112,4],[112,6],[112,6],[21,5],[21,7],[21,4],[21,6],[120,1],[120,2],[122,3],[122,4],[124,3],[124,5],[17,1],[17,3],[17,3],[17,3],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,5],[15,4],[15,3]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1:return this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Block); -break; -case 2:return this.$ = $$[$0]; -break; -case 3:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(yy.Block.wrap([$$[$0]])); -break; -case 4:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].push($$[$0])); -break; -case 5:this.$ = $$[$0-1]; -break; -case 6:this.$ = $$[$0]; -break; -case 7:this.$ = $$[$0]; -break; -case 8:this.$ = $$[$0]; -break; -case 9:this.$ = $$[$0]; -break; -case 10:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 11:this.$ = $$[$0]; -break; -case 12:this.$ = $$[$0]; -break; -case 13:this.$ = $$[$0]; -break; -case 14:this.$ = $$[$0]; -break; -case 15:this.$ = $$[$0]; -break; -case 16:this.$ = $$[$0]; -break; -case 17:this.$ = $$[$0]; -break; -case 18:this.$ = $$[$0]; -break; -case 19:this.$ = $$[$0]; -break; -case 20:this.$ = $$[$0]; -break; -case 21:this.$ = $$[$0]; -break; -case 22:this.$ = $$[$0]; -break; -case 23:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Block); -break; -case 24:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); -break; -case 25:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 26:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 27:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 28:this.$ = $$[$0]; -break; -case 29:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 30:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 31:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); -break; -case 32:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Undefined); -break; -case 33:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Null); -break; -case 34:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Bool($$[$0])); -break; -case 35:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0])); -break; -case 36:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0])); -break; -case 37:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1])); -break; -case 38:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 39:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-2])(new yy.Value($$[$0-2])), $$[$0], 'object')); -break; -case 40:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-4])(new yy.Value($$[$0-4])), $$[$0-1], 'object')); -break; -case 41:this.$ = $$[$0]; -break; -case 42:this.$ = $$[$0]; -break; -case 43:this.$ = $$[$0]; -break; -case 44:this.$ = $$[$0]; -break; -case 45:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Return($$[$0])); -break; -case 46:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Return); -break; -case 47:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Comment($$[$0])); -break; -case 48:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Code($$[$0-3], $$[$0], $$[$0-1])); -break; -case 49:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Code([], $$[$0], $$[$0-1])); -break; -case 50:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('func'); -break; -case 51:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('boundfunc'); -break; -case 52:this.$ = $$[$0]; -break; -case 53:this.$ = $$[$0]; -break; -case 54:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); -break; -case 55:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 56:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 57:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 58:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 59:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Param($$[$0])); -break; -case 60:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Param($$[$0-1], null, true)); -break; -case 61:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Param($$[$0-2], $$[$0])); -break; -case 62:this.$ = $$[$0]; -break; -case 63:this.$ = $$[$0]; -break; -case 64:this.$ = $$[$0]; -break; -case 65:this.$ = $$[$0]; -break; -case 66:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Splat($$[$0-1])); -break; -case 67:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 68:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].add($$[$0])); -break; -case 69:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value($$[$0-1], [].concat($$[$0]))); -break; -case 70:this.$ = $$[$0]; -break; -case 71:this.$ = $$[$0]; -break; -case 72:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 73:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 74:this.$ = $$[$0]; -break; -case 75:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 76:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 77:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 78:this.$ = $$[$0]; -break; -case 79:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0])); -break; -case 80:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0], 'soak')); -break; -case 81:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'))), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); -break; -case 82:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'), 'soak')), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); -break; -case 83:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Access(new yy.Literal('prototype'))); -break; -case 84:this.$ = $$[$0]; -break; -case 85:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); -break; -case 86:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(yy.extend($$[$0], { - soak: true - })); -break; -case 87:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Index($$[$0])); -break; -case 88:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Slice($$[$0])); -break; -case 89:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Obj($$[$0-2], $$[$0-3].generated)); -break; -case 90:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); -break; -case 91:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 92:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 93:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 94:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 95:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Class); -break; -case 96:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class(null, null, $$[$0])); -break; -case 97:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class(null, $$[$0])); -break; -case 98:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class(null, $$[$0-1], $$[$0])); -break; -case 99:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class($$[$0])); -break; -case 100:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class($$[$0-1], null, $$[$0])); -break; -case 101:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class($$[$0-2], $$[$0])); -break; -case 102:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Class($$[$0-3], $$[$0-1], $$[$0])); -break; -case 103:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); -break; -case 104:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); -break; -case 105:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))])); -break; -case 106:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Call('super', $$[$0])); -break; -case 107:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(false); -break; -case 108:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(true); -break; -case 109:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([]); -break; -case 110:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); -break; -case 111:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); -break; -case 112:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); -break; -case 113:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('this')), [yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))], 'this')); -break; -case 114:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Arr([])); -break; -case 115:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Arr($$[$0-2])); -break; -case 116:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('inclusive'); -break; -case 117:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('exclusive'); -break; -case 118:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Range($$[$0-3], $$[$0-1], $$[$0-2])); -break; -case 119:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Range($$[$0-2], $$[$0], $$[$0-1])); -break; -case 120:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range($$[$0-1], null, $$[$0])); -break; -case 121:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range(null, $$[$0], $$[$0-1])); -break; -case 122:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Range(null, null, $$[$0])); -break; -case 123:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 124:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 125:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 126:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); -break; -case 127:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 128:this.$ = $$[$0]; -break; -case 129:this.$ = $$[$0]; -break; -case 130:this.$ = $$[$0]; -break; -case 131:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([].concat($$[$0-2], $$[$0])); -break; -case 132:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Try($$[$0])); -break; -case 133:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Try($$[$0-1], $$[$0][0], $$[$0][1])); -break; -case 134:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Try($$[$0-2], null, null, $$[$0])); -break; -case 135:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0])); -break; -case 136:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-1], $$[$0]]); -break; -case 137:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Value($$[$0-1])), $$[$0]]); -break; -case 138:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([null, $$[$0]]); -break; -case 139:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Throw($$[$0])); -break; -case 140:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Parens($$[$0-1])); -break; -case 141:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Parens($$[$0-2])); -break; -case 142:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0])); -break; -case 143:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { - guard: $$[$0] - })); -break; -case 144:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0], { - invert: true - })); -break; -case 145:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { - invert: true, - guard: $$[$0] - })); -break; -case 146:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].addBody($$[$0])); -break; -case 147:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); -break; -case 148:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); -break; -case 149:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])($$[$0]); -break; -case 150:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody($$[$0])); -break; -case 151:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody(yy.addLocationDataFn(_$[$0])(yy.Block.wrap([$$[$0]])))); -break; -case 152:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); -break; -case 153:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); -break; -case 154:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0], $$[$0-1])); -break; -case 155:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ - source: yy.addLocationDataFn(_$[$0])(new yy.Value($$[$0])) - }); -break; -case 156:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])((function () { - $$[$0].own = $$[$0-1].own; - $$[$0].name = $$[$0-1][0]; - $$[$0].index = $$[$0-1][1]; - return $$[$0]; - }())); -break; -case 157:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0]); -break; -case 158:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { - $$[$0].own = true; - return $$[$0]; - }())); -break; -case 159:this.$ = $$[$0]; -break; -case 160:this.$ = $$[$0]; -break; -case 161:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 162:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); -break; -case 163:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 164:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-2], $$[$0]]); -break; -case 165:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ - source: $$[$0] - }); -break; -case 166:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ - source: $$[$0], - object: true - }); -break; -case 167:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ - source: $$[$0-2], - guard: $$[$0] - }); -break; -case 168:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ - source: $$[$0-2], - guard: $$[$0], - object: true - }); -break; -case 169:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ - source: $$[$0-2], - step: $$[$0] - }); -break; -case 170:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ - source: $$[$0-4], - guard: $$[$0-2], - step: $$[$0] - }); -break; -case 171:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ - source: $$[$0-4], - step: $$[$0-2], - guard: $$[$0] - }); -break; -case 172:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Switch($$[$0-3], $$[$0-1])); -break; -case 173:this.$ = yy.addLocationDataFn(_$[$0-6], _$[$0])(new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1])); -break; -case 174:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Switch(null, $$[$0-1])); -break; -case 175:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])(new yy.Switch(null, $$[$0-3], $$[$0-1])); -break; -case 176:this.$ = $$[$0]; -break; -case 177:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].concat($$[$0])); -break; -case 178:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([[$$[$0-1], $$[$0]]]); -break; -case 179:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])([[$$[$0-2], $$[$0-1]]]); -break; -case 180:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], { - type: $$[$0-2] - })); -break; -case 181:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])($$[$0-4].addElse(yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], { - type: $$[$0-2] - })))); -break; -case 182:this.$ = $$[$0]; -break; -case 183:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].addElse($$[$0])); -break; -case 184:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { - type: $$[$0-1], - statement: true - })); -break; -case 185:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { - type: $$[$0-1], - statement: true - })); -break; -case 186:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0])); -break; -case 187:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('-', $$[$0])); -break; -case 188:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('+', $$[$0])); -break; -case 189:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0])); -break; -case 190:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0])); -break; -case 191:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0-1], null, true)); -break; -case 192:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0-1], null, true)); -break; -case 193:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Existence($$[$0-1])); -break; -case 194:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('+', $$[$0-2], $$[$0])); -break; -case 195:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('-', $$[$0-2], $$[$0])); -break; -case 196:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 197:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 198:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 199:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); -break; -case 200:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { - if ($$[$0-1].charAt(0) === '!') { - return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert(); - } else { - return new yy.Op($$[$0-1], $$[$0-2], $$[$0]); - } - }())); -break; -case 201:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0], $$[$0-1])); -break; -case 202:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3])); -break; -case 203:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0], $$[$0-2])); -break; -case 204:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Extends($$[$0-2], $$[$0])); -break; -} -}, -table: [{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[3]},{1:[2,2],6:[1,72]},{1:[2,3],6:[2,3],26:[2,3],102:[2,3]},{1:[2,6],6:[2,6],26:[2,6],102:[2,6],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,7],6:[2,7],26:[2,7],102:[2,7],103:85,104:[1,63],106:[1,64],109:86,110:[1,66],111:67,126:[1,84]},{1:[2,11],6:[2,11],25:[2,11],26:[2,11],49:[2,11],54:[2,11],57:[2,11],62:88,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],73:[2,11],74:[1,96],78:[2,11],81:87,84:[1,89],85:[2,107],86:[2,11],91:[2,11],93:[2,11],102:[2,11],104:[2,11],105:[2,11],106:[2,11],110:[2,11],118:[2,11],126:[2,11],128:[2,11],129:[2,11],132:[2,11],133:[2,11],134:[2,11],135:[2,11],136:[2,11],137:[2,11]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:98,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],73:[2,12],74:[1,96],78:[2,12],81:97,84:[1,89],85:[2,107],86:[2,12],91:[2,12],93:[2,12],102:[2,12],104:[2,12],105:[2,12],106:[2,12],110:[2,12],118:[2,12],126:[2,12],128:[2,12],129:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12],137:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],73:[2,13],78:[2,13],86:[2,13],91:[2,13],93:[2,13],102:[2,13],104:[2,13],105:[2,13],106:[2,13],110:[2,13],118:[2,13],126:[2,13],128:[2,13],129:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13],137:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],73:[2,14],78:[2,14],86:[2,14],91:[2,14],93:[2,14],102:[2,14],104:[2,14],105:[2,14],106:[2,14],110:[2,14],118:[2,14],126:[2,14],128:[2,14],129:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14],137:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],73:[2,15],78:[2,15],86:[2,15],91:[2,15],93:[2,15],102:[2,15],104:[2,15],105:[2,15],106:[2,15],110:[2,15],118:[2,15],126:[2,15],128:[2,15],129:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15],137:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],73:[2,16],78:[2,16],86:[2,16],91:[2,16],93:[2,16],102:[2,16],104:[2,16],105:[2,16],106:[2,16],110:[2,16],118:[2,16],126:[2,16],128:[2,16],129:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16],137:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],73:[2,17],78:[2,17],86:[2,17],91:[2,17],93:[2,17],102:[2,17],104:[2,17],105:[2,17],106:[2,17],110:[2,17],118:[2,17],126:[2,17],128:[2,17],129:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17],137:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],73:[2,18],78:[2,18],86:[2,18],91:[2,18],93:[2,18],102:[2,18],104:[2,18],105:[2,18],106:[2,18],110:[2,18],118:[2,18],126:[2,18],128:[2,18],129:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18],137:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],73:[2,19],78:[2,19],86:[2,19],91:[2,19],93:[2,19],102:[2,19],104:[2,19],105:[2,19],106:[2,19],110:[2,19],118:[2,19],126:[2,19],128:[2,19],129:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19],137:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],73:[2,20],78:[2,20],86:[2,20],91:[2,20],93:[2,20],102:[2,20],104:[2,20],105:[2,20],106:[2,20],110:[2,20],118:[2,20],126:[2,20],128:[2,20],129:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20],137:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],73:[2,21],78:[2,21],86:[2,21],91:[2,21],93:[2,21],102:[2,21],104:[2,21],105:[2,21],106:[2,21],110:[2,21],118:[2,21],126:[2,21],128:[2,21],129:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21],137:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],73:[2,22],78:[2,22],86:[2,22],91:[2,22],93:[2,22],102:[2,22],104:[2,22],105:[2,22],106:[2,22],110:[2,22],118:[2,22],126:[2,22],128:[2,22],129:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22],137:[2,22]},{1:[2,8],6:[2,8],26:[2,8],102:[2,8],104:[2,8],106:[2,8],110:[2,8],126:[2,8]},{1:[2,9],6:[2,9],26:[2,9],102:[2,9],104:[2,9],106:[2,9],110:[2,9],126:[2,9]},{1:[2,10],6:[2,10],26:[2,10],102:[2,10],104:[2,10],106:[2,10],110:[2,10],126:[2,10]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[1,99],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],73:[2,74],74:[2,74],78:[2,74],84:[2,74],85:[2,74],86:[2,74],91:[2,74],93:[2,74],102:[2,74],104:[2,74],105:[2,74],106:[2,74],110:[2,74],118:[2,74],126:[2,74],128:[2,74],129:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74],137:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],73:[2,75],74:[2,75],78:[2,75],84:[2,75],85:[2,75],86:[2,75],91:[2,75],93:[2,75],102:[2,75],104:[2,75],105:[2,75],106:[2,75],110:[2,75],118:[2,75],126:[2,75],128:[2,75],129:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75],137:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],69:[2,76],71:[2,76],73:[2,76],74:[2,76],78:[2,76],84:[2,76],85:[2,76],86:[2,76],91:[2,76],93:[2,76],102:[2,76],104:[2,76],105:[2,76],106:[2,76],110:[2,76],118:[2,76],126:[2,76],128:[2,76],129:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76],137:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],69:[2,77],71:[2,77],73:[2,77],74:[2,77],78:[2,77],84:[2,77],85:[2,77],86:[2,77],91:[2,77],93:[2,77],102:[2,77],104:[2,77],105:[2,77],106:[2,77],110:[2,77],118:[2,77],126:[2,77],128:[2,77],129:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77],137:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],69:[2,78],71:[2,78],73:[2,78],74:[2,78],78:[2,78],84:[2,78],85:[2,78],86:[2,78],91:[2,78],93:[2,78],102:[2,78],104:[2,78],105:[2,78],106:[2,78],110:[2,78],118:[2,78],126:[2,78],128:[2,78],129:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78],137:[2,78]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],69:[2,105],71:[2,105],73:[2,105],74:[2,105],78:[2,105],82:100,84:[2,105],85:[1,101],86:[2,105],91:[2,105],93:[2,105],102:[2,105],104:[2,105],105:[2,105],106:[2,105],110:[2,105],118:[2,105],126:[2,105],128:[2,105],129:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105],137:[2,105]},{6:[2,54],25:[2,54],27:105,28:[1,71],44:106,48:102,49:[2,54],54:[2,54],55:103,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{24:111,25:[1,112]},{7:113,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:115,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:116,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{12:118,13:119,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,58:45,59:46,61:117,63:23,64:24,65:25,76:[1,68],83:[1,26],88:[1,56],89:[1,57],90:[1,55],101:[1,54]},{12:118,13:119,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,58:45,59:46,61:121,63:23,64:24,65:25,76:[1,68],83:[1,26],88:[1,56],89:[1,57],90:[1,55],101:[1,54]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,71],74:[2,71],78:[2,71],80:[1,125],84:[2,71],85:[2,71],86:[2,71],91:[2,71],93:[2,71],102:[2,71],104:[2,71],105:[2,71],106:[2,71],110:[2,71],118:[2,71],126:[2,71],128:[2,71],129:[2,71],130:[1,122],131:[1,123],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71],138:[1,124]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],73:[2,182],78:[2,182],86:[2,182],91:[2,182],93:[2,182],102:[2,182],104:[2,182],105:[2,182],106:[2,182],110:[2,182],118:[2,182],121:[1,126],126:[2,182],128:[2,182],129:[2,182],132:[2,182],133:[2,182],134:[2,182],135:[2,182],136:[2,182],137:[2,182]},{24:127,25:[1,112]},{24:128,25:[1,112]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],73:[2,149],78:[2,149],86:[2,149],91:[2,149],93:[2,149],102:[2,149],104:[2,149],105:[2,149],106:[2,149],110:[2,149],118:[2,149],126:[2,149],128:[2,149],129:[2,149],132:[2,149],133:[2,149],134:[2,149],135:[2,149],136:[2,149],137:[2,149]},{24:129,25:[1,112]},{7:130,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,131],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,95],6:[2,95],12:118,13:119,24:132,25:[1,112],26:[2,95],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,49:[2,95],54:[2,95],57:[2,95],58:45,59:46,61:134,63:23,64:24,65:25,73:[2,95],76:[1,68],78:[2,95],80:[1,133],83:[1,26],86:[2,95],88:[1,56],89:[1,57],90:[1,55],91:[2,95],93:[2,95],101:[1,54],102:[2,95],104:[2,95],105:[2,95],106:[2,95],110:[2,95],118:[2,95],126:[2,95],128:[2,95],129:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95],137:[2,95]},{7:135,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,46],6:[2,46],7:136,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,46],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],102:[2,46],103:37,104:[2,46],106:[2,46],107:38,108:[1,65],109:39,110:[2,46],111:67,119:[1,40],124:35,125:[1,62],126:[2,46],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,47],6:[2,47],25:[2,47],26:[2,47],54:[2,47],78:[2,47],102:[2,47],104:[2,47],106:[2,47],110:[2,47],126:[2,47]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,72],74:[2,72],78:[2,72],84:[2,72],85:[2,72],86:[2,72],91:[2,72],93:[2,72],102:[2,72],104:[2,72],105:[2,72],106:[2,72],110:[2,72],118:[2,72],126:[2,72],128:[2,72],129:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],69:[2,73],71:[2,73],73:[2,73],74:[2,73],78:[2,73],84:[2,73],85:[2,73],86:[2,73],91:[2,73],93:[2,73],102:[2,73],104:[2,73],105:[2,73],106:[2,73],110:[2,73],118:[2,73],126:[2,73],128:[2,73],129:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73],137:[2,73]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],69:[2,28],71:[2,28],73:[2,28],74:[2,28],78:[2,28],84:[2,28],85:[2,28],86:[2,28],91:[2,28],93:[2,28],102:[2,28],104:[2,28],105:[2,28],106:[2,28],110:[2,28],118:[2,28],126:[2,28],128:[2,28],129:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28],137:[2,28]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],69:[2,29],71:[2,29],73:[2,29],74:[2,29],78:[2,29],84:[2,29],85:[2,29],86:[2,29],91:[2,29],93:[2,29],102:[2,29],104:[2,29],105:[2,29],106:[2,29],110:[2,29],118:[2,29],126:[2,29],128:[2,29],129:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29],137:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],69:[2,30],71:[2,30],73:[2,30],74:[2,30],78:[2,30],84:[2,30],85:[2,30],86:[2,30],91:[2,30],93:[2,30],102:[2,30],104:[2,30],105:[2,30],106:[2,30],110:[2,30],118:[2,30],126:[2,30],128:[2,30],129:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30],137:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],69:[2,31],71:[2,31],73:[2,31],74:[2,31],78:[2,31],84:[2,31],85:[2,31],86:[2,31],91:[2,31],93:[2,31],102:[2,31],104:[2,31],105:[2,31],106:[2,31],110:[2,31],118:[2,31],126:[2,31],128:[2,31],129:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31],137:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],69:[2,32],71:[2,32],73:[2,32],74:[2,32],78:[2,32],84:[2,32],85:[2,32],86:[2,32],91:[2,32],93:[2,32],102:[2,32],104:[2,32],105:[2,32],106:[2,32],110:[2,32],118:[2,32],126:[2,32],128:[2,32],129:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32],137:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],69:[2,33],71:[2,33],73:[2,33],74:[2,33],78:[2,33],84:[2,33],85:[2,33],86:[2,33],91:[2,33],93:[2,33],102:[2,33],104:[2,33],105:[2,33],106:[2,33],110:[2,33],118:[2,33],126:[2,33],128:[2,33],129:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33],137:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],69:[2,34],71:[2,34],73:[2,34],74:[2,34],78:[2,34],84:[2,34],85:[2,34],86:[2,34],91:[2,34],93:[2,34],102:[2,34],104:[2,34],105:[2,34],106:[2,34],110:[2,34],118:[2,34],126:[2,34],128:[2,34],129:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34],137:[2,34]},{4:137,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,138],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:139,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:141,88:[1,56],89:[1,57],90:[1,55],91:[1,140],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],69:[2,111],71:[2,111],73:[2,111],74:[2,111],78:[2,111],84:[2,111],85:[2,111],86:[2,111],91:[2,111],93:[2,111],102:[2,111],104:[2,111],105:[2,111],106:[2,111],110:[2,111],118:[2,111],126:[2,111],128:[2,111],129:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111],137:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:145,28:[1,71],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],69:[2,112],71:[2,112],73:[2,112],74:[2,112],78:[2,112],84:[2,112],85:[2,112],86:[2,112],91:[2,112],93:[2,112],102:[2,112],104:[2,112],105:[2,112],106:[2,112],110:[2,112],118:[2,112],126:[2,112],128:[2,112],129:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112],137:[2,112]},{25:[2,50]},{25:[2,51]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],40:[2,67],49:[2,67],54:[2,67],57:[2,67],66:[2,67],67:[2,67],68:[2,67],69:[2,67],71:[2,67],73:[2,67],74:[2,67],78:[2,67],80:[2,67],84:[2,67],85:[2,67],86:[2,67],91:[2,67],93:[2,67],102:[2,67],104:[2,67],105:[2,67],106:[2,67],110:[2,67],118:[2,67],126:[2,67],128:[2,67],129:[2,67],130:[2,67],131:[2,67],132:[2,67],133:[2,67],134:[2,67],135:[2,67],136:[2,67],137:[2,67],138:[2,67]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],69:[2,70],71:[2,70],73:[2,70],74:[2,70],78:[2,70],80:[2,70],84:[2,70],85:[2,70],86:[2,70],91:[2,70],93:[2,70],102:[2,70],104:[2,70],105:[2,70],106:[2,70],110:[2,70],118:[2,70],126:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70],138:[2,70]},{7:146,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:147,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:148,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:150,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:149,25:[1,112],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{27:155,28:[1,71],44:156,58:157,59:158,64:151,76:[1,68],89:[1,109],90:[1,55],113:152,114:[1,153],115:154},{112:159,116:[1,160],117:[1,161]},{6:[2,90],10:165,25:[2,90],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:163,42:164,44:168,46:[1,44],54:[2,90],77:162,78:[2,90],89:[1,109]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],69:[2,26],71:[2,26],73:[2,26],74:[2,26],78:[2,26],84:[2,26],85:[2,26],86:[2,26],91:[2,26],93:[2,26],102:[2,26],104:[2,26],105:[2,26],106:[2,26],110:[2,26],118:[2,26],126:[2,26],128:[2,26],129:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],69:[2,27],71:[2,27],73:[2,27],74:[2,27],78:[2,27],84:[2,27],85:[2,27],86:[2,27],91:[2,27],93:[2,27],102:[2,27],104:[2,27],105:[2,27],106:[2,27],110:[2,27],118:[2,27],126:[2,27],128:[2,27],129:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27],137:[2,27]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],40:[2,25],43:[2,25],49:[2,25],54:[2,25],57:[2,25],66:[2,25],67:[2,25],68:[2,25],69:[2,25],71:[2,25],73:[2,25],74:[2,25],78:[2,25],80:[2,25],84:[2,25],85:[2,25],86:[2,25],91:[2,25],93:[2,25],102:[2,25],104:[2,25],105:[2,25],106:[2,25],110:[2,25],116:[2,25],117:[2,25],118:[2,25],126:[2,25],128:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25],137:[2,25],138:[2,25]},{1:[2,5],5:169,6:[2,5],7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,5],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],102:[2,5],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],73:[2,193],78:[2,193],86:[2,193],91:[2,193],93:[2,193],102:[2,193],104:[2,193],105:[2,193],106:[2,193],110:[2,193],118:[2,193],126:[2,193],128:[2,193],129:[2,193],132:[2,193],133:[2,193],134:[2,193],135:[2,193],136:[2,193],137:[2,193]},{7:170,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:171,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:172,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:173,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:174,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:175,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:176,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:177,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],73:[2,148],78:[2,148],86:[2,148],91:[2,148],93:[2,148],102:[2,148],104:[2,148],105:[2,148],106:[2,148],110:[2,148],118:[2,148],126:[2,148],128:[2,148],129:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148],137:[2,148]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],73:[2,153],78:[2,153],86:[2,153],91:[2,153],93:[2,153],102:[2,153],104:[2,153],105:[2,153],106:[2,153],110:[2,153],118:[2,153],126:[2,153],128:[2,153],129:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153],137:[2,153]},{7:178,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],73:[2,147],78:[2,147],86:[2,147],91:[2,147],93:[2,147],102:[2,147],104:[2,147],105:[2,147],106:[2,147],110:[2,147],118:[2,147],126:[2,147],128:[2,147],129:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147],137:[2,147]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],73:[2,152],78:[2,152],86:[2,152],91:[2,152],93:[2,152],102:[2,152],104:[2,152],105:[2,152],106:[2,152],110:[2,152],118:[2,152],126:[2,152],128:[2,152],129:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152],137:[2,152]},{82:179,85:[1,101]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],69:[2,68],71:[2,68],73:[2,68],74:[2,68],78:[2,68],80:[2,68],84:[2,68],85:[2,68],86:[2,68],91:[2,68],93:[2,68],102:[2,68],104:[2,68],105:[2,68],106:[2,68],110:[2,68],118:[2,68],126:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68],138:[2,68]},{85:[2,108]},{27:180,28:[1,71]},{27:181,28:[1,71]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:182,28:[1,71],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],69:[2,83],71:[2,83],73:[2,83],74:[2,83],78:[2,83],80:[2,83],84:[2,83],85:[2,83],86:[2,83],91:[2,83],93:[2,83],102:[2,83],104:[2,83],105:[2,83],106:[2,83],110:[2,83],118:[2,83],126:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83],138:[2,83]},{27:183,28:[1,71]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],69:[2,84],71:[2,84],73:[2,84],74:[2,84],78:[2,84],80:[2,84],84:[2,84],85:[2,84],86:[2,84],91:[2,84],93:[2,84],102:[2,84],104:[2,84],105:[2,84],106:[2,84],110:[2,84],118:[2,84],126:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84],138:[2,84]},{7:185,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],57:[1,189],58:45,59:46,61:34,63:23,64:24,65:25,72:184,75:186,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],92:187,93:[1,188],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{70:190,71:[1,95],74:[1,96]},{82:191,85:[1,101]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],69:[2,69],71:[2,69],73:[2,69],74:[2,69],78:[2,69],80:[2,69],84:[2,69],85:[2,69],86:[2,69],91:[2,69],93:[2,69],102:[2,69],104:[2,69],105:[2,69],106:[2,69],110:[2,69],118:[2,69],126:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69],138:[2,69]},{6:[1,193],7:192,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,194],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],69:[2,106],71:[2,106],73:[2,106],74:[2,106],78:[2,106],84:[2,106],85:[2,106],86:[2,106],91:[2,106],93:[2,106],102:[2,106],104:[2,106],105:[2,106],106:[2,106],110:[2,106],118:[2,106],126:[2,106],128:[2,106],129:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106],137:[2,106]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],86:[1,195],87:196,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],49:[1,198],53:200,54:[1,199]},{6:[2,55],25:[2,55],26:[2,55],49:[2,55],54:[2,55]},{6:[2,59],25:[2,59],26:[2,59],40:[1,202],49:[2,59],54:[2,59],57:[1,201]},{6:[2,62],25:[2,62],26:[2,62],40:[2,62],49:[2,62],54:[2,62],57:[2,62]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{27:145,28:[1,71]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:141,88:[1,56],89:[1,57],90:[1,55],91:[1,140],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],73:[2,49],78:[2,49],86:[2,49],91:[2,49],93:[2,49],102:[2,49],104:[2,49],105:[2,49],106:[2,49],110:[2,49],118:[2,49],126:[2,49],128:[2,49],129:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49],137:[2,49]},{4:204,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[1,203],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],73:[2,186],78:[2,186],86:[2,186],91:[2,186],93:[2,186],102:[2,186],103:82,104:[2,186],105:[2,186],106:[2,186],109:83,110:[2,186],111:67,118:[2,186],126:[2,186],128:[2,186],129:[2,186],132:[1,73],133:[2,186],134:[2,186],135:[2,186],136:[2,186],137:[2,186]},{103:85,104:[1,63],106:[1,64],109:86,110:[1,66],111:67,126:[1,84]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],73:[2,187],78:[2,187],86:[2,187],91:[2,187],93:[2,187],102:[2,187],103:82,104:[2,187],105:[2,187],106:[2,187],109:83,110:[2,187],111:67,118:[2,187],126:[2,187],128:[2,187],129:[2,187],132:[1,73],133:[2,187],134:[2,187],135:[2,187],136:[2,187],137:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],73:[2,188],78:[2,188],86:[2,188],91:[2,188],93:[2,188],102:[2,188],103:82,104:[2,188],105:[2,188],106:[2,188],109:83,110:[2,188],111:67,118:[2,188],126:[2,188],128:[2,188],129:[2,188],132:[1,73],133:[2,188],134:[2,188],135:[2,188],136:[2,188],137:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,189],74:[2,71],78:[2,189],84:[2,71],85:[2,71],86:[2,189],91:[2,189],93:[2,189],102:[2,189],104:[2,189],105:[2,189],106:[2,189],110:[2,189],118:[2,189],126:[2,189],128:[2,189],129:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189],137:[2,189]},{62:88,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],74:[1,96],81:87,84:[1,89],85:[2,107]},{62:98,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],74:[1,96],81:97,84:[1,89],85:[2,107]},{66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],74:[2,74],84:[2,74],85:[2,74]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,190],74:[2,71],78:[2,190],84:[2,71],85:[2,71],86:[2,190],91:[2,190],93:[2,190],102:[2,190],104:[2,190],105:[2,190],106:[2,190],110:[2,190],118:[2,190],126:[2,190],128:[2,190],129:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190],137:[2,190]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],73:[2,191],78:[2,191],86:[2,191],91:[2,191],93:[2,191],102:[2,191],104:[2,191],105:[2,191],106:[2,191],110:[2,191],118:[2,191],126:[2,191],128:[2,191],129:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191],137:[2,191]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],73:[2,192],78:[2,192],86:[2,192],91:[2,192],93:[2,192],102:[2,192],104:[2,192],105:[2,192],106:[2,192],110:[2,192],118:[2,192],126:[2,192],128:[2,192],129:[2,192],132:[2,192],133:[2,192],134:[2,192],135:[2,192],136:[2,192],137:[2,192]},{6:[1,207],7:205,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,206],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:208,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{24:209,25:[1,112],125:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],73:[2,132],78:[2,132],86:[2,132],91:[2,132],93:[2,132],97:211,98:[1,212],99:[1,213],102:[2,132],104:[2,132],105:[2,132],106:[2,132],110:[2,132],118:[2,132],126:[2,132],128:[2,132],129:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132],137:[2,132]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],73:[2,146],78:[2,146],86:[2,146],91:[2,146],93:[2,146],102:[2,146],104:[2,146],105:[2,146],106:[2,146],110:[2,146],118:[2,146],126:[2,146],128:[2,146],129:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146],137:[2,146]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],73:[2,154],78:[2,154],86:[2,154],91:[2,154],93:[2,154],102:[2,154],104:[2,154],105:[2,154],106:[2,154],110:[2,154],118:[2,154],126:[2,154],128:[2,154],129:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154],137:[2,154]},{25:[1,214],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{120:215,122:216,123:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],73:[2,96],78:[2,96],86:[2,96],91:[2,96],93:[2,96],102:[2,96],104:[2,96],105:[2,96],106:[2,96],110:[2,96],118:[2,96],126:[2,96],128:[2,96],129:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96],137:[2,96]},{7:218,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,99],6:[2,99],24:219,25:[1,112],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,99],74:[2,71],78:[2,99],80:[1,220],84:[2,71],85:[2,71],86:[2,99],91:[2,99],93:[2,99],102:[2,99],104:[2,99],105:[2,99],106:[2,99],110:[2,99],118:[2,99],126:[2,99],128:[2,99],129:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99],137:[2,99]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],73:[2,139],78:[2,139],86:[2,139],91:[2,139],93:[2,139],102:[2,139],103:82,104:[2,139],105:[2,139],106:[2,139],109:83,110:[2,139],111:67,118:[2,139],126:[2,139],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,45],6:[2,45],26:[2,45],102:[2,45],103:82,104:[2,45],106:[2,45],109:83,110:[2,45],111:67,126:[2,45],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,72],102:[1,221]},{4:222,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],91:[2,128],92:223,93:[1,188],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],69:[2,114],71:[2,114],73:[2,114],74:[2,114],78:[2,114],84:[2,114],85:[2,114],86:[2,114],91:[2,114],93:[2,114],102:[2,114],104:[2,114],105:[2,114],106:[2,114],110:[2,114],116:[2,114],117:[2,114],118:[2,114],126:[2,114],128:[2,114],129:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114],137:[2,114]},{6:[2,52],25:[2,52],53:225,54:[1,226],91:[2,52]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],86:[2,123],91:[2,123]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:227,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],86:[2,129],91:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],69:[2,113],71:[2,113],73:[2,113],74:[2,113],78:[2,113],80:[2,113],84:[2,113],85:[2,113],86:[2,113],91:[2,113],93:[2,113],102:[2,113],104:[2,113],105:[2,113],106:[2,113],110:[2,113],116:[2,113],117:[2,113],118:[2,113],126:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113],138:[2,113]},{24:228,25:[1,112],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],73:[2,142],78:[2,142],86:[2,142],91:[2,142],93:[2,142],102:[2,142],103:82,104:[1,63],105:[1,229],106:[1,64],109:83,110:[1,66],111:67,118:[2,142],126:[2,142],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],73:[2,144],78:[2,144],86:[2,144],91:[2,144],93:[2,144],102:[2,144],103:82,104:[1,63],105:[1,230],106:[1,64],109:83,110:[1,66],111:67,118:[2,144],126:[2,144],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],73:[2,150],78:[2,150],86:[2,150],91:[2,150],93:[2,150],102:[2,150],104:[2,150],105:[2,150],106:[2,150],110:[2,150],118:[2,150],126:[2,150],128:[2,150],129:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150],137:[2,150]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],73:[2,151],78:[2,151],86:[2,151],91:[2,151],93:[2,151],102:[2,151],103:82,104:[1,63],105:[2,151],106:[1,64],109:83,110:[1,66],111:67,118:[2,151],126:[2,151],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],49:[2,155],54:[2,155],57:[2,155],73:[2,155],78:[2,155],86:[2,155],91:[2,155],93:[2,155],102:[2,155],104:[2,155],105:[2,155],106:[2,155],110:[2,155],118:[2,155],126:[2,155],128:[2,155],129:[2,155],132:[2,155],133:[2,155],134:[2,155],135:[2,155],136:[2,155],137:[2,155]},{116:[2,157],117:[2,157]},{27:155,28:[1,71],44:156,58:157,59:158,76:[1,68],89:[1,109],90:[1,110],113:231,115:154},{54:[1,232],116:[2,163],117:[2,163]},{54:[2,159],116:[2,159],117:[2,159]},{54:[2,160],116:[2,160],117:[2,160]},{54:[2,161],116:[2,161],117:[2,161]},{54:[2,162],116:[2,162],117:[2,162]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],49:[2,156],54:[2,156],57:[2,156],73:[2,156],78:[2,156],86:[2,156],91:[2,156],93:[2,156],102:[2,156],104:[2,156],105:[2,156],106:[2,156],110:[2,156],118:[2,156],126:[2,156],128:[2,156],129:[2,156],132:[2,156],133:[2,156],134:[2,156],135:[2,156],136:[2,156],137:[2,156]},{7:233,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:234,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],53:235,54:[1,236],78:[2,52]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],78:[2,91]},{6:[2,38],25:[2,38],26:[2,38],43:[1,237],54:[2,38],78:[2,38]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],78:[2,41]},{6:[2,42],25:[2,42],26:[2,42],43:[2,42],54:[2,42],78:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],78:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],78:[2,44]},{1:[2,4],6:[2,4],26:[2,4],102:[2,4]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],73:[2,194],78:[2,194],86:[2,194],91:[2,194],93:[2,194],102:[2,194],103:82,104:[2,194],105:[2,194],106:[2,194],109:83,110:[2,194],111:67,118:[2,194],126:[2,194],128:[2,194],129:[2,194],132:[1,73],133:[1,76],134:[2,194],135:[2,194],136:[2,194],137:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],73:[2,195],78:[2,195],86:[2,195],91:[2,195],93:[2,195],102:[2,195],103:82,104:[2,195],105:[2,195],106:[2,195],109:83,110:[2,195],111:67,118:[2,195],126:[2,195],128:[2,195],129:[2,195],132:[1,73],133:[1,76],134:[2,195],135:[2,195],136:[2,195],137:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],73:[2,196],78:[2,196],86:[2,196],91:[2,196],93:[2,196],102:[2,196],103:82,104:[2,196],105:[2,196],106:[2,196],109:83,110:[2,196],111:67,118:[2,196],126:[2,196],128:[2,196],129:[2,196],132:[1,73],133:[2,196],134:[2,196],135:[2,196],136:[2,196],137:[2,196]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],73:[2,197],78:[2,197],86:[2,197],91:[2,197],93:[2,197],102:[2,197],103:82,104:[2,197],105:[2,197],106:[2,197],109:83,110:[2,197],111:67,118:[2,197],126:[2,197],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[2,197],135:[2,197],136:[2,197],137:[2,197]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],73:[2,198],78:[2,198],86:[2,198],91:[2,198],93:[2,198],102:[2,198],103:82,104:[2,198],105:[2,198],106:[2,198],109:83,110:[2,198],111:67,118:[2,198],126:[2,198],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[2,198],136:[2,198],137:[1,80]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],73:[2,199],78:[2,199],86:[2,199],91:[2,199],93:[2,199],102:[2,199],103:82,104:[2,199],105:[2,199],106:[2,199],109:83,110:[2,199],111:67,118:[2,199],126:[2,199],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[2,199],137:[1,80]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],73:[2,200],78:[2,200],86:[2,200],91:[2,200],93:[2,200],102:[2,200],103:82,104:[2,200],105:[2,200],106:[2,200],109:83,110:[2,200],111:67,118:[2,200],126:[2,200],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[2,200],136:[2,200],137:[2,200]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],73:[2,185],78:[2,185],86:[2,185],91:[2,185],93:[2,185],102:[2,185],103:82,104:[1,63],105:[2,185],106:[1,64],109:83,110:[1,66],111:67,118:[2,185],126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],73:[2,184],78:[2,184],86:[2,184],91:[2,184],93:[2,184],102:[2,184],103:82,104:[1,63],105:[2,184],106:[1,64],109:83,110:[1,66],111:67,118:[2,184],126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],66:[2,103],67:[2,103],68:[2,103],69:[2,103],71:[2,103],73:[2,103],74:[2,103],78:[2,103],84:[2,103],85:[2,103],86:[2,103],91:[2,103],93:[2,103],102:[2,103],104:[2,103],105:[2,103],106:[2,103],110:[2,103],118:[2,103],126:[2,103],128:[2,103],129:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103],137:[2,103]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],40:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],69:[2,79],71:[2,79],73:[2,79],74:[2,79],78:[2,79],80:[2,79],84:[2,79],85:[2,79],86:[2,79],91:[2,79],93:[2,79],102:[2,79],104:[2,79],105:[2,79],106:[2,79],110:[2,79],118:[2,79],126:[2,79],128:[2,79],129:[2,79],130:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79],137:[2,79],138:[2,79]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],69:[2,80],71:[2,80],73:[2,80],74:[2,80],78:[2,80],80:[2,80],84:[2,80],85:[2,80],86:[2,80],91:[2,80],93:[2,80],102:[2,80],104:[2,80],105:[2,80],106:[2,80],110:[2,80],118:[2,80],126:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80],138:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],69:[2,81],71:[2,81],73:[2,81],74:[2,81],78:[2,81],80:[2,81],84:[2,81],85:[2,81],86:[2,81],91:[2,81],93:[2,81],102:[2,81],104:[2,81],105:[2,81],106:[2,81],110:[2,81],118:[2,81],126:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81],138:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],69:[2,82],71:[2,82],73:[2,82],74:[2,82],78:[2,82],80:[2,82],84:[2,82],85:[2,82],86:[2,82],91:[2,82],93:[2,82],102:[2,82],104:[2,82],105:[2,82],106:[2,82],110:[2,82],118:[2,82],126:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82],138:[2,82]},{73:[1,238]},{57:[1,189],73:[2,87],92:239,93:[1,188],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{73:[2,88]},{7:240,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,73:[2,122],76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{11:[2,116],28:[2,116],30:[2,116],31:[2,116],33:[2,116],34:[2,116],35:[2,116],36:[2,116],37:[2,116],38:[2,116],45:[2,116],46:[2,116],47:[2,116],51:[2,116],52:[2,116],73:[2,116],76:[2,116],79:[2,116],83:[2,116],88:[2,116],89:[2,116],90:[2,116],96:[2,116],100:[2,116],101:[2,116],104:[2,116],106:[2,116],108:[2,116],110:[2,116],119:[2,116],125:[2,116],127:[2,116],128:[2,116],129:[2,116],130:[2,116],131:[2,116]},{11:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],73:[2,117],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],69:[2,86],71:[2,86],73:[2,86],74:[2,86],78:[2,86],80:[2,86],84:[2,86],85:[2,86],86:[2,86],91:[2,86],93:[2,86],102:[2,86],104:[2,86],105:[2,86],106:[2,86],110:[2,86],118:[2,86],126:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86],138:[2,86]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],69:[2,104],71:[2,104],73:[2,104],74:[2,104],78:[2,104],84:[2,104],85:[2,104],86:[2,104],91:[2,104],93:[2,104],102:[2,104],104:[2,104],105:[2,104],106:[2,104],110:[2,104],118:[2,104],126:[2,104],128:[2,104],129:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104],137:[2,104]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],73:[2,35],78:[2,35],86:[2,35],91:[2,35],93:[2,35],102:[2,35],103:82,104:[2,35],105:[2,35],106:[2,35],109:83,110:[2,35],111:67,118:[2,35],126:[2,35],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:241,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:242,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],49:[2,109],54:[2,109],57:[2,109],66:[2,109],67:[2,109],68:[2,109],69:[2,109],71:[2,109],73:[2,109],74:[2,109],78:[2,109],84:[2,109],85:[2,109],86:[2,109],91:[2,109],93:[2,109],102:[2,109],104:[2,109],105:[2,109],106:[2,109],110:[2,109],118:[2,109],126:[2,109],128:[2,109],129:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109],136:[2,109],137:[2,109]},{6:[2,52],25:[2,52],53:243,54:[1,226],86:[2,52]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],57:[1,244],86:[2,128],91:[2,128],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{50:245,51:[1,58],52:[1,59]},{6:[2,53],25:[2,53],26:[2,53],27:105,28:[1,71],44:106,55:246,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[1,247],25:[1,248]},{6:[2,60],25:[2,60],26:[2,60],49:[2,60],54:[2,60]},{7:249,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],73:[2,23],78:[2,23],86:[2,23],91:[2,23],93:[2,23],98:[2,23],99:[2,23],102:[2,23],104:[2,23],105:[2,23],106:[2,23],110:[2,23],118:[2,23],121:[2,23],123:[2,23],126:[2,23],128:[2,23],129:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23],137:[2,23]},{6:[1,72],26:[1,250]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],73:[2,201],78:[2,201],86:[2,201],91:[2,201],93:[2,201],102:[2,201],103:82,104:[2,201],105:[2,201],106:[2,201],109:83,110:[2,201],111:67,118:[2,201],126:[2,201],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:251,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:252,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,204],6:[2,204],25:[2,204],26:[2,204],49:[2,204],54:[2,204],57:[2,204],73:[2,204],78:[2,204],86:[2,204],91:[2,204],93:[2,204],102:[2,204],103:82,104:[2,204],105:[2,204],106:[2,204],109:83,110:[2,204],111:67,118:[2,204],126:[2,204],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],73:[2,183],78:[2,183],86:[2,183],91:[2,183],93:[2,183],102:[2,183],104:[2,183],105:[2,183],106:[2,183],110:[2,183],118:[2,183],126:[2,183],128:[2,183],129:[2,183],132:[2,183],133:[2,183],134:[2,183],135:[2,183],136:[2,183],137:[2,183]},{7:253,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],73:[2,133],78:[2,133],86:[2,133],91:[2,133],93:[2,133],98:[1,254],102:[2,133],104:[2,133],105:[2,133],106:[2,133],110:[2,133],118:[2,133],126:[2,133],128:[2,133],129:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133],137:[2,133]},{24:255,25:[1,112]},{24:258,25:[1,112],27:256,28:[1,71],59:257,76:[1,68]},{120:259,122:216,123:[1,217]},{26:[1,260],121:[1,261],122:262,123:[1,217]},{26:[2,176],121:[2,176],123:[2,176]},{7:264,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],95:263,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,97],6:[2,97],24:265,25:[1,112],26:[2,97],49:[2,97],54:[2,97],57:[2,97],73:[2,97],78:[2,97],86:[2,97],91:[2,97],93:[2,97],102:[2,97],103:82,104:[1,63],105:[2,97],106:[1,64],109:83,110:[1,66],111:67,118:[2,97],126:[2,97],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],49:[2,100],54:[2,100],57:[2,100],73:[2,100],78:[2,100],86:[2,100],91:[2,100],93:[2,100],102:[2,100],104:[2,100],105:[2,100],106:[2,100],110:[2,100],118:[2,100],126:[2,100],128:[2,100],129:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100],137:[2,100]},{7:266,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],66:[2,140],67:[2,140],68:[2,140],69:[2,140],71:[2,140],73:[2,140],74:[2,140],78:[2,140],84:[2,140],85:[2,140],86:[2,140],91:[2,140],93:[2,140],102:[2,140],104:[2,140],105:[2,140],106:[2,140],110:[2,140],118:[2,140],126:[2,140],128:[2,140],129:[2,140],132:[2,140],133:[2,140],134:[2,140],135:[2,140],136:[2,140],137:[2,140]},{6:[1,72],26:[1,267]},{7:268,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,66],11:[2,117],25:[2,66],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],54:[2,66],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],91:[2,66],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{6:[1,270],25:[1,271],91:[1,269]},{6:[2,53],7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[2,53],26:[2,53],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],86:[2,53],88:[1,56],89:[1,57],90:[1,55],91:[2,53],94:272,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],26:[2,52],53:273,54:[1,226]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],73:[2,180],78:[2,180],86:[2,180],91:[2,180],93:[2,180],102:[2,180],104:[2,180],105:[2,180],106:[2,180],110:[2,180],118:[2,180],121:[2,180],126:[2,180],128:[2,180],129:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180],137:[2,180]},{7:274,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:275,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{116:[2,158],117:[2,158]},{27:155,28:[1,71],44:156,58:157,59:158,76:[1,68],89:[1,109],90:[1,110],115:276},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],73:[2,165],78:[2,165],86:[2,165],91:[2,165],93:[2,165],102:[2,165],103:82,104:[2,165],105:[1,277],106:[2,165],109:83,110:[2,165],111:67,118:[1,278],126:[2,165],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],73:[2,166],78:[2,166],86:[2,166],91:[2,166],93:[2,166],102:[2,166],103:82,104:[2,166],105:[1,279],106:[2,166],109:83,110:[2,166],111:67,118:[2,166],126:[2,166],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,281],25:[1,282],78:[1,280]},{6:[2,53],10:165,25:[2,53],26:[2,53],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:283,42:164,44:168,46:[1,44],78:[2,53],89:[1,109]},{7:284,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,285],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],69:[2,85],71:[2,85],73:[2,85],74:[2,85],78:[2,85],80:[2,85],84:[2,85],85:[2,85],86:[2,85],91:[2,85],93:[2,85],102:[2,85],104:[2,85],105:[2,85],106:[2,85],110:[2,85],118:[2,85],126:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85],138:[2,85]},{7:286,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,73:[2,120],76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{73:[2,121],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],73:[2,36],78:[2,36],86:[2,36],91:[2,36],93:[2,36],102:[2,36],103:82,104:[2,36],105:[2,36],106:[2,36],109:83,110:[2,36],111:67,118:[2,36],126:[2,36],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{26:[1,287],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,270],25:[1,271],86:[1,288]},{6:[2,66],25:[2,66],26:[2,66],54:[2,66],86:[2,66],91:[2,66]},{24:289,25:[1,112]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{27:105,28:[1,71],44:106,55:290,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[2,54],25:[2,54],26:[2,54],27:105,28:[1,71],44:106,48:291,54:[2,54],55:103,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],73:[2,24],78:[2,24],86:[2,24],91:[2,24],93:[2,24],98:[2,24],99:[2,24],102:[2,24],104:[2,24],105:[2,24],106:[2,24],110:[2,24],118:[2,24],121:[2,24],123:[2,24],126:[2,24],128:[2,24],129:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24],137:[2,24]},{26:[1,292],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,203],6:[2,203],25:[2,203],26:[2,203],49:[2,203],54:[2,203],57:[2,203],73:[2,203],78:[2,203],86:[2,203],91:[2,203],93:[2,203],102:[2,203],103:82,104:[2,203],105:[2,203],106:[2,203],109:83,110:[2,203],111:67,118:[2,203],126:[2,203],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{24:293,25:[1,112],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{24:294,25:[1,112]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],73:[2,134],78:[2,134],86:[2,134],91:[2,134],93:[2,134],102:[2,134],104:[2,134],105:[2,134],106:[2,134],110:[2,134],118:[2,134],126:[2,134],128:[2,134],129:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134],137:[2,134]},{24:295,25:[1,112]},{24:296,25:[1,112]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],73:[2,138],78:[2,138],86:[2,138],91:[2,138],93:[2,138],98:[2,138],102:[2,138],104:[2,138],105:[2,138],106:[2,138],110:[2,138],118:[2,138],126:[2,138],128:[2,138],129:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138],137:[2,138]},{26:[1,297],121:[1,298],122:262,123:[1,217]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],49:[2,174],54:[2,174],57:[2,174],73:[2,174],78:[2,174],86:[2,174],91:[2,174],93:[2,174],102:[2,174],104:[2,174],105:[2,174],106:[2,174],110:[2,174],118:[2,174],126:[2,174],128:[2,174],129:[2,174],132:[2,174],133:[2,174],134:[2,174],135:[2,174],136:[2,174],137:[2,174]},{24:299,25:[1,112]},{26:[2,177],121:[2,177],123:[2,177]},{24:300,25:[1,112],54:[1,301]},{25:[2,130],54:[2,130],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],49:[2,98],54:[2,98],57:[2,98],73:[2,98],78:[2,98],86:[2,98],91:[2,98],93:[2,98],102:[2,98],104:[2,98],105:[2,98],106:[2,98],110:[2,98],118:[2,98],126:[2,98],128:[2,98],129:[2,98],132:[2,98],133:[2,98],134:[2,98],135:[2,98],136:[2,98],137:[2,98]},{1:[2,101],6:[2,101],24:302,25:[1,112],26:[2,101],49:[2,101],54:[2,101],57:[2,101],73:[2,101],78:[2,101],86:[2,101],91:[2,101],93:[2,101],102:[2,101],103:82,104:[1,63],105:[2,101],106:[1,64],109:83,110:[1,66],111:67,118:[2,101],126:[2,101],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{102:[1,303]},{91:[1,304],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],69:[2,115],71:[2,115],73:[2,115],74:[2,115],78:[2,115],84:[2,115],85:[2,115],86:[2,115],91:[2,115],93:[2,115],102:[2,115],104:[2,115],105:[2,115],106:[2,115],110:[2,115],116:[2,115],117:[2,115],118:[2,115],126:[2,115],128:[2,115],129:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115],137:[2,115]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],94:305,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:306,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],86:[2,124],91:[2,124]},{6:[1,270],25:[1,271],26:[1,307]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],73:[2,143],78:[2,143],86:[2,143],91:[2,143],93:[2,143],102:[2,143],103:82,104:[1,63],105:[2,143],106:[1,64],109:83,110:[1,66],111:67,118:[2,143],126:[2,143],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],73:[2,145],78:[2,145],86:[2,145],91:[2,145],93:[2,145],102:[2,145],103:82,104:[1,63],105:[2,145],106:[1,64],109:83,110:[1,66],111:67,118:[2,145],126:[2,145],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{116:[2,164],117:[2,164]},{7:308,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:309,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:310,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,89],6:[2,89],25:[2,89],26:[2,89],40:[2,89],49:[2,89],54:[2,89],57:[2,89],66:[2,89],67:[2,89],68:[2,89],69:[2,89],71:[2,89],73:[2,89],74:[2,89],78:[2,89],84:[2,89],85:[2,89],86:[2,89],91:[2,89],93:[2,89],102:[2,89],104:[2,89],105:[2,89],106:[2,89],110:[2,89],116:[2,89],117:[2,89],118:[2,89],126:[2,89],128:[2,89],129:[2,89],132:[2,89],133:[2,89],134:[2,89],135:[2,89],136:[2,89],137:[2,89]},{10:165,27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:311,42:164,44:168,46:[1,44],89:[1,109]},{6:[2,90],10:165,25:[2,90],26:[2,90],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:163,42:164,44:168,46:[1,44],54:[2,90],77:312,89:[1,109]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],78:[2,92]},{6:[2,39],25:[2,39],26:[2,39],54:[2,39],78:[2,39],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:313,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{73:[2,119],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],73:[2,37],78:[2,37],86:[2,37],91:[2,37],93:[2,37],102:[2,37],104:[2,37],105:[2,37],106:[2,37],110:[2,37],118:[2,37],126:[2,37],128:[2,37],129:[2,37],132:[2,37],133:[2,37],134:[2,37],135:[2,37],136:[2,37],137:[2,37]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],69:[2,110],71:[2,110],73:[2,110],74:[2,110],78:[2,110],84:[2,110],85:[2,110],86:[2,110],91:[2,110],93:[2,110],102:[2,110],104:[2,110],105:[2,110],106:[2,110],110:[2,110],118:[2,110],126:[2,110],128:[2,110],129:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110],137:[2,110]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],49:[2,48],54:[2,48],57:[2,48],73:[2,48],78:[2,48],86:[2,48],91:[2,48],93:[2,48],102:[2,48],104:[2,48],105:[2,48],106:[2,48],110:[2,48],118:[2,48],126:[2,48],128:[2,48],129:[2,48],132:[2,48],133:[2,48],134:[2,48],135:[2,48],136:[2,48],137:[2,48]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{6:[2,52],25:[2,52],26:[2,52],53:314,54:[1,199]},{1:[2,202],6:[2,202],25:[2,202],26:[2,202],49:[2,202],54:[2,202],57:[2,202],73:[2,202],78:[2,202],86:[2,202],91:[2,202],93:[2,202],102:[2,202],104:[2,202],105:[2,202],106:[2,202],110:[2,202],118:[2,202],126:[2,202],128:[2,202],129:[2,202],132:[2,202],133:[2,202],134:[2,202],135:[2,202],136:[2,202],137:[2,202]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],73:[2,181],78:[2,181],86:[2,181],91:[2,181],93:[2,181],102:[2,181],104:[2,181],105:[2,181],106:[2,181],110:[2,181],118:[2,181],121:[2,181],126:[2,181],128:[2,181],129:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181],137:[2,181]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],73:[2,135],78:[2,135],86:[2,135],91:[2,135],93:[2,135],102:[2,135],104:[2,135],105:[2,135],106:[2,135],110:[2,135],118:[2,135],126:[2,135],128:[2,135],129:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135],137:[2,135]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],73:[2,136],78:[2,136],86:[2,136],91:[2,136],93:[2,136],98:[2,136],102:[2,136],104:[2,136],105:[2,136],106:[2,136],110:[2,136],118:[2,136],126:[2,136],128:[2,136],129:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136],137:[2,136]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],73:[2,137],78:[2,137],86:[2,137],91:[2,137],93:[2,137],98:[2,137],102:[2,137],104:[2,137],105:[2,137],106:[2,137],110:[2,137],118:[2,137],126:[2,137],128:[2,137],129:[2,137],132:[2,137],133:[2,137],134:[2,137],135:[2,137],136:[2,137],137:[2,137]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],73:[2,172],78:[2,172],86:[2,172],91:[2,172],93:[2,172],102:[2,172],104:[2,172],105:[2,172],106:[2,172],110:[2,172],118:[2,172],126:[2,172],128:[2,172],129:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172],137:[2,172]},{24:315,25:[1,112]},{26:[1,316]},{6:[1,317],26:[2,178],121:[2,178],123:[2,178]},{7:318,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],49:[2,102],54:[2,102],57:[2,102],73:[2,102],78:[2,102],86:[2,102],91:[2,102],93:[2,102],102:[2,102],104:[2,102],105:[2,102],106:[2,102],110:[2,102],118:[2,102],126:[2,102],128:[2,102],129:[2,102],132:[2,102],133:[2,102],134:[2,102],135:[2,102],136:[2,102],137:[2,102]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],66:[2,141],67:[2,141],68:[2,141],69:[2,141],71:[2,141],73:[2,141],74:[2,141],78:[2,141],84:[2,141],85:[2,141],86:[2,141],91:[2,141],93:[2,141],102:[2,141],104:[2,141],105:[2,141],106:[2,141],110:[2,141],118:[2,141],126:[2,141],128:[2,141],129:[2,141],132:[2,141],133:[2,141],134:[2,141],135:[2,141],136:[2,141],137:[2,141]},{1:[2,118],6:[2,118],25:[2,118],26:[2,118],49:[2,118],54:[2,118],57:[2,118],66:[2,118],67:[2,118],68:[2,118],69:[2,118],71:[2,118],73:[2,118],74:[2,118],78:[2,118],84:[2,118],85:[2,118],86:[2,118],91:[2,118],93:[2,118],102:[2,118],104:[2,118],105:[2,118],106:[2,118],110:[2,118],118:[2,118],126:[2,118],128:[2,118],129:[2,118],132:[2,118],133:[2,118],134:[2,118],135:[2,118],136:[2,118],137:[2,118]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],86:[2,125],91:[2,125]},{6:[2,52],25:[2,52],26:[2,52],53:319,54:[1,226]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],86:[2,126],91:[2,126]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],73:[2,167],78:[2,167],86:[2,167],91:[2,167],93:[2,167],102:[2,167],103:82,104:[2,167],105:[2,167],106:[2,167],109:83,110:[2,167],111:67,118:[1,320],126:[2,167],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],73:[2,169],78:[2,169],86:[2,169],91:[2,169],93:[2,169],102:[2,169],103:82,104:[2,169],105:[1,321],106:[2,169],109:83,110:[2,169],111:67,118:[2,169],126:[2,169],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],73:[2,168],78:[2,168],86:[2,168],91:[2,168],93:[2,168],102:[2,168],103:82,104:[2,168],105:[2,168],106:[2,168],109:83,110:[2,168],111:67,118:[2,168],126:[2,168],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],78:[2,93]},{6:[2,52],25:[2,52],26:[2,52],53:322,54:[1,236]},{26:[1,323],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,247],25:[1,248],26:[1,324]},{26:[1,325]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],49:[2,175],54:[2,175],57:[2,175],73:[2,175],78:[2,175],86:[2,175],91:[2,175],93:[2,175],102:[2,175],104:[2,175],105:[2,175],106:[2,175],110:[2,175],118:[2,175],126:[2,175],128:[2,175],129:[2,175],132:[2,175],133:[2,175],134:[2,175],135:[2,175],136:[2,175],137:[2,175]},{26:[2,179],121:[2,179],123:[2,179]},{25:[2,131],54:[2,131],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,270],25:[1,271],26:[1,326]},{7:327,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:328,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[1,281],25:[1,282],26:[1,329]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],78:[2,40]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],73:[2,173],78:[2,173],86:[2,173],91:[2,173],93:[2,173],102:[2,173],104:[2,173],105:[2,173],106:[2,173],110:[2,173],118:[2,173],126:[2,173],128:[2,173],129:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173],137:[2,173]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],86:[2,127],91:[2,127]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],73:[2,170],78:[2,170],86:[2,170],91:[2,170],93:[2,170],102:[2,170],103:82,104:[2,170],105:[2,170],106:[2,170],109:83,110:[2,170],111:67,118:[2,170],126:[2,170],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],73:[2,171],78:[2,171],86:[2,171],91:[2,171],93:[2,171],102:[2,171],103:82,104:[2,171],105:[2,171],106:[2,171],109:83,110:[2,171],111:67,118:[2,171],126:[2,171],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],78:[2,94]}], -defaultActions: {58:[2,50],59:[2,51],89:[2,108],186:[2,88]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - // ace_mod - var e = new Error(str) - e.location = hash.loc - throw e; - } -}, -parse: function parse(input) { - var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - this.lexer.setInput(input); - this.lexer.yy = this.yy; - this.yy.lexer = this.lexer; - this.yy.parser = this; - if (typeof this.lexer.yylloc == 'undefined') { - this.lexer.yylloc = {}; - } - var yyloc = this.lexer.yylloc; - lstack.push(yyloc); - var ranges = this.lexer.options && this.lexer.options.ranges; - if (typeof this.yy.parseError === 'function') { - this.parseError = this.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - function lex() { - var token; - token = self.lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (this.lexer.showPosition) { - errStr = 'Expecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - // ace_mod - if (this.lexer.yylloc.first_line !== yyloc.first_line) yyloc = this.lexer.yylloc; - this.parseError(errStr, { - text: this.lexer.match, - token: this.terminals_[symbol] || symbol, - line: this.lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -undefined -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; - -module.exports = new Parser; - - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js deleted file mode 100644 index 001262b6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +++ /dev/null @@ -1,88 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var assert = require("../../test/assertions"); -var coffee = require("../coffee/coffee-script"); - -function assertLocation(e, sl, sc, el, ec) { - assert.equal(e.location.first_line, sl); - assert.equal(e.location.first_column, sc); - assert.equal(e.location.last_line, el); - assert.equal(e.location.last_column, ec); -} - -function parse(str) { - try { - coffee.parse(str).compile(); - } catch (e) { - return e; - } -} - -module.exports = { - "test parse valid coffee script": function() { - coffee.parse("square = (x) -> x * x"); - }, - - "test parse invalid coffee script": function() { - var e = parse("a = 12 f"); - assert.equal(e.message, "Unexpected 'IDENTIFIER'"); - assertLocation(e, 0, 4, 0, 5); - }, - - "test parse missing bracket": function() { - var e = parse("a = 12 f {\n\n"); - assert.equal(e.message, "missing }"); - assertLocation(e, 0, 10, 0, 10); - }, - "test unexpected indent": function() { - var e = parse("a\n a\n"); - assert.equal(e.message, "Unexpected 'INDENT'"); - assertLocation(e, 1, 0, 1, 1); - }, - "test invalid destructuring": function() { - var e = parse("\n{b: 5} = {}"); - assert.equal(e.message, '"5" cannot be assigned'); - assertLocation(e, 1, 4, 1, 4); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js deleted file mode 100644 index acb5c420..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +++ /dev/null @@ -1,516 +0,0 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 - - var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice; - - generate = function(tag, value) { - var tok; - tok = [tag, value]; - tok.generated = true; - return tok; - }; - - exports.Rewriter = (function() { - function Rewriter() {} - - Rewriter.prototype.rewrite = function(tokens) { - this.tokens = tokens; - this.removeLeadingNewlines(); - this.closeOpenCalls(); - this.closeOpenIndexes(); - this.normalizeLines(); - this.tagPostfixConditionals(); - this.addImplicitBracesAndParens(); - this.addLocationDataToGeneratedTokens(); - return this.tokens; - }; - - Rewriter.prototype.scanTokens = function(block) { - var i, token, tokens; - tokens = this.tokens; - i = 0; - while (token = tokens[i]) { - i += block.call(this, token, i, tokens); - } - return true; - }; - - Rewriter.prototype.detectEnd = function(i, condition, action) { - var levels, token, tokens, _ref, _ref1; - tokens = this.tokens; - levels = 0; - while (token = tokens[i]) { - if (levels === 0 && condition.call(this, token, i)) { - return action.call(this, token, i); - } - if (!token || levels < 0) { - return action.call(this, token, i - 1); - } - if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) { - levels += 1; - } else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) { - levels -= 1; - } - i += 1; - } - return i - 1; - }; - - Rewriter.prototype.removeLeadingNewlines = function() { - var i, tag, _i, _len, _ref; - _ref = this.tokens; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - tag = _ref[i][0]; - if (tag !== 'TERMINATOR') { - break; - } - } - if (i) { - return this.tokens.splice(0, i); - } - }; - - Rewriter.prototype.closeOpenCalls = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')'; - }; - action = function(token, i) { - return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'CALL_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - - Rewriter.prototype.closeOpenIndexes = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return (_ref = token[0]) === ']' || _ref === 'INDEX_END'; - }; - action = function(token, i) { - return token[0] = 'INDEX_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'INDEX_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - - Rewriter.prototype.matchTags = function() { - var fuzz, i, j, pattern, _i, _ref, _ref1; - i = arguments[0], pattern = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - fuzz = 0; - for (j = _i = 0, _ref = pattern.length; 0 <= _ref ? _i < _ref : _i > _ref; j = 0 <= _ref ? ++_i : --_i) { - while (this.tag(i + j + fuzz) === 'HERECOMMENT') { - fuzz += 2; - } - if (pattern[j] == null) { - continue; - } - if (typeof pattern[j] === 'string') { - pattern[j] = [pattern[j]]; - } - if (_ref1 = this.tag(i + j + fuzz), __indexOf.call(pattern[j], _ref1) < 0) { - return false; - } - } - return true; - }; - - Rewriter.prototype.looksObjectish = function(j) { - return this.matchTags(j, '@', null, ':') || this.matchTags(j, null, ':'); - }; - - Rewriter.prototype.findTagsBackwards = function(i, tags) { - var backStack, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - backStack = []; - while (i >= 0 && (backStack.length || (_ref2 = this.tag(i), __indexOf.call(tags, _ref2) < 0) && ((_ref3 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref3) < 0) || this.tokens[i].generated) && (_ref4 = this.tag(i), __indexOf.call(LINEBREAKS, _ref4) < 0))) { - if (_ref = this.tag(i), __indexOf.call(EXPRESSION_END, _ref) >= 0) { - backStack.push(this.tag(i)); - } - if ((_ref1 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref1) >= 0) && backStack.length) { - backStack.pop(); - } - i -= 1; - } - return _ref5 = this.tag(i), __indexOf.call(tags, _ref5) >= 0; - }; - - Rewriter.prototype.addImplicitBracesAndParens = function() { - var stack; - stack = []; - return this.scanTokens(function(token, i, tokens) { - var endAllImplicitCalls, endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, nextTag, offset, prevTag, prevToken, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - tag = token[0]; - prevTag = (prevToken = i > 0 ? tokens[i - 1] : [])[0]; - nextTag = (i < tokens.length - 1 ? tokens[i + 1] : [])[0]; - stackTop = function() { - return stack[stack.length - 1]; - }; - startIdx = i; - forward = function(n) { - return i - startIdx + n; - }; - inImplicit = function() { - var _ref, _ref1; - return (_ref = stackTop()) != null ? (_ref1 = _ref[2]) != null ? _ref1.ours : void 0 : void 0; - }; - inImplicitCall = function() { - var _ref; - return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '('; - }; - inImplicitObject = function() { - var _ref; - return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '{'; - }; - inImplicitControl = function() { - var _ref; - return inImplicit && ((_ref = stackTop()) != null ? _ref[0] : void 0) === 'CONTROL'; - }; - startImplicitCall = function(j) { - var idx; - idx = j != null ? j : i; - stack.push([ - '(', idx, { - ours: true - } - ]); - tokens.splice(idx, 0, generate('CALL_START', '(')); - if (j == null) { - return i += 1; - } - }; - endImplicitCall = function() { - stack.pop(); - tokens.splice(i, 0, generate('CALL_END', ')')); - return i += 1; - }; - endAllImplicitCalls = function() { - while (inImplicitCall()) { - endImplicitCall(); - } - }; - startImplicitObject = function(j, startsLine) { - var idx; - if (startsLine == null) { - startsLine = true; - } - idx = j != null ? j : i; - stack.push([ - '{', idx, { - sameLine: true, - startsLine: startsLine, - ours: true - } - ]); - tokens.splice(idx, 0, generate('{', generate(new String('{')))); - if (j == null) { - return i += 1; - } - }; - endImplicitObject = function(j) { - j = j != null ? j : i; - stack.pop(); - tokens.splice(j, 0, generate('}', '}')); - return i += 1; - }; - if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) { - stack.push([ - 'CONTROL', i, { - ours: true - } - ]); - return forward(1); - } - if (tag === 'INDENT' && inImplicit()) { - if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') { - while (inImplicitCall()) { - endImplicitCall(); - } - } - if (inImplicitControl()) { - stack.pop(); - } - stack.push([tag, i]); - return forward(1); - } - if (__indexOf.call(EXPRESSION_START, tag) >= 0) { - stack.push([tag, i]); - return forward(1); - } - if (__indexOf.call(EXPRESSION_END, tag) >= 0) { - while (inImplicit()) { - if (inImplicitCall()) { - endImplicitCall(); - } else if (inImplicitObject()) { - endImplicitObject(); - } else { - stack.pop(); - } - } - stack.pop(); - } - if ((__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced && !token.stringEnd || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (__indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || __indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((_ref = tokens[i + 1]) != null ? _ref.spaced : void 0) && !((_ref1 = tokens[i + 1]) != null ? _ref1.newLine : void 0))) { - if (tag === '?') { - tag = token[0] = 'FUNC_EXIST'; - } - startImplicitCall(i + 1); - return forward(2); - } - if (__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.matchTags(i + 1, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) { - startImplicitCall(i + 1); - stack.push(['INDENT', i + 2]); - return forward(3); - } - if (tag === ':') { - if (this.tag(i - 2) === '@') { - s = i - 2; - } else { - s = i - 1; - } - while (this.tag(s - 2) === 'HERECOMMENT') { - s -= 2; - } - startsLine = s === 0 || (_ref2 = this.tag(s - 1), __indexOf.call(LINEBREAKS, _ref2) >= 0) || tokens[s - 1].newLine; - if (stackTop()) { - _ref3 = stackTop(), stackTag = _ref3[0], stackIdx = _ref3[1]; - if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) { - return forward(1); - } - } - startImplicitObject(s, !!startsLine); - return forward(2); - } - if (inImplicitCall() && __indexOf.call(CALL_CLOSERS, tag) >= 0) { - if (prevTag === 'OUTDENT') { - endImplicitCall(); - return forward(1); - } - if (prevToken.newLine) { - endAllImplicitCalls(); - return forward(1); - } - } - if (inImplicitObject() && __indexOf.call(LINEBREAKS, tag) >= 0) { - stackTop()[2].sameLine = false; - } - if (__indexOf.call(IMPLICIT_END, tag) >= 0) { - while (inImplicit()) { - _ref4 = stackTop(), stackTag = _ref4[0], stackIdx = _ref4[1], (_ref5 = _ref4[2], sameLine = _ref5.sameLine, startsLine = _ref5.startsLine); - if (inImplicitCall() && prevTag !== ',') { - endImplicitCall(); - } else if (inImplicitObject() && sameLine && !startsLine) { - endImplicitObject(); - } else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) { - endImplicitObject(); - } else { - break; - } - } - } - if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) { - offset = nextTag === 'OUTDENT' ? 1 : 0; - while (inImplicitObject()) { - endImplicitObject(i + offset); - } - } - return forward(1); - }); - }; - - Rewriter.prototype.addLocationDataToGeneratedTokens = function() { - return this.scanTokens(function(token, i, tokens) { - var column, line, nextLocation, prevLocation, _ref, _ref1; - if (token[2]) { - return 1; - } - if (!(token.generated || token.explicit)) { - return 1; - } - if (token[0] === '{' && (nextLocation = (_ref = tokens[i + 1]) != null ? _ref[2] : void 0)) { - line = nextLocation.first_line, column = nextLocation.first_column; - } else if (prevLocation = (_ref1 = tokens[i - 1]) != null ? _ref1[2] : void 0) { - line = prevLocation.last_line, column = prevLocation.last_column; - } else { - line = column = 0; - } - token[2] = { - first_line: line, - first_column: column, - last_line: line, - last_column: column - }; - return 1; - }); - }; - - Rewriter.prototype.normalizeLines = function() { - var action, condition, indent, outdent, starter; - starter = indent = outdent = null; - condition = function(token, i) { - var _ref, _ref1, _ref2, _ref3; - return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'TERMINATOR' && (_ref1 = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref1) >= 0)) && !(token[0] === 'ELSE' && starter !== 'THEN') && !(((_ref2 = token[0]) === 'CATCH' || _ref2 === 'FINALLY') && (starter === '->' || starter === '=>')) || (_ref3 = token[0], __indexOf.call(CALL_CLOSERS, _ref3) >= 0) && this.tokens[i - 1].newLine; - }; - action = function(token, i) { - return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent); - }; - return this.scanTokens(function(token, i, tokens) { - var j, tag, _i, _ref, _ref1, _ref2; - tag = token[0]; - if (tag === 'TERMINATOR') { - if (this.tag(i + 1) === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { - tokens.splice.apply(tokens, [i, 1].concat(__slice.call(this.indentation()))); - return 1; - } - if (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0) { - tokens.splice(i, 1); - return 0; - } - } - if (tag === 'CATCH') { - for (j = _i = 1; _i <= 2; j = ++_i) { - if (!((_ref1 = this.tag(i + j)) === 'OUTDENT' || _ref1 === 'TERMINATOR' || _ref1 === 'FINALLY')) { - continue; - } - tokens.splice.apply(tokens, [i + j, 0].concat(__slice.call(this.indentation()))); - return 2 + j; - } - } - if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) { - starter = tag; - _ref2 = this.indentation(true), indent = _ref2[0], outdent = _ref2[1]; - if (starter === 'THEN') { - indent.fromThen = true; - } - tokens.splice(i + 1, 0, indent); - this.detectEnd(i + 2, condition, action); - if (tag === 'THEN') { - tokens.splice(i, 1); - } - return 1; - } - return 1; - }); - }; - - Rewriter.prototype.tagPostfixConditionals = function() { - var action, condition, original; - original = null; - condition = function(token, i) { - var prevTag, tag; - tag = token[0]; - prevTag = this.tokens[i - 1][0]; - return tag === 'TERMINATOR' || (tag === 'INDENT' && __indexOf.call(SINGLE_LINERS, prevTag) < 0); - }; - action = function(token, i) { - if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) { - return original[0] = 'POST_' + original[0]; - } - }; - return this.scanTokens(function(token, i) { - if (token[0] !== 'IF') { - return 1; - } - original = token; - this.detectEnd(i + 1, condition, action); - return 1; - }); - }; - - Rewriter.prototype.indentation = function(implicit) { - var indent, outdent; - if (implicit == null) { - implicit = false; - } - indent = ['INDENT', 2]; - outdent = ['OUTDENT', 2]; - if (implicit) { - indent.generated = outdent.generated = true; - } - if (!implicit) { - indent.explicit = outdent.explicit = true; - } - return [indent, outdent]; - }; - - Rewriter.prototype.generate = generate; - - Rewriter.prototype.tag = function(i) { - var _ref; - return (_ref = this.tokens[i]) != null ? _ref[0] : void 0; - }; - - return Rewriter; - - })(); - - BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; - - exports.INVERSES = INVERSES = {}; - - EXPRESSION_START = []; - - EXPRESSION_END = []; - - for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) { - _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1]; - EXPRESSION_START.push(INVERSES[rite] = left); - EXPRESSION_END.push(INVERSES[left] = rite); - } - - EXPRESSION_CLOSE = ['CATCH', 'THEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); - - IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; - - IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', 'THROW', '@', '->', '=>', '[', '(', '{', '--', '++']; - - IMPLICIT_UNSPACED_CALL = ['+', '-']; - - IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; - - SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; - - SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; - - LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; - - CALL_CLOSERS = ['.', '?.', '::', '?::']; - - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js deleted file mode 100644 index 5834963b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - */ - -define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 - - var Scope, extend, last, _ref; - - _ref = require('./helpers'), extend = _ref.extend, last = _ref.last; - - exports.Scope = Scope = (function() { - Scope.root = null; - - function Scope(parent, expressions, method) { - this.parent = parent; - this.expressions = expressions; - this.method = method; - this.variables = [ - { - name: 'arguments', - type: 'arguments' - } - ]; - this.positions = {}; - if (!this.parent) { - Scope.root = this; - } - } - - Scope.prototype.add = function(name, type, immediate) { - if (this.shared && !immediate) { - return this.parent.add(name, type, immediate); - } - if (Object.prototype.hasOwnProperty.call(this.positions, name)) { - return this.variables[this.positions[name]].type = type; - } else { - return this.positions[name] = this.variables.push({ - name: name, - type: type - }) - 1; - } - }; - - Scope.prototype.namedMethod = function() { - var _ref1; - if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) { - return this.method; - } - return this.parent.namedMethod(); - }; - - Scope.prototype.find = function(name) { - if (this.check(name)) { - return true; - } - this.add(name, 'var'); - return false; - }; - - Scope.prototype.parameter = function(name) { - if (this.shared && this.parent.check(name, true)) { - return; - } - return this.add(name, 'param'); - }; - - Scope.prototype.check = function(name) { - var _ref1; - return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0)); - }; - - Scope.prototype.temporary = function(name, index) { - if (name.length > 1) { - return '_' + name + (index > 1 ? index - 1 : ''); - } else { - return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a'); - } - }; - - Scope.prototype.type = function(name) { - var v, _i, _len, _ref1; - _ref1 = this.variables; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.name === name) { - return v.type; - } - } - return null; - }; - - Scope.prototype.freeVariable = function(name, reserve) { - var index, temp; - if (reserve == null) { - reserve = true; - } - index = 0; - while (this.check((temp = this.temporary(name, index)))) { - index++; - } - if (reserve) { - this.add(temp, 'var', true); - } - return temp; - }; - - Scope.prototype.assign = function(name, value) { - this.add(name, { - value: value, - assigned: true - }, true); - return this.hasAssignments = true; - }; - - Scope.prototype.hasDeclarations = function() { - return !!this.declaredVariables().length; - }; - - Scope.prototype.declaredVariables = function() { - var realVars, tempVars, v, _i, _len, _ref1; - realVars = []; - tempVars = []; - _ref1 = this.variables; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.type === 'var') { - (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name); - } - } - return realVars.sort().concat(tempVars.sort()); - }; - - Scope.prototype.assignedVariables = function() { - var v, _i, _len, _ref1, _results; - _ref1 = this.variables; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.type.assigned) { - _results.push("" + v.name + " = " + v.type.value); - } - } - return _results; - }; - - return Scope; - - })(); - - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js deleted file mode 100644 index 94c9476f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +++ /dev/null @@ -1,233 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - oop.inherits(CoffeeHighlightRules, TextHighlightRules); - - function CoffeeHighlightRules() { - var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; - - var keywords = ( - "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + - "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + - "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + - "or|on|unless|until|and|yes" - ); - - var langConstant = ( - "true|false|null|undefined|NaN|Infinity" - ); - - var illegal = ( - "case|const|default|function|var|void|with|enum|export|implements|" + - "interface|let|package|private|protected|public|static|yield|" + - "__hasProp|slice|bind|indexOf" - ); - - var supportClass = ( - "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + - "SyntaxError|TypeError|URIError|" + - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" - ); - - var supportFunction = ( - "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + - "encodeURIComponent|decodeURI|decodeURIComponent|String|" - ); - - var variableLanguage = ( - "window|arguments|prototype|document" - ); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": langConstant, - "invalid.illegal": illegal, - "language.support.class": supportClass, - "language.support.function": supportFunction, - "variable.language": variableLanguage - }, "identifier"); - - var functionRule = { - token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], - regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source - }; - - var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; - - this.$rules = { - start : [ - { - token : "constant.numeric", - regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" - }, { - stateName: "qdoc", - token : "string", regex : "'''", next : [ - {token : "string", regex : "'''", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qqdoc", - token : "string", - regex : '"""', - next : [ - {token : "string", regex : '"""', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qstring", - token : "string", regex : "'", next : [ - {token : "string", regex : "'", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qqstring", - token : "string.start", regex : '"', next : [ - {token : "string.end", regex : '"', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "js", - token : "string", regex : "`", next : [ - {token : "string", regex : "`", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - regex: "[{}]", onMatch: function(val, state, stack) { - this.next = ""; - if (val == "{" && stack.length) { - stack.unshift("start", state); - return "paren"; - } - if (val == "}" && stack.length) { - stack.shift(); - this.next = stack.shift() || ""; - if (this.next.indexOf("string") != -1) - return "paren.string"; - } - return "paren"; - } - }, { - token : "string.regex", - regex : "///", - next : "heregex" - }, { - token : "string.regex", - regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ - }, { - token : "comment", - regex : "###(?!#)", - next : "comment" - }, { - token : "comment", - regex : "#.*" - }, { - token : ["punctuation.operator", "text", "identifier"], - regex : "(\\.)(\\s*)(" + illegal + ")" - }, { - token : "punctuation.operator", - regex : "\\." - }, { - //class A extends B - token : ["keyword", "text", "language.support.class", - "text", "keyword", "text", "language.support.class"], - regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" - }, { - //play = (...) -> - token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), - regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex - }, - functionRule, - { - token : "variable", - regex : "@(?:" + identifier + ")?" - }, { - token: keywordMapper, - regex : identifier - }, { - token : "punctuation.operator", - regex : "\\,|\\." - }, { - token : "storage.type", - regex : "[\\-=]>" - }, { - token : "keyword.operator", - regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" - }, { - token : "paren.lparen", - regex : "[({[]" - }, { - token : "paren.rparen", - regex : "[\\]})]" - }, { - token : "text", - regex : "\\s+" - }], - - - heregex : [{ - token : "string.regex", - regex : '.*?///[imgy]{0,4}', - next : "start" - }, { - token : "comment.regex", - regex : "\\s+(?:#.*)?" - }, { - token : "string.regex", - regex : "\\S+" - }], - - comment : [{ - token : "comment", - regex : '###', - next : "start" - }, { - defaultToken : "comment" - }] - }; - this.normalizeRules(); - } - - exports.CoffeeHighlightRules = CoffeeHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js deleted file mode 100644 index d68f1296..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +++ /dev/null @@ -1,73 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var Mirror = require("../worker/mirror").Mirror; -var coffee = require("../mode/coffee/coffee-script"); - -window.addEventListener = function() {}; - - -var Worker = exports.Worker = function(sender) { - Mirror.call(this, sender); - this.setTimeout(250); -}; - -oop.inherits(Worker, Mirror); - -(function() { - - this.onUpdate = function() { - var value = this.doc.getValue(); - var errors = []; - try { - coffee.parse(value).compile(); - } catch(e) { - var loc = e.location; - if (loc) { - errors.push({ - row: loc.first_line, - column: loc.first_column, - endRow: loc.last_line, - endColumn: loc.last_column, - text: e.message, - type: "error" - }); - } - } - this.sender.emit("annotate", errors); - }; - -}).call(Worker.prototype); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js deleted file mode 100644 index 0b4ea449..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +++ /dev/null @@ -1,61 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var HtmlMode = require("./html").Mode; -var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules; - -var voidElements = "cfabort|cfapplication|cfargument|cfassociate|cfbreak|cfcache|cfcollection|cfcookie|cfdbinfo|cfdirectory|cfdump|cfelse|cfelseif|cferror|cfexchangecalendar|cfexchangeconnection|cfexchangecontact|cfexchangefilter|cfexchangetask|cfexit|cffeed|cffile|cfflush|cfftp|cfheader|cfhtmlhead|cfhttpparam|cfimage|cfimport|cfinclude|cfindex|cfinsert|cfinvokeargument|cflocation|cflog|cfmailparam|cfNTauthenticate|cfobject|cfobjectcache|cfparam|cfpdfformparam|cfprint|cfprocparam|cfprocresult|cfproperty|cfqueryparam|cfregistry|cfreportparam|cfrethrow|cfreturn|cfschedule|cfsearch|cfset|cfsetting|cfthrow|cfzipparam)".split("|"); - -var Mode = function() { - HtmlMode.call(this); - - this.HighlightRules = ColdfusionHighlightRules; -}; -oop.inherits(Mode, HtmlMode); - -(function() { - - // mix with html void elements - this.voidElements = oop.mixin(lang.arrayToMap(voidElements), this.voidElements); - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - - this.$id = "ace/mode/coldfusion"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js deleted file mode 100644 index 5feff6d6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +++ /dev/null @@ -1,49 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - -var ColdfusionHighlightRules = function() { - HtmlHighlightRules.call(this); - - this.embedTagRules(JavaScriptHighlightRules, "cfjs-", "cfscript"); - - this.normalizeRules(); -}; - -oop.inherits(ColdfusionHighlightRules, HtmlHighlightRules); - -exports.ColdfusionHighlightRules = ColdfusionHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js deleted file mode 100644 index b55fb1c5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +++ /dev/null @@ -1,67 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("../edit_session").EditSession; -var Range = require("../range").Range; -var ColdfusionMode = require("./coldfusion").Mode; -var assert = require("../test/assertions"); - -module.exports = { - setUp : function() { - this.mode = new ColdfusionMode(); - }, - - "test: toggle comment lines" : function() { - var session = new EditSession([" abc", " cde", "fg"]); - - var range = new Range(0, 3, 1, 1); - var comment = this.mode.toggleCommentLines("start", session, 0, 1); - assert.equal([" ", " ", "fg"].join("\n"), session.toString()); - }, - - "test: next line indent should be the same as the current line indent" : function() { - assert.equal(" ", this.mode.getNextLineIndent("start", " abc")); - assert.equal("", this.mode.getNextLineIndent("start", "abc")); - assert.equal("\t", this.mode.getNextLineIndent("start", "\tabc")); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js deleted file mode 100644 index a3b2964f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +++ /dev/null @@ -1,61 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/csharp").FoldMode; - -var Mode = function() { - this.HighlightRules = CSharpHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; - - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - - this.createWorker = function(session) { - return null; - }; - - this.$id = "ace/mode/csharp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js deleted file mode 100644 index 6e7ba5d4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +++ /dev/null @@ -1,93 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var CSharpHighlightRules = function() { - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": "abstract|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic", - "constant.language": "null|true|false" - }, "identifier"); - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, { - token : "string", // character - regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))'/ - }, { - token : "string", start : '"', end : '"|$', next: [ - {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, - {token: "invalid", regex: /\\./} - ] - }, { - token : "string", start : '@"', end : '"', next:[ - {token: "constant.language.escape", regex: '""'} - ] - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "keyword.operator", - regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "keyword", - regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); - this.normalizeRules(); -}; - -oop.inherits(CSharpHighlightRules, TextHighlightRules); - -exports.CSharpHighlightRules = CSharpHighlightRules; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js deleted file mode 100644 index 6fef5ccd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +++ /dev/null @@ -1,100 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = CssHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - // ignore braces in comments - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - 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); - }; - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("annotate", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/css"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js deleted file mode 100644 index c3c79a80..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +++ /dev/null @@ -1,9628 +0,0 @@ -define(function(require, exports, module) { -/*! -CSSLint -Copyright (c) 2014 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the 'Software'), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ -/* Build: v0.10.0 22-July-2014 01:17:52 */ -/*! -Parser-Lib -Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ -/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ -var parserlib = {}; -(function(){ - -/** - * A generic base to inherit from for any object - * that needs event handling. - * @class EventTarget - * @constructor - */ -function EventTarget(){ - - /** - * The array of listeners for various events. - * @type Object - * @property _listeners - * @private - */ - this._listeners = {}; -} - -EventTarget.prototype = { - - //restore constructor - constructor: EventTarget, - - /** - * Adds a listener for a given event type. - * @param {String} type The type of event to add a listener for. - * @param {Function} listener The function to call when the event occurs. - * @return {void} - * @method addListener - */ - addListener: function(type, listener){ - if (!this._listeners[type]){ - this._listeners[type] = []; - } - - this._listeners[type].push(listener); - }, - - /** - * Fires an event based on the passed-in object. - * @param {Object|String} event An object with at least a 'type' attribute - * or a string indicating the event name. - * @return {void} - * @method fire - */ - fire: function(event){ - if (typeof event == "string"){ - event = { type: event }; - } - if (typeof event.target != "undefined"){ - event.target = this; - } - - if (typeof event.type == "undefined"){ - throw new Error("Event object missing 'type' property."); - } - - if (this._listeners[event.type]){ - - //create a copy of the array and use that so listeners can't chane - var listeners = this._listeners[event.type].concat(); - for (var i=0, len=listeners.length; i < len; i++){ - listeners[i].call(this, event); - } - } - }, - - /** - * Removes a listener for a given event type. - * @param {String} type The type of event to remove a listener from. - * @param {Function} listener The function to remove from the event. - * @return {void} - * @method removeListener - */ - removeListener: function(type, listener){ - if (this._listeners[type]){ - var listeners = this._listeners[type]; - for (var i=0, len=listeners.length; i < len; i++){ - if (listeners[i] === listener){ - listeners.splice(i, 1); - break; - } - } - - - } - } -}; -/** - * Convenient way to read through strings. - * @namespace parserlib.util - * @class StringReader - * @constructor - * @param {String} text The text to read. - */ -function StringReader(text){ - - /** - * The input text with line endings normalized. - * @property _input - * @type String - * @private - */ - this._input = text.replace(/\n\r?/g, "\n"); - - - /** - * The row for the character to be read next. - * @property _line - * @type int - * @private - */ - this._line = 1; - - - /** - * The column for the character to be read next. - * @property _col - * @type int - * @private - */ - this._col = 1; - - /** - * The index of the character in the input to be read next. - * @property _cursor - * @type int - * @private - */ - this._cursor = 0; -} - -StringReader.prototype = { - - //restore constructor - constructor: StringReader, - - //------------------------------------------------------------------------- - // Position info - //------------------------------------------------------------------------- - - /** - * Returns the column of the character to be read next. - * @return {int} The column of the character to be read next. - * @method getCol - */ - getCol: function(){ - return this._col; - }, - - /** - * Returns the row of the character to be read next. - * @return {int} The row of the character to be read next. - * @method getLine - */ - getLine: function(){ - return this._line ; - }, - - /** - * Determines if you're at the end of the input. - * @return {Boolean} True if there's no more input, false otherwise. - * @method eof - */ - eof: function(){ - return (this._cursor == this._input.length); - }, - - //------------------------------------------------------------------------- - // Basic reading - //------------------------------------------------------------------------- - - /** - * Reads the next character without advancing the cursor. - * @param {int} count How many characters to look ahead (default is 1). - * @return {String} The next character or null if there is no next character. - * @method peek - */ - peek: function(count){ - var c = null; - count = (typeof count == "undefined" ? 1 : count); - - //if we're not at the end of the input... - if (this._cursor < this._input.length){ - - //get character and increment cursor and column - c = this._input.charAt(this._cursor + count - 1); - } - - return c; - }, - - /** - * Reads the next character from the input and adjusts the row and column - * accordingly. - * @return {String} The next character or null if there is no next character. - * @method read - */ - read: function(){ - var c = null; - - //if we're not at the end of the input... - if (this._cursor < this._input.length){ - - //if the last character was a newline, increment row count - //and reset column count - if (this._input.charAt(this._cursor) == "\n"){ - this._line++; - this._col=1; - } else { - this._col++; - } - - //get character and increment cursor and column - c = this._input.charAt(this._cursor++); - } - - return c; - }, - - //------------------------------------------------------------------------- - // Misc - //------------------------------------------------------------------------- - - /** - * Saves the current location so it can be returned to later. - * @method mark - * @return {void} - */ - mark: function(){ - this._bookmark = { - cursor: this._cursor, - line: this._line, - col: this._col - }; - }, - - reset: function(){ - if (this._bookmark){ - this._cursor = this._bookmark.cursor; - this._line = this._bookmark.line; - this._col = this._bookmark.col; - delete this._bookmark; - } - }, - - //------------------------------------------------------------------------- - // Advanced reading - //------------------------------------------------------------------------- - - /** - * Reads up to and including the given string. Throws an error if that - * string is not found. - * @param {String} pattern The string to read. - * @return {String} The string when it is found. - * @throws Error when the string pattern is not found. - * @method readTo - */ - readTo: function(pattern){ - - var buffer = "", - c; - - /* - * First, buffer must be the same length as the pattern. - * Then, buffer must end with the pattern or else reach the - * end of the input. - */ - while (buffer.length < pattern.length || buffer.lastIndexOf(pattern) != buffer.length - pattern.length){ - c = this.read(); - if (c){ - buffer += c; - } else { - throw new Error("Expected \"" + pattern + "\" at line " + this._line + ", col " + this._col + "."); - } - } - - return buffer; - - }, - - /** - * Reads characters while each character causes the given - * filter function to return true. The function is passed - * in each character and either returns true to continue - * reading or false to stop. - * @param {Function} filter The function to read on each character. - * @return {String} The string made up of all characters that passed the - * filter check. - * @method readWhile - */ - readWhile: function(filter){ - - var buffer = "", - c = this.read(); - - while(c !== null && filter(c)){ - buffer += c; - c = this.read(); - } - - return buffer; - - }, - - /** - * Reads characters that match either text or a regular expression and - * returns those characters. If a match is found, the row and column - * are adjusted; if no match is found, the reader's state is unchanged. - * reading or false to stop. - * @param {String|RegExp} matchter If a string, then the literal string - * value is searched for. If a regular expression, then any string - * matching the pattern is search for. - * @return {String} The string made up of all characters that matched or - * null if there was no match. - * @method readMatch - */ - readMatch: function(matcher){ - - var source = this._input.substring(this._cursor), - value = null; - - //if it's a string, just do a straight match - if (typeof matcher == "string"){ - if (source.indexOf(matcher) === 0){ - value = this.readCount(matcher.length); - } - } else if (matcher instanceof RegExp){ - if (matcher.test(source)){ - value = this.readCount(RegExp.lastMatch.length); - } - } - - return value; - }, - - - /** - * Reads a given number of characters. If the end of the input is reached, - * it reads only the remaining characters and does not throw an error. - * @param {int} count The number of characters to read. - * @return {String} The string made up the read characters. - * @method readCount - */ - readCount: function(count){ - var buffer = ""; - - while(count--){ - buffer += this.read(); - } - - return buffer; - } - -}; -/** - * Type to use when a syntax error occurs. - * @class SyntaxError - * @namespace parserlib.util - * @constructor - * @param {String} message The error message. - * @param {int} line The line at which the error occurred. - * @param {int} col The column at which the error occurred. - */ -function SyntaxError(message, line, col){ - - /** - * The column at which the error occurred. - * @type int - * @property col - */ - this.col = col; - - /** - * The line at which the error occurred. - * @type int - * @property line - */ - this.line = line; - - /** - * The text representation of the unit. - * @type String - * @property text - */ - this.message = message; - -} - -//inherit from Error -SyntaxError.prototype = new Error(); -/** - * Base type to represent a single syntactic unit. - * @class SyntaxUnit - * @namespace parserlib.util - * @constructor - * @param {String} text The text of the unit. - * @param {int} line The line of text on which the unit resides. - * @param {int} col The column of text on which the unit resides. - */ -function SyntaxUnit(text, line, col, type){ - - - /** - * The column of text on which the unit resides. - * @type int - * @property col - */ - this.col = col; - - /** - * The line of text on which the unit resides. - * @type int - * @property line - */ - this.line = line; - - /** - * The text representation of the unit. - * @type String - * @property text - */ - this.text = text; - - /** - * The type of syntax unit. - * @type int - * @property type - */ - this.type = type; -} - -/** - * Create a new syntax unit based solely on the given token. - * Convenience method for creating a new syntax unit when - * it represents a single token instead of multiple. - * @param {Object} token The token object to represent. - * @return {parserlib.util.SyntaxUnit} The object representing the token. - * @static - * @method fromToken - */ -SyntaxUnit.fromToken = function(token){ - return new SyntaxUnit(token.value, token.startLine, token.startCol); -}; - -SyntaxUnit.prototype = { - - //restore constructor - constructor: SyntaxUnit, - - /** - * Returns the text representation of the unit. - * @return {String} The text representation of the unit. - * @method valueOf - */ - valueOf: function(){ - return this.text; - }, - - /** - * Returns the text representation of the unit. - * @return {String} The text representation of the unit. - * @method toString - */ - toString: function(){ - return this.text; - } - -}; -/*global StringReader, SyntaxError*/ - -/** - * Generic TokenStream providing base functionality. - * @class TokenStreamBase - * @namespace parserlib.util - * @constructor - * @param {String|StringReader} input The text to tokenize or a reader from - * which to read the input. - */ -function TokenStreamBase(input, tokenData){ - - /** - * The string reader for easy access to the text. - * @type StringReader - * @property _reader - * @private - */ - this._reader = input ? new StringReader(input.toString()) : null; - - /** - * Token object for the last consumed token. - * @type Token - * @property _token - * @private - */ - this._token = null; - - /** - * The array of token information. - * @type Array - * @property _tokenData - * @private - */ - this._tokenData = tokenData; - - /** - * Lookahead token buffer. - * @type Array - * @property _lt - * @private - */ - this._lt = []; - - /** - * Lookahead token buffer index. - * @type int - * @property _ltIndex - * @private - */ - this._ltIndex = 0; - - this._ltIndexCache = []; -} - -/** - * Accepts an array of token information and outputs - * an array of token data containing key-value mappings - * and matching functions that the TokenStream needs. - * @param {Array} tokens An array of token descriptors. - * @return {Array} An array of processed token data. - * @method createTokenData - * @static - */ -TokenStreamBase.createTokenData = function(tokens){ - - var nameMap = [], - typeMap = {}, - tokenData = tokens.concat([]), - i = 0, - len = tokenData.length+1; - - tokenData.UNKNOWN = -1; - tokenData.unshift({name:"EOF"}); - - for (; i < len; i++){ - nameMap.push(tokenData[i].name); - tokenData[tokenData[i].name] = i; - if (tokenData[i].text){ - typeMap[tokenData[i].text] = i; - } - } - - tokenData.name = function(tt){ - return nameMap[tt]; - }; - - tokenData.type = function(c){ - return typeMap[c]; - }; - - return tokenData; -}; - -TokenStreamBase.prototype = { - - //restore constructor - constructor: TokenStreamBase, - - //------------------------------------------------------------------------- - // Matching methods - //------------------------------------------------------------------------- - - /** - * Determines if the next token matches the given token type. - * If so, that token is consumed; if not, the token is placed - * back onto the token stream. You can pass in any number of - * token types and this will return true if any of the token - * types is found. - * @param {int|int[]} tokenTypes Either a single token type or an array of - * token types that the next token might be. If an array is passed, - * it's assumed that the token can be any of these. - * @param {variant} channel (Optional) The channel to read from. If not - * provided, reads from the default (unnamed) channel. - * @return {Boolean} True if the token type matches, false if not. - * @method match - */ - match: function(tokenTypes, channel){ - - //always convert to an array, makes things easier - if (!(tokenTypes instanceof Array)){ - tokenTypes = [tokenTypes]; - } - - var tt = this.get(channel), - i = 0, - len = tokenTypes.length; - - while(i < len){ - if (tt == tokenTypes[i++]){ - return true; - } - } - - //no match found, put the token back - this.unget(); - return false; - }, - - /** - * Determines if the next token matches the given token type. - * If so, that token is consumed; if not, an error is thrown. - * @param {int|int[]} tokenTypes Either a single token type or an array of - * token types that the next token should be. If an array is passed, - * it's assumed that the token must be one of these. - * @param {variant} channel (Optional) The channel to read from. If not - * provided, reads from the default (unnamed) channel. - * @return {void} - * @method mustMatch - */ - mustMatch: function(tokenTypes, channel){ - - var token; - - //always convert to an array, makes things easier - if (!(tokenTypes instanceof Array)){ - tokenTypes = [tokenTypes]; - } - - if (!this.match.apply(this, arguments)){ - token = this.LT(1); - throw new SyntaxError("Expected " + this._tokenData[tokenTypes[0]].name + - " at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); - } - }, - - //------------------------------------------------------------------------- - // Consuming methods - //------------------------------------------------------------------------- - - /** - * Keeps reading from the token stream until either one of the specified - * token types is found or until the end of the input is reached. - * @param {int|int[]} tokenTypes Either a single token type or an array of - * token types that the next token should be. If an array is passed, - * it's assumed that the token must be one of these. - * @param {variant} channel (Optional) The channel to read from. If not - * provided, reads from the default (unnamed) channel. - * @return {void} - * @method advance - */ - advance: function(tokenTypes, channel){ - - while(this.LA(0) !== 0 && !this.match(tokenTypes, channel)){ - this.get(); - } - - return this.LA(0); - }, - - /** - * Consumes the next token from the token stream. - * @return {int} The token type of the token that was just consumed. - * @method get - */ - get: function(channel){ - - var tokenInfo = this._tokenData, - reader = this._reader, - value, - i =0, - len = tokenInfo.length, - found = false, - token, - info; - - //check the lookahead buffer first - if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length){ - - i++; - this._token = this._lt[this._ltIndex++]; - info = tokenInfo[this._token.type]; - - //obey channels logic - while((info.channel !== undefined && channel !== info.channel) && - this._ltIndex < this._lt.length){ - this._token = this._lt[this._ltIndex++]; - info = tokenInfo[this._token.type]; - i++; - } - - //here be dragons - if ((info.channel === undefined || channel === info.channel) && - this._ltIndex <= this._lt.length){ - this._ltIndexCache.push(i); - return this._token.type; - } - } - - //call token retriever method - token = this._getToken(); - - //if it should be hidden, don't save a token - if (token.type > -1 && !tokenInfo[token.type].hide){ - - //apply token channel - token.channel = tokenInfo[token.type].channel; - - //save for later - this._token = token; - this._lt.push(token); - - //save space that will be moved (must be done before array is truncated) - this._ltIndexCache.push(this._lt.length - this._ltIndex + i); - - //keep the buffer under 5 items - if (this._lt.length > 5){ - this._lt.shift(); - } - - //also keep the shift buffer under 5 items - if (this._ltIndexCache.length > 5){ - this._ltIndexCache.shift(); - } - - //update lookahead index - this._ltIndex = this._lt.length; - } - - /* - * Skip to the next token if: - * 1. The token type is marked as hidden. - * 2. The token type has a channel specified and it isn't the current channel. - */ - info = tokenInfo[token.type]; - if (info && - (info.hide || - (info.channel !== undefined && channel !== info.channel))){ - return this.get(channel); - } else { - //return just the type - return token.type; - } - }, - - /** - * Looks ahead a certain number of tokens and returns the token type at - * that position. This will throw an error if you lookahead past the - * end of input, past the size of the lookahead buffer, or back past - * the first token in the lookahead buffer. - * @param {int} The index of the token type to retrieve. 0 for the - * current token, 1 for the next, -1 for the previous, etc. - * @return {int} The token type of the token in the given position. - * @method LA - */ - LA: function(index){ - var total = index, - tt; - if (index > 0){ - //TODO: Store 5 somewhere - if (index > 5){ - throw new Error("Too much lookahead."); - } - - //get all those tokens - while(total){ - tt = this.get(); - total--; - } - - //unget all those tokens - while(total < index){ - this.unget(); - total++; - } - } else if (index < 0){ - - if(this._lt[this._ltIndex+index]){ - tt = this._lt[this._ltIndex+index].type; - } else { - throw new Error("Too much lookbehind."); - } - - } else { - tt = this._token.type; - } - - return tt; - - }, - - /** - * Looks ahead a certain number of tokens and returns the token at - * that position. This will throw an error if you lookahead past the - * end of input, past the size of the lookahead buffer, or back past - * the first token in the lookahead buffer. - * @param {int} The index of the token type to retrieve. 0 for the - * current token, 1 for the next, -1 for the previous, etc. - * @return {Object} The token of the token in the given position. - * @method LA - */ - LT: function(index){ - - //lookahead first to prime the token buffer - this.LA(index); - - //now find the token, subtract one because _ltIndex is already at the next index - return this._lt[this._ltIndex+index-1]; - }, - - /** - * Returns the token type for the next token in the stream without - * consuming it. - * @return {int} The token type of the next token in the stream. - * @method peek - */ - peek: function(){ - return this.LA(1); - }, - - /** - * Returns the actual token object for the last consumed token. - * @return {Token} The token object for the last consumed token. - * @method token - */ - token: function(){ - return this._token; - }, - - /** - * Returns the name of the token for the given token type. - * @param {int} tokenType The type of token to get the name of. - * @return {String} The name of the token or "UNKNOWN_TOKEN" for any - * invalid token type. - * @method tokenName - */ - tokenName: function(tokenType){ - if (tokenType < 0 || tokenType > this._tokenData.length){ - return "UNKNOWN_TOKEN"; - } else { - return this._tokenData[tokenType].name; - } - }, - - /** - * Returns the token type value for the given token name. - * @param {String} tokenName The name of the token whose value should be returned. - * @return {int} The token type value for the given token name or -1 - * for an unknown token. - * @method tokenName - */ - tokenType: function(tokenName){ - return this._tokenData[tokenName] || -1; - }, - - /** - * Returns the last consumed token to the token stream. - * @method unget - */ - unget: function(){ - //if (this._ltIndex > -1){ - if (this._ltIndexCache.length){ - this._ltIndex -= this._ltIndexCache.pop();//--; - this._token = this._lt[this._ltIndex - 1]; - } else { - throw new Error("Too much lookahead."); - } - } - -}; - - -parserlib.util = { -StringReader: StringReader, -SyntaxError : SyntaxError, -SyntaxUnit : SyntaxUnit, -EventTarget : EventTarget, -TokenStreamBase : TokenStreamBase -}; -})(); -/* -Parser-Lib -Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ -/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ -(function(){ -var EventTarget = parserlib.util.EventTarget, -TokenStreamBase = parserlib.util.TokenStreamBase, -StringReader = parserlib.util.StringReader, -SyntaxError = parserlib.util.SyntaxError, -SyntaxUnit = parserlib.util.SyntaxUnit; - -var Colors = { - aliceblue :"#f0f8ff", - antiquewhite :"#faebd7", - aqua :"#00ffff", - aquamarine :"#7fffd4", - azure :"#f0ffff", - beige :"#f5f5dc", - bisque :"#ffe4c4", - black :"#000000", - blanchedalmond :"#ffebcd", - blue :"#0000ff", - blueviolet :"#8a2be2", - brown :"#a52a2a", - burlywood :"#deb887", - cadetblue :"#5f9ea0", - chartreuse :"#7fff00", - chocolate :"#d2691e", - coral :"#ff7f50", - cornflowerblue :"#6495ed", - cornsilk :"#fff8dc", - crimson :"#dc143c", - cyan :"#00ffff", - darkblue :"#00008b", - darkcyan :"#008b8b", - darkgoldenrod :"#b8860b", - darkgray :"#a9a9a9", - darkgrey :"#a9a9a9", - darkgreen :"#006400", - darkkhaki :"#bdb76b", - darkmagenta :"#8b008b", - darkolivegreen :"#556b2f", - darkorange :"#ff8c00", - darkorchid :"#9932cc", - darkred :"#8b0000", - darksalmon :"#e9967a", - darkseagreen :"#8fbc8f", - darkslateblue :"#483d8b", - darkslategray :"#2f4f4f", - darkslategrey :"#2f4f4f", - darkturquoise :"#00ced1", - darkviolet :"#9400d3", - deeppink :"#ff1493", - deepskyblue :"#00bfff", - dimgray :"#696969", - dimgrey :"#696969", - dodgerblue :"#1e90ff", - firebrick :"#b22222", - floralwhite :"#fffaf0", - forestgreen :"#228b22", - fuchsia :"#ff00ff", - gainsboro :"#dcdcdc", - ghostwhite :"#f8f8ff", - gold :"#ffd700", - goldenrod :"#daa520", - gray :"#808080", - grey :"#808080", - green :"#008000", - greenyellow :"#adff2f", - honeydew :"#f0fff0", - hotpink :"#ff69b4", - indianred :"#cd5c5c", - indigo :"#4b0082", - ivory :"#fffff0", - khaki :"#f0e68c", - lavender :"#e6e6fa", - lavenderblush :"#fff0f5", - lawngreen :"#7cfc00", - lemonchiffon :"#fffacd", - lightblue :"#add8e6", - lightcoral :"#f08080", - lightcyan :"#e0ffff", - lightgoldenrodyellow :"#fafad2", - lightgray :"#d3d3d3", - lightgrey :"#d3d3d3", - lightgreen :"#90ee90", - lightpink :"#ffb6c1", - lightsalmon :"#ffa07a", - lightseagreen :"#20b2aa", - lightskyblue :"#87cefa", - lightslategray :"#778899", - lightslategrey :"#778899", - lightsteelblue :"#b0c4de", - lightyellow :"#ffffe0", - lime :"#00ff00", - limegreen :"#32cd32", - linen :"#faf0e6", - magenta :"#ff00ff", - maroon :"#800000", - mediumaquamarine:"#66cdaa", - mediumblue :"#0000cd", - mediumorchid :"#ba55d3", - mediumpurple :"#9370d8", - mediumseagreen :"#3cb371", - mediumslateblue :"#7b68ee", - mediumspringgreen :"#00fa9a", - mediumturquoise :"#48d1cc", - mediumvioletred :"#c71585", - midnightblue :"#191970", - mintcream :"#f5fffa", - mistyrose :"#ffe4e1", - moccasin :"#ffe4b5", - navajowhite :"#ffdead", - navy :"#000080", - oldlace :"#fdf5e6", - olive :"#808000", - olivedrab :"#6b8e23", - orange :"#ffa500", - orangered :"#ff4500", - orchid :"#da70d6", - palegoldenrod :"#eee8aa", - palegreen :"#98fb98", - paleturquoise :"#afeeee", - palevioletred :"#d87093", - papayawhip :"#ffefd5", - peachpuff :"#ffdab9", - peru :"#cd853f", - pink :"#ffc0cb", - plum :"#dda0dd", - powderblue :"#b0e0e6", - purple :"#800080", - red :"#ff0000", - rosybrown :"#bc8f8f", - royalblue :"#4169e1", - saddlebrown :"#8b4513", - salmon :"#fa8072", - sandybrown :"#f4a460", - seagreen :"#2e8b57", - seashell :"#fff5ee", - sienna :"#a0522d", - silver :"#c0c0c0", - skyblue :"#87ceeb", - slateblue :"#6a5acd", - slategray :"#708090", - slategrey :"#708090", - snow :"#fffafa", - springgreen :"#00ff7f", - steelblue :"#4682b4", - tan :"#d2b48c", - teal :"#008080", - thistle :"#d8bfd8", - tomato :"#ff6347", - turquoise :"#40e0d0", - violet :"#ee82ee", - wheat :"#f5deb3", - white :"#ffffff", - whitesmoke :"#f5f5f5", - yellow :"#ffff00", - yellowgreen :"#9acd32", - //CSS2 system colors http://www.w3.org/TR/css3-color/#css2-system - activeBorder :"Active window border.", - activecaption :"Active window caption.", - appworkspace :"Background color of multiple document interface.", - background :"Desktop background.", - buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttontext :"Text on push buttons.", - captiontext :"Text in caption, size box, and scrollbar arrow box.", - graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.", - greytext :"Greyed (disabled) text. This color is set to #000 if the current display driver does not support a solid grey color.", - highlight :"Item(s) selected in a control.", - highlighttext :"Text of item(s) selected in a control.", - inactiveborder :"Inactive window border.", - inactivecaption :"Inactive window caption.", - inactivecaptiontext :"Color of text in an inactive caption.", - infobackground :"Background color for tooltip controls.", - infotext :"Text color for tooltip controls.", - menu :"Menu background.", - menutext :"Text in menus.", - scrollbar :"Scroll bar gray area.", - threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - window :"Window background.", - windowframe :"Window frame.", - windowtext :"Text in windows." -}; -/*global SyntaxUnit, Parser*/ -/** - * Represents a selector combinator (whitespace, +, >). - * @namespace parserlib.css - * @class Combinator - * @extends parserlib.util.SyntaxUnit - * @constructor - * @param {String} text The text representation of the unit. - * @param {int} line The line of text on which the unit resides. - * @param {int} col The column of text on which the unit resides. - */ -function Combinator(text, line, col){ - - SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE); - - /** - * The type of modifier. - * @type String - * @property type - */ - this.type = "unknown"; - - //pretty simple - if (/^\s+$/.test(text)){ - this.type = "descendant"; - } else if (text == ">"){ - this.type = "child"; - } else if (text == "+"){ - this.type = "adjacent-sibling"; - } else if (text == "~"){ - this.type = "sibling"; - } - -} - -Combinator.prototype = new SyntaxUnit(); -Combinator.prototype.constructor = Combinator; - -/*global SyntaxUnit, Parser*/ -/** - * Represents a media feature, such as max-width:500. - * @namespace parserlib.css - * @class MediaFeature - * @extends parserlib.util.SyntaxUnit - * @constructor - * @param {SyntaxUnit} name The name of the feature. - * @param {SyntaxUnit} value The value of the feature or null if none. - */ -function MediaFeature(name, value){ - - SyntaxUnit.call(this, "(" + name + (value !== null ? ":" + value : "") + ")", name.startLine, name.startCol, Parser.MEDIA_FEATURE_TYPE); - - /** - * The name of the media feature - * @type String - * @property name - */ - this.name = name; - - /** - * The value for the feature or null if there is none. - * @type SyntaxUnit - * @property value - */ - this.value = value; -} - -MediaFeature.prototype = new SyntaxUnit(); -MediaFeature.prototype.constructor = MediaFeature; - -/*global SyntaxUnit, Parser*/ -/** - * Represents an individual media query. - * @namespace parserlib.css - * @class MediaQuery - * @extends parserlib.util.SyntaxUnit - * @constructor - * @param {String} modifier The modifier "not" or "only" (or null). - * @param {String} mediaType The type of media (i.e., "print"). - * @param {Array} parts Array of selectors parts making up this selector. - * @param {int} line The line of text on which the unit resides. - * @param {int} col The column of text on which the unit resides. - */ -function MediaQuery(modifier, mediaType, features, line, col){ - - SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE); - - /** - * The media modifier ("not" or "only") - * @type String - * @property modifier - */ - this.modifier = modifier; - - /** - * The mediaType (i.e., "print") - * @type String - * @property mediaType - */ - this.mediaType = mediaType; - - /** - * The parts that make up the selector. - * @type Array - * @property features - */ - this.features = features; - -} - -MediaQuery.prototype = new SyntaxUnit(); -MediaQuery.prototype.constructor = MediaQuery; - -/*global Tokens, TokenStream, SyntaxError, Properties, Validation, ValidationError, SyntaxUnit, - PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart, Selector, - PropertyName, Combinator, MediaFeature, MediaQuery, EventTarget */ - -/** - * A CSS3 parser. - * @namespace parserlib.css - * @class Parser - * @constructor - * @param {Object} options (Optional) Various options for the parser: - * starHack (true|false) to allow IE6 star hack as valid, - * underscoreHack (true|false) to interpret leading underscores - * as IE6-7 targeting for known properties, ieFilters (true|false) - * to indicate that IE < 8 filters should be accepted and not throw - * syntax errors. - */ -function Parser(options){ - - //inherit event functionality - EventTarget.call(this); - - - this.options = options || {}; - - this._tokenStream = null; -} - -//Static constants -Parser.DEFAULT_TYPE = 0; -Parser.COMBINATOR_TYPE = 1; -Parser.MEDIA_FEATURE_TYPE = 2; -Parser.MEDIA_QUERY_TYPE = 3; -Parser.PROPERTY_NAME_TYPE = 4; -Parser.PROPERTY_VALUE_TYPE = 5; -Parser.PROPERTY_VALUE_PART_TYPE = 6; -Parser.SELECTOR_TYPE = 7; -Parser.SELECTOR_PART_TYPE = 8; -Parser.SELECTOR_SUB_PART_TYPE = 9; - -Parser.prototype = function(){ - - var proto = new EventTarget(), //new prototype - prop, - additions = { - - //restore constructor - constructor: Parser, - - //instance constants - yuck - DEFAULT_TYPE : 0, - COMBINATOR_TYPE : 1, - MEDIA_FEATURE_TYPE : 2, - MEDIA_QUERY_TYPE : 3, - PROPERTY_NAME_TYPE : 4, - PROPERTY_VALUE_TYPE : 5, - PROPERTY_VALUE_PART_TYPE : 6, - SELECTOR_TYPE : 7, - SELECTOR_PART_TYPE : 8, - SELECTOR_SUB_PART_TYPE : 9, - - //----------------------------------------------------------------- - // Grammar - //----------------------------------------------------------------- - - _stylesheet: function(){ - - /* - * stylesheet - * : [ CHARSET_SYM S* STRING S* ';' ]? - * [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* - * [ namespace [S|CDO|CDC]* ]* - * [ [ ruleset | media | page | font_face | keyframes ] [S|CDO|CDC]* ]* - * ; - */ - - var tokenStream = this._tokenStream, - charset = null, - count, - token, - tt; - - this.fire("startstylesheet"); - - //try to read character set - this._charset(); - - this._skipCruft(); - - //try to read imports - may be more than one - while (tokenStream.peek() == Tokens.IMPORT_SYM){ - this._import(); - this._skipCruft(); - } - - //try to read namespaces - may be more than one - while (tokenStream.peek() == Tokens.NAMESPACE_SYM){ - this._namespace(); - this._skipCruft(); - } - - //get the next token - tt = tokenStream.peek(); - - //try to read the rest - while(tt > Tokens.EOF){ - - try { - - switch(tt){ - case Tokens.MEDIA_SYM: - this._media(); - this._skipCruft(); - break; - case Tokens.PAGE_SYM: - this._page(); - this._skipCruft(); - break; - case Tokens.FONT_FACE_SYM: - this._font_face(); - this._skipCruft(); - break; - case Tokens.KEYFRAMES_SYM: - this._keyframes(); - this._skipCruft(); - break; - case Tokens.VIEWPORT_SYM: - this._viewport(); - this._skipCruft(); - break; - case Tokens.UNKNOWN_SYM: //unknown @ rule - tokenStream.get(); - if (!this.options.strict){ - - //fire error event - this.fire({ - type: "error", - error: null, - message: "Unknown @ rule: " + tokenStream.LT(0).value + ".", - line: tokenStream.LT(0).startLine, - col: tokenStream.LT(0).startCol - }); - - //skip braces - count=0; - while (tokenStream.advance([Tokens.LBRACE, Tokens.RBRACE]) == Tokens.LBRACE){ - count++; //keep track of nesting depth - } - - while(count){ - tokenStream.advance([Tokens.RBRACE]); - count--; - } - - } else { - //not a syntax error, rethrow it - throw new SyntaxError("Unknown @ rule.", tokenStream.LT(0).startLine, tokenStream.LT(0).startCol); - } - break; - case Tokens.S: - this._readWhitespace(); - break; - default: - if(!this._ruleset()){ - - //error handling for known issues - switch(tt){ - case Tokens.CHARSET_SYM: - token = tokenStream.LT(1); - this._charset(false); - throw new SyntaxError("@charset not allowed here.", token.startLine, token.startCol); - case Tokens.IMPORT_SYM: - token = tokenStream.LT(1); - this._import(false); - throw new SyntaxError("@import not allowed here.", token.startLine, token.startCol); - case Tokens.NAMESPACE_SYM: - token = tokenStream.LT(1); - this._namespace(false); - throw new SyntaxError("@namespace not allowed here.", token.startLine, token.startCol); - default: - tokenStream.get(); //get the last token - this._unexpectedToken(tokenStream.token()); - } - - } - } - } catch(ex) { - if (ex instanceof SyntaxError && !this.options.strict){ - this.fire({ - type: "error", - error: ex, - message: ex.message, - line: ex.line, - col: ex.col - }); - } else { - throw ex; - } - } - - tt = tokenStream.peek(); - } - - if (tt != Tokens.EOF){ - this._unexpectedToken(tokenStream.token()); - } - - this.fire("endstylesheet"); - }, - - _charset: function(emit){ - var tokenStream = this._tokenStream, - charset, - token, - line, - col; - - if (tokenStream.match(Tokens.CHARSET_SYM)){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.STRING); - - token = tokenStream.token(); - charset = token.value; - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.SEMICOLON); - - if (emit !== false){ - this.fire({ - type: "charset", - charset:charset, - line: line, - col: col - }); - } - } - }, - - _import: function(emit){ - /* - * import - * : IMPORT_SYM S* - * [STRING|URI] S* media_query_list? ';' S* - */ - - var tokenStream = this._tokenStream, - tt, - uri, - importToken, - mediaList = []; - - //read import symbol - tokenStream.mustMatch(Tokens.IMPORT_SYM); - importToken = tokenStream.token(); - this._readWhitespace(); - - tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); - - //grab the URI value - uri = tokenStream.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/, "$1"); - - this._readWhitespace(); - - mediaList = this._media_query_list(); - - //must end with a semicolon - tokenStream.mustMatch(Tokens.SEMICOLON); - this._readWhitespace(); - - if (emit !== false){ - this.fire({ - type: "import", - uri: uri, - media: mediaList, - line: importToken.startLine, - col: importToken.startCol - }); - } - - }, - - _namespace: function(emit){ - /* - * namespace - * : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S* - */ - - var tokenStream = this._tokenStream, - line, - col, - prefix, - uri; - - //read import symbol - tokenStream.mustMatch(Tokens.NAMESPACE_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - this._readWhitespace(); - - //it's a namespace prefix - no _namespace_prefix() method because it's just an IDENT - if (tokenStream.match(Tokens.IDENT)){ - prefix = tokenStream.token().value; - this._readWhitespace(); - } - - tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); - /*if (!tokenStream.match(Tokens.STRING)){ - tokenStream.mustMatch(Tokens.URI); - }*/ - - //grab the URI value - uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); - - this._readWhitespace(); - - //must end with a semicolon - tokenStream.mustMatch(Tokens.SEMICOLON); - this._readWhitespace(); - - if (emit !== false){ - this.fire({ - type: "namespace", - prefix: prefix, - uri: uri, - line: line, - col: col - }); - } - - }, - - _media: function(){ - /* - * media - * : MEDIA_SYM S* media_query_list S* '{' S* ruleset* '}' S* - * ; - */ - var tokenStream = this._tokenStream, - line, - col, - mediaList;// = []; - - //look for @media - tokenStream.mustMatch(Tokens.MEDIA_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - mediaList = this._media_query_list(); - - tokenStream.mustMatch(Tokens.LBRACE); - this._readWhitespace(); - - this.fire({ - type: "startmedia", - media: mediaList, - line: line, - col: col - }); - - while(true) { - if (tokenStream.peek() == Tokens.PAGE_SYM){ - this._page(); - } else if (tokenStream.peek() == Tokens.FONT_FACE_SYM){ - this._font_face(); - } else if (tokenStream.peek() == Tokens.VIEWPORT_SYM){ - this._viewport(); - } else if (!this._ruleset()){ - break; - } - } - - tokenStream.mustMatch(Tokens.RBRACE); - this._readWhitespace(); - - this.fire({ - type: "endmedia", - media: mediaList, - line: line, - col: col - }); - }, - - - //CSS3 Media Queries - _media_query_list: function(){ - /* - * media_query_list - * : S* [media_query [ ',' S* media_query ]* ]? - * ; - */ - var tokenStream = this._tokenStream, - mediaList = []; - - - this._readWhitespace(); - - if (tokenStream.peek() == Tokens.IDENT || tokenStream.peek() == Tokens.LPAREN){ - mediaList.push(this._media_query()); - } - - while(tokenStream.match(Tokens.COMMA)){ - this._readWhitespace(); - mediaList.push(this._media_query()); - } - - return mediaList; - }, - - /* - * Note: "expression" in the grammar maps to the _media_expression - * method. - - */ - _media_query: function(){ - /* - * media_query - * : [ONLY | NOT]? S* media_type S* [ AND S* expression ]* - * | expression [ AND S* expression ]* - * ; - */ - var tokenStream = this._tokenStream, - type = null, - ident = null, - token = null, - expressions = []; - - if (tokenStream.match(Tokens.IDENT)){ - ident = tokenStream.token().value.toLowerCase(); - - //since there's no custom tokens for these, need to manually check - if (ident != "only" && ident != "not"){ - tokenStream.unget(); - ident = null; - } else { - token = tokenStream.token(); - } - } - - this._readWhitespace(); - - if (tokenStream.peek() == Tokens.IDENT){ - type = this._media_type(); - if (token === null){ - token = tokenStream.token(); - } - } else if (tokenStream.peek() == Tokens.LPAREN){ - if (token === null){ - token = tokenStream.LT(1); - } - expressions.push(this._media_expression()); - } - - if (type === null && expressions.length === 0){ - return null; - } else { - this._readWhitespace(); - while (tokenStream.match(Tokens.IDENT)){ - if (tokenStream.token().value.toLowerCase() != "and"){ - this._unexpectedToken(tokenStream.token()); - } - - this._readWhitespace(); - expressions.push(this._media_expression()); - } - } - - return new MediaQuery(ident, type, expressions, token.startLine, token.startCol); - }, - - //CSS3 Media Queries - _media_type: function(){ - /* - * media_type - * : IDENT - * ; - */ - return this._media_feature(); - }, - - /** - * Note: in CSS3 Media Queries, this is called "expression". - * Renamed here to avoid conflict with CSS3 Selectors - * definition of "expression". Also note that "expr" in the - * grammar now maps to "expression" from CSS3 selectors. - * @method _media_expression - * @private - */ - _media_expression: function(){ - /* - * expression - * : '(' S* media_feature S* [ ':' S* expr ]? ')' S* - * ; - */ - var tokenStream = this._tokenStream, - feature = null, - token, - expression = null; - - tokenStream.mustMatch(Tokens.LPAREN); - - feature = this._media_feature(); - this._readWhitespace(); - - if (tokenStream.match(Tokens.COLON)){ - this._readWhitespace(); - token = tokenStream.LT(1); - expression = this._expression(); - } - - tokenStream.mustMatch(Tokens.RPAREN); - this._readWhitespace(); - - return new MediaFeature(feature, (expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null)); - }, - - //CSS3 Media Queries - _media_feature: function(){ - /* - * media_feature - * : IDENT - * ; - */ - var tokenStream = this._tokenStream; - - tokenStream.mustMatch(Tokens.IDENT); - - return SyntaxUnit.fromToken(tokenStream.token()); - }, - - //CSS3 Paged Media - _page: function(){ - /* - * page: - * PAGE_SYM S* IDENT? pseudo_page? S* - * '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S* - * ; - */ - var tokenStream = this._tokenStream, - line, - col, - identifier = null, - pseudoPage = null; - - //look for @page - tokenStream.mustMatch(Tokens.PAGE_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - if (tokenStream.match(Tokens.IDENT)){ - identifier = tokenStream.token().value; - - //The value 'auto' may not be used as a page name and MUST be treated as a syntax error. - if (identifier.toLowerCase() === "auto"){ - this._unexpectedToken(tokenStream.token()); - } - } - - //see if there's a colon upcoming - if (tokenStream.peek() == Tokens.COLON){ - pseudoPage = this._pseudo_page(); - } - - this._readWhitespace(); - - this.fire({ - type: "startpage", - id: identifier, - pseudo: pseudoPage, - line: line, - col: col - }); - - this._readDeclarations(true, true); - - this.fire({ - type: "endpage", - id: identifier, - pseudo: pseudoPage, - line: line, - col: col - }); - - }, - - //CSS3 Paged Media - _margin: function(){ - /* - * margin : - * margin_sym S* '{' declaration [ ';' S* declaration? ]* '}' S* - * ; - */ - var tokenStream = this._tokenStream, - line, - col, - marginSym = this._margin_sym(); - - if (marginSym){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this.fire({ - type: "startpagemargin", - margin: marginSym, - line: line, - col: col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endpagemargin", - margin: marginSym, - line: line, - col: col - }); - return true; - } else { - return false; - } - }, - - //CSS3 Paged Media - _margin_sym: function(){ - - /* - * margin_sym : - * TOPLEFTCORNER_SYM | - * TOPLEFT_SYM | - * TOPCENTER_SYM | - * TOPRIGHT_SYM | - * TOPRIGHTCORNER_SYM | - * BOTTOMLEFTCORNER_SYM | - * BOTTOMLEFT_SYM | - * BOTTOMCENTER_SYM | - * BOTTOMRIGHT_SYM | - * BOTTOMRIGHTCORNER_SYM | - * LEFTTOP_SYM | - * LEFTMIDDLE_SYM | - * LEFTBOTTOM_SYM | - * RIGHTTOP_SYM | - * RIGHTMIDDLE_SYM | - * RIGHTBOTTOM_SYM - * ; - */ - - var tokenStream = this._tokenStream; - - if(tokenStream.match([Tokens.TOPLEFTCORNER_SYM, Tokens.TOPLEFT_SYM, - Tokens.TOPCENTER_SYM, Tokens.TOPRIGHT_SYM, Tokens.TOPRIGHTCORNER_SYM, - Tokens.BOTTOMLEFTCORNER_SYM, Tokens.BOTTOMLEFT_SYM, - Tokens.BOTTOMCENTER_SYM, Tokens.BOTTOMRIGHT_SYM, - Tokens.BOTTOMRIGHTCORNER_SYM, Tokens.LEFTTOP_SYM, - Tokens.LEFTMIDDLE_SYM, Tokens.LEFTBOTTOM_SYM, Tokens.RIGHTTOP_SYM, - Tokens.RIGHTMIDDLE_SYM, Tokens.RIGHTBOTTOM_SYM])) - { - return SyntaxUnit.fromToken(tokenStream.token()); - } else { - return null; - } - - }, - - _pseudo_page: function(){ - /* - * pseudo_page - * : ':' IDENT - * ; - */ - - var tokenStream = this._tokenStream; - - tokenStream.mustMatch(Tokens.COLON); - tokenStream.mustMatch(Tokens.IDENT); - - //TODO: CSS3 Paged Media says only "left", "center", and "right" are allowed - - return tokenStream.token().value; - }, - - _font_face: function(){ - /* - * font_face - * : FONT_FACE_SYM S* - * '{' S* declaration [ ';' S* declaration ]* '}' S* - * ; - */ - var tokenStream = this._tokenStream, - line, - col; - - //look for @page - tokenStream.mustMatch(Tokens.FONT_FACE_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - this.fire({ - type: "startfontface", - line: line, - col: col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endfontface", - line: line, - col: col - }); - }, - - _viewport: function(){ - /* - * viewport - * : VIEWPORT_SYM S* - * '{' S* declaration? [ ';' S* declaration? ]* '}' S* - * ; - */ - var tokenStream = this._tokenStream, - line, - col; - - tokenStream.mustMatch(Tokens.VIEWPORT_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - this.fire({ - type: "startviewport", - line: line, - col: col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endviewport", - line: line, - col: col - }); - - }, - - _operator: function(inFunction){ - - /* - * operator (outside function) - * : '/' S* | ',' S* | /( empty )/ - * operator (inside function) - * : '/' S* | '+' S* | '*' S* | '-' S* /( empty )/ - * ; - */ - - var tokenStream = this._tokenStream, - token = null; - - if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) || - (inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){ - token = tokenStream.token(); - this._readWhitespace(); - } - return token ? PropertyValuePart.fromToken(token) : null; - - }, - - _combinator: function(){ - - /* - * combinator - * : PLUS S* | GREATER S* | TILDE S* | S+ - * ; - */ - - var tokenStream = this._tokenStream, - value = null, - token; - - if(tokenStream.match([Tokens.PLUS, Tokens.GREATER, Tokens.TILDE])){ - token = tokenStream.token(); - value = new Combinator(token.value, token.startLine, token.startCol); - this._readWhitespace(); - } - - return value; - }, - - _unary_operator: function(){ - - /* - * unary_operator - * : '-' | '+' - * ; - */ - - var tokenStream = this._tokenStream; - - if (tokenStream.match([Tokens.MINUS, Tokens.PLUS])){ - return tokenStream.token().value; - } else { - return null; - } - }, - - _property: function(){ - - /* - * property - * : IDENT S* - * ; - */ - - var tokenStream = this._tokenStream, - value = null, - hack = null, - tokenValue, - token, - line, - col; - - //check for star hack - throws error if not allowed - if (tokenStream.peek() == Tokens.STAR && this.options.starHack){ - tokenStream.get(); - token = tokenStream.token(); - hack = token.value; - line = token.startLine; - col = token.startCol; - } - - if(tokenStream.match(Tokens.IDENT)){ - token = tokenStream.token(); - tokenValue = token.value; - - //check for underscore hack - no error if not allowed because it's valid CSS syntax - if (tokenValue.charAt(0) == "_" && this.options.underscoreHack){ - hack = "_"; - tokenValue = tokenValue.substring(1); - } - - value = new PropertyName(tokenValue, hack, (line||token.startLine), (col||token.startCol)); - this._readWhitespace(); - } - - return value; - }, - - //Augmented with CSS3 Selectors - _ruleset: function(){ - /* - * ruleset - * : selectors_group - * '{' S* declaration? [ ';' S* declaration? ]* '}' S* - * ; - */ - - var tokenStream = this._tokenStream, - tt, - selectors; - - - /* - * Error Recovery: If even a single selector fails to parse, - * then the entire ruleset should be thrown away. - */ - try { - selectors = this._selectors_group(); - } catch (ex){ - if (ex instanceof SyntaxError && !this.options.strict){ - - //fire error event - this.fire({ - type: "error", - error: ex, - message: ex.message, - line: ex.line, - col: ex.col - }); - - //skip over everything until closing brace - tt = tokenStream.advance([Tokens.RBRACE]); - if (tt == Tokens.RBRACE){ - //if there's a right brace, the rule is finished so don't do anything - } else { - //otherwise, rethrow the error because it wasn't handled properly - throw ex; - } - - } else { - //not a syntax error, rethrow it - throw ex; - } - - //trigger parser to continue - return true; - } - - //if it got here, all selectors parsed - if (selectors){ - - this.fire({ - type: "startrule", - selectors: selectors, - line: selectors[0].line, - col: selectors[0].col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endrule", - selectors: selectors, - line: selectors[0].line, - col: selectors[0].col - }); - - } - - return selectors; - - }, - - //CSS3 Selectors - _selectors_group: function(){ - - /* - * selectors_group - * : selector [ COMMA S* selector ]* - * ; - */ - var tokenStream = this._tokenStream, - selectors = [], - selector; - - selector = this._selector(); - if (selector !== null){ - - selectors.push(selector); - while(tokenStream.match(Tokens.COMMA)){ - this._readWhitespace(); - selector = this._selector(); - if (selector !== null){ - selectors.push(selector); - } else { - this._unexpectedToken(tokenStream.LT(1)); - } - } - } - - return selectors.length ? selectors : null; - }, - - //CSS3 Selectors - _selector: function(){ - /* - * selector - * : simple_selector_sequence [ combinator simple_selector_sequence ]* - * ; - */ - - var tokenStream = this._tokenStream, - selector = [], - nextSelector = null, - combinator = null, - ws = null; - - //if there's no simple selector, then there's no selector - nextSelector = this._simple_selector_sequence(); - if (nextSelector === null){ - return null; - } - - selector.push(nextSelector); - - do { - - //look for a combinator - combinator = this._combinator(); - - if (combinator !== null){ - selector.push(combinator); - nextSelector = this._simple_selector_sequence(); - - //there must be a next selector - if (nextSelector === null){ - this._unexpectedToken(tokenStream.LT(1)); - } else { - - //nextSelector is an instance of SelectorPart - selector.push(nextSelector); - } - } else { - - //if there's not whitespace, we're done - if (this._readWhitespace()){ - - //add whitespace separator - ws = new Combinator(tokenStream.token().value, tokenStream.token().startLine, tokenStream.token().startCol); - - //combinator is not required - combinator = this._combinator(); - - //selector is required if there's a combinator - nextSelector = this._simple_selector_sequence(); - if (nextSelector === null){ - if (combinator !== null){ - this._unexpectedToken(tokenStream.LT(1)); - } - } else { - - if (combinator !== null){ - selector.push(combinator); - } else { - selector.push(ws); - } - - selector.push(nextSelector); - } - } else { - break; - } - - } - } while(true); - - return new Selector(selector, selector[0].line, selector[0].col); - }, - - //CSS3 Selectors - _simple_selector_sequence: function(){ - /* - * simple_selector_sequence - * : [ type_selector | universal ] - * [ HASH | class | attrib | pseudo | negation ]* - * | [ HASH | class | attrib | pseudo | negation ]+ - * ; - */ - - var tokenStream = this._tokenStream, - - //parts of a simple selector - elementName = null, - modifiers = [], - - //complete selector text - selectorText= "", - - //the different parts after the element name to search for - components = [ - //HASH - function(){ - return tokenStream.match(Tokens.HASH) ? - new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : - null; - }, - this._class, - this._attrib, - this._pseudo, - this._negation - ], - i = 0, - len = components.length, - component = null, - found = false, - line, - col; - - - //get starting line and column for the selector - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol; - - elementName = this._type_selector(); - if (!elementName){ - elementName = this._universal(); - } - - if (elementName !== null){ - selectorText += elementName; - } - - while(true){ - - //whitespace means we're done - if (tokenStream.peek() === Tokens.S){ - break; - } - - //check for each component - while(i < len && component === null){ - component = components[i++].call(this); - } - - if (component === null){ - - //we don't have a selector - if (selectorText === ""){ - return null; - } else { - break; - } - } else { - i = 0; - modifiers.push(component); - selectorText += component.toString(); - component = null; - } - } - - - return selectorText !== "" ? - new SelectorPart(elementName, modifiers, selectorText, line, col) : - null; - }, - - //CSS3 Selectors - _type_selector: function(){ - /* - * type_selector - * : [ namespace_prefix ]? element_name - * ; - */ - - var tokenStream = this._tokenStream, - ns = this._namespace_prefix(), - elementName = this._element_name(); - - if (!elementName){ - /* - * Need to back out the namespace that was read due to both - * type_selector and universal reading namespace_prefix - * first. Kind of hacky, but only way I can figure out - * right now how to not change the grammar. - */ - if (ns){ - tokenStream.unget(); - if (ns.length > 1){ - tokenStream.unget(); - } - } - - return null; - } else { - if (ns){ - elementName.text = ns + elementName.text; - elementName.col -= ns.length; - } - return elementName; - } - }, - - //CSS3 Selectors - _class: function(){ - /* - * class - * : '.' IDENT - * ; - */ - - var tokenStream = this._tokenStream, - token; - - if (tokenStream.match(Tokens.DOT)){ - tokenStream.mustMatch(Tokens.IDENT); - token = tokenStream.token(); - return new SelectorSubPart("." + token.value, "class", token.startLine, token.startCol - 1); - } else { - return null; - } - - }, - - //CSS3 Selectors - _element_name: function(){ - /* - * element_name - * : IDENT - * ; - */ - - var tokenStream = this._tokenStream, - token; - - if (tokenStream.match(Tokens.IDENT)){ - token = tokenStream.token(); - return new SelectorSubPart(token.value, "elementName", token.startLine, token.startCol); - - } else { - return null; - } - }, - - //CSS3 Selectors - _namespace_prefix: function(){ - /* - * namespace_prefix - * : [ IDENT | '*' ]? '|' - * ; - */ - var tokenStream = this._tokenStream, - value = ""; - - //verify that this is a namespace prefix - if (tokenStream.LA(1) === Tokens.PIPE || tokenStream.LA(2) === Tokens.PIPE){ - - if(tokenStream.match([Tokens.IDENT, Tokens.STAR])){ - value += tokenStream.token().value; - } - - tokenStream.mustMatch(Tokens.PIPE); - value += "|"; - - } - - return value.length ? value : null; - }, - - //CSS3 Selectors - _universal: function(){ - /* - * universal - * : [ namespace_prefix ]? '*' - * ; - */ - var tokenStream = this._tokenStream, - value = "", - ns; - - ns = this._namespace_prefix(); - if(ns){ - value += ns; - } - - if(tokenStream.match(Tokens.STAR)){ - value += "*"; - } - - return value.length ? value : null; - - }, - - //CSS3 Selectors - _attrib: function(){ - /* - * attrib - * : '[' S* [ namespace_prefix ]? IDENT S* - * [ [ PREFIXMATCH | - * SUFFIXMATCH | - * SUBSTRINGMATCH | - * '=' | - * INCLUDES | - * DASHMATCH ] S* [ IDENT | STRING ] S* - * ]? ']' - * ; - */ - - var tokenStream = this._tokenStream, - value = null, - ns, - token; - - if (tokenStream.match(Tokens.LBRACKET)){ - token = tokenStream.token(); - value = token.value; - value += this._readWhitespace(); - - ns = this._namespace_prefix(); - - if (ns){ - value += ns; - } - - tokenStream.mustMatch(Tokens.IDENT); - value += tokenStream.token().value; - value += this._readWhitespace(); - - if(tokenStream.match([Tokens.PREFIXMATCH, Tokens.SUFFIXMATCH, Tokens.SUBSTRINGMATCH, - Tokens.EQUALS, Tokens.INCLUDES, Tokens.DASHMATCH])){ - - value += tokenStream.token().value; - value += this._readWhitespace(); - - tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); - value += tokenStream.token().value; - value += this._readWhitespace(); - } - - tokenStream.mustMatch(Tokens.RBRACKET); - - return new SelectorSubPart(value + "]", "attribute", token.startLine, token.startCol); - } else { - return null; - } - }, - - //CSS3 Selectors - _pseudo: function(){ - - /* - * pseudo - * : ':' ':'? [ IDENT | functional_pseudo ] - * ; - */ - - var tokenStream = this._tokenStream, - pseudo = null, - colons = ":", - line, - col; - - if (tokenStream.match(Tokens.COLON)){ - - if (tokenStream.match(Tokens.COLON)){ - colons += ":"; - } - - if (tokenStream.match(Tokens.IDENT)){ - pseudo = tokenStream.token().value; - line = tokenStream.token().startLine; - col = tokenStream.token().startCol - colons.length; - } else if (tokenStream.peek() == Tokens.FUNCTION){ - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol - colons.length; - pseudo = this._functional_pseudo(); - } - - if (pseudo){ - pseudo = new SelectorSubPart(colons + pseudo, "pseudo", line, col); - } - } - - return pseudo; - }, - - //CSS3 Selectors - _functional_pseudo: function(){ - /* - * functional_pseudo - * : FUNCTION S* expression ')' - * ; - */ - - var tokenStream = this._tokenStream, - value = null; - - if(tokenStream.match(Tokens.FUNCTION)){ - value = tokenStream.token().value; - value += this._readWhitespace(); - value += this._expression(); - tokenStream.mustMatch(Tokens.RPAREN); - value += ")"; - } - - return value; - }, - - //CSS3 Selectors - _expression: function(){ - /* - * expression - * : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+ - * ; - */ - - var tokenStream = this._tokenStream, - value = ""; - - while(tokenStream.match([Tokens.PLUS, Tokens.MINUS, Tokens.DIMENSION, - Tokens.NUMBER, Tokens.STRING, Tokens.IDENT, Tokens.LENGTH, - Tokens.FREQ, Tokens.ANGLE, Tokens.TIME, - Tokens.RESOLUTION, Tokens.SLASH])){ - - value += tokenStream.token().value; - value += this._readWhitespace(); - } - - return value.length ? value : null; - - }, - - //CSS3 Selectors - _negation: function(){ - /* - * negation - * : NOT S* negation_arg S* ')' - * ; - */ - - var tokenStream = this._tokenStream, - line, - col, - value = "", - arg, - subpart = null; - - if (tokenStream.match(Tokens.NOT)){ - value = tokenStream.token().value; - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - value += this._readWhitespace(); - arg = this._negation_arg(); - value += arg; - value += this._readWhitespace(); - tokenStream.match(Tokens.RPAREN); - value += tokenStream.token().value; - - subpart = new SelectorSubPart(value, "not", line, col); - subpart.args.push(arg); - } - - return subpart; - }, - - //CSS3 Selectors - _negation_arg: function(){ - /* - * negation_arg - * : type_selector | universal | HASH | class | attrib | pseudo - * ; - */ - - var tokenStream = this._tokenStream, - args = [ - this._type_selector, - this._universal, - function(){ - return tokenStream.match(Tokens.HASH) ? - new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : - null; - }, - this._class, - this._attrib, - this._pseudo - ], - arg = null, - i = 0, - len = args.length, - elementName, - line, - col, - part; - - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol; - - while(i < len && arg === null){ - - arg = args[i].call(this); - i++; - } - - //must be a negation arg - if (arg === null){ - this._unexpectedToken(tokenStream.LT(1)); - } - - //it's an element name - if (arg.type == "elementName"){ - part = new SelectorPart(arg, [], arg.toString(), line, col); - } else { - part = new SelectorPart(null, [arg], arg.toString(), line, col); - } - - return part; - }, - - _declaration: function(){ - - /* - * declaration - * : property ':' S* expr prio? - * | /( empty )/ - * ; - */ - - var tokenStream = this._tokenStream, - property = null, - expr = null, - prio = null, - error = null, - invalid = null, - propertyName= ""; - - property = this._property(); - if (property !== null){ - - tokenStream.mustMatch(Tokens.COLON); - this._readWhitespace(); - - expr = this._expr(); - - //if there's no parts for the value, it's an error - if (!expr || expr.length === 0){ - this._unexpectedToken(tokenStream.LT(1)); - } - - prio = this._prio(); - - /* - * If hacks should be allowed, then only check the root - * property. If hacks should not be allowed, treat - * _property or *property as invalid properties. - */ - propertyName = property.toString(); - if (this.options.starHack && property.hack == "*" || - this.options.underscoreHack && property.hack == "_") { - - propertyName = property.text; - } - - try { - this._validateProperty(propertyName, expr); - } catch (ex) { - invalid = ex; - } - - this.fire({ - type: "property", - property: property, - value: expr, - important: prio, - line: property.line, - col: property.col, - invalid: invalid - }); - - return true; - } else { - return false; - } - }, - - _prio: function(){ - /* - * prio - * : IMPORTANT_SYM S* - * ; - */ - - var tokenStream = this._tokenStream, - result = tokenStream.match(Tokens.IMPORTANT_SYM); - - this._readWhitespace(); - return result; - }, - - _expr: function(inFunction){ - /* - * expr - * : term [ operator term ]* - * ; - */ - - var tokenStream = this._tokenStream, - values = [], - //valueParts = [], - value = null, - operator = null; - - value = this._term(inFunction); - if (value !== null){ - - values.push(value); - - do { - operator = this._operator(inFunction); - - //if there's an operator, keep building up the value parts - if (operator){ - values.push(operator); - } /*else { - //if there's not an operator, you have a full value - values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col)); - valueParts = []; - }*/ - - value = this._term(inFunction); - - if (value === null){ - break; - } else { - values.push(value); - } - } while(true); - } - - //cleanup - /*if (valueParts.length){ - values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col)); - }*/ - - return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null; - }, - - _term: function(inFunction){ - - /* - * term - * : unary_operator? - * [ NUMBER S* | PERCENTAGE S* | LENGTH S* | ANGLE S* | - * TIME S* | FREQ S* | function | ie_function ] - * | STRING S* | IDENT S* | URI S* | UNICODERANGE S* | hexcolor - * ; - */ - - var tokenStream = this._tokenStream, - unary = null, - value = null, - endChar = null, - token, - line, - col; - - //returns the operator or null - unary = this._unary_operator(); - if (unary !== null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - - //exception for IE filters - if (tokenStream.peek() == Tokens.IE_FUNCTION && this.options.ieFilters){ - - value = this._ie_function(); - if (unary === null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - - //see if it's a simple block - } else if (inFunction && tokenStream.match([Tokens.LPAREN, Tokens.LBRACE, Tokens.LBRACKET])){ - - token = tokenStream.token(); - endChar = token.endChar; - value = token.value + this._expr(inFunction).text; - if (unary === null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - tokenStream.mustMatch(Tokens.type(endChar)); - value += endChar; - this._readWhitespace(); - - //see if there's a simple match - } else if (tokenStream.match([Tokens.NUMBER, Tokens.PERCENTAGE, Tokens.LENGTH, - Tokens.ANGLE, Tokens.TIME, - Tokens.FREQ, Tokens.STRING, Tokens.IDENT, Tokens.URI, Tokens.UNICODE_RANGE])){ - - value = tokenStream.token().value; - if (unary === null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - this._readWhitespace(); - } else { - - //see if it's a color - token = this._hexcolor(); - if (token === null){ - - //if there's no unary, get the start of the next token for line/col info - if (unary === null){ - line = tokenStream.LT(1).startLine; - col = tokenStream.LT(1).startCol; - } - - //has to be a function - if (value === null){ - - /* - * This checks for alpha(opacity=0) style of IE - * functions. IE_FUNCTION only presents progid: style. - */ - if (tokenStream.LA(3) == Tokens.EQUALS && this.options.ieFilters){ - value = this._ie_function(); - } else { - value = this._function(); - } - } - - /*if (value === null){ - return null; - //throw new Error("Expected identifier at line " + tokenStream.token().startLine + ", character " + tokenStream.token().startCol + "."); - }*/ - - } else { - value = token.value; - if (unary === null){ - line = token.startLine; - col = token.startCol; - } - } - - } - - return value !== null ? - new PropertyValuePart(unary !== null ? unary + value : value, line, col) : - null; - - }, - - _function: function(){ - - /* - * function - * : FUNCTION S* expr ')' S* - * ; - */ - - var tokenStream = this._tokenStream, - functionText = null, - expr = null, - lt; - - if (tokenStream.match(Tokens.FUNCTION)){ - functionText = tokenStream.token().value; - this._readWhitespace(); - expr = this._expr(true); - functionText += expr; - - //START: Horrible hack in case it's an IE filter - if (this.options.ieFilters && tokenStream.peek() == Tokens.EQUALS){ - do { - - if (this._readWhitespace()){ - functionText += tokenStream.token().value; - } - - //might be second time in the loop - if (tokenStream.LA(0) == Tokens.COMMA){ - functionText += tokenStream.token().value; - } - - tokenStream.match(Tokens.IDENT); - functionText += tokenStream.token().value; - - tokenStream.match(Tokens.EQUALS); - functionText += tokenStream.token().value; - - //functionText += this._term(); - lt = tokenStream.peek(); - while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){ - tokenStream.get(); - functionText += tokenStream.token().value; - lt = tokenStream.peek(); - } - } while(tokenStream.match([Tokens.COMMA, Tokens.S])); - } - - //END: Horrible Hack - - tokenStream.match(Tokens.RPAREN); - functionText += ")"; - this._readWhitespace(); - } - - return functionText; - }, - - _ie_function: function(){ - - /* (My own extension) - * ie_function - * : IE_FUNCTION S* IDENT '=' term [S* ','? IDENT '=' term]+ ')' S* - * ; - */ - - var tokenStream = this._tokenStream, - functionText = null, - expr = null, - lt; - - //IE function can begin like a regular function, too - if (tokenStream.match([Tokens.IE_FUNCTION, Tokens.FUNCTION])){ - functionText = tokenStream.token().value; - - do { - - if (this._readWhitespace()){ - functionText += tokenStream.token().value; - } - - //might be second time in the loop - if (tokenStream.LA(0) == Tokens.COMMA){ - functionText += tokenStream.token().value; - } - - tokenStream.match(Tokens.IDENT); - functionText += tokenStream.token().value; - - tokenStream.match(Tokens.EQUALS); - functionText += tokenStream.token().value; - - //functionText += this._term(); - lt = tokenStream.peek(); - while(lt != Tokens.COMMA && lt != Tokens.S && lt != Tokens.RPAREN){ - tokenStream.get(); - functionText += tokenStream.token().value; - lt = tokenStream.peek(); - } - } while(tokenStream.match([Tokens.COMMA, Tokens.S])); - - tokenStream.match(Tokens.RPAREN); - functionText += ")"; - this._readWhitespace(); - } - - return functionText; - }, - - _hexcolor: function(){ - /* - * There is a constraint on the color that it must - * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F]) - * after the "#"; e.g., "#000" is OK, but "#abcd" is not. - * - * hexcolor - * : HASH S* - * ; - */ - - var tokenStream = this._tokenStream, - token = null, - color; - - if(tokenStream.match(Tokens.HASH)){ - - //need to do some validation here - - token = tokenStream.token(); - color = token.value; - if (!/#[a-f0-9]{3,6}/i.test(color)){ - throw new SyntaxError("Expected a hex color but found '" + color + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); - } - this._readWhitespace(); - } - - return token; - }, - - //----------------------------------------------------------------- - // Animations methods - //----------------------------------------------------------------- - - _keyframes: function(){ - - /* - * keyframes: - * : KEYFRAMES_SYM S* keyframe_name S* '{' S* keyframe_rule* '}' { - * ; - */ - var tokenStream = this._tokenStream, - token, - tt, - name, - prefix = ""; - - tokenStream.mustMatch(Tokens.KEYFRAMES_SYM); - token = tokenStream.token(); - if (/^@\-([^\-]+)\-/.test(token.value)) { - prefix = RegExp.$1; - } - - this._readWhitespace(); - name = this._keyframe_name(); - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.LBRACE); - - this.fire({ - type: "startkeyframes", - name: name, - prefix: prefix, - line: token.startLine, - col: token.startCol - }); - - this._readWhitespace(); - tt = tokenStream.peek(); - - //check for key - while(tt == Tokens.IDENT || tt == Tokens.PERCENTAGE) { - this._keyframe_rule(); - this._readWhitespace(); - tt = tokenStream.peek(); - } - - this.fire({ - type: "endkeyframes", - name: name, - prefix: prefix, - line: token.startLine, - col: token.startCol - }); - - this._readWhitespace(); - tokenStream.mustMatch(Tokens.RBRACE); - - }, - - _keyframe_name: function(){ - - /* - * keyframe_name: - * : IDENT - * | STRING - * ; - */ - var tokenStream = this._tokenStream, - token; - - tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); - return SyntaxUnit.fromToken(tokenStream.token()); - }, - - _keyframe_rule: function(){ - - /* - * keyframe_rule: - * : key_list S* - * '{' S* declaration [ ';' S* declaration ]* '}' S* - * ; - */ - var tokenStream = this._tokenStream, - token, - keyList = this._key_list(); - - this.fire({ - type: "startkeyframerule", - keys: keyList, - line: keyList[0].line, - col: keyList[0].col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endkeyframerule", - keys: keyList, - line: keyList[0].line, - col: keyList[0].col - }); - - }, - - _key_list: function(){ - - /* - * key_list: - * : key [ S* ',' S* key]* - * ; - */ - var tokenStream = this._tokenStream, - token, - key, - keyList = []; - - //must be least one key - keyList.push(this._key()); - - this._readWhitespace(); - - while(tokenStream.match(Tokens.COMMA)){ - this._readWhitespace(); - keyList.push(this._key()); - this._readWhitespace(); - } - - return keyList; - }, - - _key: function(){ - /* - * There is a restriction that IDENT can be only "from" or "to". - * - * key - * : PERCENTAGE - * | IDENT - * ; - */ - - var tokenStream = this._tokenStream, - token; - - if (tokenStream.match(Tokens.PERCENTAGE)){ - return SyntaxUnit.fromToken(tokenStream.token()); - } else if (tokenStream.match(Tokens.IDENT)){ - token = tokenStream.token(); - - if (/from|to/i.test(token.value)){ - return SyntaxUnit.fromToken(token); - } - - tokenStream.unget(); - } - - //if it gets here, there wasn't a valid token, so time to explode - this._unexpectedToken(tokenStream.LT(1)); - }, - - //----------------------------------------------------------------- - // Helper methods - //----------------------------------------------------------------- - - /** - * Not part of CSS grammar, but useful for skipping over - * combination of white space and HTML-style comments. - * @return {void} - * @method _skipCruft - * @private - */ - _skipCruft: function(){ - while(this._tokenStream.match([Tokens.S, Tokens.CDO, Tokens.CDC])){ - //noop - } - }, - - /** - * Not part of CSS grammar, but this pattern occurs frequently - * in the official CSS grammar. Split out here to eliminate - * duplicate code. - * @param {Boolean} checkStart Indicates if the rule should check - * for the left brace at the beginning. - * @param {Boolean} readMargins Indicates if the rule should check - * for margin patterns. - * @return {void} - * @method _readDeclarations - * @private - */ - _readDeclarations: function(checkStart, readMargins){ - /* - * Reads the pattern - * S* '{' S* declaration [ ';' S* declaration ]* '}' S* - * or - * S* '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S* - * Note that this is how it is described in CSS3 Paged Media, but is actually incorrect. - * A semicolon is only necessary following a declaration is there's another declaration - * or margin afterwards. - */ - var tokenStream = this._tokenStream, - tt; - - - this._readWhitespace(); - - if (checkStart){ - tokenStream.mustMatch(Tokens.LBRACE); - } - - this._readWhitespace(); - - try { - - while(true){ - - if (tokenStream.match(Tokens.SEMICOLON) || (readMargins && this._margin())){ - //noop - } else if (this._declaration()){ - if (!tokenStream.match(Tokens.SEMICOLON)){ - break; - } - } else { - break; - } - - //if ((!this._margin() && !this._declaration()) || !tokenStream.match(Tokens.SEMICOLON)){ - // break; - //} - this._readWhitespace(); - } - - tokenStream.mustMatch(Tokens.RBRACE); - this._readWhitespace(); - - } catch (ex) { - if (ex instanceof SyntaxError && !this.options.strict){ - - //fire error event - this.fire({ - type: "error", - error: ex, - message: ex.message, - line: ex.line, - col: ex.col - }); - - //see if there's another declaration - tt = tokenStream.advance([Tokens.SEMICOLON, Tokens.RBRACE]); - if (tt == Tokens.SEMICOLON){ - //if there's a semicolon, then there might be another declaration - this._readDeclarations(false, readMargins); - } else if (tt != Tokens.RBRACE){ - //if there's a right brace, the rule is finished so don't do anything - //otherwise, rethrow the error because it wasn't handled properly - throw ex; - } - - } else { - //not a syntax error, rethrow it - throw ex; - } - } - - }, - - /** - * In some cases, you can end up with two white space tokens in a - * row. Instead of making a change in every function that looks for - * white space, this function is used to match as much white space - * as necessary. - * @method _readWhitespace - * @return {String} The white space if found, empty string if not. - * @private - */ - _readWhitespace: function(){ - - var tokenStream = this._tokenStream, - ws = ""; - - while(tokenStream.match(Tokens.S)){ - ws += tokenStream.token().value; - } - - return ws; - }, - - - /** - * Throws an error when an unexpected token is found. - * @param {Object} token The token that was found. - * @method _unexpectedToken - * @return {void} - * @private - */ - _unexpectedToken: function(token){ - throw new SyntaxError("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); - }, - - /** - * Helper method used for parsing subparts of a style sheet. - * @return {void} - * @method _verifyEnd - * @private - */ - _verifyEnd: function(){ - if (this._tokenStream.LA(1) != Tokens.EOF){ - this._unexpectedToken(this._tokenStream.LT(1)); - } - }, - - //----------------------------------------------------------------- - // Validation methods - //----------------------------------------------------------------- - _validateProperty: function(property, value){ - Validation.validate(property, value); - }, - - //----------------------------------------------------------------- - // Parsing methods - //----------------------------------------------------------------- - - parse: function(input){ - this._tokenStream = new TokenStream(input, Tokens); - this._stylesheet(); - }, - - parseStyleSheet: function(input){ - //just passthrough - return this.parse(input); - }, - - parseMediaQuery: function(input){ - this._tokenStream = new TokenStream(input, Tokens); - var result = this._media_query(); - - //if there's anything more, then it's an invalid selector - this._verifyEnd(); - - //otherwise return result - return result; - }, - - /** - * Parses a property value (everything after the semicolon). - * @return {parserlib.css.PropertyValue} The property value. - * @throws parserlib.util.SyntaxError If an unexpected token is found. - * @method parserPropertyValue - */ - parsePropertyValue: function(input){ - - this._tokenStream = new TokenStream(input, Tokens); - this._readWhitespace(); - - var result = this._expr(); - - //okay to have a trailing white space - this._readWhitespace(); - - //if there's anything more, then it's an invalid selector - this._verifyEnd(); - - //otherwise return result - return result; - }, - - /** - * Parses a complete CSS rule, including selectors and - * properties. - * @param {String} input The text to parser. - * @return {Boolean} True if the parse completed successfully, false if not. - * @method parseRule - */ - parseRule: function(input){ - this._tokenStream = new TokenStream(input, Tokens); - - //skip any leading white space - this._readWhitespace(); - - var result = this._ruleset(); - - //skip any trailing white space - this._readWhitespace(); - - //if there's anything more, then it's an invalid selector - this._verifyEnd(); - - //otherwise return result - return result; - }, - - /** - * Parses a single CSS selector (no comma) - * @param {String} input The text to parse as a CSS selector. - * @return {Selector} An object representing the selector. - * @throws parserlib.util.SyntaxError If an unexpected token is found. - * @method parseSelector - */ - parseSelector: function(input){ - - this._tokenStream = new TokenStream(input, Tokens); - - //skip any leading white space - this._readWhitespace(); - - var result = this._selector(); - - //skip any trailing white space - this._readWhitespace(); - - //if there's anything more, then it's an invalid selector - this._verifyEnd(); - - //otherwise return result - return result; - }, - - /** - * Parses an HTML style attribute: a set of CSS declarations - * separated by semicolons. - * @param {String} input The text to parse as a style attribute - * @return {void} - * @method parseStyleAttribute - */ - parseStyleAttribute: function(input){ - input += "}"; // for error recovery in _readDeclarations() - this._tokenStream = new TokenStream(input, Tokens); - this._readDeclarations(); - } - }; - - //copy over onto prototype - for (prop in additions){ - if (additions.hasOwnProperty(prop)){ - proto[prop] = additions[prop]; - } - } - - return proto; -}(); - - -/* -nth - : S* [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? | - ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S* - ; -*/ -/*global Validation, ValidationTypes, ValidationError*/ -var Properties = { - - //A - "align-items" : "flex-start | flex-end | center | baseline | stretch", - "align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", - "align-self" : "auto | flex-start | flex-end | center | baseline | stretch", - "-webkit-align-items" : "flex-start | flex-end | center | baseline | stretch", - "-webkit-align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", - "-webkit-align-self" : "auto | flex-start | flex-end | center | baseline | stretch", - "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ", - "alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", - "animation" : 1, - "animation-delay" : { multi: "
  • element - tree.insertElement(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagPlaintext = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.endTagP('p'); - tree.insertElement(name, attributes); - tree.tokenizer.setState(Tokenizer.PLAINTEXT); - }; - - modes.inBody.startTagHeading = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.endTagP('p'); - if (tree.currentStackItem().isNumberedHeader()) { - tree.parseError('unexpected-start-tag', {name: name}); - tree.popElement(); - } - tree.insertElement(name, attributes); - }; - - modes.inBody.startTagA = function(name, attributes) { - var activeA = tree.elementInActiveFormattingElements('a'); - if (activeA) { - tree.parseError("unexpected-start-tag-implies-end-tag", {startName: "a", endName: "a"}); - tree.adoptionAgencyEndTag('a'); - if (tree.openElements.contains(activeA)) - tree.openElements.remove(activeA); - tree.removeElementFromActiveFormattingElements(activeA); - } - tree.reconstructActiveFormattingElements(); - tree.insertFormattingElement(name, attributes); - }; - - modes.inBody.startTagFormatting = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertFormattingElement(name, attributes); - }; - - modes.inBody.startTagNobr = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - if (tree.openElements.inScope('nobr')) { - tree.parseError("unexpected-start-tag-implies-end-tag", {startName: 'nobr', endName: 'nobr'}); - this.processEndTag('nobr'); - // XXX Need tests that trigger the following - tree.reconstructActiveFormattingElements(); - } - tree.insertFormattingElement(name, attributes); - }; - - modes.inBody.startTagButton = function(name, attributes) { - if (tree.openElements.inScope('button')) { - tree.parseError('unexpected-start-tag-implies-end-tag', {startName: 'button', endName: 'button'}); - this.processEndTag('button'); - tree.insertionMode.processStartTag(name, attributes); - } else { - tree.framesetOk = false; - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - } - }; - - modes.inBody.startTagAppletMarqueeObject = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - tree.activeFormattingElements.push(Marker); - tree.framesetOk = false; - }; - - modes.inBody.endTagAppletMarqueeObject = function(name) { - if (!tree.openElements.inScope(name)) { - tree.parseError("unexpected-end-tag", {name: name}); - } else { - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) { - tree.parseError('end-tag-too-early', {name: name}); - } - tree.openElements.popUntilPopped(name); - tree.clearActiveFormattingElements(); - } - }; - - modes.inBody.startTagXmp = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.processEndTag('p'); - tree.reconstructActiveFormattingElements(); - tree.processGenericRawTextStartTag(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagTable = function(name, attributes) { - if (tree.compatMode !== "quirks") - if (tree.openElements.inButtonScope('p')) - this.processEndTag('p'); - tree.insertElement(name, attributes); - tree.setInsertionMode('inTable'); - tree.framesetOk = false; - }; - - modes.inBody.startTagVoidFormatting = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertSelfClosingElement(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagParamSourceTrack = function(name, attributes) { - tree.insertSelfClosingElement(name, attributes); - }; - - modes.inBody.startTagHr = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.endTagP('p'); - tree.insertSelfClosingElement(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagImage = function(name, attributes) { - // No, really... - tree.parseError('unexpected-start-tag-treated-as', {originalName: 'image', newName: 'img'}); - this.processStartTag('img', attributes); - }; - - modes.inBody.startTagInput = function(name, attributes) { - var currentFramesetOk = tree.framesetOk; - this.startTagVoidFormatting(name, attributes); - for (var key in attributes) { - // input type=hidden doesn't change framesetOk - if (attributes[key].nodeName == 'type') { - if (attributes[key].nodeValue.toLowerCase() == 'hidden') - tree.framesetOk = currentFramesetOk; - break; - } - } - }; - - modes.inBody.startTagIsindex = function(name, attributes) { - tree.parseError('deprecated-tag', {name: 'isindex'}); - tree.selfClosingFlagAcknowledged = true; - if (tree.form) - return; - var formAttributes = []; - var inputAttributes = []; - var prompt = "This is a searchable index. Enter search keywords: "; - for (var key in attributes) { - switch (attributes[key].nodeName) { - case 'action': - formAttributes.push({nodeName: 'action', - nodeValue: attributes[key].nodeValue}); - break; - case 'prompt': - prompt = attributes[key].nodeValue; - break; - case 'name': - break; - default: - inputAttributes.push({nodeName: attributes[key].nodeName, - nodeValue: attributes[key].nodeValue}); - } - } - inputAttributes.push({nodeName: 'name', nodeValue: 'isindex'}); - this.processStartTag('form', formAttributes); - this.processStartTag('hr'); - this.processStartTag('label'); - this.processCharacters(new CharacterBuffer(prompt)); - this.processStartTag('input', inputAttributes); - this.processEndTag('label'); - this.processStartTag('hr'); - this.processEndTag('form'); - }; - - modes.inBody.startTagTextarea = function(name, attributes) { - // XXX Form element pointer checking here as well... - tree.insertElement(name, attributes); - tree.tokenizer.setState(Tokenizer.RCDATA); - tree.originalInsertionMode = tree.insertionModeName; - tree.shouldSkipLeadingNewline = true; - tree.framesetOk = false; - tree.setInsertionMode('text'); - }; - - modes.inBody.startTagIFrame = function(name, attributes) { - tree.framesetOk = false; - this.startTagRawText(name, attributes); - }; - - modes.inBody.startTagRawText = function(name, attributes) { - tree.processGenericRawTextStartTag(name, attributes); - }; - - modes.inBody.startTagSelect = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - tree.framesetOk = false; - var insertionModeName = tree.insertionModeName; - if (insertionModeName == 'inTable' || - insertionModeName == 'inCaption' || - insertionModeName == 'inColumnGroup' || - insertionModeName == 'inTableBody' || - insertionModeName == 'inRow' || - insertionModeName == 'inCell') { - tree.setInsertionMode('inSelectInTable'); - } else { - tree.setInsertionMode('inSelect'); - } - }; - - modes.inBody.startTagMisplaced = function(name, attributes) { - tree.parseError('unexpected-start-tag-ignored', {name: name}); - }; - - modes.inBody.endTagMisplaced = function(name) { - // This handles elements with end tags in other insertion modes. - tree.parseError("unexpected-end-tag", {name: name}); - }; - - modes.inBody.endTagBr = function(name) { - tree.parseError("unexpected-end-tag-treated-as", {originalName: "br", newName: "br element"}); - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, []); - tree.popElement(); - }; - - modes.inBody.startTagOptionOptgroup = function(name, attributes) { - if (tree.currentStackItem().localName == 'option') - tree.popElement(); - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - }; - - modes.inBody.startTagOther = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - }; - - modes.inBody.endTagOther = function(name) { - var node; - for (var i = tree.openElements.length - 1; i > 0; i--) { - node = tree.openElements.item(i); - if (node.localName == name) { - tree.generateImpliedEndTags(name); - if (tree.currentStackItem().localName != name) - tree.parseError('unexpected-end-tag', {name: name}); - // todo optimize - tree.openElements.remove_openElements_until(function(x) {return x === node;}); - break; - } - if (node.isSpecial()) { - tree.parseError('unexpected-end-tag', {name: name}); - break; - } - } - }; - - modes.inBody.startTagMath = function(name, attributes, selfClosing) { - tree.reconstructActiveFormattingElements(); - attributes = tree.adjustMathMLAttributes(attributes); - attributes = tree.adjustForeignAttributes(attributes); - tree.insertForeignElement(name, attributes, "http://www.w3.org/1998/Math/MathML", selfClosing); - // Need to get the parse error right for the case where the token - // has a namespace not equal to the xmlns attribute - }; - - modes.inBody.startTagSVG = function(name, attributes, selfClosing) { - tree.reconstructActiveFormattingElements(); - attributes = tree.adjustSVGAttributes(attributes); - attributes = tree.adjustForeignAttributes(attributes); - tree.insertForeignElement(name, attributes, "http://www.w3.org/2000/svg", selfClosing); - // Need to get the parse error right for the case where the token - // has a namespace not equal to the xmlns attribute - }; - - modes.inBody.endTagP = function(name) { - if (!tree.openElements.inButtonScope('p')) { - tree.parseError('unexpected-end-tag', {name: 'p'}); - this.startTagCloseP('p', []); - this.endTagP('p'); - } else { - tree.generateImpliedEndTags('p'); - if (tree.currentStackItem().localName != 'p') - tree.parseError('unexpected-implied-end-tag', {name: 'p'}); - tree.openElements.popUntilPopped(name); - } - }; - - modes.inBody.endTagBody = function(name) { - if (!tree.openElements.inScope('body')) { - tree.parseError('unexpected-end-tag', {name: name}); - return; - } - - /// @todo Emit parse error on end tags other than the ones listed in http://www.w3.org/TR/html5/tree-construction.html#parsing-main-inbody - // ['dd', 'dt', 'li', 'optgroup', 'option', 'p', 'rp', 'rt', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'body', 'html'] - if (tree.currentStackItem().localName != 'body') { - tree.parseError('expected-one-end-tag-but-got-another', { - expectedName: tree.currentStackItem().localName, - gotName: name - }); - } - tree.setInsertionMode('afterBody'); - }; - - modes.inBody.endTagHtml = function(name) { - if (!tree.openElements.inScope('body')) { - tree.parseError('unexpected-end-tag', {name: name}); - return; - } - - /// @todo Emit parse error on end tags other than the ones listed in http://www.w3.org/TR/html5/tree-construction.html#parsing-main-inbody - // ['dd', 'dt', 'li', 'optgroup', 'option', 'p', 'rp', 'rt', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'body', 'html'] - if (tree.currentStackItem().localName != 'body') { - tree.parseError('expected-one-end-tag-but-got-another', { - expectedName: tree.currentStackItem().localName, - gotName: name - }); - } - tree.setInsertionMode('afterBody'); - tree.insertionMode.processEndTag(name); - }; - - modes.inBody.endTagBlock = function(name) { - if (!tree.openElements.inScope(name)) { - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) { - tree.parseError('end-tag-too-early', {name: name}); - } - tree.openElements.popUntilPopped(name); - } - }; - - modes.inBody.endTagForm = function(name) { - var node = tree.form; - tree.form = null; - if (!node || !tree.openElements.inScope(name)) { - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.generateImpliedEndTags(); - if (tree.currentStackItem() != node) { - tree.parseError('end-tag-too-early-ignored', {name: 'form'}); - } - tree.openElements.remove(node); - } - }; - - modes.inBody.endTagListItem = function(name) { - if (!tree.openElements.inListItemScope(name)) { - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.generateImpliedEndTags(name); - if (tree.currentStackItem().localName != name) - tree.parseError('end-tag-too-early', {name: name}); - tree.openElements.popUntilPopped(name); - } - }; - - modes.inBody.endTagHeading = function(name) { - if (!tree.openElements.hasNumberedHeaderElementInScope()) { - tree.parseError('unexpected-end-tag', {name: name}); - return; - } - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) - tree.parseError('end-tag-too-early', {name: name}); - - tree.openElements.remove_openElements_until(function(e) { - return e.isNumberedHeader(); - }); - }; - - modes.inBody.endTagFormatting = function(name, attributes) { - if (!tree.adoptionAgencyEndTag(name)) - this.endTagOther(name, attributes); - }; - - modes.inCaption = Object.create(modes.base); - - modes.inCaption.start_tag_handlers = { - html: 'startTagHtml', - caption: 'startTagTableElement', - col: 'startTagTableElement', - colgroup: 'startTagTableElement', - tbody: 'startTagTableElement', - td: 'startTagTableElement', - tfoot: 'startTagTableElement', - thead: 'startTagTableElement', - tr: 'startTagTableElement', - '-default': 'startTagOther' - }; - - modes.inCaption.end_tag_handlers = { - caption: 'endTagCaption', - table: 'endTagTable', - body: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - tbody: 'endTagIgnore', - td: 'endTagIgnore', - tfood: 'endTagIgnore', - thead: 'endTagIgnore', - tr: 'endTagIgnore', - '-default': 'endTagOther' - }; - - modes.inCaption.processCharacters = function(data) { - modes.inBody.processCharacters(data); - }; - - modes.inCaption.startTagTableElement = function(name, attributes) { - tree.parseError('unexpected-end-tag', {name: name}); - var ignoreEndTag = !tree.openElements.inTableScope('caption'); - tree.insertionMode.processEndTag('caption'); - if (!ignoreEndTag) tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inCaption.startTagOther = function(name, attributes, selfClosing) { - modes.inBody.processStartTag(name, attributes, selfClosing); - }; - - modes.inCaption.endTagCaption = function(name) { - if (!tree.openElements.inTableScope('caption')) { - // context case - assert.ok(tree.context); - tree.parseError('unexpected-end-tag', {name: name}); - } else { - // AT this code is quite similar to endTagTable in inTable - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != 'caption') { - // @todo this is confusing for implied end tag - tree.parseError('expected-one-end-tag-but-got-another', { - gotName: "caption", - expectedName: tree.currentStackItem().localName - }); - } - tree.openElements.popUntilPopped('caption'); - tree.clearActiveFormattingElements(); - tree.setInsertionMode('inTable'); - } - }; - - modes.inCaption.endTagTable = function(name) { - tree.parseError("unexpected-end-table-in-caption"); - var ignoreEndTag = !tree.openElements.inTableScope('caption'); - tree.insertionMode.processEndTag('caption'); - if (!ignoreEndTag) tree.insertionMode.processEndTag(name); - }; - - modes.inCaption.endTagIgnore = function(name) { - tree.parseError('unexpected-end-tag', {name: name}); - }; - - modes.inCaption.endTagOther = function(name) { - modes.inBody.processEndTag(name); - }; - - modes.inCell = Object.create(modes.base); - - modes.inCell.start_tag_handlers = { - html: 'startTagHtml', - caption: 'startTagTableOther', - col: 'startTagTableOther', - colgroup: 'startTagTableOther', - tbody: 'startTagTableOther', - td: 'startTagTableOther', - tfoot: 'startTagTableOther', - th: 'startTagTableOther', - thead: 'startTagTableOther', - tr: 'startTagTableOther', - '-default': 'startTagOther' - }; - - modes.inCell.end_tag_handlers = { - td: 'endTagTableCell', - th: 'endTagTableCell', - body: 'endTagIgnore', - caption: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - table: 'endTagImply', - tbody: 'endTagImply', - tfoot: 'endTagImply', - thead: 'endTagImply', - tr: 'endTagImply', - '-default': 'endTagOther' - }; - - modes.inCell.processCharacters = function(data) { - modes.inBody.processCharacters(data); - }; - - modes.inCell.startTagTableOther = function(name, attributes, selfClosing) { - if (tree.openElements.inTableScope('td') || tree.openElements.inTableScope('th')) { - this.closeCell(); - tree.insertionMode.processStartTag(name, attributes, selfClosing); - } else { - // context case - tree.parseError('unexpected-start-tag', {name: name}); - } - }; - - modes.inCell.startTagOther = function(name, attributes, selfClosing) { - modes.inBody.processStartTag(name, attributes, selfClosing); - }; - - modes.inCell.endTagTableCell = function(name) { - if (tree.openElements.inTableScope(name)) { - tree.generateImpliedEndTags(name); - if (tree.currentStackItem().localName != name.toLowerCase()) { - tree.parseError('unexpected-cell-end-tag', {name: name}); - tree.openElements.popUntilPopped(name); - } else { - tree.popElement(); - } - tree.clearActiveFormattingElements(); - tree.setInsertionMode('inRow'); - } else { - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inCell.endTagIgnore = function(name) { - tree.parseError('unexpected-end-tag', {name: name}); - }; - - modes.inCell.endTagImply = function(name) { - if (tree.openElements.inTableScope(name)) { - this.closeCell(); - tree.insertionMode.processEndTag(name); - } else { - // sometimes context case - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inCell.endTagOther = function(name) { - modes.inBody.processEndTag(name); - }; - - modes.inCell.closeCell = function() { - if (tree.openElements.inTableScope('td')) { - this.endTagTableCell('td'); - } else if (tree.openElements.inTableScope('th')) { - this.endTagTableCell('th'); - } - }; - - - modes.inColumnGroup = Object.create(modes.base); - - modes.inColumnGroup.start_tag_handlers = { - html: 'startTagHtml', - col: 'startTagCol', - '-default': 'startTagOther' - }; - - modes.inColumnGroup.end_tag_handlers = { - colgroup: 'endTagColgroup', - col: 'endTagCol', - '-default': 'endTagOther' - }; - - modes.inColumnGroup.ignoreEndTagColgroup = function() { - return tree.currentStackItem().localName == 'html'; - }; - - modes.inColumnGroup.processCharacters = function(buffer) { - var leadingWhitespace = buffer.takeLeadingWhitespace(); - if (leadingWhitespace) - tree.insertText(leadingWhitespace); - if (!buffer.length) - return; - var ignoreEndTag = this.ignoreEndTagColgroup(); - this.endTagColgroup('colgroup'); - if (!ignoreEndTag) tree.insertionMode.processCharacters(buffer); - }; - - modes.inColumnGroup.startTagCol = function(name, attributes) { - tree.insertSelfClosingElement(name, attributes); - }; - - modes.inColumnGroup.startTagOther = function(name, attributes, selfClosing) { - var ignoreEndTag = this.ignoreEndTagColgroup(); - this.endTagColgroup('colgroup'); - if (!ignoreEndTag) tree.insertionMode.processStartTag(name, attributes, selfClosing); - }; - - modes.inColumnGroup.endTagColgroup = function(name) { - if (this.ignoreEndTagColgroup()) { - // context case - assert.ok(tree.context); - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.popElement(); - tree.setInsertionMode('inTable'); - } - }; - - modes.inColumnGroup.endTagCol = function(name) { - tree.parseError("no-end-tag", {name: 'col'}); - }; - - modes.inColumnGroup.endTagOther = function(name) { - var ignoreEndTag = this.ignoreEndTagColgroup(); - this.endTagColgroup('colgroup'); - if (!ignoreEndTag) tree.insertionMode.processEndTag(name) ; - }; - - modes.inForeignContent = Object.create(modes.base); - - modes.inForeignContent.processStartTag = function(name, attributes, selfClosing) { - if (['b', 'big', 'blockquote', 'body', 'br', 'center', 'code', 'dd', 'div', 'dl', 'dt', 'em', 'embed', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'i', 'img', 'li', 'listing', 'menu', 'meta', 'nobr', 'ol', 'p', 'pre', 'ruby', 's', 'small', 'span', 'strong', 'strike', 'sub', 'sup', 'table', 'tt', 'u', 'ul', 'var'].indexOf(name) != -1 - || (name == 'font' && attributes.some(function(attr){ return ['color', 'face', 'size'].indexOf(attr.nodeName) >= 0 }))) { - tree.parseError('unexpected-html-element-in-foreign-content', {name: name}); - while (tree.currentStackItem().isForeign() - && !tree.currentStackItem().isHtmlIntegrationPoint() - && !tree.currentStackItem().isMathMLTextIntegrationPoint()) { - tree.openElements.pop(); - } - tree.insertionMode.processStartTag(name, attributes, selfClosing); - return; - } - if (tree.currentStackItem().namespaceURI == "http://www.w3.org/1998/Math/MathML") { - attributes = tree.adjustMathMLAttributes(attributes); - } - if (tree.currentStackItem().namespaceURI == "http://www.w3.org/2000/svg") { - name = tree.adjustSVGTagNameCase(name); - attributes = tree.adjustSVGAttributes(attributes); - } - attributes = tree.adjustForeignAttributes(attributes); - tree.insertForeignElement(name, attributes, tree.currentStackItem().namespaceURI, selfClosing); - }; - - modes.inForeignContent.processEndTag = function(name) { - var node = tree.currentStackItem(); - var index = tree.openElements.length - 1; - if (node.localName.toLowerCase() != name) - tree.parseError("unexpected-end-tag", {name: name}); - - while (true) { - if (index === 0) - break; - if (node.localName.toLowerCase() == name) { - while (tree.openElements.pop() != node); - break; - } - index -= 1; - node = tree.openElements.item(index); - if (node.isForeign()) { - continue; - } else { - tree.insertionMode.processEndTag(name); - break; - } - } - }; - - modes.inForeignContent.processCharacters = function(buffer) { - var characters = buffer.takeRemaining(); - characters = characters.replace(/\u0000/g, function(match, index){ - // @todo position - tree.parseError('invalid-codepoint'); - return '\uFFFD'; - }); - if (tree.framesetOk && !isAllWhitespaceOrReplacementCharacters(characters)) - tree.framesetOk = false; - tree.insertText(characters); - }; - - modes.inHeadNoscript = Object.create(modes.base); - - modes.inHeadNoscript.start_tag_handlers = { - html: 'startTagHtml', - basefont: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - bgsound: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - link: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - meta: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - noframes: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - style: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - head: 'startTagHeadNoscript', - noscript: 'startTagHeadNoscript', - "-default": 'startTagOther' - }; - - modes.inHeadNoscript.end_tag_handlers = { - noscript: 'endTagNoscript', - br: 'endTagBr', - '-default': 'endTagOther' - }; - - modes.inHeadNoscript.processCharacters = function(buffer) { - var leadingWhitespace = buffer.takeLeadingWhitespace(); - if (leadingWhitespace) - tree.insertText(leadingWhitespace); - if (!buffer.length) - return; - // FIXME error message - tree.parseError("unexpected-char-in-frameset"); - this.anythingElse(); - tree.insertionMode.processCharacters(buffer); - }; - - modes.inHeadNoscript.processComment = function(data) { - modes.inHead.processComment(data); - }; - - modes.inHeadNoscript.startTagBasefontBgsoundLinkMetaNoframesStyle = function(name, attributes) { - modes.inHead.processStartTag(name, attributes); - }; - - modes.inHeadNoscript.startTagHeadNoscript = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-start-tag-in-frameset", {name: name}); - }; - - modes.inHeadNoscript.startTagOther = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-start-tag-in-frameset", {name: name}); - this.anythingElse(); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inHeadNoscript.endTagBr = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-end-tag-in-frameset", {name: name}); - this.anythingElse(); - tree.insertionMode.processEndTag(name, attributes); - }; - - modes.inHeadNoscript.endTagNoscript = function(name, attributes) { - tree.popElement(); - tree.setInsertionMode('inHead'); - }; - - modes.inHeadNoscript.endTagOther = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-end-tag-in-frameset", {name: name}); - }; - - modes.inHeadNoscript.anythingElse = function() { - tree.popElement(); - tree.setInsertionMode('inHead'); - }; - - - modes.inFrameset = Object.create(modes.base); - - modes.inFrameset.start_tag_handlers = { - html: 'startTagHtml', - frameset: 'startTagFrameset', - frame: 'startTagFrame', - noframes: 'startTagNoframes', - "-default": 'startTagOther' - }; - - modes.inFrameset.end_tag_handlers = { - frameset: 'endTagFrameset', - noframes: 'endTagNoframes', - '-default': 'endTagOther' - }; - - modes.inFrameset.processCharacters = function(data) { - tree.parseError("unexpected-char-in-frameset"); - }; - - modes.inFrameset.startTagFrameset = function(name, attributes) { - tree.insertElement(name, attributes); - }; - - modes.inFrameset.startTagFrame = function(name, attributes) { - tree.insertSelfClosingElement(name, attributes); - }; - - modes.inFrameset.startTagNoframes = function(name, attributes) { - modes.inBody.processStartTag(name, attributes); - }; - - modes.inFrameset.startTagOther = function(name, attributes) { - tree.parseError("unexpected-start-tag-in-frameset", {name: name}); - }; - - modes.inFrameset.endTagFrameset = function(name, attributes) { - if (tree.currentStackItem().localName == 'html') { - // context case - tree.parseError("unexpected-frameset-in-frameset-innerhtml"); - } else { - tree.popElement(); - } - - if (!tree.context && tree.currentStackItem().localName != 'frameset') { - // If we're not in context mode an the current node is not a "frameset" element (anymore) then switch - tree.setInsertionMode('afterFrameset'); - } - }; - - modes.inFrameset.endTagNoframes = function(name) { - modes.inBody.processEndTag(name); - }; - - modes.inFrameset.endTagOther = function(name) { - tree.parseError("unexpected-end-tag-in-frameset", {name: name}); - }; - - modes.inTable = Object.create(modes.base); - - modes.inTable.start_tag_handlers = { - html: 'startTagHtml', - caption: 'startTagCaption', - colgroup: 'startTagColgroup', - col: 'startTagCol', - table: 'startTagTable', - tbody: 'startTagRowGroup', - tfoot: 'startTagRowGroup', - thead: 'startTagRowGroup', - td: 'startTagImplyTbody', - th: 'startTagImplyTbody', - tr: 'startTagImplyTbody', - style: 'startTagStyleScript', - script: 'startTagStyleScript', - input: 'startTagInput', - form: 'startTagForm', - '-default': 'startTagOther' - }; - - modes.inTable.end_tag_handlers = { - table: 'endTagTable', - body: 'endTagIgnore', - caption: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - tbody: 'endTagIgnore', - td: 'endTagIgnore', - tfoot: 'endTagIgnore', - th: 'endTagIgnore', - thead: 'endTagIgnore', - tr: 'endTagIgnore', - '-default': 'endTagOther' - }; - - modes.inTable.processCharacters = function(data) { - if (tree.currentStackItem().isFosterParenting()) { - var originalInsertionMode = tree.insertionModeName; - tree.setInsertionMode('inTableText'); - tree.originalInsertionMode = originalInsertionMode; - tree.insertionMode.processCharacters(data); - } else { - tree.redirectAttachToFosterParent = true; - modes.inBody.processCharacters(data); - tree.redirectAttachToFosterParent = false; - } - }; - - modes.inTable.startTagCaption = function(name, attributes) { - tree.openElements.popUntilTableScopeMarker(); - tree.activeFormattingElements.push(Marker); - tree.insertElement(name, attributes); - tree.setInsertionMode('inCaption'); - }; - - modes.inTable.startTagColgroup = function(name, attributes) { - tree.openElements.popUntilTableScopeMarker(); - tree.insertElement(name, attributes); - tree.setInsertionMode('inColumnGroup'); - }; - - modes.inTable.startTagCol = function(name, attributes) { - this.startTagColgroup('colgroup', []); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTable.startTagRowGroup = function(name, attributes) { - tree.openElements.popUntilTableScopeMarker(); - tree.insertElement(name, attributes); - tree.setInsertionMode('inTableBody'); - }; - - modes.inTable.startTagImplyTbody = function(name, attributes) { - this.startTagRowGroup('tbody', []); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTable.startTagTable = function(name, attributes) { - tree.parseError("unexpected-start-tag-implies-end-tag", - {startName: "table", endName: "table"}); - tree.insertionMode.processEndTag('table'); - if (!tree.context) tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTable.startTagStyleScript = function(name, attributes) { - modes.inHead.processStartTag(name, attributes); - }; - - modes.inTable.startTagInput = function(name, attributes) { - for (var key in attributes) { - if (attributes[key].nodeName.toLowerCase() == 'type') { - if (attributes[key].nodeValue.toLowerCase() == 'hidden') { - tree.parseError("unexpected-hidden-input-in-table"); - tree.insertElement(name, attributes); - // XXX associate with form - tree.openElements.pop(); - return; - } - break; - } - } - this.startTagOther(name, attributes); - }; - - modes.inTable.startTagForm = function(name, attributes) { - tree.parseError("unexpected-form-in-table"); - if (!tree.form) { - tree.insertElement(name, attributes); - tree.form = tree.currentStackItem(); - tree.openElements.pop(); - } - }; - - modes.inTable.startTagOther = function(name, attributes, selfClosing) { - tree.parseError("unexpected-start-tag-implies-table-voodoo", {name: name}); - tree.redirectAttachToFosterParent = true; - modes.inBody.processStartTag(name, attributes, selfClosing); - tree.redirectAttachToFosterParent = false; - }; - - modes.inTable.endTagTable = function(name) { - if (tree.openElements.inTableScope(name)) { - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) { - tree.parseError("end-tag-too-early-named", {gotName: 'table', expectedName: tree.currentStackItem().localName}); - } - - tree.openElements.popUntilPopped('table'); - tree.resetInsertionMode(); - } else { - assert.ok(tree.context); - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inTable.endTagIgnore = function(name) { - tree.parseError("unexpected-end-tag", {name: name}); - }; - - modes.inTable.endTagOther = function(name) { - tree.parseError("unexpected-end-tag-implies-table-voodoo", {name: name}); - // Make all the special element rearranging voodoo kick in - tree.redirectAttachToFosterParent = true; - // Process the end tag in the "in body" mode - modes.inBody.processEndTag(name); - tree.redirectAttachToFosterParent = false; - }; - - modes.inTableText = Object.create(modes.base); - - modes.inTableText.flushCharacters = function() { - var characters = tree.pendingTableCharacters.join(''); - if (!isAllWhitespace(characters)) { - tree.redirectAttachToFosterParent = true; - tree.reconstructActiveFormattingElements(); - tree.insertText(characters); - tree.framesetOk = false; - tree.redirectAttachToFosterParent = false; - } else { - tree.insertText(characters); - } - tree.pendingTableCharacters = []; - }; - - modes.inTableText.processComment = function(data) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processComment(data); - }; - - modes.inTableText.processEOF = function(data) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processEOF(); - }; - - modes.inTableText.processCharacters = function(buffer) { - var characters = buffer.takeRemaining(); - characters = characters.replace(/\u0000/g, function(match, index){ - // @todo position - tree.parseError("invalid-codepoint"); - return ''; - }); - if (!characters) - return; - tree.pendingTableCharacters.push(characters); - }; - - modes.inTableText.processStartTag = function(name, attributes, selfClosing) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processStartTag(name, attributes, selfClosing); - }; - - modes.inTableText.processEndTag = function(name, attributes) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processEndTag(name, attributes); - }; - - modes.inTableBody = Object.create(modes.base); - - modes.inTableBody.start_tag_handlers = { - html: 'startTagHtml', - tr: 'startTagTr', - td: 'startTagTableCell', - th: 'startTagTableCell', - caption: 'startTagTableOther', - col: 'startTagTableOther', - colgroup: 'startTagTableOther', - tbody: 'startTagTableOther', - tfoot: 'startTagTableOther', - thead: 'startTagTableOther', - '-default': 'startTagOther' - }; - - modes.inTableBody.end_tag_handlers = { - table: 'endTagTable', - tbody: 'endTagTableRowGroup', - tfoot: 'endTagTableRowGroup', - thead: 'endTagTableRowGroup', - body: 'endTagIgnore', - caption: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - td: 'endTagIgnore', - th: 'endTagIgnore', - tr: 'endTagIgnore', - '-default': 'endTagOther' - }; - - modes.inTableBody.processCharacters = function(data) { - modes.inTable.processCharacters(data); - }; - - modes.inTableBody.startTagTr = function(name, attributes) { - tree.openElements.popUntilTableBodyScopeMarker(); - tree.insertElement(name, attributes); - tree.setInsertionMode('inRow'); - }; - - modes.inTableBody.startTagTableCell = function(name, attributes) { - tree.parseError("unexpected-cell-in-table-body", {name: name}); - this.startTagTr('tr', []); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTableBody.startTagTableOther = function(name, attributes) { - // XXX any ideas on how to share this with endTagTable - if (tree.openElements.inTableScope('tbody') || tree.openElements.inTableScope('thead') || tree.openElements.inTableScope('tfoot')) { - tree.openElements.popUntilTableBodyScopeMarker(); - this.endTagTableRowGroup(tree.currentStackItem().localName); - tree.insertionMode.processStartTag(name, attributes); - } else { - // context case - tree.parseError('unexpected-start-tag', {name: name}); - } - }; - - modes.inTableBody.startTagOther = function(name, attributes) { - modes.inTable.processStartTag(name, attributes); - }; - - modes.inTableBody.endTagTableRowGroup = function(name) { - if (tree.openElements.inTableScope(name)) { - tree.openElements.popUntilTableBodyScopeMarker(); - tree.popElement(); - tree.setInsertionMode('inTable'); - } else { - tree.parseError('unexpected-end-tag-in-table-body', {name: name}); - } - }; - - modes.inTableBody.endTagTable = function(name) { - if (tree.openElements.inTableScope('tbody') || tree.openElements.inTableScope('thead') || tree.openElements.inTableScope('tfoot')) { - tree.openElements.popUntilTableBodyScopeMarker(); - this.endTagTableRowGroup(tree.currentStackItem().localName); - tree.insertionMode.processEndTag(name); - } else { - // context case - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inTableBody.endTagIgnore = function(name) { - tree.parseError("unexpected-end-tag-in-table-body", {name: name}); - }; - - modes.inTableBody.endTagOther = function(name) { - modes.inTable.processEndTag(name); - }; - - modes.inSelect = Object.create(modes.base); - - modes.inSelect.start_tag_handlers = { - html: 'startTagHtml', - option: 'startTagOption', - optgroup: 'startTagOptgroup', - select: 'startTagSelect', - input: 'startTagInput', - keygen: 'startTagInput', - textarea: 'startTagInput', - script: 'startTagScript', - '-default': 'startTagOther' - }; - - modes.inSelect.end_tag_handlers = { - option: 'endTagOption', - optgroup: 'endTagOptgroup', - select: 'endTagSelect', - caption: 'endTagTableElements', - table: 'endTagTableElements', - tbody: 'endTagTableElements', - tfoot: 'endTagTableElements', - thead: 'endTagTableElements', - tr: 'endTagTableElements', - td: 'endTagTableElements', - th: 'endTagTableElements', - '-default': 'endTagOther' - }; - - modes.inSelect.processCharacters = function(buffer) { - var data = buffer.takeRemaining(); - data = data.replace(/\u0000/g, function(match, index){ - // @todo position - tree.parseError("invalid-codepoint"); - return ''; - }); - if (!data) - return; - tree.insertText(data); - }; - - modes.inSelect.startTagOption = function(name, attributes) { - // we need to imply if ${3} -snippet curl+ - - - cparam+${6} - - ${3} -snippet credirect - -snippet contains - ${fn:contains(${1:string}, ${2:substr})} -snippet contains:i - ${fn:containsIgnoreCase(${1:string}, ${2:substr})} -snippet endswith - ${fn:endsWith(${1:string}, ${2:suffix})} -snippet escape - ${fn:escapeXml(${1:string})} -snippet indexof - ${fn:indexOf(${1:string}, ${2:substr})} -snippet join - ${fn:join(${1:collection}, ${2:delims})} -snippet length - ${fn:length(${1:collection_or_string})} -snippet replace - ${fn:replace(${1:string}, ${2:substr}, ${3:replace})} -snippet split - ${fn:split(${1:string}, ${2:delims})} -snippet startswith - ${fn:startsWith(${1:string}, ${2:prefix})} -snippet substr - ${fn:substring(${1:string}, ${2:begin}, ${3:end})} -snippet substr:a - ${fn:substringAfter(${1:string}, ${2:substr})} -snippet substr:b - ${fn:substringBefore(${1:string}, ${2:substr})} -snippet lc - ${fn:toLowerCase(${1:string})} -snippet uc - ${fn:toUpperCase(${1:string})} -snippet trim - ${fn:trim(${1:string})} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.js deleted file mode 100644 index 9792a7a0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./jsx.snippets"); -exports.scope = "jsx"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.js deleted file mode 100644 index f83777ef..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./julia.snippets"); -exports.scope = "julia"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.js deleted file mode 100644 index 44bef369..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./latex.snippets"); -exports.scope = "latex"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ledger.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ledger.snippets deleted file mode 100644 index 293d4b65..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ledger.snippets +++ /dev/null @@ -1,5 +0,0 @@ -# Ledger -snippet ent - `strftime("%Y/%m/%d")` ${1:transaction} - ${2:account} ${3:value} - ${4:account} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.js deleted file mode 100644 index 7acf02f2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./less.snippets"); -exports.scope = "less"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.js deleted file mode 100644 index 2e320755..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./liquid.snippets"); -exports.scope = "liquid"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.js deleted file mode 100644 index 2b6870bc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lisp.snippets"); -exports.scope = "lisp"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.js deleted file mode 100644 index ba20e7e4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./livescript.snippets"); -exports.scope = "livescript"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.js deleted file mode 100644 index 7d0167da..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./logiql.snippets"); -exports.scope = "logiql"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.js deleted file mode 100644 index 678ba41f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lsl.snippets"); -exports.scope = "lsl"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.snippets deleted file mode 100644 index bc0d2eb9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.snippets +++ /dev/null @@ -1,1066 +0,0 @@ -snippet @ - @${1:label}; -snippet CAMERA_ACTIVE - CAMERA_ACTIVE, ${1:integer isActive}, $0 -snippet CAMERA_BEHINDNESS_ANGLE - CAMERA_BEHINDNESS_ANGLE, ${1:float degrees}, $0 -snippet CAMERA_BEHINDNESS_LAG - CAMERA_BEHINDNESS_LAG, ${1:float seconds}, $0 -snippet CAMERA_DISTANCE - CAMERA_DISTANCE, ${1:float meters}, $0 -snippet CAMERA_FOCUS - CAMERA_FOCUS, ${1:vector position}, $0 -snippet CAMERA_FOCUS_LAG - CAMERA_FOCUS_LAG, ${1:float seconds}, $0 -snippet CAMERA_FOCUS_LOCKED - CAMERA_FOCUS_LOCKED, ${1:integer isLocked}, $0 -snippet CAMERA_FOCUS_OFFSET - CAMERA_FOCUS_OFFSET, ${1:vector meters}, $0 -snippet CAMERA_FOCUS_THRESHOLD - CAMERA_FOCUS_THRESHOLD, ${1:float meters}, $0 -snippet CAMERA_PITCH - CAMERA_PITCH, ${1:float degrees}, $0 -snippet CAMERA_POSITION - CAMERA_POSITION, ${1:vector position}, $0 -snippet CAMERA_POSITION_LAG - CAMERA_POSITION_LAG, ${1:float seconds}, $0 -snippet CAMERA_POSITION_LOCKED - CAMERA_POSITION_LOCKED, ${1:integer isLocked}, $0 -snippet CAMERA_POSITION_THRESHOLD - CAMERA_POSITION_THRESHOLD, ${1:float meters}, $0 -snippet CHARACTER_AVOIDANCE_MODE - CHARACTER_AVOIDANCE_MODE, ${1:integer flags}, $0 -snippet CHARACTER_DESIRED_SPEED - CHARACTER_DESIRED_SPEED, ${1:float speed}, $0 -snippet CHARACTER_DESIRED_TURN_SPEED - CHARACTER_DESIRED_TURN_SPEED, ${1:float speed}, $0 -snippet CHARACTER_LENGTH - CHARACTER_LENGTH, ${1:float length}, $0 -snippet CHARACTER_MAX_TURN_RADIUS - CHARACTER_MAX_TURN_RADIUS, ${1:float radius}, $0 -snippet CHARACTER_ORIENTATION - CHARACTER_ORIENTATION, ${1:integer orientation}, $0 -snippet CHARACTER_RADIUS - CHARACTER_RADIUS, ${1:float radius}, $0 -snippet CHARACTER_STAY_WITHIN_PARCEL - CHARACTER_STAY_WITHIN_PARCEL, ${1:boolean stay}, $0 -snippet CHARACTER_TYPE - CHARACTER_TYPE, ${1:integer type}, $0 -snippet HTTP_BODY_MAXLENGTH - HTTP_BODY_MAXLENGTH, ${1:integer length}, $0 -snippet HTTP_CUSTOM_HEADER - HTTP_CUSTOM_HEADER, ${1:string name}, ${2:string value}, $0 -snippet HTTP_METHOD - HTTP_METHOD, ${1:string method}, $0 -snippet HTTP_MIMETYPE - HTTP_MIMETYPE, ${1:string mimeType}, $0 -snippet HTTP_PRAGMA_NO_CACHE - HTTP_PRAGMA_NO_CACHE, ${1:integer send_header}, $0 -snippet HTTP_VERBOSE_THROTTLE - HTTP_VERBOSE_THROTTLE, ${1:integer noisy}, $0 -snippet HTTP_VERIFY_CERT - HTTP_VERIFY_CERT, ${1:integer verify}, $0 -snippet RC_DATA_FLAGS - RC_DATA_FLAGS, ${1:integer flags}, $0 -snippet RC_DETECT_PHANTOM - RC_DETECT_PHANTOM, ${1:integer dectedPhantom}, $0 -snippet RC_MAX_HITS - RC_MAX_HITS, ${1:integer maxHits}, $0 -snippet RC_REJECT_TYPES - RC_REJECT_TYPES, ${1:integer filterMask}, $0 -snippet at_rot_target - at_rot_target(${1:integer handle}, ${2:rotation targetrot}, ${3:rotation ourrot}) - { - $0 - } -snippet at_target - at_target(${1:integer tnum}, ${2:vector targetpos}, ${3:vector ourpos}) - { - $0 - } -snippet attach - attach(${1:key id}) - { - $0 - } -snippet changed - changed(${1:integer change}) - { - $0 - } -snippet collision - collision(${1:integer index}) - { - $0 - } -snippet collision_end - collision_end(${1:integer index}) - { - $0 - } -snippet collision_start - collision_start(${1:integer index}) - { - $0 - } -snippet control - control(${1:key id}, ${2:integer level}, ${3:integer edge}) - { - $0 - } -snippet dataserver - dataserver(${1:key query_id}, ${2:string data}) - { - $0 - } -snippet do - do - { - $0 - } - while (${1:condition}); -snippet else - else - { - $0 - } -snippet email - email(${1:string time}, ${2:string address}, ${3:string subject}, ${4:string message}, ${5:integer num_left}) - { - $0 - } -snippet experience_permissions - experience_permissions(${1:key agent_id}) - { - $0 - } -snippet experience_permissions_denied - experience_permissions_denied(${1:key agent_id}, ${2:integer reason}) - { - $0 - } -snippet for - for (${1:start}; ${3:condition}; ${3:step}) - { - $0 - } -snippet http_request - http_request(${1:key request_id}, ${2:string method}, ${3:string body}) - { - $0 - } -snippet http_response - http_response(${1:key request_id}, ${2:integer status}, ${3:list metadata}, ${4:string body}) - { - $0 - } -snippet if - if (${1:condition}) - { - $0 - } -snippet jump - jump ${1:label}; -snippet land_collision - land_collision(${1:vector pos}) - { - $0 - } -snippet land_collision_end - land_collision_end(${1:vector pos}) - { - $0 - } -snippet land_collision_start - land_collision_start(${1:vector pos}) - { - $0 - } -snippet link_message - link_message(${1:integer sender_num}, ${2:integer num}, ${3:string str}, ${4:key id}) - { - $0 - } -snippet listen - listen(${1:integer channel}, ${2:string name}, ${3:key id}, ${4:string message}) - { - $0 - } -snippet llAbs - llAbs(${1:integer val}) -snippet llAcos - llAcos(${1:float val}) -snippet llAddToLandBanList - llAddToLandBanList(${1:key agent}, ${2:float hours}); -snippet llAddToLandPassList - llAddToLandPassList(${1:key agent}, ${2:float hours}); -snippet llAdjustSoundVolume - llAdjustSoundVolume(${1:float volume}); -snippet llAgentInExperience - llAgentInExperience(${1:key agent}) -snippet llAllowInventoryDrop - llAllowInventoryDrop(${1:integer add}); -snippet llAngleBetween - llAngleBetween(${1:rotation a}, ${2:rotation b}) -snippet llApplyImpulse - llApplyImpulse(${1:vector force}, ${2:integer local}); -snippet llApplyRotationalImpulse - llApplyRotationalImpulse(${1:vector force}, ${2:integer local}); -snippet llAsin - llAsin(${1:float val}) -snippet llAtan2 - llAtan2(${1:float y}, ${2:float x}) -snippet llAttachToAvatar - llAttachToAvatar(${1:integer attach_point}); -snippet llAttachToAvatarTemp - llAttachToAvatarTemp(${1:integer attach_point}); -snippet llAvatarOnLinkSitTarget - llAvatarOnLinkSitTarget(${1:integer link}) -snippet llAvatarOnSitTarget - llAvatarOnSitTarget() -snippet llAxes2Rot - llAxes2Rot(${1:vector fwd}, ${2:vector left}, ${3:vector up}) -snippet llAxisAngle2Rot - llAxisAngle2Rot(${1:vector axis}, ${2:float angle}) -snippet llBase64ToInteger - llBase64ToInteger(${1:string str}) -snippet llBase64ToString - llBase64ToString(${1:string str}) -snippet llBreakAllLinks - llBreakAllLinks(); -snippet llBreakLink - llBreakLink(${1:integer link}); -snippet llCastRay - llCastRay(${1:vector start}, ${2:vector end}, ${3:list options}); -snippet llCeil - llCeil(${1:float val}) -snippet llClearCameraParams - llClearCameraParams(); -snippet llClearLinkMedia - llClearLinkMedia(${1:integer link}, ${2:integer face}); -snippet llClearPrimMedia - llClearPrimMedia(${1:integer face}); -snippet llCloseRemoteDataChannel - llCloseRemoteDataChannel(${1:key channel}); -snippet llCollisionFilter - llCollisionFilter(${1:string name}, ${2:key id}, ${3:integer accept}); -snippet llCollisionSound - llCollisionSound(${1:string impact_sound}, ${2:float impact_volume}); -snippet llCos - llCos(${1:float theta}) -snippet llCreateCharacter - llCreateCharacter(${1:list options}); -snippet llCreateKeyValue - llCreateKeyValue(${1:string k}) -snippet llCreateLink - llCreateLink(${1:key target}, ${2:integer parent}); -snippet llCSV2List - llCSV2List(${1:string src}) -snippet llDataSizeKeyValue - llDataSizeKeyValue() -snippet llDeleteCharacter - llDeleteCharacter(); -snippet llDeleteKeyValue - llDeleteKeyValue(${1:string k}) -snippet llDeleteSubList - llDeleteSubList(${1:list src}, ${2:integer start}, ${3:integer end}) -snippet llDeleteSubString - llDeleteSubString(${1:string src}, ${2:integer start}, ${3:integer end}) -snippet llDetachFromAvatar - llDetachFromAvatar(); -snippet llDetectedGrab - llDetectedGrab(${1:integer number}) -snippet llDetectedGroup - llDetectedGroup(${1:integer number}) -snippet llDetectedKey - llDetectedKey(${1:integer number}) -snippet llDetectedLinkNumber - llDetectedLinkNumber(${1:integer number}) -snippet llDetectedName - llDetectedName(${1:integer number}) -snippet llDetectedOwner - llDetectedOwner(${1:integer number}) -snippet llDetectedPos - llDetectedPosl(${1:integer number}) -snippet llDetectedRot - llDetectedRot(${1:integer number}) -snippet llDetectedTouchBinormal - llDetectedTouchBinormal(${1:integer number}) -snippet llDetectedTouchFace - llDetectedTouchFace(${1:integer number}) -snippet llDetectedTouchNormal - llDetectedTouchNormal(${1:integer number}) -snippet llDetectedTouchPos - llDetectedTouchPos(${1:integer number}) -snippet llDetectedTouchST - llDetectedTouchST(${1:integer number}) -snippet llDetectedTouchUV - llDetectedTouchUV(${1:integer number}) -snippet llDetectedType - llDetectedType(${1:integer number}) -snippet llDetectedVel - llDetectedVel(${1:integer number}) -snippet llDialog - llDialog(${1:key agent}, ${2:string message}, ${3:list buttons}, ${4:integer channel}); -snippet llDie - llDie(); -snippet llDumpList2String - llDumpList2String(${1:list src}, ${2:string separator}) -snippet llEdgeOfWorld - llEdgeOfWorld(${1:vector pos}, ${2:vector dir}) -snippet llEjectFromLand - llEjectFromLand(${1:key agent}); -snippet llEmail - llEmail(${1:string address}, ${2:string subject}, ${3:string message}); -snippet llEscapeURL - llEscapeURL(${1:string url}) -snippet llEuler2Rot - llEuler2Rot(${1:vector v}) -snippet llExecCharacterCmd - llExecCharacterCmd(${1:integer command}, ${2:list options}); -snippet llEvade - llEvade(${1:key target}, ${2:list options}); -snippet llFabs - llFabs(${1:float val}) -snippet llFleeFrom - llFleeFrom(${1:vector position}, ${2:float distance}, ${3:list options}); -snippet llFloor - llFloor(${1:float val}) -snippet llForceMouselook - llForceMouselook(${1:integer mouselook}); -snippet llFrand - llFrand(${1:float mag}) -snippet llGenerateKey - llGenerateKey() -snippet llGetAccel - llGetAccel() -snippet llGetAgentInfo - llGetAgentInfo(${1:key id}) -snippet llGetAgentLanguage - llGetAgentLanguage(${1:key agent}) -snippet llGetAgentList - llGetAgentList(${1:integer scope}, ${2:list options}) -snippet llGetAgentSize - llGetAgentSize(${1:key agent}) -snippet llGetAlpha - llGetAlpha(${1:integer face}) -snippet llGetAndResetTime - llGetAndResetTime() -snippet llGetAnimation - llGetAnimation(${1:key id}) -snippet llGetAnimationList - llGetAnimationList(${1:key agent}) -snippet llGetAnimationOverride - llGetAnimationOverride(${1:string anim_state}) -snippet llGetAttached - llGetAttached() -snippet llGetBoundingBox - llGetBoundingBox(${1:key object}) -snippet llGetCameraPos - llGetCameraPos() -snippet llGetCameraRot - llGetCameraRot() -snippet llGetCenterOfMass - llGetCenterOfMass() -snippet llGetClosestNavPoint - llGetClosestNavPoint(${1:vector point}, ${2:list options}) -snippet llGetColor - llGetColor(${1:integer face}) -snippet llGetCreator - llGetCreator() -snippet llGetDate - llGetDate() -snippet llGetDisplayName - llGetDisplayName(${1:key id}) -snippet llGetEnergy - llGetEnergy() -snippet llGetEnv - llGetEnv(${1:string name}) -snippet llGetExperienceDetails - llGetExperienceDetails(${1:key experience_id}) -snippet llGetExperienceErrorMessage - llGetExperienceErrorMessage(${1:integer error}) -snippet llGetForce - llGetForce() -snippet llGetFreeMemory - llGetFreeMemory() -snippet llGetFreeURLs - llGetFreeURLs() -snippet llGetGeometricCenter - llGetGeometricCenter() -snippet llGetGMTclock - llGetGMTclock() -snippet llGetHTTPHeader - llGetHTTPHeader(${1:key request_id}, ${2:string header}) -snippet llGetInventoryCreator - llGetInventoryCreator(${1:string item}) -snippet llGetInventoryKey - llGetInventoryKey(${1:string name}) -snippet llGetInventoryName - llGetInventoryName(${1:integer type}, ${2:integer number}) -snippet llGetInventoryNumber - llGetInventoryNumber(${1:integer type}) -snippet llGetInventoryPermMask - llGetInventoryPermMask(${1:string item}, ${2:integer mask}) -snippet llGetInventoryType - llGetInventoryType(${1:string name}) -snippet llGetKey - llGetKey() -snippet llGetLandOwnerAt - llGetLandOwnerAt(${1:vector pos}) -snippet llGetLinkKey - llGetLinkKey(${1:integer link}) -snippet llGetLinkMedia - llGetLinkMedia(${1:integer link}, ${2:integer face}, ${3:list params}) -snippet llGetLinkName - llGetLinkName(${1:integer link}) -snippet llGetLinkNumber - llGetLinkNumber() -snippet llGetLinkNumberOfSides - llGetLinkNumberOfSides(${1:integer link}) -snippet llGetLinkPrimitiveParams - llGetLinkPrimitiveParams(${1:integer link}, ${2:list params}) -snippet llGetListEntryType - llGetListEntryType(${1:list src}, ${2:integer index}) -snippet llGetListLength - llGetListLength(${1:list src}) -snippet llGetLocalPos - llGetLocalPos() -snippet llGetLocalRot - llGetLocalRot() -snippet llGetMass - llGetMass() -snippet llGetMassMKS - llGetMassMKS() -snippet llGetMaxScaleFactor - llGetMaxScaleFactor() -snippet llGetMemoryLimit - llGetMemoryLimit() -snippet llGetMinScaleFactor - llGetMinScaleFactor() -snippet llGetNextEmail - llGetNextEmail(${1:string address}, ${2:string subject}); -snippet llGetNotecardLine - llGetNotecardLine(${1:string name}, ${2:integer line}) -snippet llGetNumberOfNotecardLines - llGetNumberOfNotecardLines(${1:string name}) -snippet llGetNumberOfPrims - llGetNumberOfPrims() -snippet llGetNumberOfSides - llGetNumberOfSides() -snippet llGetObjectDesc - llGetObjectDesc() -snippet llGetObjectDetails - llGetObjectDetails(${1:key id}, ${2:list params}) -snippet llGetObjectMass - llGetObjectMass(${1:key id}) -snippet llGetObjectName - llGetObjectName() -snippet llGetObjectPermMask - llGetObjectPermMask(${1:integer mask}) -snippet llGetObjectPrimCount - llGetObjectPrimCount(${1:key prim}) -snippet llGetOmega - llGetOmega() -snippet llGetOwner - llGetOwner() -snippet llGetOwnerKey - llGetOwnerKey(${1:key id}) -snippet llGetParcelDetails - llGetParcelDetails(${1:vector pos}, ${2:list params}) -snippet llGetParcelFlags - llGetParcelFlags(${1:vector pos}) -snippet llGetParcelMaxPrims - llGetParcelMaxPrims(${1:vector pos}, ${2:integer sim_wide}) -snippet llGetParcelMusicURL - llGetParcelMusicURL() -snippet llGetParcelPrimCount - llGetParcelPrimCount(${1:vector pos}, ${2:integer category}, ${3:integer sim_wide}) -snippet llGetParcelPrimOwners - llGetParcelPrimOwners(${1:vector pos}) -snippet llGetPermissions - llGetPermissions() -snippet llGetPermissionsKey - llGetPermissionsKey() -snippet llGetPhysicsMaterial - llGetPhysicsMaterial() -snippet llGetPos - llGetPos() -snippet llGetPrimitiveParams - llGetPrimitiveParams(${1:list params}) -snippet llGetPrimMediaParams - llGetPrimMediaParams(${1:integer face}, ${2:list params}) -snippet llGetRegionAgentCount - llGetRegionAgentCount() -snippet llGetRegionCorner - llGetRegionCorner() -snippet llGetRegionFlags - llGetRegionFlags() -snippet llGetRegionFPS - llGetRegionFPS() -snippet llGetRegionName - llGetRegionName() -snippet llGetRegionTimeDilation - llGetRegionTimeDilation() -snippet llGetRootPosition - llGetRootPosition() -snippet llGetRootRotation - llGetRootRotation() -snippet llGetRot - llGetRot() -snippet llGetScale - llGetScale() -snippet llGetScriptName - llGetScriptName() -snippet llGetScriptState - llGetScriptState(${1:string script}) -snippet llGetSimStats - llGetSimStats(${1:integer stat_type}) -snippet llGetSimulatorHostname - llGetSimulatorHostname() -snippet llGetSPMaxMemory - llGetSPMaxMemory() -snippet llGetStartParameter - llGetStartParameter() -snippet llGetStaticPath - llGetStaticPath(${1:vector start}, ${2:vector end}, ${3:float radius}, ${4:list params}) -snippet llGetStatus - llGetStatus(${1:integer status}) -snippet llGetSubString - llGetSubString(${1:string src}, ${2:integer start}, ${3:integer end}) -snippet llGetSunDirection - llGetSunDirection() -snippet llGetTexture - llGetTexture(${1:integer face}) -snippet llGetTextureOffset - llGetTextureOffset(${1:integer face}) -snippet llGetTextureRot - llGetTextureRot(${1:integer face}) -snippet llGetTextureScale - llGetTextureScale(${1:integer face}) -snippet llGetTime - llGetTime() -snippet llGetTimeOfDay - llGetTimeOfDay() -snippet llGetTimestamp - llGetTimestamp() -snippet llGetTorque - llGetTorque() -snippet llGetUnixTime - llGetUnixTime() -snippet llGetUsedMemory - llGetUsedMemory() -snippet llGetUsername - llGetUsername(${1:key id}) -snippet llGetVel - llGetVel() -snippet llGetWallclock - llGetWallclock() -snippet llGiveInventory - llGiveInventory(${1:key destination}, ${2:string inventory}); -snippet llGiveInventoryList - llGiveInventoryList(${1:key target}, ${2:string folder}, ${3:list inventory}); -snippet llGiveMoney - llGiveMoney(${1:key destination}, ${2:integer amount}) -snippet llGround - llGround(${1:vector offset}) -snippet llGroundContour - llGroundContour(${1:vector offset}) -snippet llGroundNormal - llGroundNormal(${1:vector offset}) -snippet llGroundRepel - llGroundRepel(${1:float height}, ${2:integer water}, ${3:float tau}); -snippet llGroundSlope - llGroundSlope(${1:vector offset}) -snippet llHTTPRequest - llHTTPRequest(${1:string url}, ${2:list parameters}, ${3:string body}) -snippet llHTTPResponse - llHTTPResponse(${1:key request_id}, ${2:integer status}, ${3:string body}); -snippet llInsertString - llInsertString(${1:string dst}, ${2:integer pos}, ${3:string src}) -snippet llInstantMessage - llInstantMessage(${1:key user}, ${2:string message}); -snippet llIntegerToBase64 - llIntegerToBase64(${1:integer number}) -snippet llJson2List - llJson2List(${1:string json}) -snippet llJsonGetValue - llJsonGetValue(${1:string json}, ${2:list specifiers}) -snippet llJsonSetValue - llJsonSetValue(${1:string json}, ${2:list specifiers}, ${3:string newValue}) -snippet llJsonValueType - llJsonValueType(${1:string json}, ${2:list specifiers}) -snippet llKey2Name - llKey2Name(${1:key id}) -snippet llKeyCountKeyValue - llKeyCountKeyValue() -snippet llKeysKeyValue - llKeysKeyValue(${1:integer first}, ${2:integer count}) -snippet llLinkParticleSystem - llLinkParticleSystem(${1:integer link}, ${2:list rules}); -snippet llLinkSitTarget - llLinkSitTarget(${1:integer link}, ${2:vector offset}, ${3:rotation rot}); -snippet llList2CSV - llList2CSV(${1:list src}) -snippet llList2Float - llList2Float(${1:list src}, ${2:integer index}) -snippet llList2Integer - llList2Integer(${1:list src}, ${2:integer index}) -snippet llList2Json - llList2Json(${1:string type}, ${2:list values}) -snippet llList2Key - llList2Key(${1:list src}, ${2:integer index}) -snippet llList2List - llList2List(${1:list src}, ${2:integer start}, ${3:integer end}) -snippet llList2ListStrided - llList2ListStrided(${1:list src}, ${2:integer start}, ${3:integer end}, ${4:integer stride}) -snippet llList2Rot - llList2Rot(${1:list src}, ${2:integer index}) -snippet llList2String - llList2String(${1:list src}, ${2:integer index}) -snippet llList2Vector - llList2Vector(${1:list src}, ${2:integer index}) -snippet llListen - llListen(${1:integer channel}, ${2:string name}, ${3:key id}, ${4:string msg}) -snippet llListenControl - llListenControl(${1:integer handle}, ${2:integer active}); -snippet llListenRemove - llListenRemove(${1:integer handle}); -snippet llListFindList - llListFindList(${1:list src}, ${2:list test}) -snippet llListInsertList - llListInsertList(${1:list dest}, ${2:list src}, ${3:integer start}) -snippet llListRandomize - llListRandomize(${1:list src}, ${2:integer stride}) -snippet llListReplaceList - llListReplaceList(${1:list dest}, ${2:list src}, ${3:integer start}, ${4:integer end}) -snippet llListSort - llListSort(${1:list src}, ${2:integer stride}, ${3:integer ascending}) -snippet llListStatistics - llListStatistics(${1:integer operation}, ${2:list src}) -snippet llLoadURL - llLoadURL(${1:key agent}, ${2:string message}, ${3:string url}); -snippet llLog - llLog(${1:float val}) -snippet llLog10 - llLog10(${1:float val}) -snippet llLookAt - llLookAt(${1:vector target}, ${2:float strength}, ${3:float damping}); -snippet llLoopSound - llLoopSound(${1:string sound}, ${2:float volume}); -snippet llLoopSoundMaster - llLoopSoundMaster(${1:string sound}, ${2:float volume}); -snippet llLoopSoundSlave - llLoopSoundSlave(${1:string sound}, ${2:float volume}); -snippet llManageEstateAccess - llManageEstateAccess(${1:integer action}, ${2:key agent}) -snippet llMapDestination - llMapDestination(${1:string simname}, ${2:vector pos}, ${3:vector look_at}); -snippet llMD5String - llMD5String(${1:string src}, ${2:integer nonce}) -snippet llMessageLinked - llMessageLinked(${1:integer link}, ${2:integer num}, ${3:string str}, ${4:key id}); -snippet llMinEventDelay - llMinEventDelay(${1:float delay}); -snippet llModifyLand - llModifyLand(${1:integer action}, ${2:integer brush}); -snippet llModPow - llModPow(${1:integer a}, ${2:integer b}, ${3:integer c}) -snippet llMoveToTarget - llMoveToTarget(${1:vector target}, ${2:float tau}); -snippet llNavigateTo - llNavigateTo(${1:vector pos}, ${2:list options}); -snippet llOffsetTexture - llOffsetTexture(${1:float u}, ${2:float v}, ${3:integer face}); -snippet llOpenRemoteDataChannel - llOpenRemoteDataChannel(); -snippet llOverMyLand - llOverMyLand(${1:key id}) -snippet llOwnerSay - llOwnerSay(${1:string msg}); -snippet llParcelMediaCommandList - llParcelMediaCommandList(${1:list commandList}); -snippet llParcelMediaQuery - llParcelMediaQuery(${1:list query}) -snippet llParseString2List - llParseString2List(${1:string src}, ${2:list separators}, ${3:list spacers}) -snippet llParseStringKeepNulls - llParseStringKeepNulls(${1:string src}, ${2:list separators}, ${3:list spacers}) -snippet llParticleSystem - llParticleSystem(${1:list rules}); -snippet llPassCollisions - llPassCollisions(${1:integer pass}); -snippet llPassTouches - llPassTouches(${1:integer pass}); -snippet llPatrolPoints - llPatrolPoints(${1:list patrolPoints}, ${2:list options}); -snippet llPlaySound - llPlaySound(${1:string sound}, ${2:float volume}); -snippet llPlaySoundSlave - llPlaySoundSlave(${1:string sound}, ${2:float volume}); -snippet llPow - llPow(${1:float base}, ${2:float exponent}) -snippet llPreloadSound - llPreloadSound(${1:string sound}); -snippet llPursue - llPursue(${1:key target}, ${2:list options}); -snippet llPushObject - llPushObject(${1:key target}, ${2:vector impulse}, ${3:vector ang_impulse}, ${4:integer local}); -snippet llReadKeyValue - llReadKeyValue(${1:string k}) -snippet llRegionSay - llRegionSay(${1:integer channel}, ${2:string msg}); -snippet llRegionSayTo - llRegionSayTo(${1:key target}, ${2:integer channel}, ${3:string msg}); -snippet llReleaseControls - llReleaseControls(); -snippet llReleaseURL - llReleaseURL(${1:string url}); -snippet llRemoteDataReply - llRemoteDataReply(${1:key channel}, ${2:key message_id}, ${3:string sdata}, ${4:integer idata}); -snippet llRemoteLoadScriptPin - llRemoteLoadScriptPin(${1:key target}, ${2:string name}, ${3:integer pin}, ${4:integer running}, ${5:integer start_param}); -snippet llRemoveFromLandBanList - llRemoveFromLandBanList(${1:key agent}); -snippet llRemoveFromLandPassList - llRemoveFromLandPassList(${1:key agent}); -snippet llRemoveInventory - llRemoveInventory(${1:string item}); -snippet llRemoveVehicleFlags - llRemoveVehicleFlags(${1:integer flags}); -snippet llRequestAgentData - llRequestAgentData(${1:key id}, ${2:integer data}) -snippet llRequestDisplayName - llRequestDisplayName(${1:key id}) -snippet llRequestExperiencePermissions - llRequestExperiencePermissions(${1:key agent}, ${2:string name}) -snippet llRequestInventoryData - llRequestInventoryData(${1:string name}) -snippet llRequestPermissions - llRequestPermissions(${1:key agent}, ${2:integer permissions}) -snippet llRequestSecureURL - llRequestSecureURL() -snippet llRequestSimulatorData - llRequestSimulatorData(${1:string region}, ${2:integer data}) -snippet llRequestURL - llRequestURL() -snippet llRequestUsername - llRequestUsername(${1:key id}) -snippet llResetAnimationOverride - llResetAnimationOverride(${1:string anim_state}); -snippet llResetLandBanList - llResetLandBanList(); -snippet llResetLandPassList - llResetLandPassList(); -snippet llResetOtherScript - llResetOtherScript(${1:string name}); -snippet llResetScript - llResetScript(); -snippet llResetTime - llResetTime(); -snippet llReturnObjectsByID - llReturnObjectsByID(${1:list objects}) -snippet llReturnObjectsByOwner - llReturnObjectsByOwner(${1:key owner}, ${2:integer scope}) -snippet llRezAtRoot - llRezAtRoot(${1:string inventory}, ${2:vector position}, ${3:vector velocity}, ${4:rotation rot}, ${5:integer param}); -snippet llRezObject - llRezObject(${1:string inventory}, ${2:vector pos}, ${3:vector vel}, ${4:rotation rot}, ${5:integer param}); -snippet llRot2Angle - llRot2Angle(${1:rotation rot}) -snippet llRot2Axis - llRot2Axis(${1:rotation rot}) -snippet llRot2Euler - llRot2Euler(${1:rotation quat}) -snippet llRot2Fwd - llRot2Fwd(${1:rotation q}) -snippet llRot2Left - llRot2Left(${1:rotation q}) -snippet llRot2Up - llRot2Up(${1:rotation q}) -snippet llRotateTexture - llRotateTexture(${1:float angle}, ${2:integer face}); -snippet llRotBetween - llRotBetween(${1:vector start}, ${2:vector end}) -snippet llRotLookAt - llRotLookAt(${1:rotation target_direction}, ${2:float strength}, ${3:float damping}); -snippet llRotTarget - llRotTarget(${1:rotation rot}, ${2:float error}) -snippet llRotTargetRemove - llRotTargetRemove(${1:integer handle}); -snippet llRound - llRound(${1:float val}) -snippet llSameGroup - llSameGroup(${1:key group}) -snippet llSay - llSay(${1:integer channel}, ${2:string msg}); -snippet llScaleByFactor - llScaleByFactor(${1:float scaling_factor}) -snippet llScaleTexture - llScaleTexture(${1:float u}, ${2:float v}, ${3:integer face}); -snippet llScriptDanger - llScriptDanger(${1:vector pos}) -snippet llScriptProfiler - llScriptProfiler(${1:integer flags}); -snippet llSendRemoteData - llSendRemoteData(${1:key channel}, ${2:string dest}, ${3:integer idata}, ${4:string sdata}) -snippet llSensor - llSensor(${1:string name}, ${2:key id}, ${3:integer type}, ${4:float range}, ${5:float arc}); -snippet llSensorRepeat - llSensorRepeat(${1:string name}, ${2:key id}, ${3:integer type}, ${4:float range}, ${5:float arc}, ${6:float rate}); -snippet llSetAlpha - llSetAlpha(${1:float alpha}, ${2:integer face}); -snippet llSetAngularVelocity - llSetAngularVelocity(${1:vector force}, ${2:integer local}); -snippet llSetAnimationOverride - llSetAnimationOverride(${1:string anim_state}, ${2:string anim}) -snippet llSetBuoyancy - llSetBuoyancy(${1:float buoyancy}); -snippet llSetCameraAtOffset - llSetCameraAtOffset(${1:vector offset}); -snippet llSetCameraEyeOffset - llSetCameraEyeOffset(${1:vector offset}); -snippet llSetCameraParams - llSetCameraParams(${1:list rules}); -snippet llSetClickAction - llSetClickAction(${1:integer action}); -snippet llSetColor - llSetColor(${1:vector color}, ${2:integer face}); -snippet llSetContentType - llSetContentType(${1:key request_id}, ${2:integer content_type}); -snippet llSetDamage - llSetDamage(${1:float damage}); -snippet llSetForce - llSetForce(${1:vector force}, ${2:integer local}); -snippet llSetForceAndTorque - llSetForceAndTorque(${1:vector force}, ${2:vector torque}, ${3:integer local}); -snippet llSetHoverHeight - llSetHoverHeight(${1:float height}, ${2:integer water}, ${3:float tau}); -snippet llSetKeyframedMotion - llSetKeyframedMotion(${1:list keyframes}, ${2:list options}); -snippet llSetLinkAlpha - llSetLinkAlpha(${1:integer link}, ${2:float alpha}, ${3:integer face}); -snippet llSetLinkCamera - llSetLinkCamera(${1:integer link}, ${2:vector eye}, ${3:vector at}); -snippet llSetLinkColor - llSetLinkColor(${1:integer link}, ${2:vector color}, ${3:integer face}); -snippet llSetLinkMedia - llSetLinkMedia(${1:integer link}, ${2:integer face}, ${3:list params}); -snippet llSetLinkPrimitiveParams - llSetLinkPrimitiveParams(${1:integer link}, ${2:list rules}); -snippet llSetLinkPrimitiveParamsFast - llSetLinkPrimitiveParamsFast(${1:integer link}, ${2:list rules}); -snippet llSetLinkTexture - llSetLinkTexture(${1:integer link}, ${2:string texture}, ${3:integer face}); -snippet llSetLinkTextureAnim - llSetLinkTextureAnim(${1:integer link}, ${2:integer mode}, ${3:integer face}, ${4:integer sizex}, ${5:integer sizey}, ${6:float start}, ${7:float length}, ${8:float rate}); -snippet llSetLocalRot - llSetLocalRot(${1:rotation rot}); -snippet llSetMemoryLimit - llSetMemoryLimit(${1:integer limit}) -snippet llSetObjectDesc - llSetObjectDesc(${1:string description}); -snippet llSetObjectName - llSetObjectName(${1:string name}); -snippet llSetParcelMusicURL - llSetParcelMusicURL(${1:string url}); -snippet llSetPayPrice - llSetPayPrice(${1:integer price}, [${2:integer price_button_a}, ${3:integer price_button_b}, ${4:integer price_button_c}, ${5:integer price_button_d}]); -snippet llSetPhysicsMaterial - llSetPhysicsMaterial(${1:integer mask}, ${2:float gravity_multiplier}, ${3:float restitution}, ${4:float friction}, ${5:float density}); -snippet llSetPos - llSetPos(${1:vector pos}); -snippet llSetPrimitiveParams - llSetPrimitiveParams(${1:list rules}); -snippet llSetPrimMediaParams - llSetPrimMediaParams(${1:integer face}, ${2:list params}); -snippet llSetRegionPos - llSetRegionPos(${1:vector position}) -snippet llSetRemoteScriptAccessPin - llSetRemoteScriptAccessPin(${1:integer pin}); -snippet llSetRot - llSetRot(${1:rotation rot}); -snippet llSetScale - llSetScale(${1:vector size}); -snippet llSetScriptState - llSetScriptState(${1:string name}, ${2:integer run}); -snippet llSetSitText - llSetSitText(${1:string text}); -snippet llSetSoundQueueing - llSetSoundQueueing(${1:integer queue}); -snippet llSetSoundRadius - llSetSoundRadius(${1:float radius}); -snippet llSetStatus - llSetStatus(${1:integer status}, ${2:integer value}); -snippet llSetText - llSetText(${1:string text}, ${2:vector color}, ${3:float alpha}); -snippet llSetTexture - llSetTexture(${1:string texture}, ${2:integer face}); -snippet llSetTextureAnim - llSetTextureAnim(${1:integer mode}, ${2:integer face}, ${3:integer sizex}, ${4:integer sizey}, ${5:float start}, ${6:float length}, ${7:float rate}); -snippet llSetTimerEvent - llSetTimerEvent(${1:float sec}); -snippet llSetTorque - llSetTorque(${1:vector torque}, ${2:integer local}); -snippet llSetTouchText - llSetTouchText(${1:string text}); -snippet llSetVehicleFlags - llSetVehicleFlags(${1:integer flags}); -snippet llSetVehicleFloatParam - llSetVehicleFloatParam(${1:integer param}, ${2:float value}); -snippet llSetVehicleRotationParam - llSetVehicleRotationParam(${1:integer param}, ${2:rotation rot}); -snippet llSetVehicleType - llSetVehicleType(${1:integer type}); -snippet llSetVehicleVectorParam - llSetVehicleVectorParam(${1:integer param}, ${2:vector vec}); -snippet llSetVelocity - llSetVelocity(${1:vector force}, ${2:integer local}); -snippet llSHA1String - llSHA1String(${1:string src}) -snippet llShout - llShout(${1:integer channel}, ${2:string msg}); -snippet llSin - llSin(${1:float theta}) -snippet llSitTarget - llSitTarget(${1:vector offset}, ${2:rotation rot}); -snippet llSleep - llSleep(${1:float sec}); -snippet llSqrt - llSqrt(${1:float val}) -snippet llStartAnimation - llStartAnimation(${1:string anim}); -snippet llStopAnimation - llStopAnimation(${1:string anim}); -snippet llStopHover - llStopHover(); -snippet llStopLookAt - llStopLookAt(); -snippet llStopMoveToTarget - llStopMoveToTarget(); -snippet llStopSound - llStopSound(); -snippet llStringLength - llStringLength(${1:string str}) -snippet llStringToBase64 - llStringToBase64(${1:string str}) -snippet llStringTrim - llStringTrim(${1:string src}, ${2:integer type}) -snippet llSubStringIndex - llSubStringIndex(${1:string source}, ${2:string pattern}) -snippet llTakeControls - llTakeControls(${1:integer controls}, ${2:integer accept}, ${3:integer pass_on}); -snippet llTan - llTan(${1:float theta}) -snippet llTarget - llTarget(${1:vector position}, ${2:float range}) -snippet llTargetOmega - llTargetOmega(${1:vector axis}, ${2:float spinrate}, ${3:float gain}); -snippet llTargetRemove - llTargetRemove(${1:integer handle}); -snippet llTeleportAgent - llTeleportAgent(${1:key agent}, ${2:string landmark}, ${3:vector position}, ${4:vector look_at}); -snippet llTeleportAgentGlobalCoords - llTeleportAgentGlobalCoords(${1:key agent}, ${2:vector global_coordinates}, ${3:vector region_coordinates}, ${4:vector look_at}); -snippet llTeleportAgentHome - llTeleportAgentHome(${1:key agent}); -snippet llTextBox - llTextBox(${1:key agent}, ${2:string message}, ${3:integer channel}); -snippet llToLower - llToLower(${1:string src}) -snippet llToUpper - llToUpper(${1:string src}) -snippet llTransferLindenDollars - llTransferLindenDollars(${1:key destination}, ${2:integer amount}) -snippet llTriggerSound - llTriggerSound(${1:string sound}, ${2:float volume}); -snippet llTriggerSoundLimited - llTriggerSoundLimited(${1:string sound}, ${2:float volume}, ${3:vector top_north_east}, ${4:vector bottom_south_west}); -snippet llUnescapeURL - llUnescapeURL(${1:string url}) -snippet llUnSit - llUnSit(${1:key id}); -snippet llUpdateCharacter - llUpdateCharacter(${1:list options}) -snippet llUpdateKeyValue - llUpdateKeyValue(${1:string k}, ${2:string v}, ${3:integer checked}, ${4:string ov}) -snippet llVecDist - llVecDist(${1:vector vec_a}, ${2:vector vec_b}) -snippet llVecMag - llVecMag(${1:vector vec}) -snippet llVecNorm - llVecNorm(${1:vector vec}) -snippet llVolumeDetect - llVolumeDetect(${1:integer detect}); -snippet llWanderWithin - llWanderWithin(${1:vector origin}, ${2:vector dist}, ${3:list options}); -snippet llWater - llWater(${1:vector offset}); -snippet llWhisper - llWhisper(${1:integer channel}, ${2:string msg}); -snippet llWind - llWind(${1:vector offset}); -snippet llXorBase64 - llXorBase64(${1:string str1}, ${2:string str2}) -snippet money - money(${1:key id}, ${2:integer amount}) - { - $0 - } -snippet object_rez - object_rez(${1:key id}) - { - $0 - } -snippet on_rez - on_rez(${1:integer start_param}) - { - $0 - } -snippet path_update - path_update(${1:integer type}, ${2:list reserved}) - { - $0 - } -snippet remote_data - remote_data(${1:integer event_type}, ${2:key channel}, ${3:key message_id}, ${4:string sender}, ${5:integer idata}, ${6:string sdata}) - { - $0 - } -snippet run_time_permissions - run_time_permissions(${1:integer perm}) - { - $0 - } -snippet sensor - sensor(${1:integer index}) - { - $0 - } -snippet state - state ${1:name} -snippet touch - touch(${1:integer index}) - { - $0 - } -snippet touch_end - touch_end(${1:integer index}) - { - $0 - } -snippet touch_start - touch_start(${1:integer index}) - { - $0 - } -snippet transaction_result - transaction_result(${1:key id}, ${2:integer success}, ${3:string data}) - { - $0 - } -snippet while - while (${1:condition}) - { - $0 - } diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.js deleted file mode 100644 index 0ab6fdcd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lua.snippets"); -exports.scope = "lua"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.snippets deleted file mode 100644 index 34ae25eb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.snippets +++ /dev/null @@ -1,21 +0,0 @@ -snippet #! - #!/usr/bin/env lua - $1 -snippet local - local ${1:x} = ${2:1} -snippet fun - function ${1:fname}(${2:...}) - ${3:-- body} - end -snippet for - for ${1:i}=${2:1},${3:10} do - ${4:print(i)} - end -snippet forp - for ${1:i},${2:v} in pairs(${3:table_name}) do - ${4:-- body} - end -snippet fori - for ${1:i},${2:v} in ipairs(${3:table_name}) do - ${4:-- body} - end diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.js deleted file mode 100644 index 86b22842..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./luapage.snippets"); -exports.scope = "luapage"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.js deleted file mode 100644 index 01edb07d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lucene.snippets"); -exports.scope = "lucene"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.js deleted file mode 100644 index 0ec05ac0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./makefile.snippets"); -exports.scope = "makefile"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.snippets deleted file mode 100644 index 43648136..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.snippets +++ /dev/null @@ -1,4 +0,0 @@ -snippet ifeq - ifeq (${1:cond0},${2:cond1}) - ${3:code} - endif diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mako.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mako.snippets deleted file mode 100644 index 2a0aef9c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mako.snippets +++ /dev/null @@ -1,54 +0,0 @@ -snippet def - <%def name="${1:name}"> - ${2:} - -snippet call - <%call expr="${1:name}"> - ${2:} - -snippet doc - <%doc> - ${1:} - -snippet text - <%text> - ${1:} - -snippet for - % for ${1:i} in ${2:iter}: - ${3:} - % endfor -snippet if if - % if ${1:condition}: - ${2:} - % endif -snippet if if/else - % if ${1:condition}: - ${2:} - % else: - ${3:} - % endif -snippet try - % try: - ${1:} - % except${2:}: - ${3:pass} - % endtry -snippet wh - % while ${1:}: - ${2:} - % endwhile -snippet $ - ${ ${1:} } -snippet <% - <% ${1:} %> -snippet -snippet inherit - <%inherit file="${1:filename}" /> -snippet include - <%include file="${1:filename}" /> -snippet namespace - <%namespace file="${1:name}" /> -snippet page - <%page args="${1:}" /> diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.js deleted file mode 100644 index 3940bc90..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./markdown.snippets"); -exports.scope = "markdown"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.snippets deleted file mode 100644 index a5110fc9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.snippets +++ /dev/null @@ -1,88 +0,0 @@ -# Markdown - -# Includes octopress (http://octopress.org/) snippets - -snippet [ - [${1:text}](http://${2:address} "${3:title}") -snippet [* - [${1:link}](${2:`@*`} "${3:title}")${4} - -snippet [: - [${1:id}]: http://${2:url} "${3:title}" -snippet [:* - [${1:id}]: ${2:`@*`} "${3:title}" - -snippet ![ - ![${1:alttext}](${2:/images/image.jpg} "${3:title}") -snippet ![* - ![${1:alt}](${2:`@*`} "${3:title}")${4} - -snippet ![: - ![${1:id}]: ${2:url} "${3:title}" -snippet ![:* - ![${1:id}]: ${2:`@*`} "${3:title}" - -snippet === -regex /^/=+/=*// - ${PREV_LINE/./=/g} - - ${0} -snippet --- -regex /^/-+/-*// - ${PREV_LINE/./-/g} - - ${0} -snippet blockquote - {% blockquote %} - ${1:quote} - {% endblockquote %} - -snippet blockquote-author - {% blockquote ${1:author}, ${2:title} %} - ${3:quote} - {% endblockquote %} - -snippet blockquote-link - {% blockquote ${1:author} ${2:URL} ${3:link_text} %} - ${4:quote} - {% endblockquote %} - -snippet bt-codeblock-short - ``` - ${1:code_snippet} - ``` - -snippet bt-codeblock-full - ``` ${1:language} ${2:title} ${3:URL} ${4:link_text} - ${5:code_snippet} - ``` - -snippet codeblock-short - {% codeblock %} - ${1:code_snippet} - {% endcodeblock %} - -snippet codeblock-full - {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %} - ${5:code_snippet} - {% endcodeblock %} - -snippet gist-full - {% gist ${1:gist_id} ${2:filename} %} - -snippet gist-short - {% gist ${1:gist_id} %} - -snippet img - {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${6:alt_text} %} - -snippet youtube - {% youtube ${1:video_id} %} - -# The quote should appear only once in the text. It is inherently part of it. -# See http://octopress.org/docs/plugins/pullquote/ for more info. - -snippet pullquote - {% pullquote %} - ${1:text} {" ${2:quote} "} ${3:text} - {% endpullquote %} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.js deleted file mode 100644 index 698366ba..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./matlab.snippets"); -exports.scope = "matlab"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.js deleted file mode 100644 index 090d79b3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mel.snippets"); -exports.scope = "mel"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.js deleted file mode 100644 index 8b0d2dcb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mushcode.snippets"); -exports.scope = "mushcode"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.js deleted file mode 100644 index 25d42827..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mushcode_high_rules.snippets"); -exports.scope = "mushcode_high_rules"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.js deleted file mode 100644 index e5462390..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mysql.snippets"); -exports.scope = "mysql"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.js deleted file mode 100644 index 583abf85..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./nix.snippets"); -exports.scope = "nix"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objc.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objc.snippets deleted file mode 100644 index 5517b062..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objc.snippets +++ /dev/null @@ -1,247 +0,0 @@ -# #import <...> -snippet Imp - #import <${1:Cocoa/Cocoa.h}>${2} -# #import "..." -snippet imp - #import "${1:`Filename()`.h}"${2} -# @selector(...) -snippet sel - @selector(${1:method}:)${3} -# @"..." string -snippet s - @"${1}"${2} -# Object -snippet o - ${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};${5} -# NSLog(...) -snippet log - NSLog(@"${1:%@}"${2});${3} -# Class -snippet objc - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - { - } - @end - - @implementation $1 - ${3} - @end -# Class Interface -snippet int - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - {${3} - } - ${4} - @end -snippet @interface - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - {${3} - } - ${4} - @end -# Class Implementation -snippet impl - @implementation ${1:`Filename('', 'someClass')`} - ${2} - @end -snippet @implementation - @implementation ${1:`Filename('', 'someClass')`} - ${2} - @end -# Protocol -snippet pro - @protocol ${1:`Filename('$1Delegate', 'MyProtocol')`} ${2:} - ${3} - @end -snippet @protocol - @protocol ${1:`Filename('$1Delegate', 'MyProtocol')`} ${2:} - ${3} - @end -# init Definition -snippet init - - (id)init - { - if (self = [super init]) { - ${1} - } - return self; - } -# dealloc Definition -snippet dealloc - - (void) dealloc - { - ${1:deallocations} - [super dealloc]; - } -snippet su - [super ${1:init}]${2} -snippet ibo - IBOutlet ${1:NSSomeClass} *${2:$1};${3} -# Category -snippet cat - @interface ${1:NSObject} (${2:MyCategory}) - @end - - @implementation $1 ($2) - ${3} - @end -# Category Interface -snippet cath - @interface ${1:`Filename('$1', 'NSObject')`} (${2:MyCategory}) - ${3} - @end -# Method -snippet m - - (${1:id})${2:method} - { - ${3} - } -# Method declaration -snippet md - - (${1:id})${2:method};${3} -# IBAction declaration -snippet ibad - - (IBAction)${1:method}:(${2:id})sender;${3} -# IBAction method -snippet iba - - (IBAction)${1:method}:(${2:id})sender - { - ${3} - } -# awakeFromNib method -snippet wake - - (void)awakeFromNib - { - ${1} - } -# Class Method -snippet M - + (${1:id})${2:method} - { - ${3:return nil;} - } -# Sub-method (Call super) -snippet sm - - (${1:id})${2:method} - { - [super $2];${3} - return self; - } -# Accessor Methods For: -# Object -snippet objacc - - (${1:id})${2:thing} - { - return $2; - } - - - (void)set$2:($1)${3:new$2} - { - [$3 retain]; - [$2 release]; - $2 = $3; - }${4} -# for (object in array) -snippet forin - for (${1:Class} *${2:some$1} in ${3:array}) { - ${4} - } -snippet fore - for (${1:object} in ${2:array}) { - ${3:statements} - } -snippet forarray - unsigned int ${1:object}Count = [${2:array} count]; - - for (unsigned int index = 0; index < $1Count; index++) { - ${3:id} $1 = [$2 $1AtIndex:index]; - ${4} - } -snippet fora - unsigned int ${1:object}Count = [${2:array} count]; - - for (unsigned int index = 0; index < $1Count; index++) { - ${3:id} $1 = [$2 $1AtIndex:index]; - ${4} - } -# Try / Catch Block -snippet @try - @try { - ${1:statements} - } - @catch (NSException * e) { - ${2:handler} - } - @finally { - ${3:statements} - } -snippet @catch - @catch (${1:exception}) { - ${2:handler} - } -snippet @finally - @finally { - ${1:statements} - } -# IBOutlet -# @property (Objective-C 2.0) -snippet prop - @property (${1:retain}) ${2:NSSomeClass} ${3:*$2};${4} -# @synthesize (Objective-C 2.0) -snippet syn - @synthesize ${1:property};${2} -# [[ alloc] init] -snippet alloc - [[${1:foo} alloc] init${2}];${3} -snippet a - [[${1:foo} alloc] init${2}];${3} -# retain -snippet ret - [${1:foo} retain];${2} -# release -snippet rel - [${1:foo} release]; -# autorelease -snippet arel - [${1:foo} autorelease]; -# autorelease pool -snippet pool - NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init]; - ${2:/* code */} - [$1 drain]; -# Throw an exception -snippet except - NSException *${1:badness}; - $1 = [NSException exceptionWithName:@"${2:$1Name}" - reason:@"${3}" - userInfo:nil]; - [$1 raise]; -snippet prag - #pragma mark ${1:-} -snippet cl - @class ${1:Foo};${2} -snippet color - [[NSColor ${1:blackColor}] set]; -# NSArray -snippet array - NSMutableArray *${1:array} = [NSMutable array];${2} -snippet nsa - NSArray ${1} -snippet nsma - NSMutableArray ${1} -snippet aa - NSArray * array;${1} -snippet ma - NSMutableArray * array;${1} -# NSDictionary -snippet dict - NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2} -snippet nsd - NSDictionary ${1} -snippet nsmd - NSMutableDictionary ${1} -# NSString -snippet nss - NSString ${1} -snippet nsms - NSMutableString ${1} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.js deleted file mode 100644 index ed5d5fa8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./objectivec.snippets"); -exports.scope = "objectivec"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.js deleted file mode 100644 index a6e6842e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./ocaml.snippets"); -exports.scope = "ocaml"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.js deleted file mode 100644 index cd8f19fe..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./pascal.snippets"); -exports.scope = "pascal"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.js deleted file mode 100644 index 9b1fbe8d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./perl.snippets"); -exports.scope = "perl"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.snippets deleted file mode 100644 index 9cebedea..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.snippets +++ /dev/null @@ -1,347 +0,0 @@ -# #!/usr/bin/perl -snippet #! - #!/usr/bin/env perl - -# Hash Pointer -snippet . - => -# Function -snippet sub - sub ${1:function_name} { - ${2:#body ...} - } -# Conditional -snippet if - if (${1}) { - ${2:# body...} - } -# Conditional if..else -snippet ife - if (${1}) { - ${2:# body...} - } - else { - ${3:# else...} - } -# Conditional if..elsif..else -snippet ifee - if (${1}) { - ${2:# body...} - } - elsif (${3}) { - ${4:# elsif...} - } - else { - ${5:# else...} - } -# Conditional One-line -snippet xif - ${1:expression} if ${2:condition};${3} -# Unless conditional -snippet unless - unless (${1}) { - ${2:# body...} - } -# Unless conditional One-line -snippet xunless - ${1:expression} unless ${2:condition};${3} -# Try/Except -snippet eval - local $@; - eval { - ${1:# do something risky...} - }; - if (my $e = $@) { - ${2:# handle failure...} - } -# While Loop -snippet wh - while (${1}) { - ${2:# body...} - } -# While Loop One-line -snippet xwh - ${1:expression} while ${2:condition};${3} -# C-style For Loop -snippet cfor - for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4:# body...} - } -# For loop one-line -snippet xfor - ${1:expression} for @${2:array};${3} -# Foreach Loop -snippet for - foreach my $${1:x} (@${2:array}) { - ${3:# body...} - } -# Foreach Loop One-line -snippet fore - ${1:expression} foreach @${2:array};${3} -# Package -snippet package - package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}; - - ${2} - - 1; - - __END__ -# Package syntax perl >= 5.14 -snippet packagev514 - package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99}; - - ${3} - - 1; - - __END__ -#moose -snippet moose - use Moose; - use namespace::autoclean; - ${1:#}BEGIN {extends '${2:ParentClass}'}; - - ${3} -# parent -snippet parent - use parent qw(${1:Parent Class}); -# Read File -snippet slurp - my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> }; - ${3} -# strict warnings -snippet strwar - use strict; - use warnings; -# older versioning with perlcritic bypass -snippet vers - ## no critic - our $VERSION = '${1:version}'; - eval $VERSION; - ## use critic -# new 'switch' like feature -snippet switch - use feature 'switch'; - -# Anonymous subroutine -snippet asub - sub { - ${1:# body } - } - - - -# Begin block -snippet begin - BEGIN { - ${1:# begin body} - } - -# call package function with some parameter -snippet pkgmv - __PACKAGE__->${1:package_method}(${2:var}) - -# call package function without a parameter -snippet pkgm - __PACKAGE__->${1:package_method}() - -# call package "get_" function without a parameter -snippet pkget - __PACKAGE__->get_${1:package_method}() - -# call package function with a parameter -snippet pkgetv - __PACKAGE__->get_${1:package_method}(${2:var}) - -# complex regex -snippet qrx - qr/ - ${1:regex} - /xms - -#simpler regex -snippet qr/ - qr/${1:regex}/x - -#given -snippet given - given ($${1:var}) { - ${2:# cases} - ${3:# default} - } - -# switch-like case -snippet when - when (${1:case}) { - ${2:# body} - } - -# hash slice -snippet hslice - @{ ${1:hash} }{ ${2:array} } - - -# map -snippet map - map { ${2: body } } ${1: @array } ; - - - -# Pod stub -snippet ppod - =head1 NAME - - ${1:ClassName} - ${2:ShortDesc} - - =head1 SYNOPSIS - - use $1; - - ${3:# synopsis...} - - =head1 DESCRIPTION - - ${4:# longer description...} - - - =head1 INTERFACE - - - =head1 DEPENDENCIES - - - =head1 SEE ALSO - - -# Heading for a subroutine stub -snippet psub - =head2 ${1:MethodName} - - ${2:Summary....} - -# Heading for inline subroutine pod -snippet psubi - =head2 ${1:MethodName} - - ${2:Summary...} - - - =cut -# inline documented subroutine -snippet subpod - =head2 $1 - - Summary of $1 - - =cut - - sub ${1:subroutine_name} { - ${2:# body...} - } -# Subroutine signature -snippet parg - =over 2 - - =item - Arguments - - - =over 3 - - =item - C<${1:DataStructure}> - - ${2:Sample} - - - =back - - - =item - Return - - =over 3 - - - =item - C<${3:...return data}> - - - =back - - - =back - - - -# Moose has -snippet has - has ${1:attribute} => ( - is => '${2:ro|rw}', - isa => '${3:Str|Int|HashRef|ArrayRef|etc}', - default => sub { - ${4:defaultvalue} - }, - ${5:# other attributes} - ); - - -# override -snippet override - override ${1:attribute} => sub { - ${2:# my $self = shift;}; - ${3:# my ($self, $args) = @_;}; - }; - - -# use test classes -snippet tuse - use Test::More; - use Test::Deep; # (); # uncomment to stop prototype errors - use Test::Exception; - -# local test lib -snippet tlib - use lib qw{ ./t/lib }; - -#test methods -snippet tmeths - $ENV{TEST_METHOD} = '${1:regex}'; - -# runtestclass -snippet trunner - use ${1:test_class}; - $1->runtests(); - -# Test::Class-style test -snippet tsub - sub t${1:number}_${2:test_case} :Test(${3:num_of_tests}) { - my $self = shift; - ${4:# body} - - } - -# Test::Routine-style test -snippet trsub - test ${1:test_name} => { description => '${2:Description of test.}'} => sub { - my ($self) = @_; - ${3:# test code} - }; - -#prep test method -snippet tprep - sub prep${1:number}_${2:test_case} :Test(startup) { - my $self = shift; - ${4:# body} - } - -# cause failures to print stack trace -snippet debug_trace - use Carp; # 'verbose'; - # cloak "die" - # warn "warning" - $SIG{'__DIE__'} = sub { - require Carp; Carp::confess - }; - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.js deleted file mode 100644 index 9bbd9012..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./pgsql.snippets"); -exports.scope = "pgsql"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.js deleted file mode 100644 index b8f8ce0e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./php.snippets"); -exports.scope = "php"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.snippets deleted file mode 100644 index 8d11a281..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.snippets +++ /dev/null @@ -1,377 +0,0 @@ -snippet -# this one is for php5.4 -snippet -snippet ns - namespace ${1:Foo\Bar\Baz}; - ${2} -snippet use - use ${1:Foo\Bar\Baz}; - ${2} -snippet c - ${1:abstract }class ${2:$FILENAME} - { - ${3} - } -snippet i - interface ${1:$FILENAME} - { - ${2} - } -snippet t. - $this->${1} -snippet f - function ${1:foo}(${2:array }${3:$bar}) - { - ${4} - } -# method -snippet m - ${1:abstract }${2:protected}${3: static} function ${4:foo}(${5:array }${6:$bar}) - { - ${7} - } -# setter method -snippet sm - /** - * Sets the value of ${1:foo} - * - * @param ${2:$1} $$1 ${3:description} - * - * @return ${4:$FILENAME} - */ - ${5:public} function set${6:$2}(${7:$2 }$$1) - { - $this->${8:$1} = $$1; - return $this; - }${9} -# getter method -snippet gm - /** - * Gets the value of ${1:foo} - * - * @return ${2:$1} - */ - ${3:public} function get${4:$2}() - { - return $this->${5:$1}; - }${6} -#setter -snippet $s - ${1:$foo}->set${2:Bar}(${3}); -#getter -snippet $g - ${1:$foo}->get${2:Bar}(); - -# Tertiary conditional -snippet =?: - $${1:foo} = ${2:true} ? ${3:a} : ${4}; -snippet ?: - ${1:true} ? ${2:a} : ${3} - -snippet C - $_COOKIE['${1:variable}']${2} -snippet E - $_ENV['${1:variable}']${2} -snippet F - $_FILES['${1:variable}']${2} -snippet G - $_GET['${1:variable}']${2} -snippet P - $_POST['${1:variable}']${2} -snippet R - $_REQUEST['${1:variable}']${2} -snippet S - $_SERVER['${1:variable}']${2} -snippet SS - $_SESSION['${1:variable}']${2} - -# the following are old ones -snippet inc - include '${1:file}';${2} -snippet inc1 - include_once '${1:file}';${2} -snippet req - require '${1:file}';${2} -snippet req1 - require_once '${1:file}';${2} -# Start Docblock -snippet /* - /** - * ${1} - */ -# Class - post doc -snippet doc_cp - /** - * ${1:undocumented class} - * - * @package ${2:default} - * @subpackage ${3:default} - * @author ${4:`g:snips_author`} - */${5} -# Class Variable - post doc -snippet doc_vp - /** - * ${1:undocumented class variable} - * - * @var ${2:string} - */${3} -# Class Variable -snippet doc_v - /** - * ${3:undocumented class variable} - * - * @var ${4:string} - */ - ${1:var} $${2};${5} -# Class -snippet doc_c - /** - * ${3:undocumented class} - * - * @package ${4:default} - * @subpackage ${5:default} - * @author ${6:`g:snips_author`} - */ - ${1:}class ${2:} - { - ${7} - } // END $1class $2 -# Constant Definition - post doc -snippet doc_dp - /** - * ${1:undocumented constant} - */${2} -# Constant Definition -snippet doc_d - /** - * ${3:undocumented constant} - */ - define(${1}, ${2});${4} -# Function - post doc -snippet doc_fp - /** - * ${1:undocumented function} - * - * @return ${2:void} - * @author ${3:`g:snips_author`} - */${4} -# Function signature -snippet doc_s - /** - * ${4:undocumented function} - * - * @return ${5:void} - * @author ${6:`g:snips_author`} - */ - ${1}function ${2}(${3});${7} -# Function -snippet doc_f - /** - * ${4:undocumented function} - * - * @return ${5:void} - * @author ${6:`g:snips_author`} - */ - ${1}function ${2}(${3}) - {${7} - } -# Header -snippet doc_h - /** - * ${1} - * - * @author ${2:`g:snips_author`} - * @version ${3:$Id$} - * @copyright ${4:$2}, `strftime('%d %B, %Y')` - * @package ${5:default} - */ - -# Interface -snippet interface - /** - * ${2:undocumented class} - * - * @package ${3:default} - * @author ${4:`g:snips_author`} - */ - interface ${1:$FILENAME} - { - ${5} - } -# class ... -snippet class - /** - * ${1} - */ - class ${2:$FILENAME} - { - ${3} - /** - * ${4} - */ - ${5:public} function ${6:__construct}(${7:argument}) - { - ${8:// code...} - } - } -# define(...) -snippet def - define('${1}'${2});${3} -# defined(...) -snippet def? - ${1}defined('${2}')${3} -snippet wh - while (${1:/* condition */}) { - ${2:// code...} - } -# do ... while -snippet do - do { - ${2:// code... } - } while (${1:/* condition */}); -snippet if - if (${1:/* condition */}) { - ${2:// code...} - } -snippet ifil - - ${2:} - -snippet ife - if (${1:/* condition */}) { - ${2:// code...} - } else { - ${3:// code...} - } - ${4} -snippet ifeil - - ${2:} - - ${3:} - - ${4} -snippet else - else { - ${1:// code...} - } -snippet elseif - elseif (${1:/* condition */}) { - ${2:// code...} - } -snippet switch - switch ($${1:variable}) { - case '${2:value}': - ${3:// code...} - break; - ${5} - default: - ${4:// code...} - break; - } -snippet case - case '${1:value}': - ${2:// code...} - break;${3} -snippet for - for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4: // code...} - } -snippet foreach - foreach ($${1:variable} as $${2:value}) { - ${3:// code...} - } -snippet foreachil - - ${3:} - -snippet foreachk - foreach ($${1:variable} as $${2:key} => $${3:value}) { - ${4:// code...} - } -snippet foreachkil - $${3:value}): ?> - ${4:} - -# $... = array (...) -snippet array - $${1:arrayName} = array('${2}' => ${3});${4} -snippet try - try { - ${2} - } catch (${1:Exception} $e) { - } -# lambda with closure -snippet lambda - ${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) { - ${4} - }; -# pre_dump(); -snippet pd - echo '
    '; var_dump(${1}); echo '
    '; -# pre_dump(); die(); -snippet pdd - echo '
    '; var_dump(${1}); echo '
    '; die(${2:}); -snippet vd - var_dump(${1}); -snippet vdd - var_dump(${1}); die(${2:}); -snippet http_redirect - header ("HTTP/1.1 301 Moved Permanently"); - header ("Location: ".URL); - exit(); -# Getters & Setters -snippet gs - /** - * Gets the value of ${1:foo} - * - * @return ${2:$1} - */ - public function get${3:$2}() - { - return $this->${4:$1}; - } - - /** - * Sets the value of $1 - * - * @param $2 $$1 ${5:description} - * - * @return ${6:$FILENAME} - */ - public function set$3(${7:$2 }$$1) - { - $this->$4 = $$1; - return $this; - }${8} -# anotation, get, and set, useful for doctrine -snippet ags - /** - * ${1:description} - * - * @${7} - */ - ${2:protected} $${3:foo}; - - public function get${4:$3}() - { - return $this->$3; - } - - public function set$4(${5:$4 }$${6:$3}) - { - $this->$3 = $$6; - return $this; - } -snippet rett - return true; -snippet retf - return false; diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.js deleted file mode 100644 index 4b4dad55..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./plain_text.snippets"); -exports.scope = "plain_text"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.js deleted file mode 100644 index 4639a304..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./powershell.snippets"); -exports.scope = "powershell"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.js deleted file mode 100644 index 18afa87f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./praat.snippets"); -exports.scope = "praat"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.js deleted file mode 100644 index 7c9d0fbc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./prolog.snippets"); -exports.scope = "prolog"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.js deleted file mode 100644 index 18bd3883..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./properties.snippets"); -exports.scope = "properties"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.js deleted file mode 100644 index 24855545..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = ""; -exports.scope = "protobuf"; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.js deleted file mode 100644 index 48ddba28..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./python.snippets"); -exports.scope = "python"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.snippets deleted file mode 100644 index 347bbdeb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.snippets +++ /dev/null @@ -1,158 +0,0 @@ -snippet #! - #!/usr/bin/env python -snippet imp - import ${1:module} -snippet from - from ${1:package} import ${2:module} -# Module Docstring -snippet docs - ''' - File: ${1:FILENAME:file_name} - Author: ${2:author} - Description: ${3} - ''' -snippet wh - while ${1:condition}: - ${2:# TODO: write code...} -# dowh - does the same as do...while in other languages -snippet dowh - while True: - ${1:# TODO: write code...} - if ${2:condition}: - break -snippet with - with ${1:expr} as ${2:var}: - ${3:# TODO: write code...} -# New Class -snippet cl - class ${1:ClassName}(${2:object}): - """${3:docstring for $1}""" - def __init__(self, ${4:arg}): - ${5:super($1, self).__init__()} - self.$4 = $4 - ${6} -# New Function -snippet def - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - """${3:docstring for $1}""" - ${4:# TODO: write code...} -snippet deff - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - ${3:# TODO: write code...} -# New Method -snippet defs - def ${1:mname}(self, ${2:arg}): - ${3:# TODO: write code...} -# New Property -snippet property - def ${1:foo}(): - doc = "${2:The $1 property.}" - def fget(self): - ${3:return self._$1} - def fset(self, value): - ${4:self._$1 = value} -# Ifs -snippet if - if ${1:condition}: - ${2:# TODO: write code...} -snippet el - else: - ${1:# TODO: write code...} -snippet ei - elif ${1:condition}: - ${2:# TODO: write code...} -# For -snippet for - for ${1:item} in ${2:items}: - ${3:# TODO: write code...} -# Encodes -snippet cutf8 - # -*- coding: utf-8 -*- -snippet clatin1 - # -*- coding: latin-1 -*- -snippet cascii - # -*- coding: ascii -*- -# Lambda -snippet ld - ${1:var} = lambda ${2:vars} : ${3:action} -snippet . - self. -snippet try Try/Except - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} -snippet try Try/Except/Else - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:# TODO: write code...} -snippet try Try/Except/Finally - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - finally: - ${5:# TODO: write code...} -snippet try Try/Except/Else/Finally - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:# TODO: write code...} - finally: - ${6:# TODO: write code...} -# if __name__ == '__main__': -snippet ifmain - if __name__ == '__main__': - ${1:main()} -# __magic__ -snippet _ - __${1:init}__${2} -# python debugger (pdb) -snippet pdb - import pdb; pdb.set_trace() -# ipython debugger (ipdb) -snippet ipdb - import ipdb; ipdb.set_trace() -# ipython debugger (pdbbb) -snippet pdbbb - import pdbpp; pdbpp.set_trace() -snippet pprint - import pprint; pprint.pprint(${1})${2} -snippet " - """ - ${1:doc} - """ -# test function/method -snippet test - def test_${1:description}(${2:self}): - ${3:# TODO: write code...} -# test case -snippet testcase - class ${1:ExampleCase}(unittest.TestCase): - - def test_${2:description}(self): - ${3:# TODO: write code...} -snippet fut - from __future__ import ${1} -#getopt -snippet getopt - try: - # Short option syntax: "hv:" - # Long option syntax: "help" or "verbose=" - opts, args = getopt.getopt(sys.argv[1:], "${1:short_options}", [${2:long_options}]) - - except getopt.GetoptError, err: - # Print debug info - print str(err) - ${3:error_action} - - for option, argument in opts: - if option in ("-h", "--help"): - ${4} - elif option in ("-v", "--verbose"): - verbose = argument diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.js deleted file mode 100644 index 6b319194..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./r.snippets"); -exports.scope = "r"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.snippets deleted file mode 100644 index cfe482bc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.snippets +++ /dev/null @@ -1,121 +0,0 @@ -snippet #! - #!/usr/bin/env Rscript - -# includes -snippet lib - library(${1:package}) -snippet req - require(${1:package}) -snippet source - source('${1:file}') - -# conditionals -snippet if - if (${1:condition}) { - ${2:code} - } -snippet el - else { - ${1:code} - } -snippet ei - else if (${1:condition}) { - ${2:code} - } - -# functions -snippet fun - ${1:name} = function (${2:variables}) { - ${3:code} - } -snippet ret - return(${1:code}) - -# dataframes, lists, etc -snippet df - ${1:name}[${2:rows}, ${3:cols}] -snippet c - c(${1:items}) -snippet li - list(${1:items}) -snippet mat - matrix(${1:data}, nrow=${2:rows}, ncol=${3:cols}) - -# apply functions -snippet apply - apply(${1:array}, ${2:margin}, ${3:function}) -snippet lapply - lapply(${1:list}, ${2:function}) -snippet sapply - lapply(${1:list}, ${2:function}) -snippet vapply - vapply(${1:list}, ${2:function}, ${3:type}) -snippet mapply - mapply(${1:function}, ${2:...}) -snippet tapply - tapply(${1:vector}, ${2:index}, ${3:function}) -snippet rapply - rapply(${1:list}, ${2:function}) - -# plyr functions -snippet dd - ddply(${1:frame}, ${2:variables}, ${3:function}) -snippet dl - dlply(${1:frame}, ${2:variables}, ${3:function}) -snippet da - daply(${1:frame}, ${2:variables}, ${3:function}) -snippet d_ - d_ply(${1:frame}, ${2:variables}, ${3:function}) - -snippet ad - adply(${1:array}, ${2:margin}, ${3:function}) -snippet al - alply(${1:array}, ${2:margin}, ${3:function}) -snippet aa - aaply(${1:array}, ${2:margin}, ${3:function}) -snippet a_ - a_ply(${1:array}, ${2:margin}, ${3:function}) - -snippet ld - ldply(${1:list}, ${2:function}) -snippet ll - llply(${1:list}, ${2:function}) -snippet la - laply(${1:list}, ${2:function}) -snippet l_ - l_ply(${1:list}, ${2:function}) - -snippet md - mdply(${1:matrix}, ${2:function}) -snippet ml - mlply(${1:matrix}, ${2:function}) -snippet ma - maply(${1:matrix}, ${2:function}) -snippet m_ - m_ply(${1:matrix}, ${2:function}) - -# plot functions -snippet pl - plot(${1:x}, ${2:y}) -snippet ggp - ggplot(${1:data}, aes(${2:aesthetics})) -snippet img - ${1:(jpeg,bmp,png,tiff)}(filename="${2:filename}", width=${3}, height=${4}, unit="${5}") - ${6:plot} - dev.off() - -# statistical test functions -snippet fis - fisher.test(${1:x}, ${2:y}) -snippet chi - chisq.test(${1:x}, ${2:y}) -snippet tt - t.test(${1:x}, ${2:y}) -snippet wil - wilcox.test(${1:x}, ${2:y}) -snippet cor - cor.test(${1:x}, ${2:y}) -snippet fte - var.test(${1:x}, ${2:y}) -snippet kvt - kv.test(${1:x}, ${2:y}) diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.js deleted file mode 100644 index 0d9e6c95..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./rdoc.snippets"); -exports.scope = "rdoc"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.js deleted file mode 100644 index 96707f21..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./rhtml.snippets"); -exports.scope = "rhtml"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rst.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rst.snippets deleted file mode 100644 index 97845de3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rst.snippets +++ /dev/null @@ -1,22 +0,0 @@ -# rst - -snippet : - :${1:field name}: ${2:field body} -snippet * - *${1:Emphasis}* -snippet ** - **${1:Strong emphasis}** -snippet _ - \`${1:hyperlink-name}\`_ - .. _\`$1\`: ${2:link-block} -snippet = - ${1:Title} - =====${2:=} - ${3} -snippet - - ${1:Title} - -----${2:-} - ${3} -snippet cont: - .. contents:: - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.js deleted file mode 100644 index f7050449..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./ruby.snippets"); -exports.scope = "ruby"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.snippets deleted file mode 100644 index 0500aaa1..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.snippets +++ /dev/null @@ -1,928 +0,0 @@ -######################################## -# Ruby snippets - for Rails, see below # -######################################## - -# encoding for Ruby 1.9 -snippet enc - # encoding: utf-8 - -# #!/usr/bin/env ruby -snippet #! - #!/usr/bin/env ruby - # encoding: utf-8 - -# New Block -snippet =b - =begin rdoc - ${1} - =end -snippet y - :yields: ${1:arguments} -snippet rb - #!/usr/bin/env ruby -wKU -snippet beg - begin - ${3} - rescue ${1:Exception} => ${2:e} - end - -snippet req require - require "${1}"${2} -snippet # - # => -snippet end - __END__ -snippet case - case ${1:object} - when ${2:condition} - ${3} - end -snippet when - when ${1:condition} - ${2} -snippet def - def ${1:method_name} - ${2} - end -snippet deft - def test_${1:case_name} - ${2} - end -snippet if - if ${1:condition} - ${2} - end -snippet ife - if ${1:condition} - ${2} - else - ${3} - end -snippet elsif - elsif ${1:condition} - ${2} -snippet unless - unless ${1:condition} - ${2} - end -snippet while - while ${1:condition} - ${2} - end -snippet for - for ${1:e} in ${2:c} - ${3} - end -snippet until - until ${1:condition} - ${2} - end -snippet cla class .. end - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - ${2} - end -snippet cla class .. initialize .. end - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - def initialize(${2:args}) - ${3} - end - end -snippet cla class .. < ParentClass .. initialize .. end - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} < ${2:ParentClass} - def initialize(${3:args}) - ${4} - end - end -snippet cla ClassName = Struct .. do .. end - ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} = Struct.new(:${2:attr_names}) do - def ${3:method_name} - ${4} - end - end -snippet cla class BlankSlate .. initialize .. end - class ${1:BlankSlate} - instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ } - end -snippet cla class << self .. end - class << ${1:self} - ${2} - end -# class .. < DelegateClass .. initialize .. end -snippet cla- - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} < DelegateClass(${2:ParentClass}) - def initialize(${3:args}) - super(${4:del_obj}) - - ${5} - end - end -snippet mod module .. end - module ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - ${2} - end -snippet mod module .. module_function .. end - module ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - module_function - - ${2} - end -snippet mod module .. ClassMethods .. end - module ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - module ClassMethods - ${2} - end - - module InstanceMethods - - end - - def self.included(receiver) - receiver.extend ClassMethods - receiver.send :include, InstanceMethods - end - end -# attr_reader -snippet r - attr_reader :${1:attr_names} -# attr_writer -snippet w - attr_writer :${1:attr_names} -# attr_accessor -snippet rw - attr_accessor :${1:attr_names} -snippet atp - attr_protected :${1:attr_names} -snippet ata - attr_accessible :${1:attr_names} -# include Enumerable -snippet Enum - include Enumerable - - def each(&block) - ${1} - end -# include Comparable -snippet Comp - include Comparable - - def <=>(other) - ${1} - end -# extend Forwardable -snippet Forw- - extend Forwardable -# def self -snippet defs - def self.${1:class_method_name} - ${2} - end -# def method_missing -snippet defmm - def method_missing(meth, *args, &blk) - ${1} - end -snippet defd - def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name} -snippet defds - def_delegators :${1:@del_obj}, :${2:del_methods} -snippet am - alias_method :${1:new_name}, :${2:old_name} -snippet app - if __FILE__ == $PROGRAM_NAME - ${1} - end -# usage_if() -snippet usai - if ARGV.${1} - abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3} - end -# usage_unless() -snippet usau - unless ARGV.${1} - abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3} - end -snippet array - Array.new(${1:10}) { |${2:i}| ${3} } -snippet hash - Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} } -snippet file File.foreach() { |line| .. } - File.foreach(${1:"path/to/file"}) { |${2:line}| ${3} } -snippet file File.read() - File.read(${1:"path/to/file"})${2} -snippet Dir Dir.global() { |file| .. } - Dir.glob(${1:"dir/glob/*"}) { |${2:file}| ${3} } -snippet Dir Dir[".."] - Dir[${1:"glob/**/*.rb"}]${2} -snippet dir - Filename.dirname(__FILE__) -snippet deli - delete_if { |${1:e}| ${2} } -snippet fil - fill(${1:range}) { |${2:i}| ${3} } -# flatten_once() -snippet flao - inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3} -snippet zip - zip(${1:enums}) { |${2:row}| ${3} } -# downto(0) { |n| .. } -snippet dow - downto(${1:0}) { |${2:n}| ${3} } -snippet ste - step(${1:2}) { |${2:n}| ${3} } -snippet tim - times { |${1:n}| ${2} } -snippet upt - upto(${1:1.0/0.0}) { |${2:n}| ${3} } -snippet loo - loop { ${1} } -snippet ea - each { |${1:e}| ${2} } -snippet ead - each do |${1:e}| - ${2} - end -snippet eab - each_byte { |${1:byte}| ${2} } -snippet eac- each_char { |chr| .. } - each_char { |${1:chr}| ${2} } -snippet eac- each_cons(..) { |group| .. } - each_cons(${1:2}) { |${2:group}| ${3} } -snippet eai - each_index { |${1:i}| ${2} } -snippet eaid - each_index do |${1:i}| - ${2} - end -snippet eak - each_key { |${1:key}| ${2} } -snippet eakd - each_key do |${1:key}| - ${2} - end -snippet eal - each_line { |${1:line}| ${2} } -snippet eald - each_line do |${1:line}| - ${2} - end -snippet eap - each_pair { |${1:name}, ${2:val}| ${3} } -snippet eapd - each_pair do |${1:name}, ${2:val}| - ${3} - end -snippet eas- - each_slice(${1:2}) { |${2:group}| ${3} } -snippet easd- - each_slice(${1:2}) do |${2:group}| - ${3} - end -snippet eav - each_value { |${1:val}| ${2} } -snippet eavd - each_value do |${1:val}| - ${2} - end -snippet eawi - each_with_index { |${1:e}, ${2:i}| ${3} } -snippet eawid - each_with_index do |${1:e},${2:i}| - ${3} - end -snippet reve - reverse_each { |${1:e}| ${2} } -snippet reved - reverse_each do |${1:e}| - ${2} - end -snippet inj - inject(${1:init}) { |${2:mem}, ${3:var}| ${4} } -snippet injd - inject(${1:init}) do |${2:mem}, ${3:var}| - ${4} - end -snippet map - map { |${1:e}| ${2} } -snippet mapd - map do |${1:e}| - ${2} - end -snippet mapwi- - enum_with_index.map { |${1:e}, ${2:i}| ${3} } -snippet sor - sort { |a, b| ${1} } -snippet sorb - sort_by { |${1:e}| ${2} } -snippet ran - sort_by { rand } -snippet all - all? { |${1:e}| ${2} } -snippet any - any? { |${1:e}| ${2} } -snippet cl - classify { |${1:e}| ${2} } -snippet col - collect { |${1:e}| ${2} } -snippet cold - collect do |${1:e}| - ${2} - end -snippet det - detect { |${1:e}| ${2} } -snippet detd - detect do |${1:e}| - ${2} - end -snippet fet - fetch(${1:name}) { |${2:key}| ${3} } -snippet fin - find { |${1:e}| ${2} } -snippet find - find do |${1:e}| - ${2} - end -snippet fina - find_all { |${1:e}| ${2} } -snippet finad - find_all do |${1:e}| - ${2} - end -snippet gre - grep(${1:/pattern/}) { |${2:match}| ${3} } -snippet sub - ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} } -snippet sca - scan(${1:/pattern/}) { |${2:match}| ${3} } -snippet scad - scan(${1:/pattern/}) do |${2:match}| - ${3} - end -snippet max - max { |a, b| ${1} } -snippet min - min { |a, b| ${1} } -snippet par - partition { |${1:e}| ${2} } -snippet pard - partition do |${1:e}| - ${2} - end -snippet rej - reject { |${1:e}| ${2} } -snippet rejd - reject do |${1:e}| - ${2} - end -snippet sel - select { |${1:e}| ${2} } -snippet seld - select do |${1:e}| - ${2} - end -snippet lam - lambda { |${1:args}| ${2} } -snippet doo - do - ${1} - end -snippet dov - do |${1:variable}| - ${2} - end -snippet : - :${1:key} => ${2:"value"}${3} -snippet ope - open(${1:"path/or/url/or/pipe"}, "${2:w}") { |${3:io}| ${4} } -# path_from_here() -snippet fpath - File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2} -# unix_filter {} -snippet unif - ARGF.each_line${1} do |${2:line}| - ${3} - end -# option_parse {} -snippet optp - require "optparse" - - options = {${1:default => "args"}} - - ARGV.options do |opts| - opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} -snippet opt - opts.on( "-${1:o}", "--${2:long-option-name}", ${3:String}, - "${4:Option description.}") do |${5:opt}| - ${6} - end -snippet tc - require "test/unit" - - require "${1:library_file_name}" - - class Test${2:$1} < Test::Unit::TestCase - def test_${3:case_name} - ${4} - end - end -snippet ts - require "test/unit" - - require "tc_${1:test_case_file}" - require "tc_${2:test_case_file}"${3} -snippet as - assert ${1:test}, "${2:Failure message.}"${3} -snippet ase - assert_equal ${1:expected}, ${2:actual}${3} -snippet asne - assert_not_equal ${1:unexpected}, ${2:actual}${3} -snippet asid - assert_in_delta ${1:expected_float}, ${2:actual_float}, ${3:2 ** -20}${4} -snippet asio - assert_instance_of ${1:ExpectedClass}, ${2:actual_instance}${3} -snippet asko - assert_kind_of ${1:ExpectedKind}, ${2:actual_instance}${3} -snippet asn - assert_nil ${1:instance}${2} -snippet asnn - assert_not_nil ${1:instance}${2} -snippet asm - assert_match /${1:expected_pattern}/, ${2:actual_string}${3} -snippet asnm - assert_no_match /${1:unexpected_pattern}/, ${2:actual_string}${3} -snippet aso - assert_operator ${1:left}, :${2:operator}, ${3:right}${4} -snippet asr - assert_raise ${1:Exception} { ${2} } -snippet asrd - assert_raise ${1:Exception} do - ${2} - end -snippet asnr - assert_nothing_raised ${1:Exception} { ${2} } -snippet asnrd - assert_nothing_raised ${1:Exception} do - ${2} - end -snippet asrt - assert_respond_to ${1:object}, :${2:method}${3} -snippet ass assert_same(..) - assert_same ${1:expected}, ${2:actual}${3} -snippet ass assert_send(..) - assert_send [${1:object}, :${2:message}, ${3:args}]${4} -snippet asns - assert_not_same ${1:unexpected}, ${2:actual}${3} -snippet ast - assert_throws :${1:expected} { ${2} } -snippet astd - assert_throws :${1:expected} do - ${2} - end -snippet asnt - assert_nothing_thrown { ${1} } -snippet asntd - assert_nothing_thrown do - ${1} - end -snippet fl - flunk "${1:Failure message.}"${2} -# Benchmark.bmbm do .. end -snippet bm- - TESTS = ${1:10_000} - Benchmark.bmbm do |results| - ${2} - end -snippet rep - results.report("${1:name}:") { TESTS.times { ${2} }} -# Marshal.dump(.., file) -snippet Md - File.open(${1:"path/to/file.dump"}, "wb") { |${2:file}| Marshal.dump(${3:obj}, $2) }${4} -# Mashal.load(obj) -snippet Ml - File.open(${1:"path/to/file.dump"}, "rb") { |${2:file}| Marshal.load($2) }${3} -# deep_copy(..) -snippet deec - Marshal.load(Marshal.dump(${1:obj_to_copy}))${2} -snippet Pn- - PStore.new(${1:"file_name.pstore"})${2} -snippet tra - transaction(${1:true}) { ${2} } -# xmlread(..) -snippet xml- - REXML::Document.new(File.read(${1:"path/to/file"}))${2} -# xpath(..) { .. } -snippet xpa - elements.each(${1:"//Xpath"}) do |${2:node}| - ${3} - end -# class_from_name() -snippet clafn - split("::").inject(Object) { |par, const| par.const_get(const) } -# singleton_class() -snippet sinc - class << self; self end -snippet nam - namespace :${1:`Filename()`} do - ${2} - end -snippet tas - desc "${1:Task description}" - task :${2:task_name => [:dependent, :tasks]} do - ${3} - end -# block -snippet b - { |${1:var}| ${2} } -snippet begin - begin - raise 'A test exception.' - rescue Exception => e - puts e.message - puts e.backtrace.inspect - else - # other exception - ensure - # always executed - end - -#debugging -snippet debug - require 'ruby-debug'; debugger; true; -snippet pry - require 'pry'; binding.pry - -############################################# -# Rails snippets - for pure Ruby, see above # -############################################# -snippet art - assert_redirected_to ${1::action => "${2:index}"} -snippet artnp - assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}, ${4:@$2}) -snippet artnpp - assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}) -snippet artp - assert_redirected_to ${1:model}_path(${2:@$1}) -snippet artpp - assert_redirected_to ${1:model}s_path -snippet asd - assert_difference "${1:Model}.${2:count}", $1 do - ${3} - end -snippet asnd - assert_no_difference "${1:Model}.${2:count}" do - ${3} - end -snippet asre - assert_response :${1:success}, @response.body${2} -snippet asrj - assert_rjs :${1:replace}, "${2:dom id}" -snippet ass assert_select(..) - assert_select '${1:path}', :${2:text} => '${3:inner_html' ${4:do} -snippet bf - before_filter :${1:method} -snippet bt - belongs_to :${1:association} -snippet crw - cattr_accessor :${1:attr_names} -snippet defcreate - def create - @${1:model_class_name} = ${2:ModelClassName}.new(params[:$1]) - - respond_to do |wants| - if @$1.save - flash[:notice] = '$2 was successfully created.' - wants.html { redirect_to(@$1) } - wants.xml { render :xml => @$1, :status => :created, :location => @$1 } - else - wants.html { render :action => "new" } - wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } - end - end - end${3} -snippet defdestroy - def destroy - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - @$1.destroy - - respond_to do |wants| - wants.html { redirect_to($1s_url) } - wants.xml { head :ok } - end - end${3} -snippet defedit - def edit - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - end -snippet defindex - def index - @${1:model_class_name} = ${2:ModelClassName}.all - - respond_to do |wants| - wants.html # index.html.erb - wants.xml { render :xml => @$1s } - end - end${3} -snippet defnew - def new - @${1:model_class_name} = ${2:ModelClassName}.new - - respond_to do |wants| - wants.html # new.html.erb - wants.xml { render :xml => @$1 } - end - end${3} -snippet defshow - def show - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - - respond_to do |wants| - wants.html # show.html.erb - wants.xml { render :xml => @$1 } - end - end${3} -snippet defupdate - def update - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - - respond_to do |wants| - if @$1.update_attributes(params[:$1]) - flash[:notice] = '$2 was successfully updated.' - wants.html { redirect_to(@$1) } - wants.xml { head :ok } - else - wants.html { render :action => "edit" } - wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } - end - end - end${3} -snippet flash - flash[:${1:notice}] = "${2}" -snippet habtm - has_and_belongs_to_many :${1:object}, :join_table => "${2:table_name}", :foreign_key => "${3}_id"${4} -snippet hm - has_many :${1:object} -snippet hmd - has_many :${1:other}s, :class_name => "${2:$1}", :foreign_key => "${3:$1}_id", :dependent => :destroy${4} -snippet hmt - has_many :${1:object}, :through => :${2:object} -snippet ho - has_one :${1:object} -snippet i18 - I18n.t('${1:type.key}')${2} -snippet ist - <%= image_submit_tag("${1:agree.png}", :id => "${2:id}"${3} %> -snippet log - Rails.logger.${1:debug} ${2} -snippet log2 - RAILS_DEFAULT_LOGGER.${1:debug} ${2} -snippet logd - logger.debug { "${1:message}" }${2} -snippet loge - logger.error { "${1:message}" }${2} -snippet logf - logger.fatal { "${1:message}" }${2} -snippet logi - logger.info { "${1:message}" }${2} -snippet logw - logger.warn { "${1:message}" }${2} -snippet mapc - ${1:map}.${2:connect} '${3:controller/:action/:id}' -snippet mapca - ${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"${5} -snippet mapr - ${1:map}.resource :${2:resource} -snippet maprs - ${1:map}.resources :${2:resource} -snippet mapwo - ${1:map}.with_options :${2:controller} => '${3:thing}' do |$3| - ${4} - end -snippet mbs - before_save :${1:method} -snippet mcht - change_table :${1:table_name} do |t| - ${2} - end -snippet mp - map(&:${1:id}) -snippet mrw - mattr_accessor :${1:attr_names} -snippet oa - order("${1:field}") -snippet od - order("${1:field} DESC") -snippet pa - params[:${1:id}]${2} -snippet ra - render :action => "${1:action}" -snippet ral - render :action => "${1:action}", :layout => "${2:layoutname}" -snippet rest - respond_to do |wants| - wants.${1:html} { ${2} } - end -snippet rf - render :file => "${1:filepath}" -snippet rfu - render :file => "${1:filepath}", :use_full_path => ${2:false} -snippet ri - render :inline => "${1:<%= 'hello' %>}" -snippet ril - render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"${4} } -snippet rit - render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml} -snippet rjson - render :json => ${1:text to render} -snippet rl - render :layout => "${1:layoutname}" -snippet rn - render :nothing => ${1:true} -snippet rns - render :nothing => ${1:true}, :status => ${2:401} -snippet rp - render :partial => "${1:item}" -snippet rpc - render :partial => "${1:item}", :collection => ${2:@$1s} -snippet rpl - render :partial => "${1:item}", :locals => { :${2:$1} => ${3:@$1} -snippet rpo - render :partial => "${1:item}", :object => ${2:@$1} -snippet rps - render :partial => "${1:item}", :status => ${2:500} -snippet rt - render :text => "${1:text to render}" -snippet rtl - render :text => "${1:text to render}", :layout => "${2:layoutname}" -snippet rtlt - render :text => "${1:text to render}", :layout => ${2:true} -snippet rts - render :text => "${1:text to render}", :status => ${2:401} -snippet ru - render :update do |${1:page}| - $1.${2} - end -snippet rxml - render :xml => ${1:text to render} -snippet sc - scope :${1:name}, :where(:@${2:field} => ${3:value}) -snippet sl - scope :${1:name}, lambda do |${2:value}| - where("${3:field = ?}", ${4:bind var}) - end -snippet sha1 - Digest::SHA1.hexdigest(${1:string}) -snippet sweeper - class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper - observe $1 - - def after_save(${2:model_class_name}) - expire_cache($2) - end - - def after_destroy($2) - expire_cache($2) - end - - def expire_cache($2) - expire_page - end - end -snippet tcb - t.boolean :${1:title} - ${2} -snippet tcbi - t.binary :${1:title}, :limit => ${2:2}.megabytes - ${3} -snippet tcd - t.decimal :${1:title}, :precision => ${2:10}, :scale => ${3:2} - ${4} -snippet tcda - t.date :${1:title} - ${2} -snippet tcdt - t.datetime :${1:title} - ${2} -snippet tcf - t.float :${1:title} - ${2} -snippet tch - t.change :${1:name}, :${2:string}, :${3:limit} => ${4:80} - ${5} -snippet tci - t.integer :${1:title} - ${2} -snippet tcl - t.integer :lock_version, :null => false, :default => 0 - ${1} -snippet tcr - t.references :${1:taggable}, :polymorphic => { :default => '${2:Photo}' } - ${3} -snippet tcs - t.string :${1:title} - ${2} -snippet tct - t.text :${1:title} - ${2} -snippet tcti - t.time :${1:title} - ${2} -snippet tcts - t.timestamp :${1:title} - ${2} -snippet tctss - t.timestamps - ${1} -snippet va - validates_associated :${1:attribute} -snippet vao - validates_acceptance_of :${1:terms} -snippet vc - validates_confirmation_of :${1:attribute} -snippet ve - validates_exclusion_of :${1:attribute}, :in => ${2:%w( mov avi )} -snippet vf - validates_format_of :${1:attribute}, :with => /${2:regex}/ -snippet vi - validates_inclusion_of :${1:attribute}, :in => %w(${2: mov avi }) -snippet vl - validates_length_of :${1:attribute}, :within => ${2:3}..${3:20} -snippet vn - validates_numericality_of :${1:attribute} -snippet vpo - validates_presence_of :${1:attribute} -snippet vu - validates_uniqueness_of :${1:attribute} -snippet wants - wants.${1:js|xml|html} { ${2} } -snippet wc - where(${1:"conditions"}${2:, bind_var}) -snippet wh - where(${1:field} => ${2:value}) -snippet xdelete - xhr :delete, :${1:destroy}, :id => ${2:1}${3} -snippet xget - xhr :get, :${1:show}, :id => ${2:1}${3} -snippet xpost - xhr :post, :${1:create}, :${2:object} => { ${3} } -snippet xput - xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { ${4} }${5} -snippet test - test "should ${1:do something}" do - ${2} - end -#migrations -snippet mac - add_column :${1:table_name}, :${2:column_name}, :${3:data_type} -snippet mrc - remove_column :${1:table_name}, :${2:column_name} -snippet mrnc - rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name} -snippet mcc - change_column :${1:table}, :${2:column}, :${3:type} -snippet mccc - t.column :${1:title}, :${2:string} -snippet mct - create_table :${1:table_name} do |t| - t.column :${2:name}, :${3:type} - end -snippet migration - class ${1:class_name} < ActiveRecord::Migration - def self.up - ${2} - end - - def self.down - end - end - -snippet trc - t.remove :${1:column} -snippet tre - t.rename :${1:old_column_name}, :${2:new_column_name} - ${3} -snippet tref - t.references :${1:model} - -#rspec -snippet it - it "${1:spec_name}" do - ${2} - end -snippet itp - it "${1:spec_name}" - ${2} -snippet desc - describe ${1:class_name} do - ${2} - end -snippet cont - context "${1:message}" do - ${2} - end -snippet bef - before :${1:each} do - ${2} - end -snippet aft - after :${1:each} do - ${2} - end diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.js deleted file mode 100644 index 556d9a6b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./rust.snippets"); -exports.scope = "rust"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.js deleted file mode 100644 index ba728ac2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sass.snippets"); -exports.scope = "sass"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.js deleted file mode 100644 index 28db2155..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scad.snippets"); -exports.scope = "scad"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.js deleted file mode 100644 index 2e5a8c57..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scala.snippets"); -exports.scope = "scala"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.js deleted file mode 100644 index 7d3c6f65..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scheme.snippets"); -exports.scope = "scheme"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.js deleted file mode 100644 index a940eabd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scss.snippets"); -exports.scope = "scss"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.js deleted file mode 100644 index c48dc17f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sh.snippets"); -exports.scope = "sh"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.snippets deleted file mode 100644 index 9a48eb51..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.snippets +++ /dev/null @@ -1,83 +0,0 @@ -# Shebang. Executing bash via /usr/bin/env makes scripts more portable. -snippet #! - #!/usr/bin/env bash - -snippet if - if [[ ${1:condition} ]]; then - ${2:#statements} - fi -snippet elif - elif [[ ${1:condition} ]]; then - ${2:#statements} -snippet for - for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do - ${3:#statements} - done -snippet fori - for ${1:needle} in ${2:haystack} ; do - ${3:#statements} - done -snippet wh - while [[ ${1:condition} ]]; do - ${2:#statements} - done -snippet until - until [[ ${1:condition} ]]; do - ${2:#statements} - done -snippet case - case ${1:word} in - ${2:pattern}) - ${3};; - esac -snippet go - while getopts '${1:o}' ${2:opts} - do - case $$2 in - ${3:o0}) - ${4:#staments};; - esac - done -# Set SCRIPT_DIR variable to directory script is located. -snippet sdir - SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# getopt -snippet getopt - __ScriptVersion="${1:version}" - - #=== FUNCTION ================================================================ - # NAME: usage - # DESCRIPTION: Display usage information. - #=============================================================================== - function usage () - { - cat <<- EOT - - Usage : $${0:0} [options] [--] - - Options: - -h|help Display this message - -v|version Display script version - - EOT - } # ---------- end of function usage ---------- - - #----------------------------------------------------------------------- - # Handle command line arguments - #----------------------------------------------------------------------- - - while getopts ":hv" opt - do - case $opt in - - h|help ) usage; exit 0 ;; - - v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;; - - \? ) echo -e "\n Option does not exist : $OPTARG\n" - usage; exit 1 ;; - - esac # --- end of case --- - done - shift $(($OPTIND-1)) - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.js deleted file mode 100644 index a88cfc90..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sjs.snippets"); -exports.scope = "sjs"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.js deleted file mode 100644 index 121d0b7c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./smarty.snippets"); -exports.scope = "smarty"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.js deleted file mode 100644 index 0927805b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./snippets.snippets"); -exports.scope = "snippets"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.snippets deleted file mode 100644 index 4223fa39..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.snippets +++ /dev/null @@ -1,9 +0,0 @@ -# snippets for making snippets :) -snippet snip - snippet ${1:trigger} - ${2} -snippet msnip - snippet ${1:trigger} ${2:description} - ${3} -snippet v - {VISUAL} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.js deleted file mode 100644 index 194da757..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./soy_template.snippets"); -exports.scope = "soy_template"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.js deleted file mode 100644 index 766d493e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./space.snippets"); -exports.scope = "space"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.js deleted file mode 100644 index c96f6cb2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sql.snippets"); -exports.scope = "sql"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.snippets deleted file mode 100644 index eb4b37ca..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.snippets +++ /dev/null @@ -1,26 +0,0 @@ -snippet tbl - create table ${1:table} ( - ${2:columns} - ); -snippet col - ${1:name} ${2:type} ${3:default ''} ${4:not null} -snippet ccol - ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null} -snippet ncol - ${1:name} number ${3:default 0} ${4:not null} -snippet dcol - ${1:name} date ${3:default sysdate} ${4:not null} -snippet ind - create index ${3:$1_$2} on ${1:table}(${2:column}); -snippet uind - create unique index ${1:name} on ${2:table}(${3:column}); -snippet tblcom - comment on table ${1:table} is '${2:comment}'; -snippet colcom - comment on column ${1:table}.${2:column} is '${3:comment}'; -snippet addcol - alter table ${1:table} add (${2:column} ${3:type}); -snippet seq - create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1}; -snippet s* - select * from ${1:table} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.js deleted file mode 100644 index 86a79f7a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./stylus.snippets"); -exports.scope = "stylus"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.js deleted file mode 100644 index aeb62456..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./svg.snippets"); -exports.scope = "svg"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.js deleted file mode 100644 index 53482fc7..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./tcl.snippets"); -exports.scope = "tcl"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.snippets deleted file mode 100644 index 1fe1cb96..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.snippets +++ /dev/null @@ -1,92 +0,0 @@ -# #!/usr/bin/env tclsh -snippet #! - #!/usr/bin/env tclsh - -# Process -snippet pro - proc ${1:function_name} {${2:args}} { - ${3:#body ...} - } -#xif -snippet xif - ${1:expr}? ${2:true} : ${3:false} -# Conditional -snippet if - if {${1}} { - ${2:# body...} - } -# Conditional if..else -snippet ife - if {${1}} { - ${2:# body...} - } else { - ${3:# else...} - } -# Conditional if..elsif..else -snippet ifee - if {${1}} { - ${2:# body...} - } elseif {${3}} { - ${4:# elsif...} - } else { - ${5:# else...} - } -# If catch then -snippet ifc - if { [catch {${1:#do something...}} ${2:err}] } { - ${3:# handle failure...} - } -# Catch -snippet catch - catch {${1}} ${2:err} ${3:options} -# While Loop -snippet wh - while {${1}} { - ${2:# body...} - } -# For Loop -snippet for - for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} { - ${4:# body...} - } -# Foreach Loop -snippet fore - foreach ${1:x} {${2:#list}} { - ${3:# body...} - } -# after ms script... -snippet af - after ${1:ms} ${2:#do something} -# after cancel id -snippet afc - after cancel ${1:id or script} -# after idle -snippet afi - after idle ${1:script} -# after info id -snippet afin - after info ${1:id} -# Expr -snippet exp - expr {${1:#expression here}} -# Switch -snippet sw - switch ${1:var} { - ${3:pattern 1} { - ${4:#do something} - } - default { - ${2:#do something} - } - } -# Case -snippet ca - ${1:pattern} { - ${2:#do something} - }${3} -# Namespace eval -snippet ns - namespace eval ${1:path} {${2:#script...}} -# Namespace current -snippet nsc - namespace current diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.js deleted file mode 100644 index 267b6b69..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./tex.snippets"); -exports.scope = "tex"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.snippets deleted file mode 100644 index 10fa82ef..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.snippets +++ /dev/null @@ -1,191 +0,0 @@ -#PREAMBLE -#newcommand -snippet nc - \newcommand{\${1:cmd}}[${2:opt}]{${3:realcmd}}${4} -#usepackage -snippet up - \usepackage[${1:[options}]{${2:package}} -#newunicodechar -snippet nuc - \newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}} -#DeclareMathOperator -snippet dmo - \DeclareMathOperator{${1}}{${2}} - -#DOCUMENT -# \begin{}...\end{} -snippet begin - \begin{${1:env}} - ${2} - \end{$1} -# Tabular -snippet tab - \begin{${1:tabular}}{${2:c}} - ${3} - \end{$1} -snippet thm - \begin[${1:author}]{${2:thm}} - ${3} - \end{$1} -snippet center - \begin{center} - ${1} - \end{center} -# Align(ed) -snippet ali - \begin{align${1:ed}} - ${2} - \end{align$1} -# Gather(ed) -snippet gat - \begin{gather${1:ed}} - ${2} - \end{gather$1} -# Equation -snippet eq - \begin{equation} - ${1} - \end{equation} -# Equation -snippet eq* - \begin{equation*} - ${1} - \end{equation*} -# Unnumbered Equation -snippet \ - \[ - ${1} - \] -# Enumerate -snippet enum - \begin{enumerate} - \item ${1} - \end{enumerate} -# Itemize -snippet itemize - \begin{itemize} - \item ${1} - \end{itemize} -# Description -snippet desc - \begin{description} - \item[${1}] ${2} - \end{description} -# Matrix -snippet mat - \begin{${1:p/b/v/V/B/small}matrix} - ${2} - \end{$1matrix} -# Cases -snippet cas - \begin{cases} - ${1:equation}, &\text{ if }${2:case}\\ - ${3} - \end{cases} -# Split -snippet spl - \begin{split} - ${1} - \end{split} -# Part -snippet part - \part{${1:part name}} % (fold) - \label{prt:${2:$1}} - ${3} - % part $2 (end) -# Chapter -snippet cha - \chapter{${1:chapter name}} - \label{cha:${2:$1}} - ${3} -# Section -snippet sec - \section{${1:section name}} - \label{sec:${2:$1}} - ${3} -# Sub Section -snippet sub - \subsection{${1:subsection name}} - \label{sub:${2:$1}} - ${3} -# Sub Sub Section -snippet subs - \subsubsection{${1:subsubsection name}} - \label{ssub:${2:$1}} - ${3} -# Paragraph -snippet par - \paragraph{${1:paragraph name}} - \label{par:${2:$1}} - ${3} -# Sub Paragraph -snippet subp - \subparagraph{${1:subparagraph name}} - \label{subp:${2:$1}} - ${3} -#References -snippet itd - \item[${1:description}] ${2:item} -snippet figure - ${1:Figure}~\ref{${2:fig:}}${3} -snippet table - ${1:Table}~\ref{${2:tab:}}${3} -snippet listing - ${1:Listing}~\ref{${2:list}}${3} -snippet section - ${1:Section}~\ref{${2:sec:}}${3} -snippet page - ${1:page}~\pageref{${2}}${3} -snippet index - \index{${1:index}}${2} -#Citations -snippet cite - \cite[${1}]{${2}}${3} -snippet fcite - \footcite[${1}]{${2}}${3} -#Formating text: italic, bold, underline, small capital, emphase .. -snippet it - \textit{${1:text}} -snippet bf - \textbf{${1:text}} -snippet under - \underline{${1:text}} -snippet emp - \emph{${1:text}} -snippet sc - \textsc{${1:text}} -#Choosing font -snippet sf - \textsf{${1:text}} -snippet rm - \textrm{${1:text}} -snippet tt - \texttt{${1:text}} -#misc -snippet ft - \footnote{${1:text}} -snippet fig - \begin{figure} - \begin{center} - \includegraphics[scale=${1}]{Figures/${2}} - \end{center} - \caption{${3}} - \label{fig:${4}} - \end{figure} -snippet tikz - \begin{figure} - \begin{center} - \begin{tikzpicture}[scale=${1:1}] - ${2} - \end{tikzpicture} - \end{center} - \caption{${3}} - \label{fig:${4}} - \end{figure} -#math -snippet stackrel - \stackrel{${1:above}}{${2:below}} ${3} -snippet frac - \frac{${1:num}}{${2:denom}} -snippet sum - \sum^{${1:n}}_{${2:i=1}}{${3}} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.js deleted file mode 100644 index 434d75be..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./text.snippets"); -exports.scope = "text"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.js deleted file mode 100644 index f2622e05..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./textile.snippets"); -exports.scope = "textile"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.snippets deleted file mode 100644 index c78d6ec8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.snippets +++ /dev/null @@ -1,30 +0,0 @@ -# Jekyll post header -snippet header - --- - title: ${1:title} - layout: post - date: ${2:date} ${3:hour:minute:second} -05:00 - --- - -# Image -snippet img - !${1:url}(${2:title}):${3:link}! - -# Table -snippet | - |${1}|${2} - -# Link -snippet link - "${1:link text}":${2:url} - -# Acronym -snippet ( - (${1:Expand acronym})${2} - -# Footnote -snippet fn - [${1:ref number}] ${3} - - fn$1. ${2:footnote} - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tmsnippet.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tmsnippet.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.js deleted file mode 100644 index 419b06d8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./toml.snippets"); -exports.scope = "toml"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.js deleted file mode 100644 index b08b884c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./twig.snippets"); -exports.scope = "twig"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.js deleted file mode 100644 index 495da3f3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./typescript.snippets"); -exports.scope = "typescript"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.js deleted file mode 100644 index 6092d3c1..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.js +++ /dev/null @@ -1,195 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -// exports.snippetText = require("../requirejs/text!./.snippets"); -exports.snippets = [ - { - "content": "case ${1:condition}:\n\t$0\n\tbreak;\n", - "name": "case", - "scope": "vala", - "tabTrigger": "case" - }, - { - "content": "/**\n * ${6}\n */\n${1:public} class ${2:MethodName}${3: : GLib.Object} {\n\n\t/**\n\t * ${7}\n\t */\n\tpublic ${2}(${4}) {\n\t\t${5}\n\t}\n\n\t$0\n}", - "name": "class", - "scope": "vala", - "tabTrigger": "class" - }, - { - "content": "(${1}) => {\n\t${0}\n}\n", - "name": "closure", - "scope": "vala", - "tabTrigger": "=>" - }, - { - "content": "/*\n * $0\n */", - "name": "Comment (multiline)", - "scope": "vala", - "tabTrigger": "/*" - }, - { - "content": "Console.WriteLine($1);\n$0", - "name": "Console.WriteLine (writeline)", - "scope": "vala", - "tabTrigger": "writeline" - }, - { - "content": "[DBus(name = \"$0\")]", - "name": "DBus annotation", - "scope": "vala", - "tabTrigger": "[DBus" - }, - { - "content": "delegate ${1:void} ${2:DelegateName}($0);", - "name": "delegate", - "scope": "vala", - "tabTrigger": "delegate" - }, - { - "content": "do {\n\t$0\n} while ($1);\n", - "name": "do while", - "scope": "vala", - "tabTrigger": "dowhile" - }, - { - "content": "/**\n * $0\n */", - "name": "DocBlock", - "scope": "vala", - "tabTrigger": "/**" - }, - { - "content": "else if ($1) {\n\t$0\n}\n", - "name": "else if (elseif)", - "scope": "vala", - "tabTrigger": "elseif" - }, - { - "content": "else {\n\t$0\n}", - "name": "else", - "scope": "vala", - "tabTrigger": "else" - }, - { - "content": "enum {$1:EnumName} {\n\t$0\n}", - "name": "enum", - "scope": "vala", - "tabTrigger": "enum" - }, - { - "content": "public errordomain ${1:Error} {\n\t$0\n}", - "name": "error domain", - "scope": "vala", - "tabTrigger": "errordomain" - }, - { - "content": "for ($1;$2;$3) {\n\t$0\n}", - "name": "for", - "scope": "vala", - "tabTrigger": "for" - }, - { - "content": "foreach ($1 in $2) {\n\t$0\n}", - "name": "foreach", - "scope": "vala", - "tabTrigger": "foreach" - }, - { - "content": "Gee.ArrayList<${1:G}>($0);", - "name": "Gee.ArrayList", - "scope": "vala", - "tabTrigger": "ArrayList" - }, - { - "content": "Gee.HashMap<${1:K},${2:V}>($0);", - "name": "Gee.HashMap", - "scope": "vala", - "tabTrigger": "HashMap" - }, - { - "content": "Gee.HashSet<${1:G}>($0);", - "name": "Gee.HashSet", - "scope": "vala", - "tabTrigger": "HashSet" - }, - { - "content": "if ($1) {\n\t$0\n}", - "name": "if", - "scope": "vala", - "tabTrigger": "if" - }, - { - "content": "interface ${1:InterfaceName}{$2: : SuperInterface} {\n\t$0\n}", - "name": "interface", - "scope": "vala", - "tabTrigger": "interface" - }, - { - "content": "public static int main(string [] argv) {\n\t${0}\n\treturn 0;\n}", - "name": "Main function", - "scope": "vala", - "tabTrigger": "main" - }, - { - "content": "namespace $1 {\n\t$0\n}\n", - "name": "namespace (ns)", - "scope": "vala", - "tabTrigger": "ns" - }, - { - "content": "stdout.printf($0);", - "name": "printf", - "scope": "vala", - "tabTrigger": "printf" - }, - { - "content": "${1:public} ${2:Type} ${3:Name} {\n\tset {\n\t\t$0\n\t}\n\tget {\n\n\t}\n}", - "name": "property (prop)", - "scope": "vala", - "tabTrigger": "prop" - }, - { - "content": "${1:public} ${2:Type} ${3:Name} {\n\tget {\n\t\t$0\n\t}\n}", - "name": "read-only property (roprop)", - "scope": "vala", - "tabTrigger": "roprop" - }, - { - "content": "@\"${1:\\$var}\"", - "name": "String template (@)", - "scope": "vala", - "tabTrigger": "@" - }, - { - "content": "struct ${1:StructName} {\n\t$0\n}", - "name": "struct", - "scope": "vala", - "tabTrigger": "struct" - }, - { - "content": "switch ($1) {\n\t$0\n}", - "name": "switch", - "scope": "vala", - "tabTrigger": "switch" - }, - { - "content": "try {\n\t$2\n} catch (${1:Error} e) {\n\t$0\n}", - "name": "try/catch", - "scope": "vala", - "tabTrigger": "try" - }, - { - "content": "\"\"\"$0\"\"\";", - "name": "Verbatim string (\"\"\")", - "scope": "vala", - "tabTrigger": "verbatim" - }, - { - "content": "while ($1) {\n\t$0\n}", - "name": "while", - "scope": "vala", - "tabTrigger": "while" - } -]; -exports.scope = ""; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.js deleted file mode 100644 index 5ab8e650..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./vbscript.snippets"); -exports.scope = "vbscript"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.js deleted file mode 100644 index ba522dd2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.js +++ /dev/null @@ -1,8 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./velocity.snippets"); -exports.scope = "velocity"; -exports.includeScopes = ["html", "javascript", "css"]; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.snippets deleted file mode 100644 index dedca589..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.snippets +++ /dev/null @@ -1,28 +0,0 @@ -# macro -snippet #macro - #macro ( ${1:macroName} ${2:\$var1, [\$var2, ...]} ) - ${3:## macro code} - #end -# foreach -snippet #foreach - #foreach ( ${1:\$item} in ${2:\$collection} ) - ${3:## foreach code} - #end -# if -snippet #if - #if ( ${1:true} ) - ${0} - #end -# if ... else -snippet #ife - #if ( ${1:true} ) - ${2} - #else - ${0} - #end -#import -snippet #import - #import ( "${1:path/to/velocity/format}" ) -# set -snippet #set - #set ( $${1:var} = ${0} ) diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.js deleted file mode 100644 index 7360341e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./verilog.snippets"); -exports.scope = "verilog"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.js deleted file mode 100644 index fe5e708f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./vhdl.snippets"); -exports.scope = "vhdl"; - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.js deleted file mode 100644 index 83b1870c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./xml.snippets"); -exports.scope = "xml"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.js deleted file mode 100644 index d96a0619..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./xquery.snippets"); -exports.scope = "xquery"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.snippets deleted file mode 100644 index 965034b7..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.snippets +++ /dev/null @@ -1,61 +0,0 @@ -snippet for - for $${1:item} in ${2:expr} -snippet return - return ${1:expr} -snippet import - import module namespace ${1:ns} = "${2:http://www.example.com/}"; -snippet some - some $${1:varname} in ${2:expr} satisfies ${3:expr} -snippet every - every $${1:varname} in ${2:expr} satisfies ${3:expr} -snippet if - if(${1:true}) then ${2:expr} else ${3:true} -snippet switch - switch(${1:"foo"}) - case ${2:"foo"} - return ${3:true} - default return ${4:false} -snippet try - try { ${1:expr} } catch ${2:*} { ${3:expr} } -snippet tumbling - for tumbling window $${1:varname} in ${2:expr} - start at $${3:start} when ${4:expr} - end at $${5:end} when ${6:expr} - return ${7:expr} -snippet sliding - for sliding window $${1:varname} in ${2:expr} - start at $${3:start} when ${4:expr} - end at $${5:end} when ${6:expr} - return ${7:expr} -snippet let - let $${1:varname} := ${2:expr} -snippet group - group by $${1:varname} := ${2:expr} -snippet order - order by ${1:expr} ${2:descending} -snippet stable - stable order by ${1:expr} -snippet count - count $${1:varname} -snippet ordered - ordered { ${1:expr} } -snippet unordered - unordered { ${1:expr} } -snippet treat - treat as ${1:expr} -snippet castable - castable as ${1:atomicType} -snippet cast - cast as ${1:atomicType} -snippet typeswitch - typeswitch(${1:expr}) - case ${2:type} return ${3:expr} - default return ${4:expr} -snippet var - declare variable $${1:varname} := ${2:expr}; -snippet fn - declare function ${1:ns}:${2:name}(){ - ${3:expr} - }; -snippet module - module namespace ${1:ns} = "${2:http://www.example.com}"; diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xslt.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xslt.snippets deleted file mode 100644 index e7abdf3f..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xslt.snippets +++ /dev/null @@ -1,97 +0,0 @@ -snippet apply-templates with-param - - ${3}${4} - ${5} - -snippet apply-templates sort-by - - ${5} - ${6} - -snippet apply-templates plain - ${2} - -snippet attribute blank - ${2}${3} - -snippet attribute value-of - - - ${3} - -snippet call-template - - -snippet call-template with-param - - ${3}${4} - ${5} - -snippet choose - - - ${2} - ${3} - - -snippet copy-of - ${2} - -snippet for-each - ${2} - ${3} - -snippet if - ${2} - ${3} - -snippet import - ${2} - -snippet include - ${2} - -snippet otherwise - ${1} - - -snippet param - ${2} - ${3} - -snippet stylesheet - ${1} - - -snippet template - ${3} - - -snippet template named - ${2} - - -snippet text - ${1} - -snippet value-of - ${2} - -snippet variable blank - ${2} - - -snippet variable select - ${2} - -snippet when - ${2} - - -snippet with-param - ${2} - -snippet with-param select - - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.js deleted file mode 100644 index 17e70a3c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./yaml.snippets"); -exports.scope = "yaml"; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.snippets b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets_test.js deleted file mode 100644 index 1870d950..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets_test.js +++ /dev/null @@ -1,131 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var MultiSelect = require("./multi_select").MultiSelect; - -var snippetManager = require("./snippets").snippetManager; -var assert = require("./test/assertions"); - -module.exports = { - setUp : function(next) { - this.editor = new Editor(new MockRenderer()); - next(); - }, - - "test: textmate style format strings" : function() { - var fmt = snippetManager.tmStrFormat; - snippetManager.tmStrFormat("hello", { - guard: "(..)(.)(.)", - flag:"g", - fmt: "a\\UO\\l$1\\E$2" - }) == "aOHElo"; - }, - "test: parse snipmate file" : function() { - var expected = [{ - name: "a", - guard: "(?:(=)|(:))?s*)", - trigger: "\\(?f", - endTrigger: "\\)", - endGuard: "", - content: "{$0}\n" - }, { - tabTrigger: "f", - name: "f function", - content: "function" - }]; - - - - var parsed = snippetManager.parseSnippetFile( - "name a\nregex /(?:(=)|(:))?\s*)/\\(?f/\\)/\n\t{$0}" + - "\n\t\n\n#function\nsnippet f function\n\tfunction" - ); - - assert.equal(JSON.stringify(expected, null, 4), JSON.stringify(parsed, null, 4)) - }, - "test: parse snippet": function() { - var content = "-\\$$2a${1:x${$2:y$3\\}\\n\\}$TM_SELECTION}"; - var tokens = snippetManager.tokenizeTmSnippet(content); - assert.equal(tokens.length, 15); - assert.equal(tokens[4], tokens[14]); - assert.equal(tokens[2].tabstopId, 2); - - var content = "\\}${var/as\\/d/\\ul\\//g:s}" - var tokens = snippetManager.tokenizeTmSnippet(content); - assert.equal(tokens.length, 4); - assert.equal(tokens[1], tokens[3]); - assert.equal(tokens[2], "s"); - assert.equal(tokens[1].text, "var"); - assert.equal(tokens[1].fmt, "\\ul\\/"); - assert.equal(tokens[1].guard, "as\\/d"); - assert.equal(tokens[1].flag, "g"); - }, - "test: expand snippet with nested tabstops": function() { - var content = "-${1}-${1:1}--${2:2 ${3} 2}-${3:3 $1 3}-${4:4 $2 4}"; - this.editor.setValue(""); - snippetManager.insertSnippet(this.editor, content); - assert.equal(this.editor.getValue(), "-1-1--2 3 1 3 2-3 1 3-4 2 3 1 3 2 4"); - - assert.equal(this.editor.getSelectedText(), "1\n1\n1\n1\n1"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "2 3 1 3 2\n2 3 1 3 2"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "3 1 3\n3 1 3\n3 1 3"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "4 2 3 1 3 2 4"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), ""); - - this.editor.setValue(""); - snippetManager.insertSnippet(this.editor, "-${1:a$2}-${2:b$1}"); - assert.equal(this.editor.getValue(), "-ab-ba"); - - assert.equal(this.editor.getSelectedText(), "ab\na"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "b\nba"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), ""); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js deleted file mode 100644 index 878b0dc3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js +++ /dev/null @@ -1,373 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var EventEmitter = require("./lib/event_emitter").EventEmitter; - -var Editor = require("./editor").Editor; -var Renderer = require("./virtual_renderer").VirtualRenderer; -var EditSession = require("./edit_session").EditSession; - -/** - * @class Split - * - * - * - **/ - - -var Split = function(container, theme, splits) { - this.BELOW = 1; - this.BESIDE = 0; - - this.$container = container; - this.$theme = theme; - this.$splits = 0; - this.$editorCSS = ""; - this.$editors = []; - this.$orientation = this.BESIDE; - - this.setSplits(splits || 1); - this.$cEditor = this.$editors[0]; - - - this.on("focus", function(editor) { - this.$cEditor = editor; - }.bind(this)); -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.$createEditor = function() { - var el = document.createElement("div"); - el.className = this.$editorCSS; - el.style.cssText = "position: absolute; top:0px; bottom:0px"; - this.$container.appendChild(el); - var editor = new Editor(new Renderer(el, this.$theme)); - - editor.on("focus", function() { - this._emit("focus", editor); - }.bind(this)); - - this.$editors.push(editor); - editor.setFontSize(this.$fontSize); - return editor; - }; - - this.setSplits = function(splits) { - var editor; - if (splits < 1) { - throw "The number of splits have to be > 0!"; - } - - if (splits == this.$splits) { - return; - } else if (splits > this.$splits) { - while (this.$splits < this.$editors.length && this.$splits < splits) { - editor = this.$editors[this.$splits]; - this.$container.appendChild(editor.container); - editor.setFontSize(this.$fontSize); - this.$splits ++; - } - while (this.$splits < splits) { - this.$createEditor(); - this.$splits ++; - } - } else { - while (this.$splits > splits) { - editor = this.$editors[this.$splits - 1]; - this.$container.removeChild(editor.container); - this.$splits --; - } - } - this.resize(); - }; - - /** - * - * Returns the number of splits. - * @returns {Number} - **/ - this.getSplits = function() { - return this.$splits; - }; - - /** - * @param {Number} idx The index of the editor you want - * - * Returns the editor identified by the index `idx`. - * - **/ - this.getEditor = function(idx) { - return this.$editors[idx]; - }; - - /** - * - * Returns the current editor. - * @returns {Editor} - **/ - this.getCurrentEditor = function() { - return this.$cEditor; - }; - - /** - * Focuses the current editor. - * @related Editor.focus - **/ - this.focus = function() { - this.$cEditor.focus(); - }; - - /** - * Blurs the current editor. - * @related Editor.blur - **/ - this.blur = function() { - this.$cEditor.blur(); - }; - - /** - * - * @param {String} theme The name of the theme to set - * - * Sets a theme for each of the available editors. - * @related Editor.setTheme - **/ - this.setTheme = function(theme) { - this.$editors.forEach(function(editor) { - editor.setTheme(theme); - }); - }; - - /** - * - * @param {String} keybinding - * - * Sets the keyboard handler for the editor. - * @related editor.setKeyboardHandler - **/ - this.setKeyboardHandler = function(keybinding) { - this.$editors.forEach(function(editor) { - editor.setKeyboardHandler(keybinding); - }); - }; - - /** - * - * @param {Function} callback A callback function to execute - * @param {String} scope The default scope for the callback - * - * Executes `callback` on all of the available editors. - * - **/ - this.forEach = function(callback, scope) { - this.$editors.forEach(callback, scope); - }; - - - this.$fontSize = ""; - /** - * @param {Number} size The new font size - * - * Sets the font size, in pixels, for all the available editors. - * - **/ - this.setFontSize = function(size) { - this.$fontSize = size; - this.forEach(function(editor) { - editor.setFontSize(size); - }); - }; - - this.$cloneSession = function(session) { - var s = new EditSession(session.getDocument(), session.getMode()); - - var undoManager = session.getUndoManager(); - if (undoManager) { - var undoManagerProxy = new UndoManagerProxy(undoManager, s); - s.setUndoManager(undoManagerProxy); - } - - // Overwrite the default $informUndoManager function such that new delas - // aren't added to the undo manager from the new and the old session. - s.$informUndoManager = lang.delayedCall(function() { s.$deltas = []; }); - - // Copy over 'settings' from the session. - s.setTabSize(session.getTabSize()); - s.setUseSoftTabs(session.getUseSoftTabs()); - s.setOverwrite(session.getOverwrite()); - s.setBreakpoints(session.getBreakpoints()); - s.setUseWrapMode(session.getUseWrapMode()); - s.setUseWorker(session.getUseWorker()); - s.setWrapLimitRange(session.$wrapLimitRange.min, - session.$wrapLimitRange.max); - s.$foldData = session.$cloneFoldData(); - - return s; - }; - - /** - * - * @param {EditSession} session The new edit session - * @param {Number} idx The editor's index you're interested in - * - * Sets a new [[EditSession `EditSession`]] for the indicated editor. - * @related Editor.setSession - **/ - this.setSession = function(session, idx) { - var editor; - if (idx == null) { - editor = this.$cEditor; - } else { - editor = this.$editors[idx]; - } - - // Check if the session is used already by any of the editors in the - // split. If it is, we have to clone the session as two editors using - // the same session can cause terrible side effects (e.g. UndoQueue goes - // wrong). This also gives the user of Split the possibility to treat - // each session on each split editor different. - var isUsed = this.$editors.some(function(editor) { - return editor.session === session; - }); - - if (isUsed) { - session = this.$cloneSession(session); - } - editor.setSession(session); - - // Return the session set on the editor. This might be a cloned one. - return session; - }; - - /** - * - * Returns the orientation. - * @returns {Number} - **/ - this.getOrientation = function() { - return this.$orientation; - }; - - /** - * - * Sets the orientation. - * @param {Number} orientation The new orientation value - * - * - **/ - this.setOrientation = function(orientation) { - if (this.$orientation == orientation) { - return; - } - this.$orientation = orientation; - this.resize(); - }; - - /** - * Resizes the editor. - **/ - this.resize = function() { - var width = this.$container.clientWidth; - var height = this.$container.clientHeight; - var editor; - - if (this.$orientation == this.BESIDE) { - var editorWidth = width / this.$splits; - for (var i = 0; i < this.$splits; i++) { - editor = this.$editors[i]; - editor.container.style.width = editorWidth + "px"; - editor.container.style.top = "0px"; - editor.container.style.left = i * editorWidth + "px"; - editor.container.style.height = height + "px"; - editor.resize(); - } - } else { - var editorHeight = height / this.$splits; - for (var i = 0; i < this.$splits; i++) { - editor = this.$editors[i]; - editor.container.style.width = width + "px"; - editor.container.style.top = i * editorHeight + "px"; - editor.container.style.left = "0px"; - editor.container.style.height = editorHeight + "px"; - editor.resize(); - } - } - }; - -}).call(Split.prototype); - - -function UndoManagerProxy(undoManager, session) { - this.$u = undoManager; - this.$doc = session; -} - -(function() { - this.execute = function(options) { - this.$u.execute(options); - }; - - this.undo = function() { - var selectionRange = this.$u.undo(true); - if (selectionRange) { - this.$doc.selection.setSelectionRange(selectionRange); - } - }; - - this.redo = function() { - var selectionRange = this.$u.redo(true); - if (selectionRange) { - this.$doc.selection.setSelectionRange(selectionRange); - } - }; - - this.reset = function() { - this.$u.reset(); - }; - - this.hasUndo = function() { - return this.$u.hasUndo(); - }; - - this.hasRedo = function() { - return this.$u.hasRedo(); - }; -}).call(UndoManagerProxy.prototype); - -exports.Split = Split; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all.js deleted file mode 100644 index e437d6f0..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all.js +++ /dev/null @@ -1,35 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -"use strict"; - -require("amd-loader"); -var test = require("asyncjs").test; -test.walkTestCases(__dirname + "/..").exec(); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js deleted file mode 100644 index 7ac5092e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +++ /dev/null @@ -1,150 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -require("ace/lib/fixoldbrowsers"); -var AsyncTest = require("asyncjs").test; -var async = require("asyncjs"); - -var passed = 0 -var failed = 0 -var log = document.getElementById("log") - -var testNames = [ - "ace/anchor_test", - "ace/background_tokenizer_test", - "ace/commands/command_manager_test", - "ace/config_test", - "ace/document_test", - "ace/edit_session_test", - "ace/editor_change_document_test", - "ace/editor_highlight_selected_word_test", - "ace/editor_navigation_test", - "ace/editor_text_edit_test", - "ace/ext/static_highlight_test", - "ace/incremental_search_test", - "ace/keyboard/emacs_test", - "ace/keyboard/keybinding_test", - "ace/keyboard/vim_test", - "ace/layer/text_test", - "ace/lib/event_emitter_test", - "ace/mode/coffee/parser_test", - "ace/mode/coldfusion_test", - "ace/mode/css_test", - "ace/mode/css_worker", - "ace/mode/html_test", - "ace/mode/javascript_test", - "ace/mode/javascript_worker_test", - "ace/mode/logiql_test", - "ace/mode/python_test", - "ace/mode/text_test", - "ace/mode/xml_test", - "ace/mode/folding/cstyle_test", - "ace/mode/folding/html_test", - "ace/mode/folding/pythonic_test", - "ace/mode/folding/xml_test", - "ace/mode/folding/coffee_test", - "ace/mode/behaviour/behaviour_test", - "ace/multi_select_test", - "ace/mouse/mouse_handler_test", - "ace/occur_test", - "ace/placeholder_test", - "ace/range_test", - "ace/range_list_test", - "ace/search_test", - "ace/selection_test", - "ace/snippets_test", - "ace/token_iterator_test", - "ace/tokenizer_test", - "ace/virtual_renderer_test" -]; - -var html = ["all tests
    "]; -for (var i in testNames) { - var href = testNames[i]; - html.push("", href.replace(/^ace\//, "") ,"
    "); -} - -var nav = document.createElement("div"); -nav.innerHTML = html.join(""); -nav.style.cssText = "position:absolute;right:0;top:0"; -document.body.appendChild(nav); - -if (location.search) - testNames = location.search.substr(1).split(",") - -var filter = location.hash.substr(1); - -require(testNames, function() { - var tests = testNames.map(function(x) { - var module = require(x); - module.href = x; - return module; - }); - - async.list(tests) - .expand(function(test) { - if (filter) { - Object.keys(test).forEach(function(method) { - if (method.match(/^>?test/) && !method.match(filter)) - test[method] = undefined; - }); - } - return AsyncTest.testcase(test) - }, AsyncTest.TestGenerator) - .run() - .each(function(test, next) { - if (test.index == 1 && test.context.href) { - var href = test.context.href; - var node = document.createElement("div"); - node.innerHTML = "" + href.replace(/^ace\//, "") + ""; - log.appendChild(node); - } - var node = document.createElement("div"); - node.className = test.passed ? "passed" : "failed"; - - var name = test.name - if (test.suiteName) - name = test.suiteName + ": " + test.name - - var msg = "[" + test.count + "/" + test.index + "] " + name + " " + (test.passed ? "OK" : "FAIL") - if (!test.passed) { - if (test.err.stack) - var err = test.err.stack - else - var err = test.err - - console.error(msg); - console.error(err); - msg += "
    " + err + "
    "; - } else { - console.log(msg); - } - - node.innerHTML = msg; - log.appendChild(node); - - next() - }) - .each(function(test) { - if (test.passed) - passed += 1 - else - failed += 1 - }) - .end(function() { - log.innerHTML += [ - "
    ", - "
    ", - "Summary:
    ", - "
    ", - "Total number of tests: " + (passed + failed) + "
    ", - (passed ? "Passed tests: " + passed + "
    " : ""), - (failed ? "Failed tests: " + failed + "
    " : "") - ].join("") - console.log("Total number of tests: " + (passed + failed)); - console.log("Passed tests: " + passed); - console.log("Failed tests: " + failed); - }) -}); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js deleted file mode 100644 index 3a521003..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var assert = require("assert"); - -assert.position = function(cursor, row, column) { - assert.equal(cursor.row, row); - assert.equal(cursor.column, column); -}; - -assert.range = function(range, startRow, startColumn, endRow, endColumn) { - assert.position(range.start, startRow, startColumn); - assert.position(range.end, endRow, endColumn); -}; - -assert.notOk = function(value) { - assert.equal(value, false); -}; - -exports.jsonEquals = function(foundJson, expectedJson) { - assert.equal(JSON.stringify(foundJson), JSON.stringify(expectedJson)); -}; - -module.exports = assert; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js deleted file mode 100644 index 96e3f6e2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +++ /dev/null @@ -1,313 +0,0 @@ -define(function(require, exports, module) { - -// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 -// -// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! -// -// Originally from narwhal.js (http://narwhaljs.org) -// Copyright (c) 2009 Thomas Robinson <280north.com> -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the 'Software'), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -// UTILITY -var oop = require("ace/lib/oop"); -var pSlice = Array.prototype.slice; - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = exports; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -oop.inherits(assert.AssertionError, Error); - -toJSON = function(obj) { - if (typeof JSON !== "undefined") - return JSON.stringify(obj); - else - return obj.toString(); -} - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name + ':', this.message].join(' '); - } else { - return [this.name + ':', - toJSON(this.expected), - this.operator, - toJSON(this.actual)].join(' '); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -assert.ok = function ok(value, message) { - if (!!!value) fail(value, true, message, '==', assert.ok); -}; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (typeof Buffer !== "undefined" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try { - var ka = Object.keys(a), - kb = Object.keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (expected instanceof RegExp) { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof expected === 'string') { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail('Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail('Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function(err) { if (err) {throw err;}}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js deleted file mode 100644 index e8265119..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +++ /dev/null @@ -1,529 +0,0 @@ -/*! - * async.js - * Copyright(c) 2010 Fabian Jakobs - * MIT Licensed - */ - -define(function(require, exports, module) { - -var STOP = exports.STOP = {} - -exports.Generator = function(source) { - if (typeof source == "function") - this.source = { - next: source - } - else - this.source = source -} - -;(function() { - this.next = function(callback) { - this.source.next(callback) - } - - this.map = function(mapper) { - if (!mapper) - return this - - mapper = makeAsync(1, mapper) - - var source = this.source - this.next = function(callback) { - source.next(function(err, value) { - if (err) - callback(err) - else { - mapper(value, function(err, value) { - if (err) - callback(err) - else - callback(null, value) - }) - } - }) - } - return new this.constructor(this) - } - - this.filter = function(filter) { - if (!filter) - return this - - filter = makeAsync(1, filter) - - var source = this.source - this.next = function(callback) { - source.next(function handler(err, value) { - if (err) - callback(err) - else { - filter(value, function(err, takeIt) { - if (err) - callback(err) - else if (takeIt) - callback(null, value) - else - source.next(handler) - }) - } - }) - } - return new this.constructor(this) - } - - this.slice = function(begin, end) { - var count = -1 - if (!end || end < 0) - var end = Infinity - - var source = this.source - this.next = function(callback) { - source.next(function handler(err, value) { - count++ - if (err) - callback(err) - else if (count >= begin && count < end) - callback(null, value) - else if (count >= end) - callback(STOP) - else - source.next(handler) - }) - } - return new this.constructor(this) - } - - this.reduce = function(reduce, initialValue) { - reduce = makeAsync(3, reduce) - - var index = 0 - var done = false - var previousValue = initialValue - - var source = this.source - this.next = function(callback) { - if (done) - return callback(STOP) - - if (initialValue === undefined) { - source.next(function(err, currentValue) { - if (err) - return callback(err, previousValue) - - previousValue = currentValue - reduceAll() - }) - } - else - reduceAll() - - function reduceAll() { - source.next(function handler(err, currentValue) { - if (err) { - done = true - if (err == STOP) - return callback(null, previousValue) - else - return(err) - } - reduce(previousValue, currentValue, index++, function(err, value) { - previousValue = value - source.next(handler) - }) - }) - } - } - return new this.constructor(this) - } - - this.forEach = - this.each = function(fn) { - fn = makeAsync(1, fn) - - var source = this.source - this.next = function(callback) { - source.next(function handler(err, value) { - if (err) - callback(err) - else { - fn(value, function(err) { - callback(err, value) - }) - } - }) - } - return new this.constructor(this) - } - - this.some = function(condition) { - condition = makeAsync(1, condition) - - var source = this.source - var done = false - this.next = function(callback) { - if (done) - return callback(STOP) - - source.next(function handler(err, value) { - if (err) - return callback(err) - - condition(value, function(err, result) { - if (err) { - done = true - if (err == STOP) - callback(null, false) - else - callback(err) - } - else if (result) { - done = true - callback(null, true) - } - else - source.next(handler) - }) - }) - } - return new this.constructor(this) - } - - this.every = function(condition) { - condition = makeAsync(1, condition) - - var source = this.source - var done = false - this.next = function(callback) { - if (done) - return callback(STOP) - - source.next(function handler(err, value) { - if (err) - return callback(err) - - condition(value, function(err, result) { - if (err) { - done = true - if (err == STOP) - callback(null, true) - else - callback(err) - } - else if (!result) { - done = true - callback(null, false) - } - else - source.next(handler) - }) - }) - } - return new this.constructor(this) - } - - this.call = function(context) { - var source = this.source - return this.map(function(fn, next) { - fn = makeAsync(0, fn, context) - fn.call(context, function(err, value) { - next(err, value) - }) - }) - } - - this.concat = function(generator) { - var generators = [this] - generators.push.apply(generators, arguments) - var index = 0 - var source = generators[index++] - - return new this.constructor(function(callback) { - source.next(function handler(err, value) { - if (err) { - if (err == STOP) { - source = generators[index++] - if (!source) - return callback(STOP) - else - return source.next(handler) - } - else - return callback(err) - } - else - return callback(null, value) - }) - }) - } - - this.zip = function(generator) { - var generators = [this] - generators.push.apply(generators, arguments) - - return new this.constructor(function(callback) { - exports.list(generators) - .map(function(gen, next) { - gen.next(next) - }) - .toArray(callback) - }) - } - - this.expand = function(inserter, constructor) { - if (!inserter) - return this - - var inserter = makeAsync(1, inserter) - var constructor = constructor || this.constructor - var source = this.source; - var spliced = null; - - return new constructor(function next(callback) { - if (!spliced) { - source.next(function(err, value) { - if (err) - return callback(err) - - inserter(value, function(err, toInsert) { - if (err) - return callback(err) - - spliced = toInsert - next(callback) - }) - - }) - } - else { - spliced.next(function(err, value) { - if (err == STOP) { - spliced = null - return next(callback) - } - else if (err) - return callback(err) - - callback(err, value) - }) - } - }) - } - - this.sort = function(compare) { - var self = this - var arrGen - this.next = function(callback) { - if (arrGen) - return arrGen.next(callback) - - self.toArray(function(err, arr) { - if (err) - callback(err) - else { - arrGen = exports.list(arr.sort(compare)) - arrGen.next(callback) - } - }) - } - return new this.constructor(this) - } - - this.join = function(separator) { - return this.$arrayOp(Array.prototype.join, separator !== undefined ? [separator] : null) - } - - this.reverse = function() { - return this.$arrayOp(Array.prototype.reverse) - } - - this.$arrayOp = function(arrayMethod, args) { - var self = this - var i = 0 - this.next = function(callback) { - if (i++ > 0) - return callback(STOP) - - self.toArray(function(err, arr) { - if (err) - callback(err, "") - else { - if (args) - callback(null, arrayMethod.apply(arr, args)) - else - callback(null, arrayMethod.call(arr)) - } - }) - } - return new this.constructor(this) - - } - - this.end = function(breakOnError, callback) { - if (!callback) { - callback = arguments[0] - breakOnError = true - } - - var source = this.source - var last - var lastError - source.next(function handler(err, value) { - if (err) { - if (err == STOP) - callback && callback(lastError, last) - else if (!breakOnError) { - lastError = err - source.next(handler) - } - else - callback && callback(err, value) - } - else { - last = value - source.next(handler) - } - }) - } - - this.toArray = function(breakOnError, callback) { - if (!callback) { - callback = arguments[0] - breakOnError = true - } - - var values = [] - var errors = [] - var source = this.source - - source.next(function handler(err, value) { - if (err) { - if (err == STOP) { - if (breakOnError) - return callback(null, values) - else { - errors.length = values.length - return callback(errors, values) - } - } - else { - if (breakOnError) - return callback(err) - else - errors[values.length] = err - } - } - - values.push(value) - source.next(handler) - }) - } - -}).call(exports.Generator.prototype) - -var makeAsync = exports.makeAsync = function(args, fn, context) { - if (fn.length > args) - return fn - else { - return function() { - var value - var next = arguments[args] - try { - value = fn.apply(context || this, arguments) - } catch(e) { - return next(e) - } - next(null, value) - } - } -} - -exports.list = function(arr, construct) { - var construct = construct || exports.Generator - var i = 0 - var len = arr.length - - return new construct(function(callback) { - if (i < len) - callback(null, arr[i++]) - else - callback(STOP) - }) -} - -exports.values = function(map, construct) { - var values = [] - for (var key in map) - values.push(map[key]) - - return exports.list(values, construct) -} - -exports.keys = function(map, construct) { - var keys = [] - for (var key in map) - keys.push(key) - - return exports.list(keys, construct) -} - -/* - * range([start,] stop[, step]) -> generator of integers - * - * Return a generator containing an arithmetic progression of integers. - * range(i, j) returns [i, i+1, i+2, ..., j-1] start (!) defaults to 0. - * When step is given, it specifies the increment (or decrement). - */ -exports.range = function(start, stop, step, construct) { - var construct = construct || exports.Generator - start = start || 0 - step = step || 1 - - if (stop === undefined || stop === null) - stop = step > 0 ? Infinity : -Infinity - - var value = start - - return new construct(function(callback) { - if (step > 0 && value >= stop || step < 0 && value <= stop) - callback(STOP) - else { - var current = value - value += step - callback(null, current) - } - }) -} - -exports.concat = function(first, varargs) { - if (arguments.length > 1) - return first.concat.apply(first, Array.prototype.slice.call(arguments, 1)) - else - return first -} - -exports.zip = function(first, varargs) { - if (arguments.length > 1) - return first.zip.apply(first, Array.prototype.slice.call(arguments, 1)) - else - return first.map(function(item, next) { - next(null, [item]) - }) -} - - -exports.plugin = function(members, constructors) { - if (members) { - for (var key in members) { - exports.Generator.prototype[key] = members[key] - } - } - - if (constructors) { - for (var key in constructors) { - exports[key] = constructors[key] - } - } -} - -}) diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js deleted file mode 100644 index ed63914b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/*! - * async.js - * Copyright(c) 2010 Fabian Jakobs - * MIT Licensed - */ - -define(function(require, exports, module) { - -module.exports = require("./async") -module.exports.test = require("./test") -require("./utils") - -}) diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js deleted file mode 100644 index 4374ef7c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +++ /dev/null @@ -1,195 +0,0 @@ -/*! - * async.js - * Copyright(c) 2010 Fabian Jakobs - * MIT Licensed - */ - -define(function(require, exports, module) { - -var oop = require("ace/lib/oop") -var async = require("asyncjs/async") -require("asyncjs/utils") - -exports.TestGenerator = function(source) { - async.Generator.call(this, source) -} - -oop.inherits(exports.TestGenerator, async.Generator) - -;(function() { - - this.exec = function() { - this.run().report().summary(function(err, passed) { - console.log("DONE") - }) - } - - this.run = function() { - return this.setupTest() - .each(function(test, next) { - if (test.setUpSuite) - test.setUpSuite(next) - else - next() - }) - .each(function(test, next) { - test.test(function(err, passed) { - test.err = err - test.passed = passed - next() - }) - }) - .each(function(test, next) { - if (test.tearDownSuite) - test.tearDownSuite(next) - else - next() - }) - } - - this.report = function() { - return this.each(function(test, next) { - var color = test.passed ? "\x1b[32m" : "\x1b[31m" - var name = test.name - if (test.suiteName) - name = test.suiteName + ": " + test.name - console.log(color + "[" + test.count + "/" + test.index + "] " + name + " " + (test.passed ? "OK" : "FAIL") + "\x1b[0m") - if (!test.passed) - if (test.err.stack) - console.log(test.err.stack) - else - console.log(test.err) - - next() - }) - } - - this.summary = function(callback) { - var passed = 0 - var failed = 0 - - this.each(function(test) { - if (test.passed) - passed += 1 - else - failed += 1 - }).end(function() { - console.log("") - console.log("Summary:") - console.log("") - console.log( "Total number of tests: " + (passed + failed)) - passed && console.log("\x1b[32mPassed tests: " + passed + "\x1b[0m") - failed && console.log("\x1b[31mFailed tests: " + failed + "\x1b[0m") - console.log("") - callback(null, failed == 0) - }) - } - - this.setupTest = function() { - return this.each(function(test, next) { - var empty = function(next) { next() } - var context = test.context || this - - if (test.setUp) - var setUp = async.makeAsync(0, test.setUp, context) - else - setUp = empty - - tearDownCalled = false - if (test.tearDown) - var tearDownInner = async.makeAsync(0, test.tearDown, context) - else - tearDownInner = empty - - function tearDown(next) { - tearDownCalled = true - tearDownInner.call(test.context, next) - } - - var testFn = async.makeAsync(0, test.fn, context) - - test.test = function(callback) { - var called - function errorListener(e) { - if (called) - return - called = true - //process.removeListener('uncaughtException', errorListener) - if (!tearDownCalled) { - async.list([tearDown]) - .call() - .timeout(test.timeout) - .end(function() { - callback(e, false) - }) } - else - callback(e, false) - } - //process.addListener('uncaughtException', errorListener) - - async.list([setUp, testFn, tearDown]) - .delay(0) - .call(context) - .timeout(test.timeout) - .toArray(false, function(errors, values) { - if (called) - return - called = true - var err = errors[1] - //process.removeListener('uncaughtException', errorListener) - callback(err, !err) - }) - } - - next() - }) - } - -}).call(exports.TestGenerator.prototype) - -exports.testcase = function(testcase, suiteName, timeout) { - var methods = [] - for (var method in testcase) - methods.push(method) - - var setUp = testcase.setUp || null - var tearDown = testcase.tearDown || null - - var single - methods.forEach(function(name) { - if (name.charAt(0) == '>') - single = name - }) - if (single) - methods = [single] - - var testNames = methods.filter(function(method) { - return method.match(/^>?test/) && typeof(testcase[method]) == "function" - }) - var count = testNames.length - var i=1 - tests = testNames.map(function(name) { - return { - suiteName: suiteName || testcase.name || "", - name: name, - setUp: setUp, - tearDown: tearDown, - context: testcase, - timeout: timeout === undefined ? 3000 : timeout, - fn: testcase[name], - count: count, - index: i++ - } - }) - - if (testcase.setUpSuite) { - tests[0].setUpSuite = async.makeAsync(0, testcase.setUpSuite, testcase) - } - if (testcase.tearDownSuite) { - tests[tests.length-1].tearDownSuite = async.makeAsync(0, testcase.tearDownSuite, testcase) - } - - return async.list(tests, exports.TestGenerator) -} - -}) diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js deleted file mode 100644 index 75fb3095..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +++ /dev/null @@ -1,65 +0,0 @@ -/*! - * async.js - * Copyright(c) 2010 Fabian Jakobs - * MIT Licensed - */ - -define(function(require, exports, module) { - -var async = require("asyncjs/async") - -async.plugin({ - delay: function(delay) { - return this.each(function(item, next) { - setTimeout(function() { - next(); - }, delay) - }) - }, - - timeout: function(timeout) { - timeout = timeout || 0 - var source = this.source - - this.next = function(callback) { - var called - var id = setTimeout(function() { - called = true - callback("Source did not respond after " + timeout + "ms!") - }, timeout) - - source.next(function(err, value) { - if (called) - return - - called = true - clearTimeout(id) - - callback(err, value) - }) - } - return new this.constructor(this) - }, - - get: function(key) { - return this.map(function(value, next) { - next(null, value[key]) - }) - }, - - inspect: function() { - return this.each(function(item, next) { - console.log(JSON.stringify(item)) - next() - }) - }, - - print: function() { - return this.each(function(item, next) { - console.log(item) - next() - }) - } -}) - -}) diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js deleted file mode 100644 index cd3953c8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +++ /dev/null @@ -1,78 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("../edit_session").EditSession; - -module.exports = { - setUp : function() { - this.start = Date.now(); - }, - - tearDown : function() { - console.log("took: ", Date.now() - this.start + "ms"); - }, - - "test: document to screen position": function() { - var s = new EditSession(Array(6000).join('someText\n')); - - for (var i=0; i<6000; i++) - s.documentToScreenPosition(i, 0); - - for (var i=0; i<6000; i++) - s.documentToScreenPosition(i, 0); - - console.log(s.$rowCache.length); - }, - - "test: screen to document position": function() { - var s = new EditSession(Array(6000).join('someText\n')); - - for (var i=0; i<6000; i++) - s.screenToDocumentPosition(i, 0); - - for (var i=0; i<6000; i++) - s.documentToScreenPosition(i, 0); - - console.log(s.$rowCache.length); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js deleted file mode 100644 index 54991fc5..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -var dom = require('jsdom/lib/jsdom/level2/html').dom.level2.html; -var browser = require('jsdom/lib/jsdom/browser/index').windowAugmentation(dom); - -global.document = browser.document; -global.window = browser.window; -global.self = browser.self; -global.navigator = browser.navigator; -global.location = browser.location; diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js deleted file mode 100644 index ba4c9563..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +++ /dev/null @@ -1,208 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var MockRenderer = exports.MockRenderer = function(visibleRowCount) { - this.container = document.createElement("div"); - this.scroller = document.createElement("div"); - this.visibleRowCount = visibleRowCount || 20; - - this.layerConfig = { - firstVisibleRow : 0, - lastVisibleRow : this.visibleRowCount - }; - - this.isMockRenderer = true; - - this.$gutter = {}; -}; - - -MockRenderer.prototype.getFirstVisibleRow = function() { - return this.layerConfig.firstVisibleRow; -}; - -MockRenderer.prototype.getLastVisibleRow = function() { - return this.layerConfig.lastVisibleRow; -}; - -MockRenderer.prototype.getFirstFullyVisibleRow = function() { - return this.layerConfig.firstVisibleRow; -}; - -MockRenderer.prototype.getLastFullyVisibleRow = function() { - return this.layerConfig.lastVisibleRow; -}; - -MockRenderer.prototype.getContainerElement = function() { - return this.container; -}; - -MockRenderer.prototype.getMouseEventTarget = function() { - return this.container; -}; - -MockRenderer.prototype.getTextAreaContainer = function() { - return this.container; -}; - -MockRenderer.prototype.addGutterDecoration = function() { -}; - -MockRenderer.prototype.removeGutterDecoration = function() { -}; - -MockRenderer.prototype.moveTextAreaToCursor = function() { -}; - -MockRenderer.prototype.setSession = function(session) { - this.session = session; -}; - -MockRenderer.prototype.getSession = function(session) { - return this.session; -}; - -MockRenderer.prototype.setTokenizer = function() { -}; - -MockRenderer.prototype.on = function() { -}; - -MockRenderer.prototype.updateCursor = function() { -}; - -MockRenderer.prototype.animateScrolling = function(fromValue, callback) { - callback && callback(); -}; - -MockRenderer.prototype.scrollToX = function(scrollTop) {}; -MockRenderer.prototype.scrollToY = function(scrollLeft) {}; - -MockRenderer.prototype.scrollToLine = function(line, center) { - var lineHeight = 16; - var row = 0; - for (var l = 1; l < line; l++) { - row += this.session.getRowLength(l-1); - } - - if (center) { - row -= this.visibleRowCount / 2; - } - this.scrollToRow(row); -}; - -MockRenderer.prototype.scrollSelectionIntoView = function() { -}; - -MockRenderer.prototype.scrollCursorIntoView = function() { - var cursor = this.session.getSelection().getCursor(); - if (cursor.row < this.layerConfig.firstVisibleRow) { - this.scrollToRow(cursor.row); - } - else if (cursor.row > this.layerConfig.lastVisibleRow) { - this.scrollToRow(cursor.row); - } -}; - -MockRenderer.prototype.scrollToRow = function(row) { - var row = Math.min(this.session.getLength() - this.visibleRowCount, Math.max(0, - row)); - this.layerConfig.firstVisibleRow = row; - this.layerConfig.lastVisibleRow = row + this.visibleRowCount; -}; - -MockRenderer.prototype.getScrollTopRow = function() { - return this.layerConfig.firstVisibleRow; -}; - -MockRenderer.prototype.draw = function() { -}; - -MockRenderer.prototype.onChangeTabSize = function(startRow, endRow) { -}; - -MockRenderer.prototype.updateLines = function(startRow, endRow) { -}; - -MockRenderer.prototype.updateBackMarkers = function() { -}; - -MockRenderer.prototype.updateFrontMarkers = function() { -}; - -MockRenderer.prototype.updateBreakpoints = function() { -}; - -MockRenderer.prototype.onResize = function() { -}; - -MockRenderer.prototype.updateFull = function() { -}; - -MockRenderer.prototype.updateText = function() { -}; - -MockRenderer.prototype.showCursor = function() { -}; - -MockRenderer.prototype.visualizeFocus = function() { -}; - -MockRenderer.prototype.setAnnotations = function() { -}; - -MockRenderer.prototype.setStyle = function() { -}; - -MockRenderer.prototype.unsetStyle = function() { -}; - -MockRenderer.prototype.textToScreenCoordinates = function() { - return { - pageX: 0, - pageY: 0 - } -}; - -MockRenderer.prototype.screenToTextCoordinates = function() { - return { - row: 0, - column: 0 - } -}; - -MockRenderer.prototype.adjustWrapLimit = function () { - -}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/tests.html b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/tests.html deleted file mode 100644 index 113ecc03..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/tests.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Ace Unit Tests - - - - -
    - - - - - - - diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css deleted file mode 100644 index 9f9f7afa..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +++ /dev/null @@ -1,221 +0,0 @@ -.ace-ambiance .ace_gutter { - background-color: #3d3d3d; - background-image: -moz-linear-gradient(left, #3D3D3D, #333); - background-image: -ms-linear-gradient(left, #3D3D3D, #333); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#3D3D3D), to(#333)); - background-image: -webkit-linear-gradient(left, #3D3D3D, #333); - background-image: -o-linear-gradient(left, #3D3D3D, #333); - background-image: linear-gradient(left, #3D3D3D, #333); - background-repeat: repeat-x; - border-right: 1px solid #4d4d4d; - text-shadow: 0px 1px 1px #4d4d4d; - color: #222; -} - -.ace-ambiance .ace_gutter-layer { - background: repeat left top; -} - -.ace-ambiance .ace_gutter-active-line { - background-color: #3F3F3F; -} - -.ace-ambiance .ace_fold-widget { - text-align: center; -} - -.ace-ambiance .ace_fold-widget:hover { - color: #777; -} - -.ace-ambiance .ace_fold-widget.ace_start, -.ace-ambiance .ace_fold-widget.ace_end, -.ace-ambiance .ace_fold-widget.ace_closed{ - background: none; - border: none; - box-shadow: none; -} - -.ace-ambiance .ace_fold-widget.ace_start:after { - content: '▾' -} - -.ace-ambiance .ace_fold-widget.ace_end:after { - content: '▴' -} - -.ace-ambiance .ace_fold-widget.ace_closed:after { - content: '‣' -} - -.ace-ambiance .ace_print-margin { - border-left: 1px dotted #2D2D2D; - right: 0; - background: #262626; -} - -.ace-ambiance .ace_scroller { - -webkit-box-shadow: inset 0 0 10px black; - -moz-box-shadow: inset 0 0 10px black; - -o-box-shadow: inset 0 0 10px black; - box-shadow: inset 0 0 10px black; -} - -.ace-ambiance { - color: #E6E1DC; - background-color: #202020; -} - -.ace-ambiance .ace_cursor { - border-left: 1px solid #7991E8; -} - -.ace-ambiance .ace_overwrite-cursors .ace_cursor { - border: 1px solid #FFE300; - background: #766B13; -} - -.ace-ambiance.normal-mode .ace_cursor-layer { - z-index: 0; -} - -.ace-ambiance .ace_marker-layer .ace_selection { - background: rgba(221, 240, 255, 0.20); -} - -.ace-ambiance .ace_marker-layer .ace_selected-word { - border-radius: 4px; - border: 8px solid #3f475d; - box-shadow: 0 0 4px black; -} - -.ace-ambiance .ace_marker-layer .ace_step { - background: rgb(198, 219, 174); -} - -.ace-ambiance .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid rgba(255, 255, 255, 0.25); -} - -.ace-ambiance .ace_marker-layer .ace_active-line { - background: rgba(255, 255, 255, 0.031); -} - -.ace-ambiance .ace_invisible { - color: #333; -} - -.ace-ambiance .ace_paren { - color: #24C2C7; -} - -.ace-ambiance .ace_keyword { - color: #cda869; -} - -.ace-ambiance .ace_keyword.ace_operator { - color: #fa8d6a; -} - -.ace-ambiance .ace_punctuation.ace_operator { - color: #fa8d6a; -} - -.ace-ambiance .ace_identifier { -} - -.ace-ambiance .ace-statement { - color: #cda869; -} - -.ace-ambiance .ace_constant { - color: #CF7EA9; -} - -.ace-ambiance .ace_constant.ace_language { - color: #CF7EA9; -} - -.ace-ambiance .ace_constant.ace_library { - -} - -.ace-ambiance .ace_constant.ace_numeric { - color: #78CF8A; -} - -.ace-ambiance .ace_invalid { - text-decoration: underline; -} - -.ace-ambiance .ace_invalid.ace_illegal { - color:#F8F8F8; - background-color: rgba(86, 45, 86, 0.75); -} - -.ace-ambiance .ace_invalid, -.ace-ambiance .ace_deprecated { - text-decoration: underline; - font-style: italic; - color: #D2A8A1; -} - -.ace-ambiance .ace_support { - color: #9B859D; -} - -.ace-ambiance .ace_support.ace_function { - color: #DAD085; -} - -.ace-ambiance .ace_function.ace_buildin { - color: #9b859d; -} - -.ace-ambiance .ace_string { - color: #8f9d6a; -} - -.ace-ambiance .ace_string.ace_regexp { - color: #DAD085; -} - -.ace-ambiance .ace_comment { - font-style: italic; - color: #555; -} - -.ace-ambiance .ace_comment.ace_doc { -} - -.ace-ambiance .ace_comment.ace_doc.ace_tag { - color: #666; - font-style: normal; -} - -.ace-ambiance .ace_definition, -.ace-ambiance .ace_type { - color: #aac6e3; -} - -.ace-ambiance .ace_variable { - color: #9999cc; -} - -.ace-ambiance .ace_variable.ace_language { - color: #9b859d; -} - -.ace-ambiance .ace_xml-pe { - color: #494949; -} - -.ace-ambiance .ace_gutter-layer, -.ace-ambiance .ace_text-layer { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC"); -} - -.ace-ambiance .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQUFD4z6Crq/sfAAuYAuYl+7lfAAAAAElFTkSuQmCC") right repeat-y; -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js deleted file mode 100644 index 475c2e87..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js +++ /dev/null @@ -1,33 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright 2011 Irakli Gozalishvili. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-ambiance"; -exports.cssText = require("../requirejs/text!./ambiance.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.css deleted file mode 100644 index f57e59b3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.css +++ /dev/null @@ -1,154 +0,0 @@ -.ace-chaos .ace_gutter { - background: #141414; - color: #595959; - border-right: 1px solid #282828; -} -.ace-chaos .ace_gutter-cell.ace_warning { - background-image: none; - background: #FC0; - border-left: none; - padding-left: 0; - color: #000; -} -.ace-chaos .ace_gutter-cell.ace_error { - background-position: -6px center; - background-image: none; - background: #F10; - border-left: none; - padding-left: 0; - color: #000; -} -.ace-chaos .ace_print-margin { - border-left: 1px solid #555; - right: 0; - background: #1D1D1D; -} -.ace-chaos { - background-color: #161616; - color: #E6E1DC; -} - -.ace-chaos .ace_cursor { - border-left: 2px solid #FFFFFF; -} -.ace-chaos .ace_cursor.ace_overwrite { - border-left: 0px; - border-bottom: 1px solid #FFFFFF; -} -.ace-chaos .ace_marker-layer .ace_selection { - background: #494836; -} -.ace-chaos .ace_marker-layer .ace_step { - background: rgb(198, 219, 174); -} -.ace-chaos .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #FCE94F; -} -.ace-chaos .ace_marker-layer .ace_active-line { - background: #333; -} -.ace-chaos .ace_gutter-active-line { - background-color: #222; -} -.ace-chaos .ace_invisible { - color: #404040; -} -.ace-chaos .ace_keyword { - color:#00698F; -} -.ace-chaos .ace_keyword.ace_operator { - color:#FF308F; -} -.ace-chaos .ace_constant { - color:#1EDAFB; -} -.ace-chaos .ace_constant.ace_language { - color:#FDC251; -} -.ace-chaos .ace_constant.ace_library { - color:#8DFF0A; -} -.ace-chaos .ace_constant.ace_numeric { - color:#58C554; -} -.ace-chaos .ace_invalid { - color:#FFFFFF; - background-color:#990000; -} -.ace-chaos .ace_invalid.ace_deprecated { - color:#FFFFFF; - background-color:#990000; -} -.ace-chaos .ace_support { - color: #999; -} -.ace-chaos .ace_support.ace_function { - color:#00AEEF; -} -.ace-chaos .ace_function { - color:#00AEEF; -} -.ace-chaos .ace_string { - color:#58C554; -} -.ace-chaos .ace_comment { - color:#555; - font-style:italic; - padding-bottom: 0px; -} -.ace-chaos .ace_variable { - color:#997744; -} -.ace-chaos .ace_meta.ace_tag { - color:#BE53E6; -} -.ace-chaos .ace_entity.ace_other.ace_attribute-name { - color:#FFFF89; -} -.ace-chaos .ace_markup.ace_underline { - text-decoration: underline; -} -.ace-chaos .ace_fold-widget { - text-align: center; -} - -.ace-chaos .ace_fold-widget:hover { - color: #777; -} - -.ace-chaos .ace_fold-widget.ace_start, -.ace-chaos .ace_fold-widget.ace_end, -.ace-chaos .ace_fold-widget.ace_closed{ - background: none; - border: none; - box-shadow: none; -} - -.ace-chaos .ace_fold-widget.ace_start:after { - content: '▾' -} - -.ace-chaos .ace_fold-widget.ace_end:after { - content: '▴' -} - -.ace-chaos .ace_fold-widget.ace_closed:after { - content: '‣' -} - -.ace-chaos .ace_indent-guide { - border-right:1px dotted #333; - margin-right:-1px; -} - -.ace-chaos .ace_fold { - background: #222; - border-radius: 3px; - color: #7AF; - border: none; -} -.ace-chaos .ace_fold:hover { - background: #CCC; - color: #000; -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.js deleted file mode 100644 index 9ee83720..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.js +++ /dev/null @@ -1,33 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright 2011 Irakli Gozalishvili. All rights reserved. - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-chaos"; -exports.cssText = require("../requirejs/text!./chaos.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); - -}); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css deleted file mode 100644 index c91e802a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +++ /dev/null @@ -1,154 +0,0 @@ -.ace-chrome .ace_gutter { - background: #ebebeb; - color: #333; - overflow : hidden; -} - -.ace-chrome .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-chrome { - background-color: #FFFFFF; - color: black; -} - -.ace-chrome .ace_cursor { - color: black; -} - -.ace-chrome .ace_invisible { - color: rgb(191, 191, 191); -} - -.ace-chrome .ace_constant.ace_buildin { - color: rgb(88, 72, 246); -} - -.ace-chrome .ace_constant.ace_language { - color: rgb(88, 92, 246); -} - -.ace-chrome .ace_constant.ace_library { - color: rgb(6, 150, 14); -} - -.ace-chrome .ace_invalid { - background-color: rgb(153, 0, 0); - color: white; -} - -.ace-chrome .ace_fold { -} - -.ace-chrome .ace_support.ace_function { - color: rgb(60, 76, 114); -} - -.ace-chrome .ace_support.ace_constant { - color: rgb(6, 150, 14); -} - -.ace-chrome .ace_support.ace_type, -.ace-chrome .ace_support.ace_class -.ace-chrome .ace_support.ace_other { - color: rgb(109, 121, 222); -} - -.ace-chrome .ace_variable.ace_parameter { - font-style:italic; - color:#FD971F; -} -.ace-chrome .ace_keyword.ace_operator { - color: rgb(104, 118, 135); -} - -.ace-chrome .ace_comment { - color: #236e24; -} - -.ace-chrome .ace_comment.ace_doc { - color: #236e24; -} - -.ace-chrome .ace_comment.ace_doc.ace_tag { - color: #236e24; -} - -.ace-chrome .ace_constant.ace_numeric { - color: rgb(0, 0, 205); -} - -.ace-chrome .ace_variable { - color: rgb(49, 132, 149); -} - -.ace-chrome .ace_xml-pe { - color: rgb(104, 104, 91); -} - -.ace-chrome .ace_entity.ace_name.ace_function { - color: #0000A2; -} - - -.ace-chrome .ace_heading { - color: rgb(12, 7, 255); -} - -.ace-chrome .ace_list { - color:rgb(185, 6, 144); -} - -.ace-chrome .ace_marker-layer .ace_selection { - background: rgb(181, 213, 255); -} - -.ace-chrome .ace_marker-layer .ace_step { - background: rgb(252, 255, 0); -} - -.ace-chrome .ace_marker-layer .ace_stack { - background: rgb(164, 229, 101); -} - -.ace-chrome .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid rgb(192, 192, 192); -} - -.ace-chrome .ace_marker-layer .ace_active-line { - background: rgba(0, 0, 0, 0.07); -} - -.ace-chrome .ace_gutter-active-line { - background-color : #dcdcdc; -} - -.ace-chrome .ace_marker-layer .ace_selected-word { - background: rgb(250, 250, 255); - border: 1px solid rgb(200, 200, 250); -} - -.ace-chrome .ace_storage, -.ace-chrome .ace_keyword, -.ace-chrome .ace_meta.ace_tag { - color: rgb(147, 15, 128); -} - -.ace-chrome .ace_string.ace_regex { - color: rgb(255, 0, 0) -} - -.ace-chrome .ace_string { - color: #1A1AA6; -} - -.ace-chrome .ace_entity.ace_other.ace_attribute-name { - color: #994409; -} - -.ace-chrome .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js deleted file mode 100644 index dafa99c2..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-chrome"; -exports.cssText = require("../requirejs/text!./chrome.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css deleted file mode 100644 index e3884e02..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +++ /dev/null @@ -1,112 +0,0 @@ -.ace-clouds .ace_gutter { - background: #ebebeb; - color: #333 -} - -.ace-clouds .ace_print-margin { - width: 1px; - background: #e8e8e8 -} - -.ace-clouds { - background-color: #FFFFFF; - color: #000000 -} - -.ace-clouds .ace_cursor { - color: #000000 -} - -.ace-clouds .ace_marker-layer .ace_selection { - background: #BDD5FC -} - -.ace-clouds.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #FFFFFF; - border-radius: 2px -} - -.ace-clouds .ace_marker-layer .ace_step { - background: rgb(255, 255, 0) -} - -.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_gutter-active-line { - background-color : #dcdcdc -} - -.ace-clouds .ace_marker-layer .ace_selected-word { - border: 1px solid #BDD5FC -} - -.ace-clouds .ace_invisible { - color: #BFBFBF -} - -.ace-clouds .ace_keyword, -.ace-clouds .ace_meta, -.ace-clouds .ace_support.ace_constant.ace_property-value { - color: #AF956F -} - -.ace-clouds .ace_keyword.ace_operator { - color: #484848 -} - -.ace-clouds .ace_keyword.ace_other.ace_unit { - color: #96DC5F -} - -.ace-clouds .ace_constant.ace_language { - color: #39946A -} - -.ace-clouds .ace_constant.ace_numeric { - color: #46A609 -} - -.ace-clouds .ace_constant.ace_character.ace_entity { - color: #BF78CC -} - -.ace-clouds .ace_invalid { - background-color: #FF002A -} - -.ace-clouds .ace_fold { - background-color: #AF956F; - border-color: #000000 -} - -.ace-clouds .ace_storage, -.ace-clouds .ace_support.ace_class, -.ace-clouds .ace_support.ace_function, -.ace-clouds .ace_support.ace_other, -.ace-clouds .ace_support.ace_type { - color: #C52727 -} - -.ace-clouds .ace_string { - color: #5D90CD -} - -.ace-clouds .ace_comment { - color: #BCC8BA -} - -.ace-clouds .ace_entity.ace_name.ace_tag, -.ace-clouds .ace_entity.ace_other.ace_attribute-name { - color: #606060 -} - -.ace-clouds .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js deleted file mode 100644 index aa36edcf..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-clouds"; -exports.cssText = require("../requirejs/text!./clouds.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css deleted file mode 100644 index 8d23bcbe..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +++ /dev/null @@ -1,113 +0,0 @@ -.ace-clouds-midnight .ace_gutter { - background: #232323; - color: #929292 -} - -.ace-clouds-midnight .ace_print-margin { - width: 1px; - background: #232323 -} - -.ace-clouds-midnight { - background-color: #191919; - color: #929292 -} - -.ace-clouds-midnight .ace_cursor { - color: #7DA5DC -} - -.ace-clouds-midnight .ace_marker-layer .ace_selection { - background: #000000 -} - -.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #191919; - border-radius: 2px -} - -.ace-clouds-midnight .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: 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, -.ace-clouds-midnight .ace_meta, -.ace-clouds-midnight .ace_support.ace_constant.ace_property-value { - color: #927C5D -} - -.ace-clouds-midnight .ace_keyword.ace_operator { - color: #4B4B4B -} - -.ace-clouds-midnight .ace_keyword.ace_other.ace_unit { - color: #366F1A -} - -.ace-clouds-midnight .ace_constant.ace_language { - color: #39946A -} - -.ace-clouds-midnight .ace_constant.ace_numeric { - color: #46A609 -} - -.ace-clouds-midnight .ace_constant.ace_character.ace_entity { - color: #A165AC -} - -.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_storage, -.ace-clouds-midnight .ace_support.ace_class, -.ace-clouds-midnight .ace_support.ace_function, -.ace-clouds-midnight .ace_support.ace_other, -.ace-clouds-midnight .ace_support.ace_type { - color: #E92E2E -} - -.ace-clouds-midnight .ace_string { - color: #5D90CD -} - -.ace-clouds-midnight .ace_comment { - color: #3C403B -} - -.ace-clouds-midnight .ace_entity.ace_name.ace_tag, -.ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name { - color: #606060 -} - -.ace-clouds-midnight .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js deleted file mode 100644 index e704d57c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-clouds-midnight"; -exports.cssText = require("../requirejs/text!./clouds_midnight.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css deleted file mode 100644 index 16568fc3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +++ /dev/null @@ -1,134 +0,0 @@ -.ace-cobalt .ace_gutter { - background: #011e3a; - color: rgb(128,145,160) -} - -.ace-cobalt .ace_print-margin { - width: 1px; - background: #011e3a -} - -.ace-cobalt { - background-color: #002240; - color: #FFFFFF -} - -.ace-cobalt .ace_cursor { - color: #FFFFFF -} - -.ace-cobalt .ace_marker-layer .ace_selection { - background: rgba(179, 101, 57, 0.75) -} - -.ace-cobalt.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #002240; - border-radius: 2px -} - -.ace-cobalt .ace_marker-layer .ace_step { - background: rgb(127, 111, 19) -} - -.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_gutter-active-line { - background-color: 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, -.ace-cobalt .ace_meta { - color: #FF9D00 -} - -.ace-cobalt .ace_constant, -.ace-cobalt .ace_constant.ace_character, -.ace-cobalt .ace_constant.ace_character.ace_escape, -.ace-cobalt .ace_constant.ace_other { - color: #FF628C -} - -.ace-cobalt .ace_invalid { - color: #F8F8F8; - background-color: #800F00 -} - -.ace-cobalt .ace_support { - color: #80FFBB -} - -.ace-cobalt .ace_support.ace_constant { - color: #EB939A -} - -.ace-cobalt .ace_fold { - background-color: #FF9D00; - border-color: #FFFFFF -} - -.ace-cobalt .ace_support.ace_function { - color: #FFB054 -} - -.ace-cobalt .ace_storage { - color: #FFEE80 -} - -.ace-cobalt .ace_entity { - color: #FFDD00 -} - -.ace-cobalt .ace_string { - color: #3AD900 -} - -.ace-cobalt .ace_string.ace_regexp { - color: #80FFC2 -} - -.ace-cobalt .ace_comment { - font-style: italic; - color: #0088FF -} - -.ace-cobalt .ace_heading, -.ace-cobalt .ace_markup.ace_heading { - color: #C8E4FD; - background-color: #001221 -} - -.ace-cobalt .ace_list, -.ace-cobalt .ace_markup.ace_list { - background-color: #130D26 -} - -.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_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js deleted file mode 100644 index a466dd6c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-cobalt"; -exports.cssText = require("../requirejs/text!./cobalt.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css deleted file mode 100644 index e84292b4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +++ /dev/null @@ -1,143 +0,0 @@ -.ace-crimson-editor .ace_gutter { - background: #ebebeb; - color: #333; - overflow : hidden; -} - -.ace-crimson-editor .ace_gutter-layer { - width: 100%; - text-align: right; -} - -.ace-crimson-editor .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-crimson-editor { - background-color: #FFFFFF; - color: rgb(64, 64, 64); -} - -.ace-crimson-editor .ace_cursor { - color: black; -} - -.ace-crimson-editor .ace_invisible { - color: rgb(191, 191, 191); -} - -.ace-crimson-editor .ace_identifier { - color: black; -} - -.ace-crimson-editor .ace_keyword { - color: blue; -} - -.ace-crimson-editor .ace_constant.ace_buildin { - color: rgb(88, 72, 246); -} - -.ace-crimson-editor .ace_constant.ace_language { - color: rgb(255, 156, 0); -} - -.ace-crimson-editor .ace_constant.ace_library { - color: rgb(6, 150, 14); -} - -.ace-crimson-editor .ace_invalid { - text-decoration: line-through; - color: rgb(224, 0, 0); -} - -.ace-crimson-editor .ace_fold { -} - -.ace-crimson-editor .ace_support.ace_function { - color: rgb(192, 0, 0); -} - -.ace-crimson-editor .ace_support.ace_constant { - color: rgb(6, 150, 14); -} - -.ace-crimson-editor .ace_support.ace_type, -.ace-crimson-editor .ace_support.ace_class { - color: rgb(109, 121, 222); -} - -.ace-crimson-editor .ace_keyword.ace_operator { - color: rgb(49, 132, 149); -} - -.ace-crimson-editor .ace_string { - color: rgb(128, 0, 128); -} - -.ace-crimson-editor .ace_comment { - color: rgb(76, 136, 107); -} - -.ace-crimson-editor .ace_comment.ace_doc { - color: rgb(0, 102, 255); -} - -.ace-crimson-editor .ace_comment.ace_doc.ace_tag { - color: rgb(128, 159, 191); -} - -.ace-crimson-editor .ace_constant.ace_numeric { - color: rgb(0, 0, 64); -} - -.ace-crimson-editor .ace_variable { - color: rgb(0, 64, 128); -} - -.ace-crimson-editor .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_gutter-active-line { - background-color : #dcdcdc; -} - -.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); -} - -.ace-crimson-editor .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js deleted file mode 100644 index a5971075..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -exports.isDark = false; -exports.cssText = require("../requirejs/text!./crimson_editor.css"); - -exports.cssClass = "ace-crimson-editor"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css deleted file mode 100644 index 719f4877..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +++ /dev/null @@ -1,127 +0,0 @@ -.ace-dawn .ace_gutter { - background: #ebebeb; - color: #333 -} - -.ace-dawn .ace_print-margin { - width: 1px; - background: #e8e8e8 -} - -.ace-dawn { - background-color: #F9F9F9; - color: #080808 -} - -.ace-dawn .ace_cursor { - color: #000000 -} - -.ace-dawn .ace_marker-layer .ace_selection { - background: rgba(39, 95, 255, 0.30) -} - -.ace-dawn.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #F9F9F9; - border-radius: 2px -} - -.ace-dawn .ace_marker-layer .ace_step { - background: rgb(255, 255, 0) -} - -.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_gutter-active-line { - background-color : #dcdcdc -} - -.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, -.ace-dawn .ace_meta { - color: #794938 -} - -.ace-dawn .ace_constant, -.ace-dawn .ace_constant.ace_character, -.ace-dawn .ace_constant.ace_character.ace_escape, -.ace-dawn .ace_constant.ace_other { - 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_support.ace_constant { - color: #B4371F -} - -.ace-dawn .ace_fold { - background-color: #794938; - border-color: #080808 -} - -.ace-dawn .ace_list, -.ace-dawn .ace_markup.ace_list, -.ace-dawn .ace_support.ace_function { - color: #693A17 -} - -.ace-dawn .ace_storage { - font-style: italic; - color: #A71D5D -} - -.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_heading, -.ace-dawn .ace_markup.ace_heading { - color: #19356D -} - -.ace-dawn .ace_variable { - color: #234A97 -} - -.ace-dawn .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js deleted file mode 100644 index 2498aa3b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-dawn"; -exports.cssText = require("../requirejs/text!./dawn.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css deleted file mode 100644 index 84865a1c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +++ /dev/null @@ -1,176 +0,0 @@ -.ace-dreamweaver .ace_gutter { - background: #e8e8e8; - color: #333; -} - -.ace-dreamweaver .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-dreamweaver { - background-color: #FFFFFF; - color: black; -} - -.ace-dreamweaver .ace_fold { - background-color: #757AD8; -} - -.ace-dreamweaver .ace_cursor { - color: black; -} - -.ace-dreamweaver .ace_invisible { - color: rgb(191, 191, 191); -} - -.ace-dreamweaver .ace_storage, -.ace-dreamweaver .ace_keyword { - color: blue; -} - -.ace-dreamweaver .ace_constant.ace_buildin { - color: rgb(88, 72, 246); -} - -.ace-dreamweaver .ace_constant.ace_language { - color: rgb(88, 92, 246); -} - -.ace-dreamweaver .ace_constant.ace_library { - color: rgb(6, 150, 14); -} - -.ace-dreamweaver .ace_invalid { - background-color: rgb(153, 0, 0); - color: white; -} - -.ace-dreamweaver .ace_support.ace_function { - color: rgb(60, 76, 114); -} - -.ace-dreamweaver .ace_support.ace_constant { - color: rgb(6, 150, 14); -} - -.ace-dreamweaver .ace_support.ace_type, -.ace-dreamweaver .ace_support.ace_class { - color: #009; -} - -.ace-dreamweaver .ace_support.ace_php_tag { - color: #f00; -} - -.ace-dreamweaver .ace_keyword.ace_operator { - color: rgb(104, 118, 135); -} - -.ace-dreamweaver .ace_string { - color: #00F; -} - -.ace-dreamweaver .ace_comment { - color: rgb(76, 136, 107); -} - -.ace-dreamweaver .ace_comment.ace_doc { - color: rgb(0, 102, 255); -} - -.ace-dreamweaver .ace_comment.ace_doc.ace_tag { - color: rgb(128, 159, 191); -} - -.ace-dreamweaver .ace_constant.ace_numeric { - color: rgb(0, 0, 205); -} - -.ace-dreamweaver .ace_variable { - color: #06F -} - -.ace-dreamweaver .ace_xml-pe { - color: rgb(104, 104, 91); -} - -.ace-dreamweaver .ace_entity.ace_name.ace_function { - color: #00F; -} - - -.ace-dreamweaver .ace_heading { - color: rgb(12, 7, 255); -} - -.ace-dreamweaver .ace_list { - color:rgb(185, 6, 144); -} - -.ace-dreamweaver .ace_marker-layer .ace_selection { - background: rgb(181, 213, 255); -} - -.ace-dreamweaver .ace_marker-layer .ace_step { - background: rgb(252, 255, 0); -} - -.ace-dreamweaver .ace_marker-layer .ace_stack { - background: rgb(164, 229, 101); -} - -.ace-dreamweaver .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid rgb(192, 192, 192); -} - -.ace-dreamweaver .ace_marker-layer .ace_active-line { - background: rgba(0, 0, 0, 0.07); -} - -.ace-dreamweaver .ace_gutter-active-line { - background-color : #DCDCDC; -} - -.ace-dreamweaver .ace_marker-layer .ace_selected-word { - background: rgb(250, 250, 255); - border: 1px solid rgb(200, 200, 250); -} - -.ace-dreamweaver .ace_meta.ace_tag { - color:#009; -} - -.ace-dreamweaver .ace_meta.ace_tag.ace_anchor { - color:#060; -} - -.ace-dreamweaver .ace_meta.ace_tag.ace_form { - color:#F90; -} - -.ace-dreamweaver .ace_meta.ace_tag.ace_image { - color:#909; -} - -.ace-dreamweaver .ace_meta.ace_tag.ace_script { - color:#900; -} - -.ace-dreamweaver .ace_meta.ace_tag.ace_style { - color:#909; -} - -.ace-dreamweaver .ace_meta.ace_tag.ace_table { - color:#099; -} - -.ace-dreamweaver .ace_string.ace_regex { - color: rgb(255, 0, 0) -} - -.ace-dreamweaver .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js deleted file mode 100644 index 943dc692..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +++ /dev/null @@ -1,38 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -exports.isDark = false; -exports.cssClass = "ace-dreamweaver"; -exports.cssText = require("../requirejs/text!./dreamweaver.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css deleted file mode 100644 index c83d07a3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +++ /dev/null @@ -1,113 +0,0 @@ -.ace-eclipse .ace_gutter { - background: #ebebeb; - border-right: 1px solid rgb(159, 159, 159); - color: rgb(136, 136, 136); -} - -.ace-eclipse .ace_print-margin { - width: 1px; - background: #ebebeb; -} - -.ace-eclipse { - background-color: #FFFFFF; - color: black; -} - -.ace-eclipse .ace_fold { - background-color: rgb(60, 76, 114); -} - -.ace-eclipse .ace_cursor { - color: black; -} - -.ace-eclipse .ace_storage, -.ace-eclipse .ace_keyword, -.ace-eclipse .ace_variable { - color: rgb(127, 0, 85); -} - -.ace-eclipse .ace_constant.ace_buildin { - color: rgb(88, 72, 246); -} - -.ace-eclipse .ace_constant.ace_library { - color: rgb(6, 150, 14); -} - -.ace-eclipse .ace_function { - color: rgb(60, 76, 114); -} - -.ace-eclipse .ace_string { - color: rgb(42, 0, 255); -} - -.ace-eclipse .ace_comment { - color: rgb(113, 150, 130); -} - -.ace-eclipse .ace_comment.ace_doc { - color: rgb(63, 95, 191); -} - -.ace-eclipse .ace_comment.ace_doc.ace_tag { - color: rgb(127, 159, 191); -} - -.ace-eclipse .ace_constant.ace_numeric { - color: darkblue; -} - -.ace-eclipse .ace_tag { - color: rgb(25, 118, 116); -} - -.ace-eclipse .ace_type { - color: rgb(127, 0, 127); -} - -.ace-eclipse .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_meta.ace_tag { - color:rgb(25, 118, 116); -} - -.ace-eclipse .ace_invisible { - color: #ddd; -} - -.ace-eclipse .ace_entity.ace_other.ace_attribute-name { - color:rgb(127, 0, 127); -} -.ace-eclipse .ace_marker-layer .ace_step { - background: rgb(255, 255, 0); -} - -.ace-eclipse .ace_active-line { - background: rgb(232, 242, 254); -} - -.ace-eclipse .ace_gutter-active-line { - background-color : #DADADA; -} - -.ace-eclipse .ace_marker-layer .ace_selected-word { - border: 1px solid rgb(181, 213, 255); -} - -.ace-eclipse .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js deleted file mode 100644 index 329b8b79..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +++ /dev/null @@ -1,41 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -exports.isDark = false; -exports.cssText = require("../requirejs/text!./eclipse.css"); - -exports.cssClass = "ace-eclipse"; - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css deleted file mode 100644 index f496f6ee..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +++ /dev/null @@ -1,119 +0,0 @@ -/* CSS style content from github's default pygments highlighter template. - Cursor and selection styles from textmate.css. */ -.ace-github .ace_gutter { - background: #e8e8e8; - color: #AAA; -} - -.ace-github { - background: #fff; - color: #000; -} - -.ace-github .ace_keyword { - font-weight: bold; -} - -.ace-github .ace_string { - color: #D14; -} - -.ace-github .ace_variable.ace_class { - color: teal; -} - -.ace-github .ace_constant.ace_numeric { - color: #099; -} - -.ace-github .ace_constant.ace_buildin { - color: #0086B3; -} - -.ace-github .ace_support.ace_function { - color: #0086B3; -} - -.ace-github .ace_comment { - color: #998; - font-style: italic; -} - -.ace-github .ace_variable.ace_language { - color: #0086B3; -} - -.ace-github .ace_paren { - font-weight: bold; -} - -.ace-github .ace_boolean { - font-weight: bold; -} - -.ace-github .ace_string.ace_regexp { - color: #009926; - font-weight: normal; -} - -.ace-github .ace_variable.ace_instance { - color: teal; -} - -.ace-github .ace_constant.ace_language { - font-weight: bold; -} - -.ace-github .ace_cursor { - color: black; -} - -.ace-github .ace_marker-layer .ace_active-line { - background: rgb(255, 255, 204); -} - -.ace-github .ace_marker-layer .ace_selection { - background: rgb(181, 213, 255); -} - -.ace-github.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px white; - border-radius: 2px; -} -/* bold keywords cause cursor issues for some fonts */ -/* this disables bold style for editor and keeps for static highlighter */ -.ace-github.ace_nobold .ace_line > span { - font-weight: normal !important; -} - -.ace-github .ace_marker-layer .ace_step { - background: rgb(252, 255, 0); -} - -.ace-github .ace_marker-layer .ace_stack { - background: rgb(164, 229, 101); -} - -.ace-github .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid rgb(192, 192, 192); -} - -.ace-github .ace_gutter-active-line { - background-color : rgba(0, 0, 0, 0.07); -} - -.ace-github .ace_marker-layer .ace_selected-word { - background: rgb(250, 250, 255); - border: 1px solid rgb(200, 200, 250); - -} - -.ace-github .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-github .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.js deleted file mode 100644 index de013c8c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-github"; -exports.cssText = require("../requirejs/text!./github.css"); - - var dom = require("../lib/dom"); - dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css deleted file mode 100644 index f507ec10..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +++ /dev/null @@ -1,113 +0,0 @@ -.ace-idle-fingers .ace_gutter { - background: #3b3b3b; - color: rgb(153,153,153) -} - -.ace-idle-fingers .ace_print-margin { - width: 1px; - background: #3b3b3b -} - -.ace-idle-fingers { - background-color: #323232; - color: #FFFFFF -} - -.ace-idle-fingers .ace_cursor { - color: #91FF00 -} - -.ace-idle-fingers .ace_marker-layer .ace_selection { - background: rgba(90, 100, 126, 0.88) -} - -.ace-idle-fingers.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #323232; - border-radius: 2px -} - -.ace-idle-fingers .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: #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, -.ace-idle-fingers .ace_meta { - color: #CC7833 -} - -.ace-idle-fingers .ace_constant, -.ace-idle-fingers .ace_constant.ace_character, -.ace-idle-fingers .ace_constant.ace_character.ace_escape, -.ace-idle-fingers .ace_constant.ace_other, -.ace-idle-fingers .ace_support.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_variable.ace_parameter { - font-style: italic -} - -.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_collab.ace_user1 { - color: #323232; - background-color: #FFF980 -} - -.ace-idle-fingers .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js deleted file mode 100644 index 096a2314..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-idle-fingers"; -exports.cssText = require("../requirejs/text!./idle_fingers.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.css deleted file mode 100644 index e2526b93..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.css +++ /dev/null @@ -1,140 +0,0 @@ -.ace-katzenmilch .ace_gutter, -/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: ) */ - -.ace-katzenmilch .ace_gutter { - background: #e8e8e8; - color: #333 -} - -.ace-katzenmilch .ace_print-margin { - width: 1px; - background: #e8e8e8 -} - -.ace-katzenmilch { - background-color: #f3f2f3; - color: rgba(15, 0, 9, 1.0) -} - -.ace-katzenmilch .ace_cursor { - border-left: 2px solid #100011 -} - -.ace-katzenmilch .ace_overwrite-cursors .ace_cursor { - border-left: 0px; - border-bottom: 1px solid #100011 -} - -.ace-katzenmilch .ace_marker-layer .ace_selection { - background: rgba(100, 5, 208, 0.27) -} - -.ace-katzenmilch.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #f3f2f3; - border-radius: 2px -} - -.ace-katzenmilch .ace_marker-layer .ace_step { - background: rgb(198, 219, 174) -} - -.ace-katzenmilch .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #000000 -} - -.ace-katzenmilch .ace_marker-layer .ace_active-line { - background: rgb(232, 242, 254) -} - -.ace-katzenmilch .ace_gutter-active-line { - background-color: rgb(232, 242, 254) -} - -.ace-katzenmilch .ace_marker-layer .ace_selected-word { - border: 1px solid rgba(100, 5, 208, 0.27) -} - -.ace-katzenmilch .ace_fold { - background-color: rgba(2, 95, 73, 0.97); - border-color: rgba(15, 0, 9, 1.0) -} - -.ace-katzenmilch .ace_keyword { - color: #674Aa8; - rbackground-color: rgba(163, 170, 216, 0.055) -} - -.ace-katzenmilch .ace_constant.ace_language { - color: #7D7e52; - rbackground-color: rgba(189, 190, 130, 0.059) -} - -.ace-katzenmilch .ace_constant.ace_numeric { - color: rgba(79, 130, 123, 0.93); - rbackground-color: rgba(119, 194, 187, 0.059) -} - -.ace-katzenmilch .ace_constant.ace_character, -.ace-katzenmilch .ace_constant.ace_other { - color: rgba(2, 95, 105, 1.0); - rbackground-color: rgba(127, 34, 153, 0.063) -} - -.ace-katzenmilch .ace_support.ace_function { - color: #9D7e62; - rbackground-color: rgba(189, 190, 130, 0.039) -} - -.ace-katzenmilch .ace_support.ace_class { - color: rgba(239, 106, 167, 1.0); - rbackground-color: rgba(239, 106, 167, 0.063) -} - -.ace-katzenmilch .ace_storage { - color: rgba(123, 92, 191, 1.0); - rbackground-color: rgba(139, 93, 223, 0.051) -} - -.ace-katzenmilch .ace_invalid { - color: #DFDFD5; - rbackground-color: #CC1B27 -} - -.ace-katzenmilch .ace_string { - color: #5a5f9b; - rbackground-color: rgba(170, 175, 219, 0.035) -} - -.ace-katzenmilch .ace_comment { - font-style: italic; - color: rgba(64, 79, 80, 0.67); - rbackground-color: rgba(95, 15, 255, 0.0078) -} - -.ace-katzenmilch .ace_entity.ace_name.ace_function, -.ace-katzenmilch .ace_variable { - color: rgba(2, 95, 73, 0.97); - rbackground-color: rgba(34, 255, 73, 0.12) -} - -.ace-katzenmilch .ace_variable.ace_language { - color: #316fcf; - rbackground-color: rgba(58, 175, 255, 0.039) -} - -.ace-katzenmilch .ace_variable.ace_parameter { - font-style: italic; - color: rgba(51, 150, 159, 0.87); - rbackground-color: rgba(5, 214, 249, 0.043) -} - -.ace-katzenmilch .ace_entity.ace_other.ace_attribute-name { - color: rgba(73, 70, 194, 0.93); - rbackground-color: rgba(73, 134, 194, 0.035) -} - -.ace-katzenmilch .ace_entity.ace_name.ace_tag { - color: #3976a2; - rbackground-color: rgba(73, 166, 210, 0.039) -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.js deleted file mode 100644 index 4787483d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-katzenmilch"; -exports.cssText = require("../requirejs/text!./katzenmilch.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css deleted file mode 100644 index 339786ad..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +++ /dev/null @@ -1,124 +0,0 @@ -.ace-kr-theme .ace_gutter { - background: #1c1917; - color: #FCFFE0 -} - -.ace-kr-theme .ace_print-margin { - width: 1px; - background: #1c1917 -} - -.ace-kr-theme { - background-color: #0B0A09; - color: #FCFFE0 -} - -.ace-kr-theme .ace_cursor { - color: #FF9900 -} - -.ace-kr-theme .ace_marker-layer .ace_selection { - background: rgba(170, 0, 255, 0.45) -} - -.ace-kr-theme.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #0B0A09; - border-radius: 2px -} - -.ace-kr-theme .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color : #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, -.ace-kr-theme .ace_meta { - color: #949C8B -} - -.ace-kr-theme .ace_constant, -.ace-kr-theme .ace_constant.ace_character, -.ace-kr-theme .ace_constant.ace_character.ace_escape, -.ace-kr-theme .ace_constant.ace_other { - 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_support.ace_constant { - color: #C27E66 -} - -.ace-kr-theme .ace_fold { - background-color: #949C8B; - border-color: #FCFFE0 -} - -.ace-kr-theme .ace_support.ace_function { - color: #85873A -} - -.ace-kr-theme .ace_storage { - color: #FFEE80 -} - -.ace-kr-theme .ace_string { - color: rgba(164, 161, 181, 0.8) -} - -.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_list, -.ace-kr-theme .ace_markup.ace_list { - background-color: #0F0040 -} - -.ace-kr-theme .ace_variable.ace_language { - color: #FF80E1 -} - -.ace-kr-theme .ace_meta.ace_tag { - color: #BABD9C -} - -.ace-kr-theme .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js deleted file mode 100644 index fb6a5abe..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-kr-theme"; -exports.cssText = require("../requirejs/text!./kr_theme.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.css deleted file mode 100644 index 9c0ba6a8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.css +++ /dev/null @@ -1,67 +0,0 @@ -/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: 467560D0-6ACE-4409-82FD-4791420837AC) */ - -.ace-kuroir .ace_gutter { - background: #e8e8e8; - color: #333; -} - -.ace-kuroir .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-kuroir { - background-color: #E8E9E8; - color: #363636; -} - -.ace-kuroir .ace_cursor { - color: #202020; -} - -.ace-kuroir .ace_marker-layer .ace_selection { - background: rgba(245, 170, 0, 0.57); -} - -.ace-kuroir.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #E8E9E8; - border-radius: 2px; -} - -.ace-kuroir .ace_marker-layer .ace_step { - background: rgb(198, 219, 174); -} - -.ace-kuroir .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid rgba(0, 0, 0, 0.29); -} - -.ace-kuroir .ace_marker-layer .ace_active-line { - background: rgba(203, 220, 47, 0.22); -} - -.ace-kuroir .ace_gutter-active-line { - background-color: rgba(203, 220, 47, 0.22); -} - -.ace-kuroir .ace_marker-layer .ace_selected-word { - border: 1px solid rgba(245, 170, 0, 0.57); -} - -.ace-kuroir .ace_fold { - border-color: #363636; -} - - - - - -.ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224; -background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline; -font-style:italic; -color:#FD1732; -background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00; -background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91); -background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D; -background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.js deleted file mode 100644 index cef6a50b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-kuroir"; -exports.cssText = require("../requirejs/text!./kuroir.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css deleted file mode 100644 index a84ec3a6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +++ /dev/null @@ -1,110 +0,0 @@ -.ace-merbivore .ace_gutter { - background: #202020; - color: #E6E1DC -} - -.ace-merbivore .ace_print-margin { - width: 1px; - background: #555651 -} - -.ace-merbivore { - background-color: #161616; - color: #E6E1DC -} - -.ace-merbivore .ace_cursor { - color: #FFFFFF -} - -.ace-merbivore .ace_marker-layer .ace_selection { - background: #454545 -} - -.ace-merbivore.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #161616; - border-radius: 2px -} - -.ace-merbivore .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: #333435 -} - -.ace-merbivore .ace_marker-layer .ace_selected-word { - border: 1px solid #454545 -} - -.ace-merbivore .ace_invisible { - color: #404040 -} - -.ace-merbivore .ace_entity.ace_name.ace_tag, -.ace-merbivore .ace_keyword, -.ace-merbivore .ace_meta, -.ace-merbivore .ace_meta.ace_tag, -.ace-merbivore .ace_storage, -.ace-merbivore .ace_support.ace_function { - color: #FC6F09 -} - -.ace-merbivore .ace_constant, -.ace-merbivore .ace_constant.ace_character, -.ace-merbivore .ace_constant.ace_character.ace_escape, -.ace-merbivore .ace_constant.ace_other, -.ace-merbivore .ace_support.ace_type { - color: #1EDAFB -} - -.ace-merbivore .ace_constant.ace_character.ace_escape { - color: #519F50 -} - -.ace-merbivore .ace_constant.ace_language { - color: #FDC251 -} - -.ace-merbivore .ace_constant.ace_library, -.ace-merbivore .ace_string, -.ace-merbivore .ace_support.ace_constant { - 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_comment { - font-style: italic; - color: #AD2EA4 -} - -.ace-merbivore .ace_entity.ace_other.ace_attribute-name { - color: #FFFF89 -} - -.ace-merbivore .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js deleted file mode 100644 index 9b29db1c..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-merbivore"; -exports.cssText = require("../requirejs/text!./merbivore.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css deleted file mode 100644 index f0ad0bac..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +++ /dev/null @@ -1,111 +0,0 @@ -.ace-merbivore-soft .ace_gutter { - background: #262424; - color: #E6E1DC -} - -.ace-merbivore-soft .ace_print-margin { - width: 1px; - background: #262424 -} - -.ace-merbivore-soft { - background-color: #1C1C1C; - color: #E6E1DC -} - -.ace-merbivore-soft .ace_cursor { - color: #FFFFFF -} - -.ace-merbivore-soft .ace_marker-layer .ace_selection { - background: #494949 -} - -.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #1C1C1C; - border-radius: 2px -} - -.ace-merbivore-soft .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: #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_entity.ace_name.ace_tag, -.ace-merbivore-soft .ace_keyword, -.ace-merbivore-soft .ace_meta, -.ace-merbivore-soft .ace_meta.ace_tag, -.ace-merbivore-soft .ace_storage { - color: #FC803A -} - -.ace-merbivore-soft .ace_constant, -.ace-merbivore-soft .ace_constant.ace_character, -.ace-merbivore-soft .ace_constant.ace_character.ace_escape, -.ace-merbivore-soft .ace_constant.ace_other, -.ace-merbivore-soft .ace_support.ace_type { - color: #68C1D8 -} - -.ace-merbivore-soft .ace_constant.ace_character.ace_escape { - color: #B3E5B4 -} - -.ace-merbivore-soft .ace_constant.ace_language { - color: #E1C582 -} - -.ace-merbivore-soft .ace_constant.ace_library, -.ace-merbivore-soft .ace_string, -.ace-merbivore-soft .ace_support.ace_constant { - color: #8EC65F -} - -.ace-merbivore-soft .ace_constant.ace_numeric { - color: #7FC578 -} - -.ace-merbivore-soft .ace_invalid, -.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_comment, -.ace-merbivore-soft .ace_meta { - font-style: italic; - color: #AC4BB8 -} - -.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name { - color: #EAF1A3 -} - -.ace-merbivore-soft .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js deleted file mode 100644 index c0ffd910..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-merbivore-soft"; -exports.cssText = require("../requirejs/text!./merbivore_soft.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css deleted file mode 100644 index 7e40a3b9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +++ /dev/null @@ -1,126 +0,0 @@ -.ace-mono-industrial .ace_gutter { - background: #1d2521; - color: #C5C9C9 -} - -.ace-mono-industrial .ace_print-margin { - width: 1px; - background: #555651 -} - -.ace-mono-industrial { - background-color: #222C28; - color: #FFFFFF -} - -.ace-mono-industrial .ace_cursor { - color: #FFFFFF -} - -.ace-mono-industrial .ace_marker-layer .ace_selection { - background: rgba(145, 153, 148, 0.40) -} - -.ace-mono-industrial.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #222C28; - border-radius: 2px -} - -.ace-mono-industrial .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: 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_string { - background-color: #151C19; - color: #FFFFFF -} - -.ace-mono-industrial .ace_keyword, -.ace-mono-industrial .ace_meta { - color: #A39E64 -} - -.ace-mono-industrial .ace_constant, -.ace-mono-industrial .ace_constant.ace_character, -.ace-mono-industrial .ace_constant.ace_character.ace_escape, -.ace-mono-industrial .ace_constant.ace_numeric, -.ace-mono-industrial .ace_constant.ace_other { - color: #E98800 -} - -.ace-mono-industrial .ace_entity.ace_name.ace_function, -.ace-mono-industrial .ace_keyword.ace_operator, -.ace-mono-industrial .ace_variable { - color: #A8B3AB -} - -.ace-mono-industrial .ace_invalid { - color: #FFFFFF; - background-color: rgba(153, 0, 0, 0.68) -} - -.ace-mono-industrial .ace_support.ace_constant { - color: #C87500 -} - -.ace-mono-industrial .ace_fold { - background-color: #A8B3AB; - border-color: #FFFFFF -} - -.ace-mono-industrial .ace_support.ace_function { - color: #588E60 -} - -.ace-mono-industrial .ace_entity.ace_name, -.ace-mono-industrial .ace_support.ace_class, -.ace-mono-industrial .ace_support.ace_type { - color: #5778B6 -} - -.ace-mono-industrial .ace_storage { - color: #C23B00 -} - -.ace-mono-industrial .ace_variable.ace_language, -.ace-mono-industrial .ace_variable.ace_parameter { - color: #648BD2 -} - -.ace-mono-industrial .ace_comment { - color: #666C68; - background-color: #151C19 -} - -.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name { - color: #909993 -} - -.ace-mono-industrial .ace_entity.ace_name.ace_tag { - color: #A65EFF -} - -.ace-mono-industrial .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js deleted file mode 100644 index cf0d0e48..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-mono-industrial"; -exports.cssText = require("../requirejs/text!./mono_industrial.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css deleted file mode 100644 index a3a063df..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +++ /dev/null @@ -1,122 +0,0 @@ -.ace-monokai .ace_gutter { - background: #2F3129; - color: #8F908A -} - -.ace-monokai .ace_print-margin { - width: 1px; - background: #555651 -} - -.ace-monokai { - background-color: #272822; - color: #F8F8F2 -} - -.ace-monokai .ace_cursor { - color: #F8F8F0 -} - -.ace-monokai .ace_marker-layer .ace_selection { - background: #49483E -} - -.ace-monokai.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #272822; - border-radius: 2px -} - -.ace-monokai .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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: #202020 -} - -.ace-monokai .ace_gutter-active-line { - background-color: #272727 -} - -.ace-monokai .ace_marker-layer .ace_selected-word { - border: 1px solid #49483E -} - -.ace-monokai .ace_invisible { - color: #52524d -} - -.ace-monokai .ace_entity.ace_name.ace_tag, -.ace-monokai .ace_keyword, -.ace-monokai .ace_meta.ace_tag, -.ace-monokai .ace_storage { - color: #F92672 -} - -.ace-monokai .ace_punctuation, -.ace-monokai .ace_punctuation.ace_tag { - color: #fff -} - -.ace-monokai .ace_constant.ace_character, -.ace-monokai .ace_constant.ace_language, -.ace-monokai .ace_constant.ace_numeric, -.ace-monokai .ace_constant.ace_other { - 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_support.ace_constant, -.ace-monokai .ace_support.ace_function { - color: #66D9EF -} - -.ace-monokai .ace_fold { - background-color: #A6E22E; - border-color: #F8F8F2 -} - -.ace-monokai .ace_storage.ace_type, -.ace-monokai .ace_support.ace_class, -.ace-monokai .ace_support.ace_type { - font-style: italic; - color: #66D9EF -} - -.ace-monokai .ace_entity.ace_name.ace_function, -.ace-monokai .ace_entity.ace_other, -.ace-monokai .ace_entity.ace_other.ace_attribute-name, -.ace-monokai .ace_variable { - color: #A6E22E -} - -.ace-monokai .ace_variable.ace_parameter { - font-style: italic; - color: #FD971F -} - -.ace-monokai .ace_string { - color: #E6DB74 -} - -.ace-monokai .ace_comment { - color: #75715E -} - -.ace-monokai .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js deleted file mode 100644 index 87d07786..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-monokai"; -exports.cssText = require("../requirejs/text!./monokai.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css deleted file mode 100644 index 8cab16a1..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +++ /dev/null @@ -1,129 +0,0 @@ -.ace-pastel-on-dark .ace_gutter { - background: #353030; - color: #8F938F -} - -.ace-pastel-on-dark .ace_print-margin { - width: 1px; - background: #353030 -} - -.ace-pastel-on-dark { - background-color: #2C2828; - color: #8F938F -} - -.ace-pastel-on-dark .ace_cursor { - color: #A7A7A7 -} - -.ace-pastel-on-dark .ace_marker-layer .ace_selection { - background: rgba(221, 240, 255, 0.20) -} - -.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #2C2828; - border-radius: 2px -} - -.ace-pastel-on-dark .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: 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, -.ace-pastel-on-dark .ace_meta { - color: #757aD8 -} - -.ace-pastel-on-dark .ace_constant, -.ace-pastel-on-dark .ace_constant.ace_character, -.ace-pastel-on-dark .ace_constant.ace_character.ace_escape, -.ace-pastel-on-dark .ace_constant.ace_other { - color: #4FB7C5 -} - -.ace-pastel-on-dark .ace_keyword.ace_operator { - color: #797878 -} - -.ace-pastel-on-dark .ace_constant.ace_character { - color: #AFA472 -} - -.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, -.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_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js deleted file mode 100644 index 6eea03a4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-pastel-on-dark"; -exports.cssText = require("../requirejs/text!./pastel_on_dark.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css deleted file mode 100644 index ea8ec8aa..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +++ /dev/null @@ -1,101 +0,0 @@ -.ace-solarized-dark .ace_gutter { - background: #01313f; - color: #d0edf7 -} - -.ace-solarized-dark .ace_print-margin { - width: 1px; - background: #33555E -} - -.ace-solarized-dark { - background-color: #002B36; - color: #93A1A1 -} - -.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name, -.ace-solarized-dark .ace_storage { - color: #93A1A1 -} - -.ace-solarized-dark .ace_cursor, -.ace-solarized-dark .ace_string.ace_regexp { - color: #D30102 -} - -.ace-solarized-dark .ace_marker-layer .ace_active-line, -.ace-solarized-dark .ace_marker-layer .ace_selection { - background: rgba(255, 255, 255, 0.1) -} - -.ace-solarized-dark.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #002B36; - border-radius: 2px -} - -.ace-solarized-dark .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: #0d3440 -} - -.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, -.ace-solarized-dark .ace_meta, -.ace-solarized-dark .ace_support.ace_class, -.ace-solarized-dark .ace_support.ace_type { - color: #859900 -} - -.ace-solarized-dark .ace_constant.ace_character, -.ace-solarized-dark .ace_constant.ace_other { - color: #CB4B16 -} - -.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_entity.ace_name.ace_function, -.ace-solarized-dark .ace_entity.ace_name.ace_tag, -.ace-solarized-dark .ace_support.ace_function, -.ace-solarized-dark .ace_variable, -.ace-solarized-dark .ace_variable.ace_language { - color: #268BD2 -} - -.ace-solarized-dark .ace_string { - color: #2AA198 -} - -.ace-solarized-dark .ace_comment { - font-style: italic; - color: #657B83 -} - -.ace-solarized-dark .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js deleted file mode 100644 index 71812c28..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-solarized-dark"; -exports.cssText = require("../requirejs/text!./solarized_dark.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css deleted file mode 100644 index 64c4bac9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +++ /dev/null @@ -1,106 +0,0 @@ -.ace-solarized-light .ace_gutter { - background: #fbf1d3; - color: #333 -} - -.ace-solarized-light .ace_print-margin { - width: 1px; - background: #e8e8e8 -} - -.ace-solarized-light { - background-color: #FDF6E3; - color: #586E75 -} - -.ace-solarized-light .ace_cursor { - color: #000000 -} - -.ace-solarized-light .ace_marker-layer .ace_selection { - background: rgba(7, 54, 67, 0.09) -} - -.ace-solarized-light.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #FDF6E3; - border-radius: 2px -} - -.ace-solarized-light .ace_marker-layer .ace_step { - background: rgb(255, 255, 0) -} - -.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_gutter-active-line { - background-color : #EDE5C1 -} - -.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, -.ace-solarized-light .ace_meta, -.ace-solarized-light .ace_support.ace_class, -.ace-solarized-light .ace_support.ace_type { - color: #859900 -} - -.ace-solarized-light .ace_constant.ace_character, -.ace-solarized-light .ace_constant.ace_other { - color: #CB4B16 -} - -.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_entity.ace_name.ace_function, -.ace-solarized-light .ace_entity.ace_name.ace_tag, -.ace-solarized-light .ace_support.ace_function, -.ace-solarized-light .ace_variable, -.ace-solarized-light .ace_variable.ace_language { - color: #268BD2 -} - -.ace-solarized-light .ace_storage { - color: #073642 -} - -.ace-solarized-light .ace_string { - color: #2AA198 -} - -.ace-solarized-light .ace_string.ace_regexp { - color: #D30102 -} - -.ace-solarized-light .ace_comment, -.ace-solarized-light .ace_entity.ace_other.ace_attribute-name { - color: #93A1A1 -} - -.ace-solarized-light .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js deleted file mode 100644 index 35ec219e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-solarized-light"; -exports.cssText = require("../requirejs/text!./solarized_light.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.css deleted file mode 100644 index 3636a03d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.css +++ /dev/null @@ -1,132 +0,0 @@ -.ace-terminal-theme .ace_gutter { - background: #1a0005; - color: steelblue -} - -.ace-terminal-theme .ace_print-margin { - width: 1px; - background: #1a1a1a -} - -.ace-terminal-theme { - background-color: black; - color: #DEDEDE -} - -.ace-terminal-theme .ace_cursor { - color: #9F9F9F -} - -.ace-terminal-theme .ace_marker-layer .ace_selection { - background: #424242 -} - -.ace-terminal-theme.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px black; - border-radius: 2px -} - -.ace-terminal-theme .ace_marker-layer .ace_step { - background: rgb(0, 0, 0) -} - -.ace-terminal-theme .ace_marker-layer .ace_bracket { - background: #090; -} - -.ace-terminal-theme .ace_marker-layer .ace_bracket-start { - background: #090; -} - -.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched { - margin: -1px 0 0 -1px; - border: 1px solid #900 -} - -.ace-terminal-theme .ace_marker-layer .ace_active-line { - background: #2A2A2A -} - -.ace-terminal-theme .ace_gutter-active-line { - background-color: #2A112A -} - -.ace-terminal-theme .ace_marker-layer .ace_selected-word { - border: 1px solid #424242 -} - -.ace-terminal-theme .ace_invisible { - color: #343434 -} - -.ace-terminal-theme .ace_keyword, -.ace-terminal-theme .ace_meta, -.ace-terminal-theme .ace_storage, -.ace-terminal-theme .ace_storage.ace_type, -.ace-terminal-theme .ace_support.ace_type { - color: tomato -} - -.ace-terminal-theme .ace_keyword.ace_operator { - color: deeppink -} - -.ace-terminal-theme .ace_constant.ace_character, -.ace-terminal-theme .ace_constant.ace_language, -.ace-terminal-theme .ace_constant.ace_numeric, -.ace-terminal-theme .ace_keyword.ace_other.ace_unit, -.ace-terminal-theme .ace_support.ace_constant, -.ace-terminal-theme .ace_variable.ace_parameter { - color: #E78C45 -} - -.ace-terminal-theme .ace_constant.ace_other { - color: gold -} - -.ace-terminal-theme .ace_invalid { - color: yellow; - background-color: red -} - -.ace-terminal-theme .ace_invalid.ace_deprecated { - color: #CED2CF; - background-color: #B798BF -} - -.ace-terminal-theme .ace_fold { - background-color: #7AA6DA; - border-color: #DEDEDE -} - -.ace-terminal-theme .ace_entity.ace_name.ace_function, -.ace-terminal-theme .ace_support.ace_function, -.ace-terminal-theme .ace_variable { - color: #7AA6DA -} - -.ace-terminal-theme .ace_support.ace_class, -.ace-terminal-theme .ace_support.ace_type { - color: #E7C547 -} - -.ace-terminal-theme .ace_heading, -.ace-terminal-theme .ace_string { - color: #B9CA4A -} - -.ace-terminal-theme .ace_entity.ace_name.ace_tag, -.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name, -.ace-terminal-theme .ace_meta.ace_tag, -.ace-terminal-theme .ace_string.ace_regexp, -.ace-terminal-theme .ace_variable { - color: #D54E53 -} - -.ace-terminal-theme .ace_comment { - color: orangered -} - -.ace-terminal-theme .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y; -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.js deleted file mode 100644 index d7ff36ae..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-terminal-theme"; -exports.cssText = require("../requirejs/text!./terminal.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css deleted file mode 100644 index 6cb159ba..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +++ /dev/null @@ -1,155 +0,0 @@ -.ace-tm .ace_gutter { - background: #f0f0f0; - color: #333; -} - -.ace-tm .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-tm .ace_fold { - background-color: #6B72E6; -} - -.ace-tm { - background-color: #FFFFFF; - color: black; -} - -.ace-tm .ace_cursor { - color: black; -} - -.ace-tm .ace_invisible { - color: rgb(191, 191, 191); -} - -.ace-tm .ace_storage, -.ace-tm .ace_keyword { - color: blue; -} - -.ace-tm .ace_constant { - color: rgb(197, 6, 11); -} - -.ace-tm .ace_constant.ace_buildin { - color: rgb(88, 72, 246); -} - -.ace-tm .ace_constant.ace_language { - color: rgb(88, 92, 246); -} - -.ace-tm .ace_constant.ace_library { - color: rgb(6, 150, 14); -} - -.ace-tm .ace_invalid { - background-color: rgba(255, 0, 0, 0.1); - color: red; -} - -.ace-tm .ace_support.ace_function { - color: rgb(60, 76, 114); -} - -.ace-tm .ace_support.ace_constant { - color: rgb(6, 150, 14); -} - -.ace-tm .ace_support.ace_type, -.ace-tm .ace_support.ace_class { - color: rgb(109, 121, 222); -} - -.ace-tm .ace_keyword.ace_operator { - color: rgb(104, 118, 135); -} - -.ace-tm .ace_string { - color: rgb(3, 106, 7); -} - -.ace-tm .ace_comment { - color: rgb(76, 136, 107); -} - -.ace-tm .ace_comment.ace_doc { - color: rgb(0, 102, 255); -} - -.ace-tm .ace_comment.ace_doc.ace_tag { - color: rgb(128, 159, 191); -} - -.ace-tm .ace_constant.ace_numeric { - color: rgb(0, 0, 205); -} - -.ace-tm .ace_variable { - color: rgb(49, 132, 149); -} - -.ace-tm .ace_xml-pe { - color: rgb(104, 104, 91); -} - -.ace-tm .ace_entity.ace_name.ace_function { - color: #0000A2; -} - - -.ace-tm .ace_heading { - color: rgb(12, 7, 255); -} - -.ace-tm .ace_list { - color:rgb(185, 6, 144); -} - -.ace-tm .ace_meta.ace_tag { - color:rgb(0, 22, 142); -} - -.ace-tm .ace_string.ace_regex { - color: rgb(255, 0, 0) -} - -.ace-tm .ace_marker-layer .ace_selection { - background: rgb(181, 213, 255); -} -.ace-tm.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px white; - border-radius: 2px; -} -.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: rgba(0, 0, 0, 0.07); -} - -.ace-tm .ace_gutter-active-line { - background-color : #dcdcdc; -} - -.ace-tm .ace_marker-layer .ace_selected-word { - background: rgb(250, 250, 255); - border: 1px solid rgb(200, 200, 250); -} - -.ace-tm .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js deleted file mode 100644 index 75e19745..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +++ /dev/null @@ -1,40 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -exports.isDark = false; -exports.cssClass = "ace-tm"; -exports.cssText = require("../requirejs/text!./textmate.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css deleted file mode 100644 index 20975004..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +++ /dev/null @@ -1,125 +0,0 @@ -.ace-tomorrow .ace_gutter { - background: #f6f6f6; - color: #4D4D4C -} - -.ace-tomorrow .ace_print-margin { - width: 1px; - background: #f6f6f6 -} - -.ace-tomorrow { - background-color: #FFFFFF; - color: #4D4D4C -} - -.ace-tomorrow .ace_cursor { - color: #AEAFAD -} - -.ace-tomorrow .ace_marker-layer .ace_selection { - background: #D6D6D6 -} - -.ace-tomorrow.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #FFFFFF; - border-radius: 2px -} - -.ace-tomorrow .ace_marker-layer .ace_step { - background: rgb(255, 255, 0) -} - -.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_gutter-active-line { - background-color : #dcdcdc -} - -.ace-tomorrow .ace_marker-layer .ace_selected-word { - border: 1px solid #D6D6D6 -} - -.ace-tomorrow .ace_invisible { - color: #D1D1D1 -} - -.ace-tomorrow .ace_keyword, -.ace-tomorrow .ace_meta, -.ace-tomorrow .ace_storage, -.ace-tomorrow .ace_storage.ace_type, -.ace-tomorrow .ace_support.ace_type { - color: #8959A8 -} - -.ace-tomorrow .ace_keyword.ace_operator { - color: #3E999F -} - -.ace-tomorrow .ace_constant.ace_character, -.ace-tomorrow .ace_constant.ace_language, -.ace-tomorrow .ace_constant.ace_numeric, -.ace-tomorrow .ace_keyword.ace_other.ace_unit, -.ace-tomorrow .ace_support.ace_constant, -.ace-tomorrow .ace_variable.ace_parameter { - color: #F5871F -} - -.ace-tomorrow .ace_constant.ace_other { - color: #666969 -} - -.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_entity.ace_name.ace_function, -.ace-tomorrow .ace_support.ace_function, -.ace-tomorrow .ace_variable { - color: #4271AE -} - -.ace-tomorrow .ace_support.ace_class, -.ace-tomorrow .ace_support.ace_type { - color: #C99E00 -} - -.ace-tomorrow .ace_heading, -.ace-tomorrow .ace_markup.ace_heading, -.ace-tomorrow .ace_string { - color: #718C00 -} - -.ace-tomorrow .ace_entity.ace_name.ace_tag, -.ace-tomorrow .ace_entity.ace_other.ace_attribute-name, -.ace-tomorrow .ace_meta.ace_tag, -.ace-tomorrow .ace_string.ace_regexp, -.ace-tomorrow .ace_variable { - color: #C82829 -} - -.ace-tomorrow .ace_comment { - color: #8E908C -} - -.ace-tomorrow .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js deleted file mode 100644 index 1f02d7d9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-tomorrow"; -exports.cssText = require("../requirejs/text!./tomorrow.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css deleted file mode 100644 index aafceab6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +++ /dev/null @@ -1,125 +0,0 @@ -.ace-tomorrow-night .ace_gutter { - background: #25282c; - color: #C5C8C6 -} - -.ace-tomorrow-night .ace_print-margin { - width: 1px; - background: #25282c -} - -.ace-tomorrow-night { - background-color: #1D1F21; - color: #C5C8C6 -} - -.ace-tomorrow-night .ace_cursor { - color: #AEAFAD -} - -.ace-tomorrow-night .ace_marker-layer .ace_selection { - background: #373B41 -} - -.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #1D1F21; - border-radius: 2px -} - -.ace-tomorrow-night .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: #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, -.ace-tomorrow-night .ace_meta, -.ace-tomorrow-night .ace_storage, -.ace-tomorrow-night .ace_storage.ace_type, -.ace-tomorrow-night .ace_support.ace_type { - color: #B294BB -} - -.ace-tomorrow-night .ace_keyword.ace_operator { - color: #8ABEB7 -} - -.ace-tomorrow-night .ace_constant.ace_character, -.ace-tomorrow-night .ace_constant.ace_language, -.ace-tomorrow-night .ace_constant.ace_numeric, -.ace-tomorrow-night .ace_keyword.ace_other.ace_unit, -.ace-tomorrow-night .ace_support.ace_constant, -.ace-tomorrow-night .ace_variable.ace_parameter { - color: #DE935F -} - -.ace-tomorrow-night .ace_constant.ace_other { - color: #CED1CF -} - -.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_entity.ace_name.ace_function, -.ace-tomorrow-night .ace_support.ace_function, -.ace-tomorrow-night .ace_variable { - color: #81A2BE -} - -.ace-tomorrow-night .ace_support.ace_class, -.ace-tomorrow-night .ace_support.ace_type { - color: #F0C674 -} - -.ace-tomorrow-night .ace_heading, -.ace-tomorrow-night .ace_markup.ace_heading, -.ace-tomorrow-night .ace_string { - color: #B5BD68 -} - -.ace-tomorrow-night .ace_entity.ace_name.ace_tag, -.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name, -.ace-tomorrow-night .ace_meta.ace_tag, -.ace-tomorrow-night .ace_string.ace_regexp, -.ace-tomorrow-night .ace_variable { - color: #CC6666 -} - -.ace-tomorrow-night .ace_comment { - color: #969896 -} - -.ace-tomorrow-night .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js deleted file mode 100644 index e7137ffc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night"; -exports.cssText = require("../requirejs/text!./tomorrow_night.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css deleted file mode 100644 index e717be0a..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +++ /dev/null @@ -1,122 +0,0 @@ -.ace-tomorrow-night-blue .ace_gutter { - background: #00204b; - color: #7388b5 -} - -.ace-tomorrow-night-blue .ace_print-margin { - width: 1px; - background: #00204b -} - -.ace-tomorrow-night-blue { - background-color: #002451; - color: #FFFFFF -} - -.ace-tomorrow-night-blue .ace_constant.ace_other, -.ace-tomorrow-night-blue .ace_cursor { - color: #FFFFFF -} - -.ace-tomorrow-night-blue .ace_marker-layer .ace_selection { - background: #003F8E -} - -.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #002451; - border-radius: 2px -} - -.ace-tomorrow-night-blue .ace_marker-layer .ace_step { - background: rgb(127, 111, 19) -} - -.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_gutter-active-line { - background-color: #022040 -} - -.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, -.ace-tomorrow-night-blue .ace_meta, -.ace-tomorrow-night-blue .ace_storage, -.ace-tomorrow-night-blue .ace_storage.ace_type, -.ace-tomorrow-night-blue .ace_support.ace_type { - color: #EBBBFF -} - -.ace-tomorrow-night-blue .ace_keyword.ace_operator { - color: #99FFFF -} - -.ace-tomorrow-night-blue .ace_constant.ace_character, -.ace-tomorrow-night-blue .ace_constant.ace_language, -.ace-tomorrow-night-blue .ace_constant.ace_numeric, -.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit, -.ace-tomorrow-night-blue .ace_support.ace_constant, -.ace-tomorrow-night-blue .ace_variable.ace_parameter { - 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_entity.ace_name.ace_function, -.ace-tomorrow-night-blue .ace_support.ace_function, -.ace-tomorrow-night-blue .ace_variable { - color: #BBDAFF -} - -.ace-tomorrow-night-blue .ace_support.ace_class, -.ace-tomorrow-night-blue .ace_support.ace_type { - color: #FFEEAD -} - -.ace-tomorrow-night-blue .ace_heading, -.ace-tomorrow-night-blue .ace_markup.ace_heading, -.ace-tomorrow-night-blue .ace_string { - color: #D1F1A9 -} - -.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag, -.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name, -.ace-tomorrow-night-blue .ace_meta.ace_tag, -.ace-tomorrow-night-blue .ace_string.ace_regexp, -.ace-tomorrow-night-blue .ace_variable { - color: #FF9DA4 -} - -.ace-tomorrow-night-blue .ace_comment { - color: #7285B7 -} - -.ace-tomorrow-night-blue .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js deleted file mode 100644 index dcdf4adc..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night-blue"; -exports.cssText = require("../requirejs/text!./tomorrow_night_blue.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css deleted file mode 100644 index 5c896fb9..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +++ /dev/null @@ -1,141 +0,0 @@ -.ace-tomorrow-night-bright .ace_gutter { - background: #1a1a1a; - color: #DEDEDE -} - -.ace-tomorrow-night-bright .ace_print-margin { - width: 1px; - background: #1a1a1a -} - -.ace-tomorrow-night-bright { - background-color: #000000; - color: #DEDEDE -} - -.ace-tomorrow-night-bright .ace_cursor { - color: #9F9F9F -} - -.ace-tomorrow-night-bright .ace_marker-layer .ace_selection { - background: #424242 -} - -.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #000000; - border-radius: 2px -} - -.ace-tomorrow-night-bright .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #888888 -} - -.ace-tomorrow-night-bright .ace_marker-layer .ace_highlight { - border: 1px solid rgb(110, 119, 0); - border-bottom: 0; - box-shadow: inset 0 -1px rgb(110, 119, 0); - margin: -1px 0 0 -1px; - background: rgba(255, 235, 0, 0.1) -} - -.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line { - background: #2A2A2A -} - -.ace-tomorrow-night-bright .ace_gutter-active-line { - background-color: #2A2A2A -} - -.ace-tomorrow-night-bright .ace_stack { - background-color: rgb(66, 90, 44) -} - -.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word { - border: 1px solid #888888 -} - -.ace-tomorrow-night-bright .ace_invisible { - color: #343434 -} - -.ace-tomorrow-night-bright .ace_keyword, -.ace-tomorrow-night-bright .ace_meta, -.ace-tomorrow-night-bright .ace_storage, -.ace-tomorrow-night-bright .ace_storage.ace_type, -.ace-tomorrow-night-bright .ace_support.ace_type { - color: #C397D8 -} - -.ace-tomorrow-night-bright .ace_keyword.ace_operator { - color: #70C0B1 -} - -.ace-tomorrow-night-bright .ace_constant.ace_character, -.ace-tomorrow-night-bright .ace_constant.ace_language, -.ace-tomorrow-night-bright .ace_constant.ace_numeric, -.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit, -.ace-tomorrow-night-bright .ace_support.ace_constant, -.ace-tomorrow-night-bright .ace_variable.ace_parameter { - color: #E78C45 -} - -.ace-tomorrow-night-bright .ace_constant.ace_other { - color: #EEEEEE -} - -.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_entity.ace_name.ace_function, -.ace-tomorrow-night-bright .ace_support.ace_function, -.ace-tomorrow-night-bright .ace_variable { - color: #7AA6DA -} - -.ace-tomorrow-night-bright .ace_support.ace_class, -.ace-tomorrow-night-bright .ace_support.ace_type { - color: #E7C547 -} - -.ace-tomorrow-night-bright .ace_heading, -.ace-tomorrow-night-bright .ace_markup.ace_heading, -.ace-tomorrow-night-bright .ace_string { - color: #B9CA4A -} - -.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag, -.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name, -.ace-tomorrow-night-bright .ace_meta.ace_tag, -.ace-tomorrow-night-bright .ace_string.ace_regexp, -.ace-tomorrow-night-bright .ace_variable { - color: #D54E53 -} - -.ace-tomorrow-night-bright .ace_comment { - color: #969896 -} - -.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword { - color: #C2C280 -} - -.ace-tomorrow-night-bright .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js deleted file mode 100644 index 4b285668..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night-bright"; -exports.cssText = require("../requirejs/text!./tomorrow_night_bright.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css deleted file mode 100644 index 85d7b089..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +++ /dev/null @@ -1,125 +0,0 @@ -.ace-tomorrow-night-eighties .ace_gutter { - background: #272727; - color: #CCC -} - -.ace-tomorrow-night-eighties .ace_print-margin { - width: 1px; - background: #272727 -} - -.ace-tomorrow-night-eighties { - background-color: #2D2D2D; - color: #CCCCCC -} - -.ace-tomorrow-night-eighties .ace_constant.ace_other, -.ace-tomorrow-night-eighties .ace_cursor { - color: #CCCCCC -} - -.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection { - background: #515151 -} - -.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #2D2D2D; - border-radius: 2px -} - -.ace-tomorrow-night-eighties .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #6A6A6A -} - -.ace-tomorrow-night-bright .ace_stack { - background: rgb(66, 90, 44) -} - -.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line { - background: #393939 -} - -.ace-tomorrow-night-eighties .ace_gutter-active-line { - background-color: #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, -.ace-tomorrow-night-eighties .ace_meta, -.ace-tomorrow-night-eighties .ace_storage, -.ace-tomorrow-night-eighties .ace_storage.ace_type, -.ace-tomorrow-night-eighties .ace_support.ace_type { - color: #CC99CC -} - -.ace-tomorrow-night-eighties .ace_keyword.ace_operator { - color: #66CCCC -} - -.ace-tomorrow-night-eighties .ace_constant.ace_character, -.ace-tomorrow-night-eighties .ace_constant.ace_language, -.ace-tomorrow-night-eighties .ace_constant.ace_numeric, -.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit, -.ace-tomorrow-night-eighties .ace_support.ace_constant, -.ace-tomorrow-night-eighties .ace_variable.ace_parameter { - 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_entity.ace_name.ace_function, -.ace-tomorrow-night-eighties .ace_support.ace_function, -.ace-tomorrow-night-eighties .ace_variable { - color: #6699CC -} - -.ace-tomorrow-night-eighties .ace_support.ace_class, -.ace-tomorrow-night-eighties .ace_support.ace_type { - color: #FFCC66 -} - -.ace-tomorrow-night-eighties .ace_heading, -.ace-tomorrow-night-eighties .ace_markup.ace_heading, -.ace-tomorrow-night-eighties .ace_string { - color: #99CC99 -} - -.ace-tomorrow-night-eighties .ace_comment { - color: #999999 -} - -.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag, -.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name, -.ace-tomorrow-night-eighties .ace_meta.ace_tag, -.ace-tomorrow-night-eighties .ace_variable { - color: #F2777A -} - -.ace-tomorrow-night-eighties .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js deleted file mode 100644 index 9ac7be67..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night-eighties"; -exports.cssText = require("../requirejs/text!./tomorrow_night_eighties.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css deleted file mode 100644 index 0ca694fb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +++ /dev/null @@ -1,128 +0,0 @@ -.ace-twilight .ace_gutter { - background: #232323; - color: #E2E2E2 -} - -.ace-twilight .ace_print-margin { - width: 1px; - background: #232323 -} - -.ace-twilight { - background-color: #141414; - color: #F8F8F8 -} - -.ace-twilight .ace_cursor { - color: #A7A7A7 -} - -.ace-twilight .ace_marker-layer .ace_selection { - background: rgba(221, 240, 255, 0.20) -} - -.ace-twilight.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #141414; - border-radius: 2px -} - -.ace-twilight .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: 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, -.ace-twilight .ace_meta { - color: #CDA869 -} - -.ace-twilight .ace_constant, -.ace-twilight .ace_constant.ace_character, -.ace-twilight .ace_constant.ace_character.ace_escape, -.ace-twilight .ace_constant.ace_other, -.ace-twilight .ace_heading, -.ace-twilight .ace_markup.ace_heading, -.ace-twilight .ace_support.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_list, -.ace-twilight .ace_markup.ace_list, -.ace-twilight .ace_storage { - color: #F9EE98 -} - -.ace-twilight .ace_entity.ace_name.ace_function, -.ace-twilight .ace_meta.ace_tag, -.ace-twilight .ace_variable { - color: #AC885B -} - -.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_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js deleted file mode 100644 index 904f7ef6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-twilight"; -exports.cssText = require("../requirejs/text!./twilight.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css deleted file mode 100644 index e2901156..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +++ /dev/null @@ -1,110 +0,0 @@ -.ace-vibrant-ink .ace_gutter { - background: #1a1a1a; - color: #BEBEBE -} - -.ace-vibrant-ink .ace_print-margin { - width: 1px; - background: #1a1a1a -} - -.ace-vibrant-ink { - background-color: #0F0F0F; - color: #FFFFFF -} - -.ace-vibrant-ink .ace_cursor { - color: #FFFFFF -} - -.ace-vibrant-ink .ace_marker-layer .ace_selection { - background: #6699CC -} - -.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #0F0F0F; - border-radius: 2px -} - -.ace-vibrant-ink .ace_marker-layer .ace_step { - background: rgb(102, 82, 0) -} - -.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_gutter-active-line { - background-color: #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, -.ace-vibrant-ink .ace_meta { - color: #FF6600 -} - -.ace-vibrant-ink .ace_constant, -.ace-vibrant-ink .ace_constant.ace_character, -.ace-vibrant-ink .ace_constant.ace_character.ace_escape, -.ace-vibrant-ink .ace_constant.ace_other { - color: #339999 -} - -.ace-vibrant-ink .ace_constant.ace_numeric { - color: #99CC99 -} - -.ace-vibrant-ink .ace_invalid, -.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_entity.ace_name.ace_function, -.ace-vibrant-ink .ace_support.ace_function, -.ace-vibrant-ink .ace_variable { - color: #FFCC00 -} - -.ace-vibrant-ink .ace_variable.ace_parameter { - font-style: italic -} - -.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_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js deleted file mode 100644 index 7156e5de..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-vibrant-ink"; -exports.cssText = require("../requirejs/text!./vibrant_ink.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css deleted file mode 100644 index 56eb9a89..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +++ /dev/null @@ -1,103 +0,0 @@ -/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */ - -.ace-xcode .ace_gutter { - background: #e8e8e8; - color: #333 -} - -.ace-xcode .ace_print-margin { - width: 1px; - background: #e8e8e8 -} - -.ace-xcode { - background-color: #FFFFFF; - color: #000000 -} - -.ace-xcode .ace_cursor { - color: #000000 -} - -.ace-xcode .ace_marker-layer .ace_selection { - background: #B5D5FF -} - -.ace-xcode.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #FFFFFF; - border-radius: 2px -} - -.ace-xcode .ace_marker-layer .ace_step { - background: rgb(198, 219, 174) -} - -.ace-xcode .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #BFBFBF -} - -.ace-xcode .ace_marker-layer .ace_active-line { - background: rgba(0, 0, 0, 0.071) -} - -.ace-xcode .ace_gutter-active-line { - background-color: rgba(0, 0, 0, 0.071) -} - -.ace-xcode .ace_marker-layer .ace_selected-word { - border: 1px solid #B5D5FF -} - -.ace-xcode .ace_constant.ace_language, -.ace-xcode .ace_keyword, -.ace-xcode .ace_meta, -.ace-xcode .ace_variable.ace_language { - color: #C800A4 -} - -.ace-xcode .ace_invisible { - color: #BFBFBF -} - -.ace-xcode .ace_constant.ace_character, -.ace-xcode .ace_constant.ace_other { - color: #275A5E -} - -.ace-xcode .ace_constant.ace_numeric { - color: #3A00DC -} - -.ace-xcode .ace_entity.ace_other.ace_attribute-name, -.ace-xcode .ace_support.ace_constant, -.ace-xcode .ace_support.ace_function { - color: #450084 -} - -.ace-xcode .ace_fold { - background-color: #C800A4; - border-color: #000000 -} - -.ace-xcode .ace_entity.ace_name.ace_tag, -.ace-xcode .ace_support.ace_class, -.ace-xcode .ace_support.ace_type { - color: #790EAD -} - -.ace-xcode .ace_storage { - color: #C900A4 -} - -.ace-xcode .ace_string { - color: #DF0002 -} - -.ace-xcode .ace_comment { - color: #008E00 -} - -.ace-xcode .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js deleted file mode 100644 index e17d708d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-xcode"; -exports.cssText = require("../requirejs/text!./xcode.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js deleted file mode 100644 index 74376fb3..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +++ /dev/null @@ -1,150 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -/** - * - * - * This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens. - * @class TokenIterator - **/ - -/** - * Creates a new token iterator object. The inital token index is set to the provided row and column coordinates. - * @param {EditSession} session The session to associate with - * @param {Number} initialRow The row to start the tokenizing at - * @param {Number} initialColumn The column to start the tokenizing at - * - * @constructor - **/ -var TokenIterator = function(session, initialRow, initialColumn) { - this.$session = session; - this.$row = initialRow; - this.$rowTokens = session.getTokens(initialRow); - - var token = session.getTokenAt(initialRow, initialColumn); - this.$tokenIndex = token ? token.index : -1; -}; - -(function() { - - /** - * - * Tokenizes all the items from the current point to the row prior in the document. - * @returns {[String]} If the current point is not at the top of the file, this function returns `null`. Otherwise, it returns an array of the tokenized strings. - **/ - this.stepBackward = function() { - this.$tokenIndex -= 1; - - while (this.$tokenIndex < 0) { - this.$row -= 1; - if (this.$row < 0) { - this.$row = 0; - return null; - } - - this.$rowTokens = this.$session.getTokens(this.$row); - this.$tokenIndex = this.$rowTokens.length - 1; - } - - return this.$rowTokens[this.$tokenIndex]; - }; - - /** - * - * Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns `null`. Otherwise, it returns the tokenized string. - * @returns {String} - **/ - this.stepForward = function() { - this.$tokenIndex += 1; - var rowCount; - while (this.$tokenIndex >= this.$rowTokens.length) { - this.$row += 1; - if (!rowCount) - rowCount = this.$session.getLength(); - if (this.$row >= rowCount) { - this.$row = rowCount - 1; - return null; - } - - this.$rowTokens = this.$session.getTokens(this.$row); - this.$tokenIndex = 0; - } - - return this.$rowTokens[this.$tokenIndex]; - }; - - /** - * - * Returns the current tokenized string. - * @returns {String} - **/ - this.getCurrentToken = function () { - return this.$rowTokens[this.$tokenIndex]; - }; - - /** - * - * Returns the current row. - * @returns {Number} - **/ - this.getCurrentTokenRow = function () { - return this.$row; - }; - - /** - * - * Returns the current column. - * @returns {Number} - **/ - 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/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js deleted file mode 100644 index c7202e84..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +++ /dev/null @@ -1,212 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - if (typeof process !== "undefined") { - require("amd-loader"); - } - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./edit_session").EditSession; -var JavaScriptMode = require("./mode/javascript").Mode; -var TokenIterator = require("./token_iterator").TokenIterator; -var assert = require("./test/assertions"); - -module.exports = { - "test: token iterator initialization in JavaScript document" : function() { - var lines = [ - "function foo(items) {", - " for (var i=0; i= 0; i--) - assert.equal(iterator.stepBackward(), tokens[i]); - assert.equal(iterator.stepBackward(), null); - assert.equal(iterator.getCurrentToken(), null); - }, - - "test: token iterator reports correct row and column" : function() { - var lines = [ - "function foo(items) {", - " for (var i=0; i 1) - rule.onMatch = this.$applyToken; - else - rule.onMatch = rule.token; - } - - if (matchcount > 1) { - if (/\\\d/.test(rule.regex)) { - // Replace any backreferences and offset appropriately. - adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); - } else { - matchcount = 1; - adjustedregex = this.removeCapturingGroups(rule.regex); - } - if (!rule.splitRegex && typeof rule.token != "string") - splitterRurles.push(rule); // flag will be known only at the very end - } - - mapping[matchTotal] = i; - matchTotal += matchcount; - - ruleRegExps.push(adjustedregex); - - // makes property access faster - if (!rule.onMatch) - rule.onMatch = null; - } - - if (!ruleRegExps.length) { - mapping[0] = 0; - ruleRegExps.push("$"); - } - - splitterRurles.forEach(function(rule) { - rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); - }, this); - - this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); - } -}; - -(function() { - this.$setMaxTokenCount = function(m) { - MAX_TOKEN_COUNT = m | 0; - }; - - this.$applyToken = function(str) { - var values = this.splitRegex.exec(str).slice(1); - var types = this.token.apply(this, values); - - // required for compatibility with old modes - if (typeof types === "string") - return [{type: types, value: str}]; - - var tokens = []; - for (var i = 0, l = types.length; i < l; i++) { - if (values[i]) - tokens[tokens.length] = { - type: types[i], - value: values[i] - }; - } - return tokens; - }, - - this.$arrayTokens = function(str) { - if (!str) - return []; - var values = this.splitRegex.exec(str); - if (!values) - return "text"; - var tokens = []; - var types = this.tokenArray; - for (var i = 0, l = types.length; i < l; i++) { - if (values[i + 1]) - tokens[tokens.length] = { - type: types[i], - value: values[i + 1] - }; - } - return tokens; - }; - - this.removeCapturingGroups = function(src) { - var r = src.replace( - /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, - function(x, y) {return y ? "(?:" : x;} - ); - return r; - }; - - this.createSplitterRegexp = function(src, flag) { - if (src.indexOf("(?=") != -1) { - var stack = 0; - var inChClass = false; - var lastCapture = {}; - src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( - m, esc, parenOpen, parenClose, square, index - ) { - if (inChClass) { - inChClass = square != "]"; - } else if (square) { - inChClass = true; - } else if (parenClose) { - if (stack == lastCapture.stack) { - lastCapture.end = index+1; - lastCapture.stack = -1; - } - stack--; - } else if (parenOpen) { - stack++; - if (parenOpen.length != 1) { - lastCapture.stack = stack - lastCapture.start = index; - } - } - return m; - }); - - if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) - src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); - } - return new RegExp(src, (flag||"").replace("g", "")); - }; - - /** - * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @returns {Object} - **/ - this.getLineTokens = function(line, startState) { - if (startState && typeof startState != "string") { - var stack = startState.slice(0); - startState = stack[0]; - if (startState === "#tmp") { - stack.shift() - startState = stack.shift() - } - } else - var stack = []; - - var currentState = startState || "start"; - var state = this.states[currentState]; - if (!state) { - currentState = "start"; - state = this.states[currentState]; - } - var mapping = this.matchMappings[currentState]; - var re = this.regExps[currentState]; - re.lastIndex = 0; - - var match, tokens = []; - var lastIndex = 0; - var matchAttempts = 0; - - var token = {type: null, value: ""}; - - while (match = re.exec(line)) { - var type = mapping.defaultToken; - var rule = null; - var value = match[0]; - var index = re.lastIndex; - - if (index - value.length > lastIndex) { - var skipped = line.substring(lastIndex, index - value.length); - if (token.type == type) { - token.value += skipped; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: skipped}; - } - } - - for (var i = 0; i < match.length-2; i++) { - if (match[i + 1] === undefined) - continue; - - rule = state[mapping[i]]; - - if (rule.onMatch) - type = rule.onMatch(value, currentState, stack); - else - type = rule.token; - - if (rule.next) { - if (typeof rule.next == "string") { - currentState = rule.next; - } else { - currentState = rule.next(currentState, stack); - } - - state = this.states[currentState]; - if (!state) { - this.reportError("state doesn't exist", currentState); - currentState = "start"; - state = this.states[currentState]; - } - mapping = this.matchMappings[currentState]; - lastIndex = index; - re = this.regExps[currentState]; - re.lastIndex = index; - } - break; - } - - if (value) { - if (typeof type === "string") { - if ((!rule || rule.merge !== false) && token.type === type) { - token.value += value; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: value}; - } - } else if (type) { - if (token.type) - tokens.push(token); - token = {type: null, value: ""}; - for (var i = 0; i < type.length; i++) - tokens.push(type[i]); - } - } - - if (lastIndex == line.length) - break; - - lastIndex = index; - - if (matchAttempts++ > MAX_TOKEN_COUNT) { - if (matchAttempts > 2 * line.length) { - this.reportError("infinite loop with in ace tokenizer", { - startState: startState, - line: line - }); - } - // chrome doens't show contents of text nodes with very long text - while (lastIndex < line.length) { - if (token.type) - tokens.push(token); - token = { - value: line.substring(lastIndex, lastIndex += 2000), - type: "overflow" - }; - } - currentState = "start"; - stack = []; - break; - } - } - - if (token.type) - tokens.push(token); - - if (stack.length > 1) { - if (stack[0] !== currentState) - stack.unshift("#tmp", currentState); - } - return { - tokens : tokens, - state : stack.length ? stack : currentState - }; - }; - - this.reportError = config.reportError; - -}).call(Tokenizer.prototype); - -exports.Tokenizer = Tokenizer; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js deleted file mode 100644 index 61821f60..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +++ /dev/null @@ -1,183 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -var BaseTokenizer = require("./tokenizer").Tokenizer; - -// tokenizing lines longer than this makes editor very slow -var MAX_TOKEN_COUNT = 100000; -/* - * version of Tokenizer with additional logging - * and infinite loop checks - * can be used for developing/testing new modes - **/ - -var Tokenizer = function(rules) { - BaseTokenizer.call(this, rules); - - /** - * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @returns {Object} - **/ - this.getLineTokens = function(line, startState) { - if (startState && typeof startState != "string") { - var stack = startState.slice(0); - startState = stack[0]; - } else - var stack = []; - - var currentState = startState || "start"; - var state = this.states[currentState]; - var mapping = this.matchMappings[currentState]; - var re = this.regExps[currentState]; - re.lastIndex = 0; - - var match, tokens = []; - - var lastIndex = 0; - - var stateTransitions = []; - function onStateChange() { - stateTransitions.push(startState+"@"+lastIndex); - } - function initState() { - onStateChange(); - stateTransitions = []; - onStateChange(); - } - - var token = { - type: null, - value: "", - state: currentState - }; - initState(); - - var maxRecur = 100000; - - while (match = re.exec(line)) { - var type = mapping.defaultToken; - var rule = null; - var value = match[0]; - var index = re.lastIndex; - - if (index - value.length > lastIndex) { - var skipped = line.substring(lastIndex, index - value.length); - if (token.type == type) { - token.value += skipped; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: skipped}; - } - } - - for (var i = 0; i < match.length-2; i++) { - if (match[i + 1] === undefined) - continue; - - if (!maxRecur--) { - throw "infinite" + state[mapping[i]] + currentState - } - - rule = state[mapping[i]]; - - if (rule.onMatch) - type = rule.onMatch(value, currentState, stack); - else - type = rule.token; - - if (rule.next) { - if (typeof rule.next == "string") - currentState = rule.next; - else - currentState = rule.next(currentState, stack); - - state = this.states[currentState]; - if (!state) { - window.console && console.error && console.error(currentState, "doesn't exist"); - currentState = "start"; - state = this.states[currentState]; - } - mapping = this.matchMappings[currentState]; - lastIndex = index; - re = this.regExps[currentState]; - re.lastIndex = index; - - onStateChange(); - } - break; - } - - if (value) { - if (typeof type == "string") { - if ((!rule || rule.merge !== false) && token.type === type) { - token.value += value; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: value}; - } - } else { - if (token.type) - tokens.push(token); - token = {type: null, value: ""}; - for (var i = 0; i < type.length; i++) - tokens.push(type[i]); - } - } - - if (lastIndex == line.length) - break; - - lastIndex = index; - - if (tokens.length > MAX_TOKEN_COUNT) { - token.value += line.substr(lastIndex); - currentState = "start" - break; - } - } - - if (token.type) - tokens.push(token); - - return { - tokens : tokens, - state : stack.length ? stack : currentState - }; - }; - -}; - -Tokenizer.prototype = BaseTokenizer.prototype; - -exports.Tokenizer = Tokenizer; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_test.js deleted file mode 100644 index 41bf01c8..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_test.js +++ /dev/null @@ -1,97 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - if (typeof process !== "undefined") { - require("amd-loader"); - } - -define(function(require, exports, module) { -"use strict"; - -var Tokenizer = require("./tokenizer").Tokenizer; -var assert = require("./test/assertions"); - -module.exports = { - "test: createSplitterRegexp" : function() { - var t = new Tokenizer({}); - var re = t.createSplitterRegexp("(a)(b)(?=[x)(])"); - assert.equal(re.source, "(a)(b)"); - var re = t.createSplitterRegexp("xc(?=([x)(]))"); - assert.equal(re.source, "xc"); - var re = t.createSplitterRegexp("(xc(?=([x)(])))"); - assert.equal(re.source, "(xc)"); - var re = t.createSplitterRegexp("(?=r)[(?=)](?=([x)(]))"); - assert.equal(re.source, "(?=r)[(?=)]"); - var re = t.createSplitterRegexp("(?=r)[(?=)](\\?=t)"); - assert.equal(re.source, "(?=r)[(?=)](\\?=t)"); - var re = t.createSplitterRegexp("[(?=)](\\?=t)"); - assert.equal(re.source, "[(?=)](\\?=t)"); - }, - - "test: removeCapturingGroups" : function() { - var t = new Tokenizer({}); - var re = t.removeCapturingGroups("(ax(by))[()]"); - assert.equal(re, "(?:ax(?:by))[()]"); - }, - - "test: broken highlight rules": function() { - var t = new Tokenizer({ - start: [{ - token: 's', - regex: '&&&|^^^' - }, { - defaultToken: "def" - }], - state1: [{ - token: 'x', - regex: /\b([\w]*)(\s*)((?::)?)/ - }] - }); - var errorReports = 0; - t.reportError = function() { errorReports++; }; - var tokens = t.getLineTokens("x|", "start"); - assert.deepEqual(tokens, { - tokens: [{value: 'x|', type: 'overflow'}], - state: 'start' - }); - var tokens = t.getLineTokens("x|", "state1"); - assert.deepEqual(tokens, { - tokens: [{value: 'x', type: 'x'}, {value: '|', type: 'overflow'}], - state: 'start' - }); - assert.equal(errorReports, 2); - }, -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tooltip.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tooltip.js deleted file mode 100644 index 1f5502d6..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tooltip.js +++ /dev/null @@ -1,138 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); - -/** - * @class Tooltip - **/ - -/** - * @param {Element} parentNode - * - * @constructor - **/ -function Tooltip (parentNode) { - this.isOpen = false; - this.$element = null; - this.$parentNode = parentNode; -} - -(function() { - this.$init = function() { - this.$element = dom.createElement("div"); - this.$element.className = "ace_tooltip"; - this.$element.style.display = "none"; - this.$parentNode.appendChild(this.$element); - return this.$element; - }; - - /** - * @returns {Element} - **/ - this.getElement = function() { - return this.$element || this.$init(); - }; - - /** - * @param {String} text - **/ - this.setText = function(text) { - dom.setInnerText(this.getElement(), text); - }; - - /** - * @param {String} html - **/ - this.setHtml = function(html) { - this.getElement().innerHTML = html; - }; - - /** - * @param {Number} x - * @param {Number} y - **/ - this.setPosition = function(x, y) { - this.getElement().style.left = x + "px"; - this.getElement().style.top = y + "px"; - }; - - /** - * @param {String} className - **/ - this.setClassName = function(className) { - dom.addCssClass(this.getElement(), className); - }; - - /** - * @param {String} text - * @param {Number} x - * @param {Number} y - **/ - this.show = function(text, x, y) { - if (text != null) - this.setText(text); - if (x != null && y != null) - this.setPosition(x, y); - if (!this.isOpen) { - this.getElement().style.display = "block"; - this.isOpen = true; - } - }; - - this.hide = function() { - if (this.isOpen) { - this.getElement().style.display = "none"; - this.isOpen = false; - } - }; - - /** - * @returns {Number} - **/ - this.getHeight = function() { - return this.getElement().offsetHeight; - }; - - /** - * @returns {Number} - **/ - this.getWidth = function() { - return this.getElement().offsetWidth; - }; - -}).call(Tooltip.prototype); - -exports.Tooltip = Tooltip; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js deleted file mode 100644 index 4411ae8b..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +++ /dev/null @@ -1,168 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -/** - * - * - * This object maintains the undo stack for an [[EditSession `EditSession`]]. - * @class UndoManager - **/ - -/** - * - * - * Resets the current undo state and creates a new `UndoManager`. - * - * @constructor - **/ -var UndoManager = function() { - this.reset(); -}; - -(function() { - - /** - * Provides a means for implementing your own undo manager. `options` has one property, `args`, an [[Array `Array`]], with two elements: - * - * - `args[0]` is an array of deltas - * - `args[1]` is the document to associate with - * - * @param {Object} options Contains additional properties - * - **/ - this.execute = function(options) { - var deltas = options.args[0]; - this.$doc = options.args[1]; - if (options.merge && this.hasUndo()){ - this.dirtyCounter--; - deltas = this.$undoStack.pop().concat(deltas); - } - this.$undoStack.push(deltas); - this.$redoStack = []; - - if (this.dirtyCounter < 0) { - // The user has made a change after undoing past the last clean state. - // We can never get back to a clean state now until markClean() is called. - this.dirtyCounter = NaN; - } - this.dirtyCounter++; - }; - - /** - * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} - * @param {Boolean} dontSelect {:dontSelect} - * - * - * @returns {Range} The range of the undo. - **/ - this.undo = function(dontSelect) { - var deltas = this.$undoStack.pop(); - var undoSelectionRange = null; - if (deltas) { - undoSelectionRange = - this.$doc.undoChanges(deltas, dontSelect); - this.$redoStack.push(deltas); - this.dirtyCounter--; - } - - return undoSelectionRange; - }; - - /** - * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} - * @param {Boolean} dontSelect {:dontSelect} - * - * - **/ - this.redo = function(dontSelect) { - var deltas = this.$redoStack.pop(); - var redoSelectionRange = null; - if (deltas) { - redoSelectionRange = - this.$doc.redoChanges(deltas, dontSelect); - this.$undoStack.push(deltas); - this.dirtyCounter++; - } - - return redoSelectionRange; - }; - - /** - * - * Destroys the stack of undo and redo redo operations. - **/ - this.reset = function() { - this.$undoStack = []; - this.$redoStack = []; - this.dirtyCounter = 0; - }; - - /** - * - * Returns `true` if there are undo operations left to perform. - * @returns {Boolean} - **/ - this.hasUndo = function() { - return this.$undoStack.length > 0; - }; - - /** - * - * Returns `true` if there are redo operations left to perform. - * @returns {Boolean} - **/ - this.hasRedo = function() { - return this.$redoStack.length > 0; - }; - - /** - * - * Marks the current status clean - **/ - this.markClean = function() { - this.dirtyCounter = 0; - }; - - /** - * - * Returns if the current status is clean - * @returns {Boolean} - **/ - this.isClean = function() { - return this.dirtyCounter === 0; - }; - -}).call(UndoManager.prototype); - -exports.UndoManager = UndoManager; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/unicode.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/unicode.js deleted file mode 100644 index 5c291744..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/unicode.js +++ /dev/null @@ -1,107 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -/* -XRegExp Unicode plugin pack: Categories 1.0 -(c) 2010 Steven Levithan -MIT License - -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$&"); -}; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js deleted file mode 100644 index 484ebb5e..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +++ /dev/null @@ -1,1764 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var config = require("./config"); -var useragent = require("./lib/useragent"); -var GutterLayer = require("./layer/gutter").Gutter; -var MarkerLayer = require("./layer/marker").Marker; -var TextLayer = require("./layer/text").Text; -var CursorLayer = require("./layer/cursor").Cursor; -var HScrollBar = require("./scrollbar").HScrollBar; -var VScrollBar = require("./scrollbar").VScrollBar; -var RenderLoop = require("./renderloop").RenderLoop; -var FontMetrics = require("./layer/font_metrics").FontMetrics; -var EventEmitter = require("./lib/event_emitter").EventEmitter; -var editorCss = require("./requirejs/text!./css/editor.css"); - -dom.importCssString(editorCss, "ace_editor"); - -/** - * The class that is responsible for drawing everything you see on the screen! - * @related editor.renderer - * @class VirtualRenderer - **/ - -/** - * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. - * @param {DOMElement} container The root element of the editor - * @param {String} theme The starting theme - * - * @constructor - **/ - -var VirtualRenderer = function(container, theme) { - var _self = this; - - this.container = container || dom.createElement("div"); - - // TODO: this breaks rendering in Cloud9 with multiple ace instances - // // Imports CSS once per DOM document ('ace_editor' serves as an identifier). - // dom.importCssString(editorCss, "ace_editor", container.ownerDocument); - - // in IE <= 9 the native cursor always shines through - this.$keepTextAreaAtCursor = !useragent.isOldIE; - - 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.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); - - 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.$cursorLayer = new CursorLayer(this.content); - - // Indicates whether the horizontal scrollbar is visible - this.$horizScroll = false; - this.$vScroll = false; - - this.scrollBar = - this.scrollBarV = new VScrollBar(this.container, this); - this.scrollBarH = new HScrollBar(this.container, this); - this.scrollBarV.addEventListener("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollTop(e.data - _self.scrollMargin.top); - }); - this.scrollBarH.addEventListener("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollLeft(e.data - _self.scrollMargin.left); - }); - - this.scrollTop = 0; - this.scrollLeft = 0; - - this.cursorPos = { - row : 0, - column : 0 - }; - - this.$fontMetrics = new FontMetrics(this.container, 500); - this.$textLayer.$setFontMetrics(this.$fontMetrics); - this.$textLayer.addEventListener("changeCharacterSize", function(e) { - _self.updateCharacterSize(); - _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); - _self._signal("changeCharacterSize", e); - }); - - this.$size = { - width: 0, - height: 0, - scrollerHeight: 0, - scrollerWidth: 0, - $dirty: true - }; - - this.layerConfig = { - width : 1, - padding : 0, - firstRow : 0, - firstRowScreen: 0, - lastRow : 0, - lineHeight : 0, - characterWidth : 0, - minHeight : 1, - maxHeight : 1, - offset : 0, - height : 1, - gutterOffset: 1 - }; - - this.scrollMargin = { - left: 0, - right: 0, - top: 0, - bottom: 0, - v: 0, - h: 0 - }; - - this.$loop = new RenderLoop( - this.$renderChanges.bind(this), - this.container.ownerDocument.defaultView - ); - this.$loop.schedule(this.CHANGE_FULL); - - this.updateCharacterSize(); - this.setPadding(4); - config.resetOptions(this); - config._emit("renderer", this); -}; - -(function() { - - 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; - this.CHANGE_H_SCROLL = 1024; - - // this.$logChanges = function(changes) { - // var a = "" - // if (changes & this.CHANGE_CURSOR) a += " cursor"; - // if (changes & this.CHANGE_MARKER) a += " marker"; - // if (changes & this.CHANGE_GUTTER) a += " gutter"; - // if (changes & this.CHANGE_SCROLL) a += " scroll"; - // if (changes & this.CHANGE_LINES) a += " lines"; - // if (changes & this.CHANGE_TEXT) a += " text"; - // if (changes & this.CHANGE_SIZE) a += " size"; - // if (changes & this.CHANGE_MARKER_BACK) a += " marker_back"; - // if (changes & this.CHANGE_MARKER_FRONT) a += " marker_front"; - // if (changes & this.CHANGE_FULL) a += " full"; - // if (changes & this.CHANGE_H_SCROLL) a += " h_scroll"; - // console.log(a.trim()) - // }; - - oop.implement(this, EventEmitter); - - this.updateCharacterSize = function() { - if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) { - this.$allowBoldFonts = this.$textLayer.allowBoldFonts; - this.setStyle("ace_nobold", !this.$allowBoldFonts); - } - - this.layerConfig.characterWidth = - this.characterWidth = this.$textLayer.getCharacterWidth(); - this.layerConfig.lineHeight = - this.lineHeight = this.$textLayer.getLineHeight(); - this.$updatePrintMargin(); - }; - - /** - * - * Associates the renderer with an [[EditSession `EditSession`]]. - **/ - this.setSession = function(session) { - if (this.session) - this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode); - - this.session = session; - if (session && this.scrollMargin.top && session.getScrollTop() <= 0) - session.setScrollTop(-this.scrollMargin.top); - - this.$cursorLayer.setSession(session); - this.$markerBack.setSession(session); - this.$markerFront.setSession(session); - this.$gutterLayer.setSession(session); - this.$textLayer.setSession(session); - if (!session) - return; - - this.$loop.schedule(this.CHANGE_FULL); - this.session.$setFontMetrics(this.$fontMetrics); - - this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this); - this.onChangeNewLineMode() - this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode); - }; - - /** - * Triggers a partial update of the text, from the range given by the two parameters. - * @param {Number} firstRow The first row to update - * @param {Number} lastRow The last row to update - * - * - **/ - this.updateLines = function(firstRow, lastRow, force) { - 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; - } - - // If the change happened offscreen above us then it's possible - // that a new line wrap will affect the position of the lines on our - // screen so they need redrawn. - // TODO: better solution is to not change scroll position when text is changed outside of visible area - if (this.$changedLines.lastRow < this.layerConfig.firstRow) { - if (force) - this.$changedLines.lastRow = this.layerConfig.lastRow; - else - return; - } - if (this.$changedLines.firstRow > this.layerConfig.lastRow) - return; - this.$loop.schedule(this.CHANGE_LINES); - }; - - this.onChangeNewLineMode = function() { - this.$loop.schedule(this.CHANGE_TEXT); - this.$textLayer.$updateEolChar(); - }; - - this.onChangeTabSize = function() { - this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); - this.$textLayer.onChangeTabSize(); - }; - - /** - * Triggers a full update of the text, for all the rows. - **/ - this.updateText = function() { - this.$loop.schedule(this.CHANGE_TEXT); - }; - - /** - * Triggers a full update of all the layers, for all the rows. - * @param {Boolean} force If `true`, forces the changes through - * - * - **/ - this.updateFull = function(force) { - if (force) - this.$renderChanges(this.CHANGE_FULL, true); - else - this.$loop.schedule(this.CHANGE_FULL); - }; - - /** - * - * Updates the font size. - **/ - this.updateFontSize = function() { - this.$textLayer.checkForSizeChanges(); - }; - - this.$changes = 0; - this.$updateSizeAsync = function() { - if (this.$loop.pending) - this.$size.$dirty = true; - else - this.onResize(); - }; - /** - * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} - * @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed - * @param {Number} gutterWidth The width of the gutter in pixels - * @param {Number} width The width of the editor in pixels - * @param {Number} height The hiehgt of the editor, in pixels - * - * - **/ - this.onResize = function(force, gutterWidth, width, height) { - if (this.resizing > 2) - return; - else if (this.resizing > 0) - this.resizing++; - else - this.resizing = force ? 1 : 0; - // `|| el.scrollHeight` is required for outosizing editors on ie - // where elements with clientHeight = 0 alsoe have clientWidth = 0 - var el = this.container; - if (!height) - height = el.clientHeight || el.scrollHeight; - if (!width) - width = el.clientWidth || el.scrollWidth; - var changes = this.$updateCachedSize(force, gutterWidth, width, height); - - - if (!this.$size.scrollerHeight || (!width && !height)) - return this.resizing = 0; - - if (force) - this.$gutterLayer.$padding = null; - - if (force) - this.$renderChanges(changes | this.$changes, true); - else - this.$loop.schedule(changes | this.$changes); - - if (this.resizing) - this.resizing = 0; - // reset cached values on scrollbars, needs to be removed when switching to non-native scrollbars - // see https://github.com/ajaxorg/ace/issues/2195 - this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null; - }; - - this.$updateCachedSize = function(force, gutterWidth, width, height) { - height -= (this.$extraHeight || 0); - var changes = 0; - var size = this.$size; - var oldSize = { - width: size.width, - height: size.height, - scrollerHeight: size.scrollerHeight, - scrollerWidth: size.scrollerWidth - }; - if (height && (force || size.height != height)) { - size.height = height; - changes |= this.CHANGE_SIZE; - - size.scrollerHeight = size.height; - if (this.$horizScroll) - size.scrollerHeight -= this.scrollBarH.getHeight(); - - // this.scrollBarV.setHeight(size.scrollerHeight); - this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px"; - - changes = changes | this.CHANGE_SCROLL; - } - - if (width && (force || size.width != width)) { - changes |= this.CHANGE_SIZE; - size.width = width; - - if (gutterWidth == null) - gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; - - this.gutterWidth = gutterWidth; - - this.scrollBarH.element.style.left = - this.scroller.style.left = gutterWidth + "px"; - size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth()); - - this.scrollBarH.element.style.right = - this.scroller.style.right = this.scrollBarV.getWidth() + "px"; - this.scroller.style.bottom = this.scrollBarH.getHeight() + "px"; - - // this.scrollBarH.element.style.setWidth(size.scrollerWidth); - - if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) - changes |= this.CHANGE_FULL; - } - - size.$dirty = !width || !height; - - if (changes) - this._signal("resize", oldSize); - - return changes; - }; - - this.onGutterResize = function() { - var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; - if (gutterWidth != this.gutterWidth) - this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height); - - if (this.session.getUseWrapMode() && this.adjustWrapLimit()) { - this.$loop.schedule(this.CHANGE_FULL); - } else if (this.$size.$dirty) { - this.$loop.schedule(this.CHANGE_FULL); - } else { - this.$computeLayerConfig(); - this.$loop.schedule(this.CHANGE_MARKER); - } - }; - - /** - * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. - **/ - this.adjustWrapLimit = function() { - var availableWidth = this.$size.scrollerWidth - this.$padding * 2; - var limit = Math.floor(availableWidth / this.characterWidth); - return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn); - }; - - /** - * Identifies whether you want to have an animated scroll or not. - * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls - * - **/ - this.setAnimatedScroll = function(shouldAnimate){ - this.setOption("animatedScroll", shouldAnimate); - }; - - /** - * Returns whether an animated scroll happens or not. - * @returns {Boolean} - **/ - this.getAnimatedScroll = function() { - return this.$animatedScroll; - }; - - /** - * Identifies whether you want to show invisible characters or not. - * @param {Boolean} showInvisibles Set to `true` to show invisibles - * - **/ - this.setShowInvisibles = function(showInvisibles) { - this.setOption("showInvisibles", showInvisibles); - }; - - /** - * Returns whether invisible characters are being shown or not. - * @returns {Boolean} - **/ - this.getShowInvisibles = function() { - return this.getOption("showInvisibles"); - }; - this.getDisplayIndentGuides = function() { - return this.getOption("displayIndentGuides"); - }; - - this.setDisplayIndentGuides = function(display) { - this.setOption("displayIndentGuides", display); - }; - - /** - * Identifies whether you want to show the print margin or not. - * @param {Boolean} showPrintMargin Set to `true` to show the print margin - * - **/ - this.setShowPrintMargin = function(showPrintMargin) { - this.setOption("showPrintMargin", showPrintMargin); - }; - - /** - * Returns whether the print margin is being shown or not. - * @returns {Boolean} - **/ - this.getShowPrintMargin = function() { - return this.getOption("showPrintMargin"); - }; - /** - * Identifies whether you want to show the print margin column or not. - * @param {Boolean} showPrintMargin Set to `true` to show the print margin column - * - **/ - this.setPrintMarginColumn = function(showPrintMargin) { - this.setOption("printMarginColumn", showPrintMargin); - }; - - /** - * Returns whether the print margin column is being shown or not. - * @returns {Boolean} - **/ - this.getPrintMarginColumn = function() { - return this.getOption("printMarginColumn"); - }; - - /** - * Returns `true` if the gutter is being shown. - * @returns {Boolean} - **/ - this.getShowGutter = function(){ - return this.getOption("showGutter"); - }; - - /** - * Identifies whether you want to show the gutter or not. - * @param {Boolean} show Set to `true` to show the gutter - * - **/ - this.setShowGutter = function(show){ - return this.setOption("showGutter", show); - }; - - this.getFadeFoldWidgets = function(){ - return this.getOption("fadeFoldWidgets") - }; - - this.setFadeFoldWidgets = function(show) { - this.setOption("fadeFoldWidgets", show); - }; - - this.setHighlightGutterLine = function(shouldHighlight) { - this.setOption("highlightGutterLine", shouldHighlight); - }; - - this.getHighlightGutterLine = function() { - return this.getOption("highlightGutterLine"); - }; - - this.$updateGutterLineHighlight = function() { - var pos = this.$cursorLayer.$pixelPos; - var height = this.layerConfig.lineHeight; - if (this.session.getUseWrapMode()) { - var cursor = this.session.selection.getCursor(); - cursor.column = 0; - pos = this.$cursorLayer.getPixelPosition(cursor, true); - height *= this.session.getRowLength(cursor.row); - } - this.$gutterLineHighlight.style.top = pos.top - this.layerConfig.offset + "px"; - this.$gutterLineHighlight.style.height = height + "px"; - }; - - this.$updatePrintMargin = function() { - if (!this.$showPrintMargin && !this.$printMarginEl) - return; - - if (!this.$printMarginEl) { - var containerEl = dom.createElement("div"); - containerEl.className = "ace_layer ace_print-margin-layer"; - this.$printMarginEl = dom.createElement("div"); - this.$printMarginEl.className = "ace_print-margin"; - containerEl.appendChild(this.$printMarginEl); - this.content.insertBefore(containerEl, this.content.firstChild); - } - - var style = this.$printMarginEl.style; - style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px"; - style.visibility = this.$showPrintMargin ? "visible" : "hidden"; - - if (this.session && this.session.$wrap == -1) - this.adjustWrapLimit(); - }; - - /** - * - * Returns the root element containing this renderer. - * @returns {DOMElement} - **/ - this.getContainerElement = function() { - return this.container; - }; - - /** - * - * Returns the element that the mouse events are attached to - * @returns {DOMElement} - **/ - this.getMouseEventTarget = function() { - return this.content; - }; - - /** - * - * Returns the element to which the hidden text area is added. - * @returns {DOMElement} - **/ - this.getTextAreaContainer = function() { - return this.container; - }; - - // move text input over the cursor - // this is required for iOS and IME - this.$moveTextAreaToCursor = function() { - if (!this.$keepTextAreaAtCursor) - return; - var config = this.layerConfig; - var posTop = this.$cursorLayer.$pixelPos.top; - var posLeft = this.$cursorLayer.$pixelPos.left; - posTop -= config.offset; - - var style = this.textarea.style; - var h = this.lineHeight; - if (posTop < 0 || posTop > config.height - h) { - style.top = style.left = "0"; - return; - } - - var w = this.characterWidth; - if (this.$composition) { - var val = this.textarea.value.replace(/^\x01+/, ""); - w *= (this.session.$getStringScreenWidth(val)[0]+2); - h += 2; - } - posLeft -= this.scrollLeft; - if (posLeft > this.$size.scrollerWidth - w) - posLeft = this.$size.scrollerWidth - w; - - posLeft += this.gutterWidth; - style.height = h + "px"; - style.width = w + "px"; - style.left = Math.min(posLeft, this.$size.scrollerWidth - w) + "px"; - style.top = Math.min(posTop, this.$size.height - h) + "px"; - }; - - /** - * - * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} - * @returns {Number} - **/ - this.getFirstVisibleRow = function() { - return this.layerConfig.firstRow; - }; - - /** - * - * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} - **/ - this.getFirstFullyVisibleRow = function() { - return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); - }; - - /** - * - * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} - **/ - this.getLastFullyVisibleRow = function() { - var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight); - return this.layerConfig.firstRow - 1 + flint; - }; - - /** - * - * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} - * @returns {Number} - **/ - this.getLastVisibleRow = function() { - return this.layerConfig.lastRow; - }; - - this.$padding = null; - - /** - * Sets the padding for all the layers. - * @param {Number} padding A new padding value (in pixels) - * - * - * - **/ - 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.setScrollMargin = function(top, bottom, left, right) { - var sm = this.scrollMargin; - sm.top = top|0; - sm.bottom = bottom|0; - sm.right = right|0; - sm.left = left|0; - sm.v = sm.top + sm.bottom; - sm.h = sm.left + sm.right; - if (sm.top && this.scrollTop <= 0 && this.session) - this.session.setScrollTop(-sm.top); - this.updateFull(); - }; - - /** - * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - **/ - this.getHScrollBarAlwaysVisible = function() { - return this.$hScrollBarAlwaysVisible; - }; - - /** - * Identifies whether you want to show the horizontal scrollbar or not. - * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - **/ - this.setHScrollBarAlwaysVisible = function(alwaysVisible) { - this.setOption("hScrollBarAlwaysVisible", alwaysVisible); - }; - /** - * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - **/ - this.getVScrollBarAlwaysVisible = function() { - return this.$vScrollBarAlwaysVisible; - }; - - /** - * Identifies whether you want to show the horizontal scrollbar or not. - * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - **/ - this.setVScrollBarAlwaysVisible = function(alwaysVisible) { - this.setOption("vScrollBarAlwaysVisible", alwaysVisible); - }; - - this.$updateScrollBarV = function() { - var scrollHeight = this.layerConfig.maxHeight; - var scrollerHeight = this.$size.scrollerHeight; - if (!this.$maxLines && this.$scrollPastEnd) { - scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd; - if (this.scrollTop > scrollHeight - scrollerHeight) { - scrollHeight = this.scrollTop + scrollerHeight; - this.scrollBarV.scrollTop = null; - } - } - this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v); - this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top); - }; - this.$updateScrollBarH = function() { - this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h); - this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left); - }; - - this.$frozen = false; - this.freeze = function() { - this.$frozen = true; - }; - - this.unfreeze = function() { - this.$frozen = false; - }; - - this.$renderChanges = function(changes, force) { - if (this.$changes) { - changes |= this.$changes; - this.$changes = 0; - } - if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) { - this.$changes |= changes; - return; - } - if (this.$size.$dirty) { - this.$changes |= changes; - return this.onResize(true); - } - if (!this.lineHeight) { - this.$textLayer.checkForSizeChanges(); - } - // this.$logChanges(changes); - - this._signal("beforeRender"); - var config = this.layerConfig; - // 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 || - changes & this.CHANGE_H_SCROLL - ) { - changes |= this.$computeLayerConfig(); - // If a change is made offscreen and wrapMode is on, then the onscreen - // lines may have been pushed down. If so, the first screen row will not - // have changed, but the first actual row will. In that case, adjust - // scrollTop so that the cursor and onscreen content stays in the same place. - // TODO: find a better way to handle this, that works non wrapped case and doesn't compute layerConfig twice - if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) { - var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight; - if (st > 0) { - // this check is needed as a workaround for the documentToScreenRow returning -1 if document.length == 0 - this.scrollTop = st; - changes = changes | this.CHANGE_SCROLL; - changes |= this.$computeLayerConfig(); - } - } - config = this.layerConfig; - // update scrollbar first to not lose scroll position when gutter calls resize - this.$updateScrollBarV(); - if (changes & this.CHANGE_H_SCROLL) - this.$updateScrollBarH(); - this.$gutterLayer.element.style.marginTop = (-config.offset) + "px"; - this.content.style.marginTop = (-config.offset) + "px"; - this.content.style.width = config.width + 2 * this.$padding + "px"; - this.content.style.height = config.minHeight + "px"; - } - - // horizontal scrolling - if (changes & this.CHANGE_H_SCROLL) { - this.content.style.marginLeft = -this.scrollLeft + "px"; - this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"; - } - - // full - if (changes & this.CHANGE_FULL) { - this.$textLayer.update(config); - if (this.$showGutter) - this.$gutterLayer.update(config); - this.$markerBack.update(config); - this.$markerFront.update(config); - this.$cursorLayer.update(config); - this.$moveTextAreaToCursor(); - this.$highlightGutterLine && this.$updateGutterLineHighlight(); - this._signal("afterRender"); - return; - } - - // scrolling - if (changes & this.CHANGE_SCROLL) { - if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) - this.$textLayer.update(config); - else - this.$textLayer.scrollLines(config); - - if (this.$showGutter) - this.$gutterLayer.update(config); - this.$markerBack.update(config); - this.$markerFront.update(config); - this.$cursorLayer.update(config); - this.$highlightGutterLine && this.$updateGutterLineHighlight(); - this.$moveTextAreaToCursor(); - this._signal("afterRender"); - return; - } - - if (changes & this.CHANGE_TEXT) { - this.$textLayer.update(config); - if (this.$showGutter) - this.$gutterLayer.update(config); - } - else if (changes & this.CHANGE_LINES) { - if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.$showGutter) - this.$gutterLayer.update(config); - } - else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) { - if (this.$showGutter) - this.$gutterLayer.update(config); - } - - if (changes & this.CHANGE_CURSOR) { - this.$cursorLayer.update(config); - this.$moveTextAreaToCursor(); - this.$highlightGutterLine && this.$updateGutterLineHighlight(); - } - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { - this.$markerFront.update(config); - } - - if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { - this.$markerBack.update(config); - } - - this._signal("afterRender"); - }; - - - this.$autosize = function() { - var height = this.session.getScreenLength() * this.lineHeight; - var maxHeight = this.$maxLines * this.lineHeight; - var desiredHeight = Math.max( - (this.$minLines||1) * this.lineHeight, - Math.min(maxHeight, height) - ) + this.scrollMargin.v + (this.$extraHeight || 0); - var vScroll = height > maxHeight; - - if (desiredHeight != this.desiredHeight || - this.$size.height != this.desiredHeight || vScroll != this.$vScroll) { - if (vScroll != this.$vScroll) { - this.$vScroll = vScroll; - this.scrollBarV.setVisible(vScroll); - } - - var w = this.container.clientWidth; - this.container.style.height = desiredHeight + "px"; - this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight); - // this.$loop.changes = 0; - this.desiredHeight = desiredHeight; - - this._signal("autosize"); - } - }; - - this.$computeLayerConfig = function() { - if (this.$maxLines && this.lineHeight > 1) - this.$autosize(); - - var session = this.session; - var size = this.$size; - - var hideScrollbars = size.height <= 2 * this.lineHeight; - var screenLines = this.session.getScreenLength(); - var maxHeight = screenLines * this.lineHeight; - - var offset = this.scrollTop % this.lineHeight; - var minHeight = size.scrollerHeight + this.lineHeight; - - var longestLine = this.$getLongestLine(); - - var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || - size.scrollerWidth - longestLine - 2 * this.$padding < 0); - - var hScrollChanged = this.$horizScroll !== horizScroll; - if (hScrollChanged) { - this.$horizScroll = horizScroll; - this.scrollBarH.setVisible(horizScroll); - } - - var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd - ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd - : 0; - maxHeight += scrollPastEnd; - - this.session.setScrollTop(Math.max(-this.scrollMargin.top, - Math.min(this.scrollTop, maxHeight - size.scrollerHeight + this.scrollMargin.bottom))); - - this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft, - longestLine + 2 * this.$padding - size.scrollerWidth + this.scrollMargin.right))); - - var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || - size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop); - var vScrollChanged = this.$vScroll !== vScroll; - if (vScrollChanged) { - this.$vScroll = vScroll; - this.scrollBarV.setVisible(vScroll); - } - - 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 = 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.getRowLength(firstRow) * lineHeight; - - lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); - minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + - firstRowHeight; - - offset = this.scrollTop - firstRowScreen * lineHeight; - - var changes = 0; - if (this.layerConfig.width != longestLine) - changes = this.CHANGE_H_SCROLL; - // Horizontal scrollbar visibility may have changed, which changes - // the client height of the scroller - if (hScrollChanged || vScrollChanged) { - changes = this.$updateCachedSize(true, this.gutterWidth, size.width, size.height); - this._signal("scrollbarVisibilityChanged"); - if (vScrollChanged) - longestLine = this.$getLongestLine(); - } - - this.layerConfig = { - width : longestLine, - padding : this.$padding, - firstRow : firstRow, - firstRowScreen: firstRowScreen, - lastRow : lastRow, - lineHeight : lineHeight, - characterWidth : this.characterWidth, - minHeight : minHeight, - maxHeight : maxHeight, - offset : offset, - gutterOffset : Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)), - height : this.$size.scrollerHeight - }; - - // For debugging. - // console.log(JSON.stringify(this.layerConfig)); - - return changes; - }; - - this.$updateLines = function() { - var firstRow = this.$changedLines.firstRow; - var lastRow = this.$changedLines.lastRow; - this.$changedLines = null; - - var layerConfig = this.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); - return true; - }; - - this.$getLongestLine = function() { - var charCount = this.session.getScreenWidth(); - if (this.showInvisibles && !this.session.$useWrapMode) - charCount += 1; - - return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth)); - }; - - /** - * - * Schedules an update to all the front markers in the document. - **/ - this.updateFrontMarkers = function() { - this.$markerFront.setMarkers(this.session.getMarkers(true)); - this.$loop.schedule(this.CHANGE_MARKER_FRONT); - }; - - /** - * - * Schedules an update to all the back markers in the document. - **/ - this.updateBackMarkers = function() { - this.$markerBack.setMarkers(this.session.getMarkers()); - this.$loop.schedule(this.CHANGE_MARKER_BACK); - }; - - /** - * - * Deprecated; (moved to [[EditSession]]) - * @deprecated - **/ - this.addGutterDecoration = function(row, className){ - this.$gutterLayer.addGutterDecoration(row, className); - }; - - /** - * Deprecated; (moved to [[EditSession]]) - * @deprecated - **/ - this.removeGutterDecoration = function(row, className){ - this.$gutterLayer.removeGutterDecoration(row, className); - }; - - /** - * - * Redraw breakpoints. - **/ - this.updateBreakpoints = function(rows) { - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - /** - * - * Sets annotations for the gutter. - * @param {Array} annotations An array containing annotations - * - * - **/ - this.setAnnotations = function(annotations) { - this.$gutterLayer.setAnnotations(annotations); - this.$loop.schedule(this.CHANGE_GUTTER); - }; - - /** - * - * Updates the cursor icon. - **/ - this.updateCursor = function() { - this.$loop.schedule(this.CHANGE_CURSOR); - }; - - /** - * - * Hides the cursor icon. - **/ - this.hideCursor = function() { - this.$cursorLayer.hideCursor(); - }; - - /** - * - * Shows the cursor icon. - **/ - this.showCursor = function() { - this.$cursorLayer.showCursor(); - }; - - this.scrollSelectionIntoView = function(anchor, lead, offset) { - // first scroll anchor into view then scroll lead into view - this.scrollCursorIntoView(anchor, offset); - this.scrollCursorIntoView(lead, offset); - }; - - /** - * - * Scrolls the cursor into the first visibile area of the editor - **/ - this.scrollCursorIntoView = function(cursor, offset, $viewMargin) { - // the editor is not visible - if (this.$size.scrollerHeight === 0) - return; - - var pos = this.$cursorLayer.getPixelPosition(cursor); - - var left = pos.left; - var top = pos.top; - - var topMargin = $viewMargin && $viewMargin.top || 0; - var bottomMargin = $viewMargin && $viewMargin.bottom || 0; - - var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; - - if (scrollTop + topMargin > top) { - if (offset) - top -= offset * this.$size.scrollerHeight; - if (top === 0) - top = -this.scrollMargin.top; - this.session.setScrollTop(top); - } else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) { - if (offset) - top += offset * this.$size.scrollerHeight; - this.session.setScrollTop(top + this.lineHeight - this.$size.scrollerHeight); - } - - var scrollLeft = this.scrollLeft; - - if (scrollLeft > left) { - if (left < this.$padding + 2 * this.layerConfig.characterWidth) - left = -this.scrollMargin.left; - this.session.setScrollLeft(left); - } else if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { - this.session.setScrollLeft(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); - } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) { - this.session.setScrollLeft(0); - } - }; - - /** - * {:EditSession.getScrollTop} - * @related EditSession.getScrollTop - * @returns {Number} - **/ - this.getScrollTop = function() { - return this.session.getScrollTop(); - }; - - /** - * {:EditSession.getScrollLeft} - * @related EditSession.getScrollLeft - * @returns {Number} - **/ - this.getScrollLeft = function() { - return this.session.getScrollLeft(); - }; - - /** - * - * Returns the first visible row, regardless of whether it's fully visible or not. - * @returns {Number} - **/ - this.getScrollTopRow = function() { - return this.scrollTop / this.lineHeight; - }; - - /** - * - * Returns the last visible row, regardless of whether it's fully visible or not. - * @returns {Number} - **/ - this.getScrollBottomRow = function() { - return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); - }; - - /** - * Gracefully scrolls from the top of the editor to the row indicated. - * @param {Number} row A row id - * - * - * @related EditSession.setScrollTop - **/ - this.scrollToRow = function(row) { - this.session.setScrollTop(row * this.lineHeight); - }; - - this.alignCursor = function(cursor, alignment) { - if (typeof cursor == "number") - cursor = {row: cursor, column: 0}; - - var pos = this.$cursorLayer.getPixelPosition(cursor); - var h = this.$size.scrollerHeight - this.lineHeight; - var offset = pos.top - h * (alignment || 0); - - this.session.setScrollTop(offset); - return offset; - }; - - this.STEPS = 8; - this.$calcSteps = function(fromValue, toValue){ - var i = 0; - var l = this.STEPS; - var steps = []; - - var func = function(t, x_min, dx) { - return dx * (Math.pow(t - 1, 3) + 1) + x_min; - }; - - for (i = 0; i < l; ++i) - steps.push(func(i / this.STEPS, fromValue, toValue - fromValue)); - - return steps; - }; - - /** - * Gracefully scrolls the editor to the row indicated. - * @param {Number} line A line number - * @param {Boolean} center If `true`, centers the editor the to indicated line - * @param {Boolean} animate If `true` animates scrolling - * @param {Function} callback Function to be called after the animation has finished - * - * - **/ - this.scrollToLine = function(line, center, animate, callback) { - var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); - var offset = pos.top; - if (center) - offset -= this.$size.scrollerHeight / 2; - - var initialScroll = this.scrollTop; - this.session.setScrollTop(offset); - if (animate !== false) - this.animateScrolling(initialScroll, callback); - }; - - this.animateScrolling = function(fromValue, callback) { - var toValue = this.scrollTop; - if (!this.$animatedScroll) - return; - var _self = this; - - if (fromValue == toValue) - return; - - if (this.$scrollAnimation) { - var oldSteps = this.$scrollAnimation.steps; - if (oldSteps.length) { - fromValue = oldSteps[0]; - if (fromValue == toValue) - return; - } - } - - var steps = _self.$calcSteps(fromValue, toValue); - this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; - - clearInterval(this.$timer); - - _self.session.setScrollTop(steps.shift()); - // trick session to think it's already scrolled to not loose toValue - _self.session.$scrollTop = toValue; - this.$timer = setInterval(function() { - if (steps.length) { - _self.session.setScrollTop(steps.shift()); - _self.session.$scrollTop = toValue; - } else if (toValue != null) { - _self.session.$scrollTop = -1; - _self.session.setScrollTop(toValue); - toValue = null; - } else { - // do this on separate step to not get spurious scroll event from scrollbar - _self.$timer = clearInterval(_self.$timer); - _self.$scrollAnimation = null; - callback && callback(); - } - }, 10); - }; - - /** - * Scrolls the editor to the y pixel indicated. - * @param {Number} scrollTop The position to scroll to - * - * - * @returns {Number} - **/ - this.scrollToY = function(scrollTop) { - // after calling scrollBar.setScrollTop - // scrollbar sends us event with same scrollTop. ignore it - if (this.scrollTop !== scrollTop) { - this.$loop.schedule(this.CHANGE_SCROLL); - this.scrollTop = scrollTop; - } - }; - - /** - * Scrolls the editor across the x-axis to the pixel indicated. - * @param {Number} scrollLeft The position to scroll to - * - * - * @returns {Number} - **/ - this.scrollToX = function(scrollLeft) { - if (this.scrollLeft !== scrollLeft) - this.scrollLeft = scrollLeft; - this.$loop.schedule(this.CHANGE_H_SCROLL); - }; - - /** - * Scrolls the editor across both x- and y-axes. - * @param {Number} x The x value to scroll to - * @param {Number} y The y value to scroll to - **/ - this.scrollTo = function(x, y) { - this.session.setScrollTop(y); - this.session.setScrollLeft(y); - }; - - /** - * Scrolls the editor across both x- and y-axes. - * @param {Number} deltaX The x value to scroll by - * @param {Number} deltaY The y value to scroll by - **/ - this.scrollBy = function(deltaX, deltaY) { - deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY); - deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX); - }; - - /** - * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line. - * @param {Number} deltaX The x value to scroll by - * @param {Number} deltaY The y value to scroll by - * - * - * @returns {Boolean} - **/ - this.isScrollableBy = function(deltaX, deltaY) { - if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) - return true; - if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) - return true; - if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) - return true; - if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - - this.layerConfig.width < -1 + this.scrollMargin.right) - return true; - }; - - this.pixelToScreenCoordinates = function(x, y) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var offset = (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth; - var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight); - var col = Math.round(offset); - - return {row: row, column: col, side: offset - col > 0 ? 1 : -1}; - }; - - this.screenToTextCoordinates = function(x, y) { - var canvasPos = this.scroller.getBoundingClientRect(); - - var col = Math.round( - (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth - ); - - var row = (y + this.scrollTop - canvasPos.top) / this.lineHeight; - - return this.session.screenToDocumentPosition(row, Math.max(col, 0)); - }; - - /** - * Returns an object containing the `pageX` and `pageY` coordinates of the document position. - * @param {Number} row The document row position - * @param {Number} column The document column position - * - * - * - * @returns {Object} - **/ - 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.scrollLeft, - pageY: canvasPos.top + y - this.scrollTop - }; - }; - - /** - * - * Focuses the current container. - **/ - this.visualizeFocus = function() { - dom.addCssClass(this.container, "ace_focus"); - }; - - /** - * - * Blurs the current container. - **/ - this.visualizeBlur = function() { - dom.removeCssClass(this.container, "ace_focus"); - }; - - /** - * @param {Number} position - * - * @private - **/ - this.showComposition = function(position) { - if (!this.$composition) - this.$composition = { - keepTextAreaAtCursor: this.$keepTextAreaAtCursor, - cssText: this.textarea.style.cssText - }; - - this.$keepTextAreaAtCursor = true; - dom.addCssClass(this.textarea, "ace_composition"); - this.textarea.style.cssText = ""; - this.$moveTextAreaToCursor(); - }; - - /** - * @param {String} text A string of text to use - * - * Sets the inner text of the current composition to `text`. - **/ - this.setCompositionText = function(text) { - this.$moveTextAreaToCursor(); - }; - - /** - * - * Hides the current composition. - **/ - this.hideComposition = function() { - if (!this.$composition) - return; - - dom.removeCssClass(this.textarea, "ace_composition"); - this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor; - this.textarea.style.cssText = this.$composition.cssText; - this.$composition = null; - }; - - /** - * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} - * @param {String} theme The path to a theme - * @param {Function} cb optional callback - * - **/ - this.setTheme = function(theme, cb) { - var _self = this; - this.$themeId = theme; - _self._dispatchEvent('themeChange',{theme:theme}); - - if (!theme || typeof theme == "string") { - var moduleName = theme || this.$options.theme.initialValue; - config.loadModule(["theme", moduleName], afterLoad); - } else { - afterLoad(theme); - } - - function afterLoad(module) { - if (_self.$themeId != theme) - return cb && cb(); - if (!module.cssClass) - return; - dom.importCssString( - module.cssText, - module.cssClass, - _self.container.ownerDocument - ); - - if (_self.theme) - dom.removeCssClass(_self.container, _self.theme.cssClass); - - var padding = "padding" in module ? module.padding - : "padding" in (_self.theme || {}) ? 4 : _self.$padding; - if (_self.$padding && padding != _self.$padding) - _self.setPadding(padding); - - // this is kept only for backwards compatibility - _self.$theme = module.cssClass; - - _self.theme = module; - dom.addCssClass(_self.container, module.cssClass); - dom.setCssClass(_self.container, "ace_dark", module.isDark); - - // force re-measure of the gutter width - if (_self.$size) { - _self.$size.width = 0; - _self.$updateSizeAsync(); - } - - _self._dispatchEvent('themeLoaded', {theme:module}); - cb && cb(); - } - }; - - /** - * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} - * @returns {String} - **/ - this.getTheme = function() { - return this.$themeId; - }; - - // 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. - - /** - * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} - * @param {String} style A class name - * - **/ - this.setStyle = function(style, include) { - dom.setCssClass(this.container, style, include !== false); - }; - - /** - * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} - * @param {String} style A class name - * - **/ - this.unsetStyle = function(style) { - dom.removeCssClass(this.container, style); - }; - - this.setCursorStyle = function(style) { - if (this.scroller.style.cursor != style) - this.scroller.style.cursor = style; - }; - - /** - * @param {String} cursorStyle A css cursor style - * - **/ - this.setMouseCursor = function(cursorStyle) { - this.scroller.style.cursor = cursorStyle; - }; - - /** - * Destroys the text and cursor layers for this renderer. - **/ - this.destroy = function() { - this.$textLayer.destroy(); - this.$cursorLayer.destroy(); - }; - -}).call(VirtualRenderer.prototype); - - -config.defineOptions(VirtualRenderer.prototype, "renderer", { - animatedScroll: {initialValue: false}, - showInvisibles: { - set: function(value) { - if (this.$textLayer.setShowInvisibles(value)) - this.$loop.schedule(this.CHANGE_TEXT); - }, - initialValue: false - }, - showPrintMargin: { - set: function() { this.$updatePrintMargin(); }, - initialValue: true - }, - printMarginColumn: { - set: function() { this.$updatePrintMargin(); }, - initialValue: 80 - }, - printMargin: { - set: function(val) { - if (typeof val == "number") - this.$printMarginColumn = val; - this.$showPrintMargin = !!val; - this.$updatePrintMargin(); - }, - get: function() { - return this.$showPrintMargin && this.$printMarginColumn; - } - }, - showGutter: { - set: function(show){ - this.$gutter.style.display = show ? "block" : "none"; - this.$loop.schedule(this.CHANGE_FULL); - this.onGutterResize(); - }, - initialValue: true - }, - fadeFoldWidgets: { - set: function(show) { - dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show); - }, - initialValue: false - }, - showFoldWidgets: { - set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)}, - initialValue: true - }, - showLineNumbers: { - set: function(show) { - this.$gutterLayer.setShowLineNumbers(show); - this.$loop.schedule(this.CHANGE_GUTTER); - }, - initialValue: true - }, - displayIndentGuides: { - set: function(show) { - if (this.$textLayer.setDisplayIndentGuides(show)) - this.$loop.schedule(this.CHANGE_TEXT); - }, - initialValue: true - }, - highlightGutterLine: { - set: function(shouldHighlight) { - if (!this.$gutterLineHighlight) { - this.$gutterLineHighlight = dom.createElement("div"); - this.$gutterLineHighlight.className = "ace_gutter-active-line"; - this.$gutter.appendChild(this.$gutterLineHighlight); - return; - } - - this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none"; - // if cursorlayer have never been updated there's nothing on screen to update - if (this.$cursorLayer.$pixelPos) - this.$updateGutterLineHighlight(); - }, - initialValue: false, - value: true - }, - hScrollBarAlwaysVisible: { - set: function(val) { - if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: false - }, - vScrollBarAlwaysVisible: { - set: function(val) { - if (!this.$vScrollBarAlwaysVisible || !this.$vScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: false - }, - fontSize: { - set: function(size) { - if (typeof size == "number") - size = size + "px"; - this.container.style.fontSize = size; - this.updateFontSize(); - }, - initialValue: 12 - }, - fontFamily: { - set: function(name) { - this.container.style.fontFamily = name; - this.updateFontSize(); - } - }, - maxLines: { - set: function(val) { - this.updateFull(); - } - }, - minLines: { - set: function(val) { - this.updateFull(); - } - }, - scrollPastEnd: { - set: function(val) { - val = +val || 0; - if (this.$scrollPastEnd == val) - return; - this.$scrollPastEnd = val; - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: 0, - handlesSet: true - }, - fixedWidthGutter: { - set: function(val) { - this.$gutterLayer.$fixedWidth = !!val; - this.$loop.schedule(this.CHANGE_GUTTER); - } - }, - theme: { - set: function(val) { this.setTheme(val) }, - get: function() { return this.$themeId || this.theme; }, - initialValue: "./theme/textmate", - handlesSet: true - } -}); - -exports.VirtualRenderer = VirtualRenderer; -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js deleted file mode 100644 index e8a8fcbd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +++ /dev/null @@ -1,86 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("./test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./edit_session").EditSession; -var VirtualRenderer = require("./virtual_renderer").VirtualRenderer; -var assert = require("./test/assertions"); - -module.exports = { - "test: screen2text the column should be rounded to the next character edge" : function() { - var el = document.createElement("div"); - - if (!el.getBoundingClientRect) { - console.log("Skipping test: This test only runs in the browser"); - return; - } - - el.style.left = "20px"; - el.style.top = "30px"; - el.style.width = "300px"; - el.style.height = "100px"; - document.body.appendChild(el); - - var renderer = new VirtualRenderer(el); - renderer.setPadding(0); - renderer.setSession(new EditSession("1234")); - - var r = renderer.scroller.getBoundingClientRect(); - function testPixelToText(x, y, row, column) { - assert.position(renderer.screenToTextCoordinates(x+r.left, y+r.top), row, column); - } - - renderer.characterWidth = 10; - renderer.lineHeight = 15; - - testPixelToText(4, 0, 0, 0); - testPixelToText(5, 0, 0, 1); - testPixelToText(9, 0, 0, 1); - testPixelToText(10, 0, 0, 1); - testPixelToText(14, 0, 0, 1); - testPixelToText(15, 0, 0, 2); - document.body.removeChild(el); - } - - // change tab size after setDocument (for text layer) -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js deleted file mode 100644 index 7a3318fb..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +++ /dev/null @@ -1,49 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var Document = require("../document").Document; -var lang = require("../lib/lang"); - -var Mirror = exports.Mirror = function(sender) { - this.sender = sender; - var doc = this.doc = new Document(""); - - var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); - - var _self = this; - sender.on("change", function(e) { - doc.applyDeltas(e.data); - if (_self.$timeout) - return deferredUpdate.schedule(_self.$timeout); - _self.onUpdate(); - }); -}; - -(function() { - - this.$timeout = 500; - - this.setTimeout = function(timeout) { - this.$timeout = timeout; - }; - - this.setValue = function(value) { - this.doc.setValue(value); - this.deferredUpdate.schedule(this.$timeout); - }; - - this.getValue = function(callbackId) { - this.sender.callback(this.doc.getValue(), callbackId); - }; - - this.onUpdate = function() { - // abstract method - }; - - this.isPending = function() { - return this.deferredUpdate.isPending(); - }; - -}).call(Mirror.prototype); - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js deleted file mode 100644 index 928000dd..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +++ /dev/null @@ -1,193 +0,0 @@ -"no use strict"; -;(function(window) { -if (typeof window.window != "undefined" && window.document) { - return; -} - -window.console = function() { - var msgs = Array.prototype.slice.call(arguments, 0); - postMessage({type: "log", data: msgs}); -}; -window.console.error = -window.console.warn = -window.console.log = -window.console.trace = window.console; - -window.window = window; -window.ace = window; - -window.onerror = function(message, file, line, col, err) { - postMessage({type: "error", data: { - message: message, - file: file, - line: line, - col: col, - stack: err.stack - }}); -}; - -window.normalizeModule = function(parentId, moduleName) { - // normalize plugin requires - if (moduleName.indexOf("!") !== -1) { - var chunks = moduleName.split("!"); - return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); - } - // normalize relative requires - if (moduleName.charAt(0) == ".") { - var base = parentId.split("/").slice(0, -1).join("/"); - moduleName = (base ? base + "/" : "") + moduleName; - - while(moduleName.indexOf(".") !== -1 && previous != moduleName) { - var previous = moduleName; - moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); - } - } - - return moduleName; -}; - -window.require = function(parentId, id) { - if (!id) { - id = parentId; - parentId = null; - } - if (!id.charAt) - throw new Error("worker.js require() accepts only (parentId, id) as arguments"); - - id = window.normalizeModule(parentId, id); - - var module = window.require.modules[id]; - if (module) { - if (!module.initialized) { - module.initialized = true; - module.exports = module.factory().exports; - } - return module.exports; - } - - var chunks = id.split("/"); - if (!window.require.tlns) - return console.log("unable to load " + id); - chunks[0] = window.require.tlns[chunks[0]] || chunks[0]; - var path = chunks.join("/") + ".js"; - - window.require.id = id; - importScripts(path); - return window.require(parentId, id); -}; -window.require.modules = {}; -window.require.tlns = {}; - -window.define = function(id, deps, factory) { - if (arguments.length == 2) { - factory = deps; - if (typeof id != "string") { - deps = id; - id = window.require.id; - } - } else if (arguments.length == 1) { - factory = id; - deps = []; - id = window.require.id; - } - - if (typeof factory != "function") { - window.require.modules[id] = { - exports: factory, - initialized: true - }; - return; - } - - if (!deps.length) - // If there is no dependencies, we inject 'require', 'exports' and - // 'module' as dependencies, to provide CommonJS compatibility. - deps = ['require', 'exports', 'module']; - - var req = function(childId) { - return window.require(id, childId); - }; - - window.require.modules[id] = { - exports: {}, - factory: function() { - var module = this; - var returnExports = factory.apply(this, deps.map(function(dep) { - switch(dep) { - // Because 'require', 'exports' and 'module' aren't actual - // dependencies, we must handle them seperately. - case 'require': return req; - case 'exports': return module.exports; - case 'module': return module; - // But for all other dependencies, we can just go ahead and - // require them. - default: return req(dep); - } - })); - if (returnExports) - module.exports = returnExports; - return module; - } - }; -}; -window.define.amd = {}; - -window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { - require.tlns = topLevelNamespaces; -}; - -window.initSender = function initSender() { - - var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; - var oop = window.require("ace/lib/oop"); - - var Sender = function() {}; - - (function() { - - oop.implement(this, EventEmitter); - - this.callback = function(data, callbackId) { - postMessage({ - type: "call", - id: callbackId, - data: data - }); - }; - - this.emit = function(name, data) { - postMessage({ - type: "event", - name: name, - data: data - }); - }; - - }).call(Sender.prototype); - - return new Sender(); -}; - -var main = window.main = null; -var sender = window.sender = null; - -window.onmessage = function(e) { - var msg = e.data; - if (msg.command) { - if (main[msg.command]) - main[msg.command].apply(main, msg.args); - else - throw new Error("Unknown command:" + msg.command); - } - else if (msg.init) { - initBaseUrls(msg.tlns); - require("ace/lib/es5-shim"); - sender = window.sender = initSender(); - var clazz = require(msg.module)[msg.classname]; - main = window.main = new clazz(sender); - } - else if (msg.event && sender) { - sender._signal(msg.event, msg.data); - } -}; -})(this); \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js deleted file mode 100644 index ad445287..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +++ /dev/null @@ -1,255 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var net = require("../lib/net"); -var EventEmitter = require("../lib/event_emitter").EventEmitter; -var config = require("../config"); - -var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { - this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); - this.changeListener = this.changeListener.bind(this); - this.onMessage = this.onMessage.bind(this); - - // nameToUrl is renamed to toUrl in requirejs 2 - if (require.nameToUrl && !require.toUrl) - require.toUrl = require.nameToUrl; - - if (config.get("packaged") || !require.toUrl) { - workerUrl = workerUrl || config.moduleUrl(mod, "worker"); - } else { - var normalizePath = this.$normalizePath; - workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_")); - - var tlns = {}; - topLevelNamespaces.forEach(function(ns) { - tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, "")); - }); - } - - try { - this.$worker = new Worker(workerUrl); - } catch(e) { - if (e instanceof window.DOMException) { - // Likely same origin problem. Use importScripts from a shim Worker - var blob = this.$workerBlob(workerUrl); - var URL = window.URL || window.webkitURL; - var blobURL = URL.createObjectURL(blob); - - this.$worker = new Worker(blobURL); - URL.revokeObjectURL(blobURL); - } else { - throw e; - } - } - this.$worker.postMessage({ - init : true, - tlns : tlns, - module : mod, - classname : classname - }); - - this.callbackId = 1; - this.callbacks = {}; - - this.$worker.onmessage = this.onMessage; -}; - -(function(){ - - oop.implement(this, EventEmitter); - - this.onMessage = function(e) { - var msg = e.data; - switch(msg.type) { - case "event": - this._signal(msg.name, {data: msg.data}); - break; - case "call": - var callback = this.callbacks[msg.id]; - if (callback) { - callback(msg.data); - delete this.callbacks[msg.id]; - } - break; - case "error": - this.reportError(msg.data); - break; - case "log": - window.console && console.log && console.log.apply(console, msg.data); - break; - } - }; - - this.reportError = function(err) { - window.console && console.error && console.error(err); - }; - - this.$normalizePath = function(path) { - return net.qualifyURL(path); - }; - - this.terminate = function() { - this._signal("terminate", {}); - this.deltaQueue = null; - this.$worker.terminate(); - this.$worker = null; - if (this.$doc) - this.$doc.off("change", this.changeListener); - this.$doc = null; - }; - - this.send = function(cmd, args) { - this.$worker.postMessage({command: cmd, args: args}); - }; - - this.call = function(cmd, args, callback) { - if (callback) { - var id = this.callbackId++; - this.callbacks[id] = callback; - args.push(id); - } - this.send(cmd, args); - }; - - this.emit = function(event, data) { - try { - // firefox refuses to clone objects which have function properties - // TODO: cleanup event - this.$worker.postMessage({event: event, data: {data: data.data}}); - } - catch(ex) { - console.error(ex.stack); - } - }; - - this.attachToDocument = function(doc) { - if(this.$doc) - this.terminate(); - - this.$doc = doc; - this.call("setValue", [doc.getValue()]); - doc.on("change", this.changeListener); - }; - - this.changeListener = function(e) { - if (!this.deltaQueue) { - this.deltaQueue = [e.data]; - setTimeout(this.$sendDeltaQueue, 0); - } else - this.deltaQueue.push(e.data); - }; - - this.$sendDeltaQueue = function() { - var q = this.deltaQueue; - if (!q) return; - this.deltaQueue = null; - if (q.length > 20 && q.length > this.$doc.getLength() >> 1) { - this.call("setValue", [this.$doc.getValue()]); - } else - this.emit("change", {data: q}); - }; - - this.$workerBlob = function(workerUrl) { - // workerUrl can be protocol relative - // importScripts only takes fully qualified urls - var script = "importScripts('" + net.qualifyURL(workerUrl) + "');"; - try { - return new Blob([script], {"type": "application/javascript"}); - } catch (e) { // Backwards-compatibility - var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; - var blobBuilder = new BlobBuilder(); - blobBuilder.append(script); - return blobBuilder.getBlob("application/javascript"); - } - }; - -}).call(WorkerClient.prototype); - - -var UIWorkerClient = function(topLevelNamespaces, mod, classname) { - this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); - this.changeListener = this.changeListener.bind(this); - this.callbackId = 1; - this.callbacks = {}; - this.messageBuffer = []; - - var main = null; - var emitSync = false; - var sender = Object.create(EventEmitter); - var _self = this; - - this.$worker = {}; - this.$worker.terminate = function() {}; - this.$worker.postMessage = function(e) { - _self.messageBuffer.push(e); - if (main) { - if (emitSync) - setTimeout(processNext); - else - processNext(); - } - }; - this.setEmitSync = function(val) { emitSync = val }; - - var processNext = function() { - var msg = _self.messageBuffer.shift(); - if (msg.command) - main[msg.command].apply(main, msg.args); - else if (msg.event) - sender._signal(msg.event, msg.data); - }; - - sender.postMessage = function(msg) { - _self.onMessage({data: msg}); - }; - sender.callback = function(data, callbackId) { - this.postMessage({type: "call", id: callbackId, data: data}); - }; - sender.emit = function(name, data) { - this.postMessage({type: "event", name: name, data: data}); - }; - - config.loadModule(["worker", mod], function(Main) { - main = new Main[classname](sender); - while (_self.messageBuffer.length) - processNext(); - }); -}; - -UIWorkerClient.prototype = WorkerClient.prototype; - -exports.UIWorkerClient = UIWorkerClient; -exports.WorkerClient = WorkerClient; - -}); diff --git a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_test.js deleted file mode 100644 index c0a5b0a7..00000000 --- a/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_test.js +++ /dev/null @@ -1,125 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -// The loading of ace/worker/worker is complicated, because when we need to load -// it via RequireJS, it needs a shim to make it into a AMD-module. -// When using the AMD-loader it's just works, so we just it load the file now - -require("amd-loader"); - -define(function(require, exports, module) { -"use strict"; - -var assert = require("../test/assertions"); -var worker = require("./worker") - -module.exports = { - setUp : function() { - // And define a few mock dependency modules - worker.define("depA", [], function(require, exports, module) { - module.exports = 'dependency A'; - }) - worker.define("depB", [], function(require, exports, module) { - module.exports = 'dependency B'; - }) - }, - - "test: define() with no dependencies, and CommonJS-compatability require()-calls" : function() { - // We want to be able to call define without an id or deps, but - // since we aren't loading an external file, we must explicitly give - // it some kind of id, in this case 'test1'. - worker.require.id = 'test1'; - // Now define out module - worker.define(function(require, exports, module) { - var depA = require("depA"); - var depB = require("depB"); - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - module.exports = 'test 1'; - }) - // And then try and require it - var res = worker.require("test1") - assert.equal("test 1", res) - }, - "test: define() with dependencies" : function() { - // We want to be able to call define without an id, but since we aren't - // loading an external file, we must explicitly give it some kind of - // id, in this case 'test2'. - worker.require.id = 'test2'; - // Now define our module - worker.define(['depA', 'depB'], function(depA, depB) { - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - return 'test 2'; - }) - // And then try and require it - var res = worker.require("test2"); - assert.equal("test 2", res); - }, - "test: define() used require, exports and module as a dependency": function() { - // We want to be able to call define without an id, but since we aren't - // loading an external file, we must explicitly give it some kind of - // id, in this case 'test3'. - worker.require.id = 'test3'; - // Now define our module - worker.define(['require', 'exports', 'module', 'depA', 'depB'], function(require, exports, module) { - var depA = require("depA"); - var depB = require("depB"); - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - module.exports = 'test 3'; - }) - // And then try and require it - var res = worker.require("test3"); - assert.equal("test 3", res); - }, - "test: define() with a mix of require and actual dependecies": function() { - // We want to be able to call define without an id, but since we aren't - // loading an external file, we must explicitly give it some kind of - // id, in this case 'test4'. - worker.require.id = 'test4'; - // Now define our module - worker.define(['depA', 'require'], function(depA, require) { - var depB = require("depB"); - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - return 'test 4'; - }) - // And then try and require it - var res = worker.require("test4"); - assert.equal("test 4", res); - } -} - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js b/lib/gollum/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js deleted file mode 100644 index 702954d4..00000000 --- a/lib/gollum/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(window,undefined){"$:nomunge";var $=window.jQuery||window.Cowboy||(window.Cowboy={}),jq_throttle;$.throttle=jq_throttle=function(delay,no_trailing,callback,debounce_mode){var timeout_id,last_exec=0;if(typeof no_trailing!=="boolean"){debounce_mode=callback;callback=no_trailing;no_trailing=undefined}function wrapper(){var that=this,elapsed=+new Date-last_exec,args=arguments;function exec(){last_exec=+new Date;callback.apply(that,args)}function clear(){timeout_id=undefined}if(debounce_mode&& -!timeout_id)exec();timeout_id&&clearTimeout(timeout_id);if(debounce_mode===undefined&&elapsed>delay)exec();else if(no_trailing!==true)timeout_id=setTimeout(debounce_mode?clear:exec,debounce_mode===undefined?delay-elapsed:delay)}if($.guid)wrapper.guid=callback.guid=callback.guid||$.guid++;return wrapper};$.debounce=function(delay,at_begin,callback){return callback===undefined?jq_throttle(delay,at_begin,false):jq_throttle(delay,callback,at_begin!==false)}})(this); diff --git a/lib/gollum/public/gollum/livepreview/js/livepreview.js b/lib/gollum/public/gollum/livepreview/js/livepreview.js deleted file mode 100644 index 60280d93..00000000 --- a/lib/gollum/public/gollum/livepreview/js/livepreview.js +++ /dev/null @@ -1,530 +0,0 @@ -require([ 'ace/undomanager', 'ace/ext/static_highlight', 'ace/theme/github', 'ace/editor', 'ace/virtual_renderer', 'ace/mode/markdown', 'ace/theme/twilight', -'ace/mode/c_cpp', 'ace/mode/clojure', 'ace/mode/coffee', 'ace/mode/coldfusion', 'ace/mode/csharp', 'ace/mode/css', 'ace/mode/diff', 'ace/mode/golang', 'ace/mode/groovy', 'ace/mode/haxe', 'ace/mode/html', 'ace/mode/java', 'ace/mode/javascript', 'ace/mode/json', 'ace/mode/latex', 'ace/mode/less', 'ace/mode/liquid', 'ace/mode/lua', 'ace/mode/markdown', 'ace/mode/ocaml', 'ace/mode/perl', 'ace/mode/pgsql', 'ace/mode/php', 'ace/mode/powershell', 'ace/mode/python', 'ace/mode/ruby', 'ace/mode/scad', 'ace/mode/scala', 'ace/mode/scss', 'ace/mode/sh', 'ace/mode/sql', 'ace/mode/svg', 'ace/mode/textile', 'ace/mode/text', 'ace/mode/xml', 'ace/mode/xquery', 'ace/mode/yaml' -], function() { -var UndoManager = require("ace/undomanager").UndoManager; -var Renderer = require( 'ace/virtual_renderer' ).VirtualRenderer; -var Editor = require( 'ace/editor' ).Editor; -var dom = require( 'ace/lib/dom' ); - -var win = window; -var location = win.location; -var doc = document; - -win.onbeforeunload = function() { return 'Leaving Live Preview will discard all edits!' }; - -var editor = new Editor( new Renderer( doc.getElementById( 'editor' ) ));//ace.edit( 'editor' ); -var editorSession = editor.getSession(); -$.editorSession = editorSession; // for testing -var editorContainer = editor.container; -var preview = doc.getElementById( 'previewframe' ); -var content = doc.getElementById( 'contentframe' ); -var toolPanel = doc.getElementById( 'toolpanel' ); -var comment = doc.getElementById( 'comment' ); -var commentToolPanel = doc.getElementById( 'commenttoolpanel' ); -// dim the page -var darkness = doc.getElementById( 'darkness' ); - -var leftRight = true; -var jsm = {}; // JavaScript Markdown -win.jsm = jsm; -win.jsm.toggleLeftRight = function() { - leftRight = leftRight === false ? true : false; - jsm.resize(); -} - -var MarkdownMode = require( 'ace/mode/markdown' ).Mode; - -function initAce( editor, editorSession ) { - editorSession.setUndoManager(new UndoManager()); - editorSession.setMode( new MarkdownMode() ); - // Gutter shows line numbers - editor.renderer.setShowGutter( true ); - editor.renderer.setHScrollBarAlwaysVisible( false ); - editorSession.setUseSoftTabs( true ); - editorSession.setTabSize( 2 ); - editorSession.setUseWrapMode( true ); - editor.setShowPrintMargin( false ); - editor.setBehavioursEnabled( true ); - if ( win.initAce ) { - win.initAce(editor, editorSession); - } else { - editor.setTheme( 'ace/theme/twilight' ); - } -} - -initAce( editor, editorSession ); - -// Setup comment ace. -var commentEditor = new Editor( new Renderer( doc.getElementById( 'comment' ) ));//ace.edit( 'comment' ); -var commentEditorSession = commentEditor.getSession(); -$.commentSession = commentEditorSession; // for testing -var commentEditorContainer = commentEditor.container; - -initAce( commentEditor, commentEditorSession ); - -// Find the app's base url, knowing we are in /livepreview/index.html -var baseUrl = location.pathname.split('/').slice(0,-2).join('/'); - -// RegExp from http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript -// Returns value on success and undefined on failure. -$.key = function( key ) { - var value = new RegExp( '[\\?&]' + key + '=([^&#]*)' ).exec( location.href ); - return ( !value ) ? undefined : value[ 1 ] || undefined; -} - -// True if &create=true -var create = $.key( 'create' ); -// The path and name of the page being edited. -var pageName = $.key( 'page' ); -var pathName = $.key( 'path' ); - -defaultCommitMessage = function() { - var msg = pageName + ' (markdown)'; - - if (create) { - return 'Created ' + msg; - } else { - return 'Updated ' + msg; - } -} - -// Set comment using the default commit message. -commentEditorSession.setValue( defaultCommitMessage() ); - -$.preview = function( previewWindow ) { - jQuery.ajax( { - type: 'POST', - url: baseUrl + '/preview', - data: { page: 'Preview: ' + pageName, format: 'markdown', content: editorSession.getValue() }, - success: function( html ) { - previewWindow.document.write( html ); - previewWindow.focus(); - } - }); -} - -$.save = function( commitMessage ) { - win.onbeforeunload = null; - - var POST = 'POST'; - var markdown = 'markdown'; - var txt = editorSession.getValue(); - var msg = defaultCommitMessage(); - var newLocation = baseUrl; - - // Remove all duplicate slashes - function clean( str ) { - return str.replace(/\/+/g, '/'); - } - - // 'a%2Fb' => a/b - if ( pathName ) { - pathName = unescape( pathName ); - newLocation += '/' + pathName; - pathName = pathName + '/'; // pathName must end with / - - pathName = clean( pathName ); - } - - newLocation += '/' + pageName; - newLocation = clean( newLocation ); - - // if &create=true then handle create instead of edit. - if ( create ) { - jQuery.ajax( { - type: POST, - url: baseUrl + '/create', - data: { path: pathName, page: pageName, format: markdown, content: txt, message: commitMessage || msg }, - success: function() { - win.location = newLocation; - } - }); - } else { - jQuery.ajax( { - type: POST, - url: baseUrl + '/edit/' + pageName, - data: { path: pathName, page: pageName, format: markdown, content: txt, message: commitMessage || msg }, - success: function() { - win.location = newLocation; - } - }); - } // end else -} - -var elapsedTime; -var oldInputText = ''; - -// ---- from Markdown.Editor -var timeout; - -var nonSuckyBrowserPreviewSet = function( text ) { - content.innerHTML = text; -} - -// IE doesn't let you use innerHTML if the element is contained somewhere in a table -// (which is the case for inline editing) -- in that case, detach the element, set the -// value, and reattach. Yes, that *is* ridiculous. -var ieSafePreviewSet = function( text ) { - var parent = content.parentNode; - var sibling = content.nextSibling; - parent.removeChild( content ); - content.innerHTML = text; - if ( !sibling ) - parent.appendChild( content ); - else - parent.insertBefore( content, sibling ); -} - -var cssTextSet = function( element, css ){ - element.style.cssText = css; -} - -var cssAttrSet = function( element, css ){ - element.setAttribute( 'style', css ); -} - -/* - Redefine the function based on browser support. - element - the element to set the css on - css - a fully formed css string. ex: 'top: 0; left: 0;' - - Avoid reflow by batching CSS changes. - http://dev.opera.com/articles/view/efficient-javascript/?page=3#stylechanges -*/ -var cssSet = function( element, css ) { - if( typeof( element.style.cssText ) != 'undefined' ) { - cssTextSet( element, css ); - cssSet = cssTextSet; - } else { - cssAttrSet( element, css ); - cssSet = cssAttrSet; - } -} - -var previewSet = function( text ) { - try { - nonSuckyBrowserPreviewSet( text ); - previewSet = nonSuckyBrowserPreviewSet; - } catch ( e ) { - ieSafePreviewSet( text ); - previewSet = ieSafePreviewSet; - } -}; - -// See pygmentsLanguageToAceMode for pygment to ace mode translations. -// TODO: Update languages and translation once Ace is upgraded to v1.0. -var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee', - 'coffeescript', 'coldfusion', 'csharp', 'css', 'diff', 'golang', - 'groovy', 'haxe', 'html', 'java', 'javascript', 'json', 'latex', - 'less', 'liquid', 'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php', - 'powershell', 'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql', - 'svg', 'textile', 'text', 'xml', 'xquery', 'yaml' ]; - -var staticHighlight = require( 'ace/ext/static_highlight' ); -var githubTheme = require( 'ace/theme/github' ); -var langModes = {}; - -(function() { -var languagesLength = languages.length; -for ( var a = 0; a < languagesLength; a++ ) { - var name = languages[ a ]; - langModes[ name ] = false; -} -})(); - -function getLang( language ) { - var mode = langModes[ language ]; - - if ( mode ) { - return mode; - } - - // require.Mode must be wrapped in parens. - mode = new ( require( 'ace/mode/' + language ).Mode )(); - - return mode; -} - -function highlight( element, language ) { - // Highlighting requires .innerText not - // .innerHTML. It's the difference between - // '>' and '>'. - // Firefox does not support innerText. - var data = element.innerText || element.textContent; - data = data.trim(); - var mode = getLang( language ); - // input, mode, theme, lineStart, disableGutter - var color = staticHighlight.render( data, mode, githubTheme, 1, true ); - - var newDiv = doc.createElement('div'); - newDiv.innerHTML = color.html; - element.parentNode.parentNode.replaceChild( newDiv, element.parentNode ); -} - -// Pygments and Ace have different names for languages. -function pygmentsLanguageToAceMode( declaredLanguage ) { - declaredLanguage = declaredLanguage.toLowerCase(); - - switch ( declaredLanguage ) { - case 'bash': - return 'sh'; - case 'c': - case 'c++': - case 'cpp': - case 'objective-c': - return 'c_cpp'; - case 'c#': - return 'csharp'; - case 'coffeescript': - return 'coffee'; - case 'html+erb': - return 'html' - } - - // Assume language name is the same - // if it's not handled above. - return declaredLanguage; -} - -var makePreviewHtml = function () { - var text = editorSession.getValue(); - - if ( text == undefined || text == '' ) { - previewSet( '' ); - return; - } - - if (text && text == oldInputText) { - return; // Input text hasn't changed. - } - else { - oldInputText = text; - } - - var prevTime = new Date().getTime(); - // Handle gollum file code insertion syntax. - text = text.replace(/^[ \t]*``` ?([^:\n\r]+:[^`\n\r]+)```/gm, '``$1``'); - text = md_to_html( text ); - - // Calculate the processing time of the HTML creation. - // It's used as the delay time in the event listener. - var currTime = new Date().getTime(); - elapsedTime = currTime - prevTime; - - // Update the text using feature detection to support IE. - // preview.innerHTML = text; // this doesn't work on IE. - previewSet( text ); - - if (win.MathJax) { - win.MathJax.Hub.Queue(['Typeset', win.MathJax.Hub, 'contentframe']); - } - - // highlight code blocks. - var codeElements = preview.getElementsByTagName( 'pre' ); - var codeElementsLength = codeElements.length; - var skipped = 0; - - if ( codeElementsLength > 0 ) { - for ( var idx = 0; idx < codeElementsLength; idx++ ) { - // highlight removes an element so 0 is always the correct index. - // Skipped tags are not removed so they must be added. - var element = codeElements[ 0 + skipped ].firstChild; - if ( element == undefined ) { - skipped++; - continue; - } - var codeHTML = element.innerHTML; - if ( codeHTML == undefined ) { - skipped++; - continue; - } - var txt = codeHTML.split( /\b/ ); - // the syntax for code highlighting means all code, even one line, contains newlines. - if ( txt.length > 1 && codeHTML.match( /\n/ ) ) { - var declaredLanguage = element.className.toLowerCase(); - var aceMode = pygmentsLanguageToAceMode( declaredLanguage ); - - if ( $.inArray( declaredLanguage, languages ) === -1 ) { - // Unsupported language. - skipped++; - continue; - } - // highlight: element - highlight( element, aceMode ); - } else { - // Highlighting is not for `code` inline syntax. For example `puts "string"`. - skipped++; - } - } - } -}; - -// setTimeout is already used. Used as an event listener. -var applyTimeout = function () { - if ( timeout ) { - clearTimeout(timeout); - timeout = undefined; - } - - // 3 second max delay - if ( elapsedTime > 3000 ) { - elapsedTime = 3000; - } - - timeout = setTimeout( makePreviewHtml, elapsedTime ); -}; - - /* Load markdown from /data/page into the ace editor. - ~-1 == false; !~-1 == true; - */ - if ( !~ location.host.indexOf( 'github.com' ) ) { - - // returns unescaped key with leading slashes removed - function key_no_leading_slash( key ) { - return unescape( $.key( key ) || '' ).replace( /^\/+/, '' ); - } - - // ensure leading / is removed from path and that it ends with / - var path = key_no_leading_slash( 'path' ); - // don't append '/' if path is empty from removing leading slash - if ( path !== '' && path.charAt( path.length - 1 ) !== '/' ) { - path += '/'; - } - - jQuery.ajax( { - type: 'GET', - url: baseUrl + '/data/' + path + key_no_leading_slash( 'page' ), - cache: false, - success: function( data ) { - editorSession.setValue( data ); - } - }); - } - - $( '#preview' ).click( function() { - $(this).target = "_blank"; - // pass window into preview - $.preview( window.open() ); - return false; - }); - - $( '#save' ).click( function() { - $.save(); - return false; - }); - - // Hide dimmer, comment tool panel, and comment. - $( '#commentcancel' ).click( function() { - // Restore focus on commentcancel but not on - // savecommentconfirm because the latter loads - // a new page. - hideCommentWindow(); - editor.focus(); - }); - - var isCommentHidden = true; - - // var style = darkness.style.visibility will not update visibility. - var darknessStyle = darkness.style; - var commentToolPanelStyle = commentToolPanel.style; - var commentStyle = comment.style; - - function hideCommentWindow() { - isCommentHidden = true; - darknessStyle.visibility = - commentToolPanelStyle.visibility = - commentStyle.visibility = 'hidden'; - } - - // Show dimmer, comment tool panel, and comment. - $( '#savecomment' ).click( function() { - isCommentHidden = false; - darknessStyle.visibility = - commentToolPanelStyle.visibility = - commentStyle.visibility = 'visible'; - // Set focus so typing can begin immediately. - commentEditor.focus(); - }); - - $( '#savecommentconfirm' ).click( function() { - $.save( commentEditorSession.getValue() ); - hideCommentWindow(); - }); - - // onChange calls applyTimeout which rate limits the calling of makePreviewHtml based on render time. - editor.on( 'change', applyTimeout ); - makePreviewHtml(); // preview default text on load - - function resize() { - var width = $( win ).width(); - var widthHalf = width / 2; - var widthFourth = widthHalf / 2; - var height = $( win ).height(); - var heightHalf = height / 2; - - // height minus 40 so the end of document text doesn't flow off the page. - var editorContainerStyle = 'width:' + widthHalf + 'px;' + - 'height:' + (height - 40) + 'px;' + - 'left:' + (leftRight === false ? widthHalf + 'px;' : '0px;') + - 'top:' + '40px;'; // use 40px for tool menu - cssSet( editorContainer, editorContainerStyle ); - editor.resize(); - - var previewStyle = 'width:' + widthHalf + 'px;' + - 'height:' + (height - 40) + 'px;' + - 'left:' + (leftRight === false ? '10px;' : widthHalf + 'px;') + - // preview panel top is equal to height of comment tool panel (40px) + 1 - 'top:41px;'; - cssSet( preview, previewStyle ); - - // Resize tool panel - var toolPanelStyle = 'width:50%;'; - cssSet( toolPanel, toolPanelStyle ); - - // Resize comment related elements. - var commentHidden = 'visibility:' + ( isCommentHidden === true ? 'hidden;' : 'visible;' ); - - // Adjust comment editor - var commentEditorContainerStyle = 'height:' + heightHalf + 'px;' + - 'width:' + widthHalf + 'px;' + - 'left:' + widthFourth + 'px;' + - 'top:' + (heightHalf / 2) + 'px;' + - commentHidden; - cssSet( commentEditorContainer, commentEditorContainerStyle ); - commentEditor.resize(); - - var commentToolPanelHeight = height / 4 - 40; - - // In top subtract height (40px) of comment tool panel. - var commentToolPanelStyle = 'width:' + widthHalf + 'px;' + - 'left:' + widthFourth + 'px;' + - 'top:' + commentToolPanelHeight + 'px;' + - commentHidden; - cssSet( commentToolPanel, commentToolPanelStyle ); - - // Resize dimmer. - var darknessStyle = 'width:' + width + 'px;' + - 'height:' + height + 'px;' + - commentHidden; - cssSet( darkness, darknessStyle ); - } - - win.jsm.resize = resize; - - // remove editor_bg after loading because - // it'll cause problems if toggle left right is used - var ebg = doc.getElementById('editor_bg'); - ebg.parentNode.removeChild(ebg); - - /* - Resize can be called an absurd amount of times - and will crash the page without debouncing. - http://benalman.com/projects/jquery-throttle-debounce-plugin/ - https://github.com/cowboy/jquery-throttle-debounce - http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ - */ - $( win ).resize( $.debounce( 100, resize ) ); - - // resize for the intial page load - resize(); -}); diff --git a/lib/gollum/public/gollum/livepreview/js/md_sundown.js b/lib/gollum/public/gollum/livepreview/js/md_sundown.js deleted file mode 100644 index 66579044..00000000 --- a/lib/gollum/public/gollum/livepreview/js/md_sundown.js +++ /dev/null @@ -1,22 +0,0 @@ -// Define one global function that renders markdown. -(function() { - // Grab functions from emscripten - var Pointer_stringify = Module.Pointer_stringify; - var _str_to_html = Module._str_to_html; - var malloc = Module._malloc; - var realloc = Module._realloc; - var writeStringToMemory = Module.writeStringToMemory; - var allocSize = 2048; - var pointer = malloc( allocSize ) ; - - window.md_to_html = function( text ) { - var textLength = text.length; - while ( textLength > allocSize ) { - allocSize <<= 1; // double - pointer = realloc( pointer, allocSize ); - } - - writeStringToMemory( text, pointer ); - return Pointer_stringify( _str_to_html( pointer ) ); - }; -})(); diff --git a/lib/gollum/public/gollum/livepreview/js/requirejs.min.js b/lib/gollum/public/gollum/livepreview/js/requirejs.min.js deleted file mode 100644 index 4e0dea6d..00000000 --- a/lib/gollum/public/gollum/livepreview/js/requirejs.min.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - RequireJS 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. - Available via the MIT or new BSD license. - see: http://github.com/jrburke/requirejs for details -*/ -var requirejs,require,define; -(function(Y){function x(b){return J.call(b)==="[object Function]"}function G(b){return J.call(b)==="[object Array]"}function q(b,c){if(b){var e;for(e=0;e-1;e-=1)if(b[e]&&c(b[e],e,b))break}}function y(b,c){for(var e in b)if(b.hasOwnProperty(e)&&c(b[e],e))break}function K(b,c,e,i){c&&y(c,function(c,j){if(e||!b.hasOwnProperty(j))i&&typeof c!=="string"?(b[j]||(b[j]={}),K(b[j],c,e,i)):b[j]=c});return b}function s(b, -c){return function(){return c.apply(b,arguments)}}function Z(b){if(!b)return b;var c=Y;q(b.split("."),function(b){c=c[b]});return c}function $(b,c,e){return function(){var i=fa.call(arguments,0),g;if(e&&x(g=i[i.length-1]))g.__requireJsBuild=!0;i.push(c);return b.apply(null,i)}}function aa(b,c,e){q([["toUrl"],["undef"],["defined","requireDefined"],["specified","requireSpecified"]],function(i){var g=i[1]||i[0];b[i[0]]=c?$(c[g],e):function(){var b=z[O];return b[g].apply(b,arguments)}})}function H(b, -c,e,i){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=i;if(e)c.originalError=e;return c}function ga(){if(I&&I.readyState==="interactive")return I;N(document.getElementsByTagName("script"),function(b){if(b.readyState==="interactive")return I=b});return I}var ha=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ia=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,ba=/\.js$/,ja=/^\.\//,J=Object.prototype.toString,A=Array.prototype,fa=A.slice,ka=A.splice,w=!!(typeof window!== -"undefined"&&navigator&&document),ca=!w&&typeof importScripts!=="undefined",la=w&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,O="_",S=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",z={},p={},P=[],L=!1,j,t,C,u,D,I,E,da,ea;if(typeof define==="undefined"){if(typeof requirejs!=="undefined"){if(x(requirejs))return;p=requirejs;requirejs=void 0}typeof require!=="undefined"&&!x(require)&&(p=require,require=void 0);j=requirejs=function(b,c,e,i){var g=O,r;!G(b)&& -typeof b!=="string"&&(r=b,G(c)?(b=c,c=e,e=i):b=[]);if(r&&r.context)g=r.context;(i=z[g])||(i=z[g]=j.s.newContext(g));r&&i.configure(r);return i.require(b,c,e)};j.config=function(b){return j(b)};require||(require=j);j.version="2.0.4";j.jsExtRegExp=/^\/|:|\?|\.js$/;j.isBrowser=w;A=j.s={contexts:z,newContext:function(b){function c(a,d,o){var l=d&&d.split("/"),f=l,b=k.map,c=b&&b["*"],e,g,h;if(a&&a.charAt(0)===".")if(d){f=k.pkgs[d]?l=[d]:l.slice(0,l.length-1);d=a=f.concat(a.split("/"));for(f=0;d[f];f+= -1)if(e=d[f],e===".")d.splice(f,1),f-=1;else if(e==="..")if(f===1&&(d[2]===".."||d[0]===".."))break;else f>0&&(d.splice(f-1,2),f-=2);f=k.pkgs[d=a[0]];a=a.join("/");f&&a===d+"/"+f.main&&(a=d)}else a.indexOf("./")===0&&(a=a.substring(2));if(o&&(l||c)&&b){d=a.split("/");for(f=d.length;f>0;f-=1){g=d.slice(0,f).join("/");if(l)for(e=l.length;e>0;e-=1)if(o=b[l.slice(0,e).join("/")])if(o=o[g]){h=o;break}!h&&c&&c[g]&&(h=c[g]);if(h){d.splice(0,f,h);a=d.join("/");break}}}return a}function e(a){w&&q(document.getElementsByTagName("script"), -function(d){if(d.getAttribute("data-requiremodule")===a&&d.getAttribute("data-requirecontext")===h.contextName)return d.parentNode.removeChild(d),!0})}function i(a){var d=k.paths[a];if(d&&G(d)&&d.length>1)return e(a),d.shift(),h.undef(a),h.require([a]),!0}function g(a,d,o,b){var f=a?a.indexOf("!"):-1,v=null,e=d?d.name:null,g=a,i=!0,j="",k,m;a||(i=!1,a="_@r"+(N+=1));f!==-1&&(v=a.substring(0,f),a=a.substring(f+1,a.length));v&&(v=c(v,e,b),m=n[v]);a&&(v?j=m&&m.normalize?m.normalize(a,function(a){return c(a, -e,b)}):c(a,e,b):(j=c(a,e,b),k=h.nameToUrl(j)));a=v&&!m&&!o?"_unnormalized"+(O+=1):"";return{prefix:v,name:j,parentMap:d,unnormalized:!!a,url:k,originalName:g,isDefine:i,id:(v?v+"!"+j:j)+a}}function r(a){var d=a.id,o=m[d];o||(o=m[d]=new h.Module(a));return o}function p(a,d,o){var b=a.id,f=m[b];if(n.hasOwnProperty(b)&&(!f||f.defineEmitComplete))d==="defined"&&o(n[b]);else r(a).on(d,o)}function B(a,d){var b=a.requireModules,l=!1;if(d)d(a);else if(q(b,function(d){if(d=m[d])d.error=a,d.events.error&&(l= -!0,d.emit("error",a))}),!l)j.onError(a)}function u(){P.length&&(ka.apply(F,[F.length-1,0].concat(P)),P=[])}function t(a,d,b){a=a&&a.map;d=$(b||h.require,a,d);aa(d,h,a);d.isBrowser=w;return d}function z(a){delete m[a];q(M,function(d,b){if(d.map.id===a)return M.splice(b,1),d.defined||(h.waitCount-=1),!0})}function A(a,d){var b=a.map.id,l=a.depMaps,f;if(a.inited){if(d[b])return a;d[b]=!0;q(l,function(a){if(a=m[a.id])return!a.inited||!a.enabled?(f=null,delete d[b],!0):f=A(a,K({},d))});return f}}function C(a, -d,b){var l=a.map.id,f=a.depMaps;if(a.inited&&a.map.isDefine){if(d[l])return n[l];d[l]=a;q(f,function(f){var f=f.id,c=m[f];!Q[f]&&c&&(!c.inited||!c.enabled?b[l]=!0:(c=C(c,d,b),b[f]||a.defineDepById(f,c)))});a.check(!0);return n[l]}}function D(a){a.check()}function E(){var a=k.waitSeconds*1E3,d=a&&h.startTime+a<(new Date).getTime(),b=[],l=!1,f=!0,c,g,j;if(!T){T=!0;y(m,function(a){c=a.map;g=c.id;if(a.enabled&&!a.error)if(!a.inited&&d)i(g)?l=j=!0:(b.push(g),e(g));else if(!a.inited&&a.fetched&&c.isDefine&& -(l=!0,!c.prefix))return f=!1});if(d&&b.length)return a=H("timeout","Load timeout for modules: "+b,null,b),a.contextName=h.contextName,B(a);f&&(q(M,function(a){if(!a.defined){var a=A(a,{}),d={};a&&(C(a,d,{}),y(d,D))}}),y(m,D));if((!d||j)&&l)if((w||ca)&&!U)U=setTimeout(function(){U=0;E()},50);T=!1}}function V(a){r(g(a[0],null,!0)).init(a[1],a[2])}function J(a){var a=a.currentTarget||a.srcElement,d=h.onScriptLoad;a.detachEvent&&!S?a.detachEvent("onreadystatechange",d):a.removeEventListener("load",d, -!1);d=h.onScriptError;a.detachEvent&&!S||a.removeEventListener("error",d,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}var k={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},shim:{}},m={},W={},F=[],n={},R={},N=1,O=1,M=[],T,X,h,Q,U;Q={require:function(a){return t(a)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports=n[a.map.id]={}},module:function(a){return a.module={id:a.map.id,uri:a.map.url,config:function(){return k.config&&k.config[a.map.id]||{}},exports:n[a.map.id]}}}; -X=function(a){this.events=W[a.id]||{};this.map=a;this.shim=k.shim[a.id];this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};X.prototype={init:function(a,d,b,l){l=l||{};if(!this.inited){this.factory=d;if(b)this.on("error",b);else this.events.error&&(b=s(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.depMaps.rjsSkipMap=a.rjsSkipMap;this.errback=b;this.inited=!0;this.ignore=l.ignore;l.enabled||this.enabled?this.enable():this.check()}},defineDepById:function(a, -d){var b;q(this.depMaps,function(d,f){if(d.id===a)return b=f,!0});return this.defineDep(b,d)},defineDep:function(a,d){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=d)},fetch:function(){if(!this.fetched){this.fetched=!0;h.startTime=(new Date).getTime();var a=this.map;if(this.shim)t(this,!0)(this.shim.deps||[],s(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;R[a]|| -(R[a]=!0,h.load(this.map.id,a))},check:function(a){if(this.enabled&&!this.enabling){var d=this.map.id,b=this.depExports,c=this.exports,f=this.factory,e;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(x(f)){if(this.events.error)try{c=h.execCb(d,f,b,c)}catch(g){e=g}else c=h.execCb(d,f,b,c);if(this.map.isDefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)c=b.exports;else if(c===void 0&&this.usingExports)c= -this.exports;if(e)return e.requireMap=this.map,e.requireModules=[this.map.id],e.requireType="define",B(this.error=e)}else c=f;this.exports=c;if(this.map.isDefine&&!this.ignore&&(n[d]=c,j.onResourceLoad))j.onResourceLoad(h,this.map,this.depMaps);delete m[d];this.defined=!0;h.waitCount-=1;h.waitCount===0&&(M=[])}this.defining=!1;if(!a&&this.defined&&!this.defineEmitted)this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0}}else this.fetch()}},callPlugin:function(){var a= -this.map,d=a.id,b=g(a.prefix,null,!1,!0);p(b,"defined",s(this,function(b){var f=this.map.name,e=this.map.parentMap?this.map.parentMap.name:null;if(this.map.unnormalized){if(b.normalize&&(f=b.normalize(f,function(a){return c(a,e,!0)})||""),b=g(a.prefix+"!"+f,this.map.parentMap,!1,!0),p(b,"defined",s(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),b=m[b.id]){if(this.events.error)b.on("error",s(this,function(a){this.emit("error",a)}));b.enable()}}else f=s(this,function(a){this.init([], -function(){return a},null,{enabled:!0})}),f.error=s(this,function(a){this.inited=!0;this.error=a;a.requireModules=[d];y(m,function(a){a.map.id.indexOf(d+"_unnormalized")===0&&z(a.map.id)});B(a)}),f.fromText=function(a,d){var b=L;b&&(L=!1);r(g(a));j.exec(d);b&&(L=!0);h.completeLoad(a)},b.load(a.name,t(a.parentMap,!0,function(a,d){a.rjsSkipMap=!0;return h.require(a,d)}),f,k)}));h.enable(b,this);this.pluginMaps[b.id]=b},enable:function(){this.enabled=!0;if(!this.waitPushed)M.push(this),h.waitCount+= -1,this.waitPushed=!0;this.enabling=!0;q(this.depMaps,s(this,function(a,d){var b,c;if(typeof a==="string"){a=g(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.depMaps.rjsSkipMap);this.depMaps[d]=a;if(b=Q[a.id]){this.depExports[d]=b(this);return}this.depCount+=1;p(a,"defined",s(this,function(a){this.defineDep(d,a);this.check()}));this.errback&&p(a,"error",this.errback)}b=a.id;c=m[b];!Q[b]&&c&&!c.enabled&&h.enable(a,this)}));y(this.pluginMaps,s(this,function(a){var b=m[a.id];b&&!b.enabled&& -h.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){q(this.events[a],function(a){a(b)});a==="error"&&delete this.events[a]}};return h={config:k,contextName:b,registry:m,defined:n,urlFetched:R,waitCount:0,defQueue:F,Module:X,makeModuleMap:g,configure:function(a){a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!=="/"&&(a.baseUrl+="/");var b=k.pkgs,c=k.shim,e=k.paths,f=k.map;K(k,a,!0);k.paths=K(e,a.paths,!0);if(a.map)k.map= -K(f||{},a.map,!0,!0);if(a.shim)y(a.shim,function(a,b){G(a)&&(a={deps:a});if(a.exports&&!a.exports.__buildReady)a.exports=h.makeShimExports(a.exports);c[b]=a}),k.shim=c;if(a.packages)q(a.packages,function(a){a=typeof a==="string"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ja,"").replace(ba,"")}}),k.pkgs=b;y(m,function(a,b){a.map=g(b)});if(a.deps||a.callback)h.require(a.deps||[],a.callback)},makeShimExports:function(a){var b;return typeof a==="string"? -(b=function(){return Z(a)},b.exports=a,b):function(){return a.apply(Y,arguments)}},requireDefined:function(a,b){var c=g(a,b,!1,!0).id;return n.hasOwnProperty(c)},requireSpecified:function(a,b){a=g(a,b,!1,!0).id;return n.hasOwnProperty(a)||m.hasOwnProperty(a)},require:function(a,d,c,e){var f;if(typeof a==="string"){if(x(d))return B(H("requireargs","Invalid require call"),c);if(j.get)return j.get(h,a,d);a=g(a,d,!1,!0);a=a.id;return!n.hasOwnProperty(a)?B(H("notloaded",'Module name "'+a+'" has not been loaded yet for context: '+ -b)):n[a]}c&&!x(c)&&(e=c,c=void 0);d&&!x(d)&&(e=d,d=void 0);for(u();F.length;)if(f=F.shift(),f[0]===null)return B(H("mismatch","Mismatched anonymous define() module: "+f[f.length-1]));else V(f);r(g(null,e)).init(a,d,c,{enabled:!0});E();return h.require},undef:function(a){var b=g(a,null,!0),c=m[a];delete n[a];delete R[b.url];delete W[a];if(c){if(c.events.defined)W[a]=c.events;z(a)}},enable:function(a){m[a.id]&&r(a).enable()},completeLoad:function(a){var b=k.shim[a]||{},c=b.exports&&b.exports.exports, -e,f;for(u();F.length;){f=F.shift();if(f[0]===null){f[0]=a;if(e)break;e=!0}else f[0]===a&&(e=!0);V(f)}f=m[a];if(!e&&!n[a]&&f&&!f.inited)if(k.enforceDefine&&(!c||!Z(c)))if(i(a))return;else return B(H("nodefine","No define call for "+a,null,[a]));else V([a,b.deps||[],b.exports]);E()},toUrl:function(a,b){var e=a.lastIndexOf("."),g=null;e!==-1&&(g=a.substring(e,a.length),a=a.substring(0,e));return h.nameToUrl(c(a,b&&b.id,!0),g)},nameToUrl:function(a,b){var c,e,f,g,h,i;if(j.jsExtRegExp.test(a))g=a+(b|| -"");else{c=k.paths;e=k.pkgs;g=a.split("/");for(h=g.length;h>0;h-=1)if(i=g.slice(0,h).join("/"),f=e[i],i=c[i]){G(i)&&(i=i[0]);g.splice(0,h,i);break}else if(f){c=a===f.name?f.location+"/"+f.main:f.location;g.splice(0,h,c);break}g=g.join("/")+(b||".js");g=(g.charAt(0)==="/"||g.match(/^[\w\+\.\-]+:/)?"":k.baseUrl)+g}return k.urlArgs?g+((g.indexOf("?")===-1?"?":"&")+k.urlArgs):g},load:function(a,b){j.load(h,a,b)},execCb:function(a,b,c,e){return b.apply(e,c)},onScriptLoad:function(a){if(a.type==="load"|| -la.test((a.currentTarget||a.srcElement).readyState))I=null,a=J(a),h.completeLoad(a.id)},onScriptError:function(a){var b=J(a);if(!i(b.id))return B(H("scripterror","Script error",a,[b.id]))}}}};j({});aa(j);if(w&&(t=A.head=document.getElementsByTagName("head")[0],C=document.getElementsByTagName("base")[0]))t=A.head=C.parentNode;j.onError=function(b){throw b;};j.load=function(b,c,e){var i=b&&b.config||{},g;if(w)return g=i.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"), -g.type=i.scriptType||"text/javascript",g.charset="utf-8",g.async=!0,g.setAttribute("data-requirecontext",b.contextName),g.setAttribute("data-requiremodule",c),g.attachEvent&&!(g.attachEvent.toString&&g.attachEvent.toString().indexOf("[native code")<0)&&!S?(L=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):(g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",b.onScriptError,!1)),g.src=e,E=g,C?t.insertBefore(g,C):t.appendChild(g),E=null,g;else ca&&(importScripts(e),b.completeLoad(c))}; -w&&N(document.getElementsByTagName("script"),function(b){if(!t)t=b.parentNode;if(u=b.getAttribute("data-main")){if(!p.baseUrl)D=u.split("/"),da=D.pop(),ea=D.length?D.join("/")+"/":"./",p.baseUrl=ea,u=da;u=u.replace(ba,"");p.deps=p.deps?p.deps.concat(u):[u];return!0}});define=function(b,c,e){var i,g;typeof b!=="string"&&(e=c,c=b,b=null);G(c)||(e=c,c=[]);!c.length&&x(e)&&e.length&&(e.toString().replace(ha,"").replace(ia,function(b,e){c.push(e)}),c=(e.length===1?["require"]:["require","exports","module"]).concat(c)); -if(L&&(i=E||ga()))b||(b=i.getAttribute("data-requiremodule")),g=z[i.getAttribute("data-requirecontext")];(g?g.defQueue:P).push([b,c,e])};define.amd={jQuery:!0};j.exec=function(b){return eval(b)};j(p)}})(this); diff --git a/lib/gollum/public/gollum/livepreview/js/sundown.js b/lib/gollum/public/gollum/livepreview/js/sundown.js deleted file mode 100644 index d084a6ea..00000000 --- a/lib/gollum/public/gollum/livepreview/js/sundown.js +++ /dev/null @@ -1 +0,0 @@ -function c(b){throw b}var ba=void 0,m=!0,n=null,p=!1;try{this.Module=Module}catch(da){this.Module=Module={}}var ea="object"===typeof process,ga="object"===typeof window,ia="function"===typeof importScripts,ja=!ga&&!ea&&!ia;if(ea){Module.print=(function(b){process.stdout.write(b+"\n")});Module.printErr=(function(b){process.stderr.write(b+"\n")});var ma=require("fs"),na=require("path");Module.read=(function(b){var b=na.normalize(b),d=ma.readFileSync(b).toString();!d&&b!=na.resolve(b)&&(b=path.join(__dirname,"..","src",b),d=ma.readFileSync(b).toString());return d});Module.load=(function(b){oa(read(b))});Module.arguments||(Module.arguments=process.argv.slice(2))}else{ja?(Module.print=print,"undefined"!=typeof printErr&&(Module.printErr=printErr),Module.read="undefined"!=typeof read?read:(function(b){snarf(b)}),Module.arguments||("undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments))):ga?(Module.print||(Module.print=(function(b){console.log(b)})),Module.printErr||(Module.printErr=(function(b){console.log(b)})),Module.read=(function(b){var d=new XMLHttpRequest;d.open("GET",b,p);d.send(n);return d.responseText}),Module.arguments||"undefined"!=typeof arguments&&(Module.arguments=arguments)):ia?Module.load=importScripts:c("Unknown runtime environment. Where are we?")}function oa(b){eval.call(n,b)}"undefined"==!Module.load&&Module.read&&(Module.load=(function(b){oa(Module.read(b))}));Module.print||(Module.print=(function(){}));Module.printErr||(Module.printErr=Module.print);Module.arguments||(Module.arguments=[]);Module.print=Module.print;Module.tc=Module.printErr;Module.preRun||(Module.preRun=[]);Module.postRun||(Module.postRun=[]);function ra(b){if(1==sa){return 1}var d={"%i1":1,"%i8":1,"%i16":2,"%i32":4,"%i64":8,"%float":4,"%double":8}["%"+b];d||("*"==b[b.length-1]?d=sa:"i"==b[0]&&(b=parseInt(b.substr(1)),wa(0==b%8),d=b/8));return d}function xa(){var b=[],d=0;this.R=(function(a){a&=255;d&&(b.push(a),d--);if(0==b.length){if(128>a){return String.fromCharCode(a)}b.push(a);d=191a?1:2;return""}if(0a?String.fromCharCode((a&31)<<6|e&63):String.fromCharCode((a&15)<<12|(e&63)<<6|f&63);b.length=0;return a});this.kc=(function(a){for(var a=unescape(encodeURIComponent(a)),b=[],d=0;d>2<<2;return d}function Da(b){var d=Ea;Ea+=b;Ea=Ea+3>>2<<2;if(Ea>=Fa){for(;Fa<=Ea;){Fa=2*Fa+4095>>12<<12}var b=u,a=new ArrayBuffer(Fa);u=new Int8Array(a);Ga=new Int16Array(a);v=new Int32Array(a);z=new Uint8Array(a);Pa=new Uint16Array(a);B=new Uint32Array(a);Ra=new Float32Array(a);Sa=new Float64Array(a);u.set(b)}return d}var sa=4,Za={},$a;function ab(b){Module.print(b+":\n"+Error().stack);c("Assertion: "+b)}function wa(b,d){b||ab("Assertion failed: "+d)}var bb=this;function cb(b,d,a,e){function f(a,b){if("string"==b){if(a===n||a===ba||0===a){return 0}g||(g=s);var d=Ca(a.length+1);db(a,d);return d}return"array"==b?(g||(g=s),d=Ca(a.length),fb(a,d),d):a}var g=0;try{var h=eval("_"+b)}catch(i){try{h=bb.Module["_"+b]}catch(j){}}wa(h,"Cannot call unknown function "+b+" (perhaps LLVM optimizations or closure removed it?)");var k=0,b=e?e.map((function(b){return f(b,a[k++])})):[],d=(function(a,b){if("string"==b){return gb(a)}wa("array"!=b);return a})(h.apply(n,b),d);g&&(s=g);return d}Module.ccall=cb;Module.cwrap=(function(b,d,a){return(function(){return cb(b,d,a,Array.prototype.slice.call(arguments))})});function nb(b,d,a){a=a||"i8";"*"===a[a.length-1]&&(a="i32");switch(a){case"i1":u[b]=d;break;case"i8":u[b]=d;break;case"i16":Ga[b>>1]=d;break;case"i32":v[b>>2]=d;break;case"i64":v[b>>2]=d;break;case"float":Ra[b>>2]=d;break;case"double":ob[0]=d;v[b>>2]=pb[0];v[b+4>>2]=pb[1];break;default:ab("invalid type for setValue: "+a)}}Module.setValue=nb;Module.getValue=(function(b,d){d=d||"i8";"*"===d[d.length-1]&&(d="i32");switch(d){case"i1":return u[b];case"i8":return u[b];case"i16":return Ga[b>>1];case"i32":return v[b>>2];case"i64":return v[b>>2];case"float":return Ra[b>>2];case"double":return pb[0]=v[b>>2],pb[1]=v[b+4>>2],ob[0];default:ab("invalid type for setValue: "+d)}return n});var C=2;Module.ALLOC_NORMAL=0;Module.ALLOC_STACK=1;Module.ALLOC_STATIC=C;function F(b,d,a){var e,f;"number"===typeof b?(e=m,f=b):(e=p,f=b.length);var g="string"===typeof d?d:n,a=[qb,Ca,Da][a===ba?C:a](Math.max(f,g?1:d.length));if(e){return rb(a,f),a}e=0;for(var h;e>2);Ra.subarray(Ob>>2);var ob=Sa.subarray(Ob>>3);Ib=Ob+8;Ea=Ib+4095>>12<<12;function Pb(b){for(;0=d?2*Math.abs(1<=b){return b}var a=32>=d?Math.abs(1<=a&&(32>=d||b>a)){b=-2*a+b}return b}var xc=0;function yc(){xc++;Module.monitorRunDependencies&&Module.monitorRunDependencies(xc)}Module.addRunDependency=yc;Module.removeRunDependency=(function(){xc--;Module.monitorRunDependencies&&Module.monitorRunDependencies(xc);0==xc&&zc()});Module._str_to_html=(function(b){var d=s;s+=124;var a=d+104,e=Ac(2048),f;f=a>>2;v[f]=0;v[f+1]=0;v[f+2]=0;v[f+3]=0;v[f+4]=0;v[a+12>>2]=0;f=Bc>>2;for(var g=d>>2,h=f+26;f>2]|0);a:do{if(!g){for(var h=b|0,i=0;;){if(Lc(v[v[h>>2]+(i<<2)>>2]),i=i+1|0,i>>>0>=B[f>>2]>>>0){break a}}}}while(0);f=a+396|0;g=a+404|0;h=0==(v[g>>2]|0);a:do{if(!h){for(var i=f|0,j=0;;){if(Lc(v[v[i>>2]+(j<<2)>>2]),j=j+1|0,j>>>0>=B[g>>2]>>>0){break a}}}}while(0);Mc(b);Mc(f);Nc(a);a=qb(v[e+4>>2]+1|0);h=0==(e|0)?4:0==(v[e+12>>2]|0)?4:5;4==h&&Oc(K.c|0,99,K.Z|0,K.b|0);b=e+4|0;f=B[b>>2];g=B[e+8>>2];if(f>>>0>>0){if(h=B[e>>2],0==u[h+f|0]<<24>>24){var k=h,h=11}else{h=7}}else{h=7}do{if(7==h){k=f+1|0;if(k>>>0>g>>>0){if(0!=(Pc(e,k)|0)){k=0;break}k=v[b>>2]}else{k=f}i=e|0;u[v[i>>2]+k|0]=0;k=v[i>>2]}}while(0);b=0;do{u[a+b]=u[k+b],b++}while(0!=u[k+(b-1)]);Lc(e);s=d;return a});function Cc(b,d,a,e){var f;0==(d|0)|0==(a|0)&&Oc(K.l|0,2400,K.ea|0,K.Ta|0);var g=qb(432);f=g>>2;if(0==(g|0)){b=0}else{for(var a=a>>2,h=f,i=a+26;a>2,i=s;s+=4;var j;g=i>>2;var k=Ac(64),l=0==(k|0);do{if(!l){Pc(k,a);var o=e+108|0;f=o>>2;v[f]=0;v[f+1]=0;v[f+2]=0;v[f+3]=0;v[f+4]=0;v[f+5]=0;v[f+6]=0;v[f+7]=0;f=2>>0?0==(Rc(d,K.fc|0,3)|0)?3:0:0;var t=f>>>0>>0;a:do{if(t){for(var q=o|0,r=f;;){var w=0==(Sc(d,r,a,i,q)|0);b:do{if(w){for(j=r;j>>>0>>0;){var x=u[d+j|0];if(13==x<<24>>24||10==x<<24>>24){break}j=j+1|0}v[g]=j;if(j>>>0>r>>>0){var x=k,D=d+r|0;j=j-r|0;for(var y=0,A=0;A>>>0>>0;){for(var E=A;;){if(E>>>0>=j>>>0){var G=0;break}if(9==u[D+E|0]<<24>>24){G=1;break}y=y+1|0;E=E+1|0}E>>>0>A>>>0&&L(x,D+A|0,E-A|0);if(!G){break}for(A=y;;){O(x,32);var N=A+1|0;if(0==(N&3|0)){break}A=N}y=N;A=E+1|0}x=v[g]}else{x=j}for(;;){if(x>>>0>=a>>>0){var I=x;break b}D=u[d+x|0];do{if(10==D<<24>>24){j=19}else{if(13==D<<24>>24){if(j=x+1|0,j>>>0>>0){10==u[d+j|0]<<24>>24?(M=x,j=20):j=19}else{var M=x;j=20}}else{I=x;break b}}}while(0);19==j&&(O(k,10),M=v[g]);x=M+1|0;v[g]=x}}else{I=v[g]}}while(0);if(I>>>0>=a>>>0){break a}r=I}}}while(0);f=(k+4|0)>>2;t=B[f];Pc(b,(t>>>1)+t|0);t=B[h+24];if(0!=(t|0)){H[t](b,v[h+26])}t=B[f];0!=(t|0)&&(q=k|0,r=v[q>>2],w=u[r+(t-1)|0],10==w<<24>>24||13==w<<24>>24?(q=r,f=t):(O(k,10),q=v[q>>2],f=v[f]),Tc(b,e,q,f));f=v[h+25];if(0!=(f|0)){H[f](b,v[h+26])}Lc(k);o|=0;f=ba;for(t=0;;){q=v[o+(t<<2)>>2];r=0==(q|0);a:do{if(!r){w=q;for(f=w>>2;;){x=v[f+3];Lc(v[f+1]);Lc(v[f+2]);Nc(w);if(0==(x|0)){break a}w=x;f=w>>2}}}while(0);f=t+1|0;if(8==(f|0)){break}t=f}0!=(v[h+103]|0)&&Oc(K.l|0,2522,K.r|0,K.Wa|0);0!=(v[h+100]|0)&&Oc(K.l|0,2523,K.r|0,K.Ya|0)}}while(0);s=i}Dc.X=1;function Sc(b,d,a,e,f){var g,h=d+3|0,i=h>>>0>>0;a:do{if(i){var j=32==u[b+d|0]<<24>>24;do{if(j){if(32!=u[d+(b+1)|0]<<24>>24){var k=1}else{if(32!=u[d+(b+2)|0]<<24>>24){k=2}else{if(32==u[b+h|0]<<24>>24){j=0;break a}k=3}}}else{k=0}}while(0);j=k+d|0;if(91!=u[b+j|0]<<24>>24){j=0}else{for(var l=k=j+1|0;;){if(l>>>0>=a>>>0){j=0;break a}j=u[b+l|0];if(93==j<<24>>24){break}else{if(10==j<<24>>24||13==j<<24>>24){j=0;break a}}l=l+1|0}j=l+1|0;if(j>>>0>>0){if(58!=u[b+j|0]<<24>>24){j=0}else{for(j=l+2|0;;){if(j>>>0>=a>>>0){var o=j;g=21;break}var t=z[b+j|0];if(32!=t<<24>>24){10==t<<24>>24||13==t<<24>>24?g=18:(o=j,g=21);break}j=j+1|0}18==g&&(o=j+1|0,o=o>>>0>>0?13!=u[b+o|0]<<24>>24?o:10==t<<24>>24?j+2|0:o:o);for(;;){if(o>>>0>=a>>>0){j=0;break a}var q=z[b+o|0];if(32!=q<<24>>24){break}o=o+1|0}for(var r=j=(60==q<<24>>24&1)+o|0;r>>>0>>0;){var w=u[b+r|0];if(32==w<<24>>24||10==w<<24>>24||13==w<<24>>24){break}r=r+1|0}w=r-1|0;for(w=62==u[b+w|0]<<24>>24?w:r;;){if(r>>>0>=a>>>0){var x=r;break}var D=u[b+r|0];if(32==D<<24>>24){r=r+1|0}else{if(13==D<<24>>24||10==D<<24>>24){x=r;break}else{if(34==D<<24>>24||39==D<<24>>24||40==D<<24>>24){x=0;break}else{j=0;break a}}}}var D=r+1|0,D=D>>>0>>0?10!=u[b+r|0]<<24>>24?x:13==u[b+D|0]<<24>>24?D:x:x,y=0==(D|0);b:do{if(y){var A=r}else{for(var E=D;;){E=E+1|0;if(E>>>0>=a>>>0){A=E;break b}if(32!=u[b+E|0]<<24>>24){A=E;break b}}}}while(0);var E=A+1|0,G=E>>>0>>0;b:do{if(G){if(r=u[b+A|0],39==r<<24>>24||34==r<<24>>24||40==r<<24>>24){for(r=E;;){if(r>>>0>=a>>>0){var N=r+1|0;break}g=u[b+r|0];y=r+1|0;if(13==g<<24>>24||10==g<<24>>24){N=y;break}r=y}if(N>>>0>>0){if(10!=u[b+r|0]<<24>>24){g=46}else{if(13==u[b+N|0]<<24>>24){var I=N;g=47}else{g=46}}}else{g=46}for(46==g&&(I=r);;){var M=r-1|0;if(M>>>0<=E>>>0){J=D;y=I;r=E;break b}r=u[b+M|0];if(32==r<<24>>24){r=M}else{if(39==r<<24>>24||34==r<<24>>24||41==r<<24>>24){break}else{J=D;y=I;r=E;break b}}}J=I;y=M;r=E}else{var J=D,r=y=0}}else{J=D,r=y=0}}while(0);0==(J|0)|(w|0)==(j|0)?j=0:(0!=(e|0)&&(v[e>>2]=J),0==(f|0))?j=1:(D=f,E=b+k|0,l=l-k|0,k=Uc(1,16),0==(k|0)?k=0:(l=Vc(E,l),v[k>>2]=l,l=((l&7)<<2)+D|0,v[k+12>>2]=v[l>>2],v[l>>2]=k),0==(k|0))?j=0:(l=w-j|0,w=Ac(l),v[k+4>>2]=w,L(w,b+j|0,l),y>>>0>r>>>0&&(j=y-r|0,l=Ac(j),v[k+8>>2]=l,L(l,b+r|0,j)),j=1)}}else{j=0}}}else{j=0}}while(0);return j}Sc.X=1;function Wc(b,d,a){var e=35==u[d]<<24>>24;a:do{if(e){var f=0==(v[b+420>>2]&64|0);b:do{if(!f){for(var g=0;;){var h=g>>>0>>0;if(!(h&6>g>>>0)){if(!h){break b}var i=u[d+g|0];break}h=z[d+g|0];if(35!=h<<24>>24){i=h;break}g=g+1|0}if(32!=i<<24>>24){f=0;break a}}}while(0);f=1}else{f=0}}while(0);return f}function Xc(b,d){var a=0;a:for(;;){var e=a>>>0>>0;do{if(e){var f=u[b+a|0];if(10!=f<<24>>24){if(32!=f<<24>>24){var g=0;break a}a=a+1|0;continue a}}}while(0);g=a+1|0;break}return g}function Yc(b,d){var a=3>d>>>0;a:do{if(a){var e=0}else{var f=32==u[b]<<24>>24?32!=u[b+1|0]<<24>>24?1:32==u[b+2|0]<<24>>24?3:2:0;if((f+2|0)>>>0>>0){if(e=z[b+f|0],42==e<<24>>24||45==e<<24>>24||95==e<<24>>24){for(var g=0;f>>>0>>0;){var h=z[b+f|0];if(10==h<<24>>24){break}if(h<<24>>24==e<<24>>24){g=g+1|0}else{if(32!=h<<24>>24){e=0;break a}}f=f+1|0}e=2>>0&1}else{e=0}}else{e=0}}}while(0);return e}function Tc(b,d,a,e){var f=(v[d+400>>2]+v[d+412>>2]|0)>>>0>B[d+424>>2]>>>0|0==(e|0);a:do{if(!f){for(var g=d+8|0,h=d+420|0,i=d+16|0,j=d+104|0,k=0;;){var l=a+k|0,o=e-k|0,t=0==(Wc(d,l,o)|0);b:do{if(t){var q=60==u[l]<<24>>24;do{if(q&&0!=(v[g>>2]|0)){var r=Zc(b,d,l,o,1);if(0!=(r|0)){q=r+k|0;break b}}}while(0);q=Xc(l,o);if(0==(q|0)){if(0==(Yc(l,o)|0)){q=B[h>>2];if(0!=(q&4|0)){q=$c(b,d,l,o);if(0!=(q|0)){q=q+k|0;break}q=v[h>>2]}q=0==(q&2|0);do{if(!q&&(r=ad(b,d,l,o),0!=(r|0))){q=r+k|0;break b}}while(0);q=0==(bd(l,o)|0)?0==(cd(l,o)|0)?0==(dd(l,o)|0)?0==(ed(l,o)|0)?fd(b,d,l,o)+k|0:gd(b,d,l,o,1)+k|0:gd(b,d,l,o,0)+k|0:hd(b,d,l,o)+k|0:id(b,d,l,o)+k|0}else{q=v[i>>2];if(0!=(q|0)){H[q](b,v[j>>2])}for(q=k;q>>>0>>0;){r=q+1|0;if(10==u[a+q|0]<<24>>24){q=r;break b}q=r}q=q+1|0}}else{q=q+k|0}}else{q=jd(b,d,l,o)+k|0}}while(0);if(q>>>0>=e>>>0){break a}k=q}}}while(0)}Tc.X=1;function jd(b,d,a,e){for(var f=0;;){if(!(f>>>0>>0&6>f>>>0)){var g=f;break}if(35!=u[a+f|0]<<24>>24){g=f;break}f=f+1|0}for(;;){if(g>>>0>=e>>>0){var h=g;break}if(32!=u[a+g|0]<<24>>24){h=g;break}g=g+1|0}for(;;){if(h>>>0>=e>>>0){var i=h;break}if(10==u[a+h|0]<<24>>24){i=h;break}h=h+1|0}for(;;){if(0==(i|0)){var j=0;break}e=i-1|0;if(35!=u[a+e|0]<<24>>24){j=i;break}i=e}for(;0!=(j|0);){i=j-1|0;if(32!=u[a+i|0]<<24>>24){break}j=i}if(j>>>0>g>>>0){i=P(d,1);kd(i,d,a+g|0,j-g|0);a=v[d+12>>2];if(0!=(a|0)){H[a](b,i,f,v[d+104>>2])}R(d,1)}return h}jd.X=1;function Zc(b,d,a,e,f){var g,h,d=d>>2,i=s;s+=16;h=i>>2;v[h]=a;g=(i+4|0)>>2;v[g]=0;v[h+2]=0;v[h+3]=0;h=2>e>>>0;a:do{if(h){var j=0}else{if(60!=u[a]<<24>>24){j=0}else{for(var k=1;k>>>0>>0;){j=u[a+k|0];if(62==j<<24>>24||32==j<<24>>24){var j=a+1|0,k=k-1|0,l=ba;if(11>k>>>0&0!=(k|0)){if(l=(z[K.H+(z[j]&255)|0]&255)+(1==(k|0)?1:(z[K.H+(z[j+1|0]&255)+1|0]&255)+k|0)|0,38>l>>>0){if(l=B[U+(l<<2)>>2],0!=((u[l]^u[j])&-33)<<24>>24){l=7}else{if(0!=(nd(j,l,k)|0)){l=7}else{if(0==u[l+k|0]<<24>>24){var o=l,l=8}else{l=7}}}}else{l=7}}else{l=7}7==l&&(o=0);j=o;if(0==(j|0)){break}o=od(j,a,e,1);if(0==(o|0)){if(0==(pd(j,K.z|0)|0)){j=0;break a}if(0==(pd(j,K.F|0)|0)){j=0;break a}a=od(j,a,e,0);if(0==(a|0)){j=0;break a}}else{a=o}v[g]=a;if(0==(f|0)){j=a;break a}f=v[d+2];if(0==(f|0)){j=a;break a}H[f](b,i,v[d+26]);j=a;break a}k=k+1|0}j=5>>0;do{if(j&&33==u[a+1|0]<<24>>24&&45==u[a+2|0]<<24>>24&&45==u[a+3|0]<<24>>24){k=5;b:for(;;){if(k>>>0>=e>>>0){var t=k+1|0;break}l=45==u[a+(k-2)|0]<<24>>24;do{if(l&&45==u[a+(k-1)|0]<<24>>24){l=k+1|0;if(62==u[a+k|0]<<24>>24){t=l;break b}k=l;continue b}}while(0);k=k+1|0}if(t>>>0>>0&&(k=Xc(a+t|0,e-t|0),0!=(k|0))){a=k+t|0;v[g]=a;if(0==(f|0)){j=a;break a}f=v[d+2];if(0==(f|0)){j=a;break a}H[f](b,i,v[d+26]);j=v[g];break a}}}while(0);if(4>>0){if(j=u[a+1|0],104==j<<24>>24||72==j<<24>>24){if(j=u[a+2|0],114==j<<24>>24||82==j<<24>>24){for(j=3;;){if(j>>>0>=e>>>0){var q=j+1|0;break}k=j+1|0;if(62==u[a+j|0]<<24>>24){q=k;break}j=k}q>>>0>>0?(j=Xc(a+q|0,e-q|0),0==(j|0)?j=0:(j=j+q|0,v[g]=j,0!=(f|0)&&(k=v[d+2],0!=(k|0)&&(H[k](b,i,v[d+26]),j=v[g])))):j=0}else{j=0}}else{j=0}}else{j=0}}}}while(0);s=i;return j}Zc.X=1;function $c(b,d,a,e){var f,g,h=s;s+=32;var i=h+16;g=h>>2;v[g]=0;v[g+1]=0;v[g+2]=0;v[g+3]=0;var j=qd(a,e,h);if(0==(j|0)){b=0}else{g=P(d,0);f=i>>2;var k=i+4|0,l=j;a:for(;;){if(l>>>0>=e>>>0){var o=l;break}v[f]=0;v[f+1]=0;v[f+2]=0;v[f+3]=0;var j=a+l|0,t=qd(j,e-l|0,i),q=0==(t|0);do{if(!q){if(0!=(v[k>>2]|0)){var r=l;break}o=t+l|0;break a}r=l}while(0);for(;;){var w=r+1|0;if(w>>>0>=e>>>0){break}if(10==u[a+r|0]<<24>>24){break}r=w}l>>>0>>0&&(l=w-l|0,0==(Xc(j,l)|0)?L(g,j,l):O(g,10));l=w}a=v[g+4>>2];0!=(a|0)&&10!=u[v[g>>2]+(a-1)|0]<<24>>24&&O(g,10);a=v[d>>2];if(0!=(a|0)){H[a](b,g,0!=(v[h+4>>2]|0)?h:0,v[d+104>>2])}R(d,0);b=o}s=h;return b}$c.X=1;function ad(b,d,a,e){var f,g=s;s+=8;var h=g+4;f=h>>2;v[f]=0;var i=P(d,1),j=P(d,0),h=rd(i,d,a,e,g,h),k=0==(h|0);do{if(k){var l=0,o=v[f]}else{for(var t=v[g>>2],o=v[f],l=h;l>>>0>>0;){for(var q=0,r=l;r>>>0>>0;){var w=z[a+r|0];if(10==w<<24>>24){break}q=(124==w<<24>>24&1)+q|0;r=r+1|0}if(0==(q|0)|(r|0)==(e|0)){break}sd(j,d,a+l|0,r-l|0,t,o,0);l=r+1|0}t=v[d+32>>2];if(0!=(t|0)){H[t](b,i,j,v[d+104>>2])}}}while(0);Nc(o);R(d,1);R(d,0);s=g;return l}ad.X=1;function bd(b,d){var a=0==(d|0)?0:32==u[b]<<24>>24&1,a=a>>>0>>0?(32==u[b+a|0]<<24>>24&1)+a|0:a,a=a>>>0>>0?(32==u[b+a|0]<<24>>24&1)+a|0:a;if(a>>>0>>0){if(62!=u[b+a|0]<<24>>24){a=0}else{var e=a+1|0;if(e>>>0>>0){return 32==u[b+e|0]<<24>>24?a+2|0:e}a=e}}else{a=0}return a}function cd(b,d){var a;if(3>>0){if(32!=u[b]<<24>>24){a=7}else{if(32!=u[b+1|0]<<24>>24){a=7}else{if(32!=u[b+2|0]<<24>>24){a=7}else{if(32==u[b+3|0]<<24>>24){var e=4;a=8}else{a=7}}}}}else{a=7}7==a&&(e=0);return e}function td(b,d){var a=u[b];a:do{if(61==a<<24>>24){for(var e=1;;){if(e>>>0>=d>>>0){var f=e;break}if(61!=u[b+e|0]<<24>>24){f=e;break}e=e+1|0}for(;;){if(f>>>0>=d>>>0){var g=1;break}e=z[b+f|0];if(32==e<<24>>24){f=f+1|0}else{g=10==e<<24>>24;break}}e=g&1}else{if(45==a<<24>>24){for(e=1;;){if(e>>>0>=d>>>0){var h=e;break}if(45!=u[b+e|0]<<24>>24){h=e;break}e=e+1|0}for(;;){if(h>>>0>=d>>>0){e=2;break a}var i=z[b+h|0];if(32!=i<<24>>24){break}h=h+1|0}e=10==i<<24>>24?2:0}else{e=0}}}while(0);return e}function id(b,d,a,e){var f=P(d,0),g=0,h=0,i=0;a:for(;;){for(;;){if(i>>>0>=e>>>0){var j=i;break a}for(var k=i;;){var l=k+1|0;if(l>>>0>=e>>>0){var o=0;break}if(10==u[a+k|0]<<24>>24){o=1;break}k=l}var t=a+i|0,q=l-i|0,r=bd(t,q),w=0==(r|0);do{if(w){if(0!=(Xc(t,q)|0)){if(!o){j=l;break a}var k=a+l|0,x=e-l|0;if(0==(bd(k,x)|0)&&0==(Xc(k,x)|0)){j=l;break a}}k=i}else{k=r+i|0}}while(0);if(k>>>0>>0){break}i=l}t=a+k|0;if(0==(g|0)){g=t}else{if(i=g+h|0,(t|0)!=(i|0)){if(q=l-k|0,t>2];if(0!=(a|0)){H[a](b,f,v[d+104>>2])}R(d,0);return j}id.X=1;function hd(b,d,a,e){for(var f=P(d,0),g=0;g>>>0>>0;){for(var h=g;;){var i=h+1|0;if(i>>>0>=e>>>0){break}if(10==u[a+h|0]<<24>>24){break}h=i}var h=a+g|0,j=i-g|0,k=cd(h,j);if(0==(k|0)){if(0==(Xc(h,j)|0)){break}h=g}else{h=k+g|0}h>>>0>>0&&(g=a+h|0,h=i-h|0,0==(Xc(g,h)|0)?L(f,g,h):O(f,10));g=i}a=f+4|0;e=f|0;for(i=v[a>>2];0!=(i|0);){i=i-1|0;if(10!=u[v[e>>2]+i|0]<<24>>24){break}v[a>>2]=i}O(f,10);a=v[d>>2];if(0!=(a|0)){H[a](b,f,0,v[d+104>>2])}R(d,0);return g}hd.X=1;function dd(b,d){var a=0==(d|0)?0:32==u[b]<<24>>24&1,a=a>>>0>>0?(32==u[b+a|0]<<24>>24&1)+a|0:a,a=a>>>0>>0?(32==u[b+a|0]<<24>>24&1)+a|0:a,e=a+1|0;if(e>>>0>>0){var f=b+a|0,g=u[f];if((42==g<<24>>24||43==g<<24>>24||45==g<<24>>24)&&32==u[b+e|0]<<24>>24){return 0==(vd(f,d-a|0)|0)?a+2|0:0}}return 0}function gd(b,d,a,e,f){var g,h=s;s+=4;g=h>>2;v[g]=f;for(var f=P(d,0),i=0;;){if(i>>>0>=e>>>0){var j=i;break}var k=wd(f,d,a+i|0,e-i|0,h),i=k+i|0;if(0==(k|0)){j=i;break}if(0!=(v[g]&8|0)){j=i;break}}a=v[d+20>>2];if(0!=(a|0)){H[a](b,f,v[g],v[d+104>>2])}R(d,0);s=h;return j}function ed(b,d){var a=0==(d|0)?0:32==u[b]<<24>>24&1,a=a>>>0>>0?(32==u[b+a|0]<<24>>24&1)+a|0:a,a=a>>>0>>0?(32==u[b+a|0]<<24>>24&1)+a|0:a,e=a>>>0>>0;do{if(e&&9>=(u[b+a|0]-48&255)){for(var f=a;;){if(f>>>0>=d>>>0){var g=f+1|0;break}var h=f+1|0;if(10<=(u[b+f|0]-48&255)){g=h;break}f=h}if(g>>>0>>0&&(h=b+f|0,46==u[h]<<24>>24&&32==u[b+g|0]<<24>>24)){return 0==(vd(h,d-f|0)|0)?f+2|0:0}}}while(0);return 0}ed.X=1;function fd(b,d,a,e){var f=d>>2,g=d+420|0,h=d+8|0,i=0;a:for(;;){if(i>>>0>=e>>>0){var j=0,k=i;break}for(var l=i;;){var o=l+1|0;if(o>>>0>=e>>>0){break}if(10==u[a+l|0]<<24>>24){break}l=o}var l=a+i|0,t=e-i|0;if(0!=(Xc(l,t)|0)){j=0;k=o;break}var q=td(l,t);if(0!=(q|0)){j=q;k=o;break}if(0!=(Wc(d,l,t)|0)){j=0;k=i;break}if(0!=(Yc(l,t)|0)){j=0;k=i;break}if(0!=(bd(l,t)|0)){j=0;k=i;break}if(0!=(v[g>>2]&256|0)&&0==(xd(z[l]&255)|0)){if(0!=(ed(l,t)|0)){j=0;k=i;break}if(0!=(dd(l,t)|0)){j=0;k=i;break}q=60==u[l]<<24>>24;do{if(q&&0!=(v[h>>2]|0)&&0!=(Zc(b,d,l,t,0)|0)){j=0;k=i;break a}}while(0);if(0!=(v[g>>2]&4|0)&&0!=(qd(l,t,0)|0)){j=0;k=i;break}}i=o}for(e=i;;){if(0==(e|0)){var r=0;break}g=e-1|0;if(10!=u[a+g|0]<<24>>24){r=1;break}e=g}if(0==(j|0)){j=P(d,0);kd(j,d,a,e);a=v[f+7];if(0!=(a|0)){H[a](b,j,v[f+26])}R(d,0)}else{a:do{if(r){for(g=e;;){h=g-1|0;if(0==(h|0)){var w=0;break}if(10==u[a+h|0]<<24>>24){w=h;break}g=h}for(;;){if(0==(w|0)){h=a;g=e;break a}h=w-1|0;if(10!=u[a+h|0]<<24>>24){break}w=h}h=P(d,0);kd(h,d,a,w);i=v[f+7];if(0!=(i|0)){H[i](b,h,v[f+26])}R(d,0);h=a+g|0;g=e-g|0}else{h=a,g=0}}while(0);a=P(d,1);kd(a,d,h,g);r=v[f+3];if(0!=(r|0)){H[r](b,a,j,v[f+26])}R(d,1)}return k}fd.X=1;function qd(b,d,a){var e,f;f=3>d>>>0;if(f){var g=0}else{var h=32==u[b]<<24>>24?32!=u[b+1|0]<<24>>24?1:32==u[b+2|0]<<24>>24?3:2:0;if((h+2|0)>>>0>>0){if(g=z[b+h|0],126==g<<24>>24||96==g<<24>>24){for(var i=0;h>>>0>>0&&u[b+h|0]<<24>>24==g<<24>>24;){i=i+1|0,h=h+1|0}g=3>i>>>0?0:h}else{g=0}}else{g=0}}f=g;g=0==(f|0);a:do{if(g){i=0}else{for(i=f;;){var j=b+i|0;if(i>>>0>=d>>>0){var k=0,l=i;e=17;break}var h=u[j],o=i+1|0;if(32==h<<24>>24){i=o}else{123==h<<24>>24?e=5:(k=0,l=i,e=17);break}}b:do{if(5==e){for(var t=b+o|0,q=0,r=i;;){var w=r+1|0;if(w>>>0>=d>>>0){break}h=u[b+w|0];if(125==h<<24>>24||10==h<<24>>24){break}q=q+1|0;r=w}if((w|0)==(d|0)){i=0;break a}if(125!=u[b+w|0]<<24>>24){i=0;break a}for(;;){if(0==(q|0)){var x=0;break}if(0==(V(z[t]&255)|0)){x=q;break}t=t+1|0;q=q-1|0}for(;0!=(x|0);){q=x-1|0;if(0==(V(z[t+q|0]&255)|0)){break}x=q}q=t;t=x;r=r+2|0}else{if(17==e){for(;;){if(l>>>0>=d>>>0){q=j;t=k;r=l;break b}if(0!=(V(z[b+l|0]&255)|0)){q=j;t=k;r=l;break b}k=k+1|0;l=l+1|0}}}}while(0);0==(a|0)?(i=r,e=22):(v[a>>2]=q,v[a+4>>2]=t,i=r);for(;i>>>0>>0;){h=z[b+i|0];if(10==h<<24>>24){break}if(0==(V(h&255)|0)){i=0;break a}i=i+1|0}i=i+1|0}}while(0);return i}qd.X=1;function P(b,d){var a,e=b+12*d+396|0;a=b+12*d+400|0;var f=B[a>>2];if(f>>>0>2)+(3*d|0)]>>>0){var g=(f<<2)+v[e>>2]|0;if(0==(v[g>>2]|0)){a=5}else{v[a>>2]=f+1|0;var h=v[g>>2];v[(h+4|0)>>2]=0;a=6}}else{a=5}5==a&&(h=Ac(v[yd+(d<<2)>>2]),a=(e+4|0)>>2,0>(zd(e,v[a]<<1)|0)||(f=v[a],v[a]=f+1|0,v[((f<<2)+v[e>>2]|0)>>2]=h));return h}function R(b,d){var a=b+12*d+400|0;v[a>>2]=v[a>>2]-1|0}function kd(b,d,a,e){var f,g=s;s+=16;f=g>>2;v[f]=0;v[f+1]=0;v[f+2]=0;v[f+3]=0;f=(v[d+400>>2]+v[d+412>>2]|0)>>>0>B[d+424>>2]>>>0;a:do{if(!f){for(var h=d+92|0,i=g|0,j=g+4|0,k=d+104|0,l=0,o=0,t=0;;){if(t>>>0>=e>>>0){break a}for(var q=o;;){if(q>>>0>=e>>>0){var r=l,w=0;break}o=z[d+(z[a+q|0]&255)+140|0];if(0!=o<<24>>24){r=o;w=1;break}l=0;q=q+1|0}o=B[h>>2];l=a+t|0;0==(o|0)?L(b,l,q-t|0):(v[i>>2]=l,v[j>>2]=q-t|0,H[o](b,g,v[k>>2]));if(!w){break a}t=H[v[Ad+((r&255)<<2)>>2]](b,d,a+q|0,q,e-q|0);0==(t|0)?(l=r,o=q+1|0):(q=t+q|0,l=r,o=q);t=q}}}while(0);s=g}kd.X=1;function Bd(b,d,a,e,f){e=z[a];if(2>>0){var g=a+1|0,h=z[g],i=h&255;if(h<<24>>24==e<<24>>24){3>>0?(g=a+2|0,h=z[g],h<<24>>24==e<<24>>24?4>>0?(a=a+3|0,g=z[a],g<<24>>24==e<<24>>24|126==e<<24>>24?b=0:0!=(V(g&255)|0)?b=0:(b=Cd(b,d,a,f-3|0,e),b=0==(b|0)?0:b+3|0)):b=0:0!=(V(h&255)|0)?b=0:(b=Dd(b,d,g,f-2|0,e),b=0==(b|0)?0:b+2|0)):b=0}else{if(126==e<<24>>24){b=0}else{if(0!=(V(i)|0)){b=0}else{return b=Ed(b,d,g,f-1|0,e),0==(b|0)?0:b+1|0}}}}else{b=0}return b}Bd.X=1;function Fd(b,d,a,e,f){var g,e=s;s+=16;var h;g=e>>2;for(var i=0;;){if(i>>>0>=f>>>0){var j=i,k=0,l=0;h=8;break}var o=z[a+i|0];if(96!=o<<24>>24){h=5;break}i=i+1|0}a:do{if(5==h){if(0==(i|0)){var t=i;h=9}else{for(var q=i,r=1,w=o;;){r=96==w<<24>>24?r:0;q=q+1|0;w=q>>>0>>0;if(!(w&r>>>0>>0)){j=q;k=r;l=w;h=8;break a}w=u[a+q|0];r=r+1|0}}}}while(0);if(8==h){if(k>>>0>=i>>>0|l){t=j,h=9}else{var x=0;h=18}}if(9==h){for(f=i;f>>>0>>0&&32==u[a+f|0]<<24>>24;){f=f+1|0}for(h=t-i|0;h>>>0>i>>>0;){j=h-1|0;if(32!=u[a+j|0]<<24>>24){break}h=j}if(f>>>0>>0){v[g]=a+f|0,v[g+1]=h-f|0,v[g+2]=0,v[g+3]=0,x=0==(H[v[d+48>>2]](b,e,v[d+104>>2])|0)?0:t}else{return b=0==(H[v[d+48>>2]](b,0,v[d+104>>2])|0)?0:t,s=e,b}}s=e;return x}Fd.X=1;function Gd(b,d,a,e,f){var g=d>>2;if(0==(e|0)){var h=e=d+412|0,i=v[e>>2],e=6}else{var e=d+412|0,j=B[e>>2];if(33!=u[a-1|0]<<24>>24){h=e,i=j,e=6}else{if(0==(v[g+15]|0)){var k=0,l=1,o=e,t=j,e=92}else{var q=1,r=e,w=j,e=7}}}6==e&&(0==(v[g+17]|0)?(k=0,l=1,o=h,t=i,e=92):(q=0,r=h,w=i,e=7));a:do{if(7==e){o=0;h=l=1;b:for(;;){if(h>>>0>=f>>>0){k=0;l=h;o=r;t=w;break a}k=z[a+h|0];t=10==k<<24>>24;do{if(t){i=1,j=l}else{var x=h-1|0;if(92==u[a+x|0]<<24>>24){i=o,j=l}else{if(91==k<<24>>24){i=o,j=l+1|0}else{if(93==k<<24>>24){j=l-1|0;if(1>(j|0)){break b}i=o}else{i=o,j=l}}}}}while(0);o=i;l=j;h=h+1|0}for(l=k=h+1|0;;){if(l>>>0>=f>>>0){e=69;break}var D=z[a+l|0],y=l+1|0;if(0==(V(D&255)|0)){e=18;break}l=y}do{if(18==e){if(40==D<<24>>24){for(var A=l;;){var E=A+1|0;if(E>>>0>=f>>>0){var G=E;break}if(0==(V(z[a+E|0]&255)|0)){G=E;break}A=E}b:for(;;){if(G>>>0>=f>>>0){k=0;l=G;o=r;t=w;break a}var N=z[a+G|0];if(92==N<<24>>24){G=G+2|0}else{if(41==N<<24>>24){var I=G,M=G,J=0,S=0,e=46;break}else{var Q=0==(G|0);do{if(!Q&&0!=(V(z[a+(G-1)|0]&255)|0)&&(39==N<<24>>24||34==N<<24>>24)){e=28;break b}}while(0);G=G+1|0}}}do{if(28==e){J=G+1|0;I=0;M=J;b:for(;;){c:do{if(I){for(var $=M;;){if($>>>0>=f>>>0){k=0;l=$;o=r;t=w;break a}S=z[a+$|0];if(92==S<<24>>24){$=$+2|0}else{if(S<<24>>24==N<<24>>24){var Ha=$;break c}if(41==S<<24>>24){var Qa=$;break b}$=$+1|0}}}else{for(S=M;;){if(S>>>0>=f>>>0){k=0;l=S;o=r;t=w;break a}Q=z[a+S|0];if(92==Q<<24>>24){S=S+2|0}else{if(Q<<24>>24==N<<24>>24){Ha=S;break c}S=S+1|0}}}}while(0);I=1;M=Ha+1|0}for(;;){var pa=Qa-1|0,ka=z[a+pa|0];if(pa>>>0<=J>>>0){break}if(0==(V(ka&255)|0)){break}Qa=pa}39==ka<<24>>24||34==ka<<24>>24?(I=$,M=G,S=pa):(M=I=$,S=J=0)}}while(0);for(e=M;;){var qa=e-1|0,Q=z[a+qa|0];if(e>>>0<=E>>>0){var eb=Q;break}if(0==(V(Q&255)|0)){eb=Q;break}e=qa}A=60==u[a+E|0]<<24>>24?A+2|0:E;e=62==eb<<24>>24?qa:e;e>>>0>A>>>0?(Q=P(d,1),L(Q,a+A|0,e-A|0),e=Q):e=0;if(S>>>0>J>>>0){A=P(d,1);L(A,a+J|0,S-J|0);var Y=A}else{Y=0}A=I+1|0;Q=e;e=80}else{if(91==D<<24>>24){for(e=y;;){if(e>>>0>=f>>>0){k=0;l=e;o=r;t=w;break a}var Ia=e+1|0;if(93==u[a+e|0]<<24>>24){break}e=Ia}if((y|0)==(e|0)){if(0==(o|0)){Q=a+1|0,A=x}else{A=P(d,1);Q=1>>0;b:do{if(Q){for(Y=1;;){if(t=z[a+Y|0],10==t<<24>>24?32!=u[a+(Y-1)|0]<<24>>24&&O(A,32):O(A,t&255),Y=Y+1|0,(Y|0)==(h|0)){break b}}}}while(0);Q=v[A>>2];A=v[A+4>>2]}}else{Q=a+y|0,A=e-y|0}Y=Hd(d+108|0,Q,A);if(0==(Y|0)){k=0;l=e;o=r;t=w;break a}A=Ia;Q=v[Y+4>>2];Y=v[Y+8>>2];e=80}else{e=69}}}}while(0);if(69==e){if(0==(o|0)){A=x,o=a+1|0}else{o=P(d,1);A=1>>0;b:do{if(A){for(Q=1;;){if(Y=z[a+Q|0],10==Y<<24>>24?32!=u[a+(Q-1)|0]<<24>>24&&O(o,32):O(o,Y&255),Q=Q+1|0,(Q|0)==(h|0)){break b}}}}while(0);A=v[o+4>>2];o=v[o>>2]}o=Hd(d+108|0,o,A);if(0==(o|0)){k=0;o=r;t=w;break}A=k;Q=v[o+4>>2];Y=v[o+8>>2]}1>>0?(h=P(d,1),q?L(h,a+1|0,x):(l=d+428|0,v[l>>2]=1,kd(h,d,a+1|0,x),v[l>>2]=0)):h=0;0==(Q|0)?l=0:(l=P(d,1),Id(l,Q));q?(k=b+4|0,o=v[k>>2],0!=(o|0)&&(o=o-1|0,33==u[v[b>>2]+o|0]<<24>>24&&(v[k>>2]=o)),k=H[v[g+15]](b,l,Y,h,v[g+26])):k=H[v[g+17]](b,l,Y,h,v[g+26]);l=A;o=r;t=w}}while(0);v[o>>2]=t;return 0!=(k|0)?l:0}Gd.X=1;function V(b){return(32==(b|0)|10==(b|0))&1}function Jd(b,d,a,e,f){var g,h=s;s+=4;g=(d+68|0)>>2;if(0==(v[g]|0)){b=0}else{if(0!=(v[d+428>>2]|0)){b=0}else{var i=P(d,1);if(0==(e|0)){e=5}else{if(e=a-1|0,0!=(Kd(z[e]&255)|0)){e=5}else{if(0==(Ld(z[e]&255)|0)|4>f>>>0){var j=0,e=12}else{e=6}}}5==e&&(4>f>>>0?(j=0,e=12):e=6);if(6==e){if(0!=(Rc(a,K.Nb|0,4)|0)){j=0}else{if(j=Md(a,f,0),0==(j|0)){j=0}else{for(;j>>>0>>0&&0==(Ld(z[a+j|0]&255)|0);){j=j+1|0}j=Nd(a,j);0==(j|0)?j=0:(L(i,a,j),v[h>>2]=0)}}}a=j;if(0!=(a|0)){f=P(d,1);L(f,K.u|0,7);L(f,v[i>>2],v[i+4>>2]);e=b+4|0;v[e>>2]=v[e>>2]-v[h>>2]|0;e=d+92|0;if(0==(v[e>>2]|0)){H[v[g]](b,f,0,i,v[d+104>>2])}else{var j=P(d,1),k=d+104|0;H[v[e>>2]](j,i,v[k>>2]);H[v[g]](b,f,0,j,v[k>>2]);R(d,1)}R(d,1)}R(d,1);b=a}}s=h;return b}Jd.X=1;function Od(b,d,a,e,f){var e=d+84|0,g=0==(v[e>>2]|0)|2>f>>>0;a:do{if(g){var h=0}else{h=40==u[a+1|0]<<24>>24;b:do{if(h){for(var i=2;i>>>0>>0&&41!=u[a+i|0]<<24>>24&&92!=u[a+(i-1)|0]<<24>>24;){i=i+1|0}if((i|0)==(f|0)){h=0;break a}var j=2}else{for(var k=1;;){if(k>>>0>=f>>>0){i=k;j=1;break b}if(0!=(V(z[a+k|0]&255)|0)){i=k;j=1;break b}k=k+1|0}}}while(0);(i|0)==(j|0)?h=2==(j|0)?3:0:(h=i-j|0,k=P(d,1),kd(k,d,a+j|0,h),H[v[e>>2]](b,k,v[d+104>>2]),R(d,1),h=(2==(j|0)&1)+i|0)}}while(0);return h}Od.X=1;function Pd(b,d,a){var a=a>>2,e=3>d>>>0;a:do{if(e){var f=0}else{if(60!=u[b]<<24>>24){f=0}else{var g=47==u[b+1|0]<<24>>24?2:1;if(0==(xd(z[b+g|0]&255)|0)){f=0}else{for(v[a]=0;g>>>0>>0;){var h=b+g|0;if(0==(xd(z[h]&255)|0)&&(h=u[h],!(46==h<<24>>24||43==h<<24>>24||45==h<<24>>24))){break}g=g+1|0}h=1>>0;do{if(h){var i=b+g|0,j=64==u[i]<<24>>24;do{if(j){var k,l=k=0;b:for(;;){if(l>>>0>=(d-g|0)>>>0){var o=0;break}var t=i+l|0,q=0==(xd(z[t]&255)|0);do{if(q){var r=z[t]&255;if(64==(r|0)){r=k+1|0}else{if(45==(r|0)||46==(r|0)||95==(r|0)){r=k}else{o=62==(r|0)?1==(k|0)?l+1|0:0:0;break b}}}else{r=k}}while(0);k=r;l=l+1|0}k=o;if(0!=(k|0)){v[a]=2;f=k+g|0;break a}}}while(0);2>>0?58!=u[i]<<24>>24?i=g:(v[a]=1,i=g+1|0):i=g}else{i=g}}while(0);g=i>>>0>>0;do{if(g){if(0==(v[a]|0)){h=i}else{for(h=i;;){if(h>>>0>=d>>>0){f=0;break a}var w=z[b+h|0];if(92==w<<24>>24){h=h+2|0}else{if(62==w<<24>>24||39==w<<24>>24||34==w<<24>>24||32==w<<24>>24||10==w<<24>>24){break}else{h=h+1|0}}}if(h>>>0>i>>>0&62==w<<24>>24){f=h+1|0;break a}v[a]=0}}else{v[a]=0,h=i}}while(0);for(;;){if(h>>>0>=d>>>0){f=0;break a}g=h+1|0;if(62==u[b+h|0]<<24>>24){f=g;break a}h=g}}}}}while(0);return f}Pd.X=1;function Id(b,d){var a,e=d+4|0;a=(d|0)>>2;for(var f=0;;){var g=B[e>>2];if(f>>>0>=g>>>0){break}for(var h=f;h>>>0>>0&&92!=u[v[a]+h|0]<<24>>24;){h=h+1|0}h>>>0>f>>>0?(L(b,v[a]+f|0,h-f|0),f=v[e>>2]):f=g;g=h+1|0;if(g>>>0>=f>>>0){break}O(b,z[v[a]+g|0]&255);f=h+2|0}}function Hd(b,d,a){d=Vc(d,a);for(b=((d&7)<<2)+b|0;;){b=v[b>>2];if(0==(b|0)){var e=0;break}if((v[b>>2]|0)==(d|0)){e=b;break}b=b+12|0}return e}function Vc(b,d){var a=0==(d|0);a:do{if(a){var e=0}else{for(var f=0,g=0;;){if(g=Qd(z[b+f|0]&255)-g+65600*g|0,f=f+1|0,(f|0)==(d|0)){e=g;break a}}}}while(0);return e}function Ed(b,d,a,e,f){var g=d+56|0,h=0==(v[g>>2]|0);a:do{if(h){var i=0}else{for(var i=d+420|0,j=1>>0?u[a]<<24>>24!=f<<24>>24?0:u[a+1|0]<<24>>24==f<<24>>24&1:0;;){if(j>>>0>=e>>>0){i=0;break a}var k=Rd(a+j|0,e-j|0,f);if(0==(k|0)){i=0;break a}k=k+j|0;if(k>>>0>=e>>>0){i=0;break a}if(u[a+k|0]<<24>>24==f<<24>>24&&0==(V(z[a+(k-1)|0]&255)|0)){var l=k+1|0;if(0==(v[i>>2]&1|0)|(l|0)==(e|0)){break}j=z[a+l|0]&255;if(0!=(V(j)|0)){break}if(0!=(Kd(j)|0)){break}}j=k}i=P(d,1);kd(i,d,a,k);i=H[v[g>>2]](b,i,v[d+104>>2]);R(d,1);i=0==(i|0)?0:l}}while(0);return i}Ed.X=1;function Dd(b,d,a,e,f){var g=B[(126==f<<24>>24?d+80|0:d+52|0)>>2],h=0==(g|0);a:do{if(h){var i=0}else{for(i=0;;){if(i>>>0>=e>>>0){i=0;break a}var j=Rd(a+i|0,e-i|0,f);if(0==(j|0)){i=0;break a}j=j+i|0;i=j+1|0;if(i>>>0>>0&&u[a+j|0]<<24>>24==f<<24>>24&&!(u[a+i|0]<<24>>24!=f<<24>>24|0==(j|0))&&0==(V(z[a+(j-1)|0]&255)|0)){break}}i=P(d,1);kd(i,d,a,j);i=H[g](b,i,v[d+104>>2]);R(d,1);i=0==(i|0)?0:j+2|0}}while(0);return i}function Cd(b,d,a,e,f){var g=0;a:for(;;){if(g>>>0>=e>>>0){var h=0;break}var i=Rd(a+g|0,e-g|0,f);if(0==(i|0)){h=0;break}g=i+g|0;if(u[a+g|0]<<24>>24==f<<24>>24&&0==(V(z[a+(g-1)|0]&255)|0)){var i=g+2|0,j=i>>>0>>0,k=g+1|0;do{if(j&&u[a+k|0]<<24>>24==f<<24>>24&&u[a+i|0]<<24>>24==f<<24>>24&&(h=d+76|0,0!=(v[h>>2]|0))){e=P(d,1);kd(e,d,a,g);b=H[v[h>>2]](b,e,v[d+104>>2]);R(d,1);h=0==(b|0)?0:g+3|0;break a}}while(0);if(k>>>0>>0&&u[a+k|0]<<24>>24==f<<24>>24){return d=Ed(b,d,a-2|0,e+2|0,f),0==(d|0)?0:d-2|0}d=Dd(b,d,a-1|0,e+1|0,f);h=0==(d|0)?0:d-1|0;break}}return h}Cd.X=1;function Rd(b,d,a){var e=1;a:for(;;){if(e>>>0>=d>>>0){var f=0;break}for(var g=e;g>>>0>>0;){e=z[b+g|0];if(e<<24>>24==a<<24>>24){break}if(96==e<<24>>24||91==e<<24>>24){break}g=g+1|0}if((g|0)==(d|0)){f=0;break}e=z[b+g|0];if(e<<24>>24==a<<24>>24){f=g;break}var h=0==(g|0);do{if(!h&&92==u[b+(g-1)|0]<<24>>24){e=g+1|0;continue a}}while(0);if(96==e<<24>>24){h=g;for(e=0;;){if(h>>>0>=d>>>0){f=0;break a}var i=z[b+h|0];if(96!=i<<24>>24){break}h=h+1|0;e=e+1|0}if(0==(e|0)){e=h}else{for(var g=1,j=0,k=i;;){var l=0==(j|0)?k<<24>>24==a<<24>>24?h:0:j,g=96==k<<24>>24?g:0,o=h+1|0,t=o>>>0>>0;if(!(t&g>>>0>>0)){break}k=u[b+o|0];g=g+1|0;h=o;j=l}if(!t){f=l;break}e=o}}else{if(91==e<<24>>24){for(e=0;;){h=g+1|0;if(h>>>0>=d>>>0){break}j=z[b+h|0];if(93==j<<24>>24){break}e=0==(e|0)&j<<24>>24==a<<24>>24?h:e;g=h}for(h=g+2|0;;){if(h>>>0>=d>>>0){f=e;break a}var q=z[b+h|0];if(!(32==q<<24>>24||10==q<<24>>24)){break}h=h+1|0}g=q&255;if(91==(g|0)){g=93}else{if(40==(g|0)){g=41}else{if(0==(e|0)){e=h;continue}f=e;break}}for(;;){j=h+1|0;if(j>>>0>=d>>>0){f=e;break a}k=z[b+j|0];if((k&255|0)==(g|0)){break}e=0==(e|0)&k<<24>>24==a<<24>>24?j:e;h=j}e=h+2|0}else{e=g}}}return f}Rd.X=1;function vd(b,d){for(var a=0;;){if(a>>>0>=d>>>0){var e=a+1|0;break}var f=a+1|0;if(10==u[b+a|0]<<24>>24){e=f;break}a=f}return e>>>0>>0?td(b+e|0,d-e|0):0}function wd(b,d,a,e,f){for(var g,h,f=f>>2,i,j=0;3>j>>>0&j>>>0>>0&&32==u[a+j|0]<<24>>24;){j=j+1|0}g=dd(a,e);if(0==(g|0)){if(g=ed(a,e),0==(g|0)){var k=0;i=51}else{h=g,i=7}}else{h=g,i=7}if(7==i){for(var l=h;l>>>0>>0&&10!=u[a+(l-1)|0]<<24>>24;){l=l+1|0}g=P(d,1);k=P(d,1);L(g,a+h|0,l-h|0);var o=d+420|0;h=(g+4|0)>>2;var t=0,q=0;i=l;l=0;a:for(;;){for(var r=0,w=i;;){if(w>>>0>=e>>>0){var x=q;break a}for(var D=w;;){var y=D+1|0;if(y>>>0>=e>>>0){break}if(10==u[a+D|0]<<24>>24){break}D=y}D=y-w|0;if(0==(Xc(a+w|0,D)|0)){var A=0;break}r=1;w=y}for(;4>A>>>0;){i=A+w|0;if(i>>>0>=y>>>0){break}if(32!=u[a+i|0]<<24>>24){break}A=A+1|0}t=0==(v[o>>2]&4|0)?t:0==(qd(a+A+w|0,D-A|0,0)|0)?t:0==(t|0)&1;if(0==(t|0)){var E=a+A+w|0,G=D-A|0;i=ed(E,G);E=dd(E,G)}else{E=i=0}r=0!=(r|0);do{if(r){var G=v[f],N=G&1;if(!(0==(N|0)|0==(E|0)&&0!=(N|0)|0==(i|0))){v[f]=G|8;x=q;break a}}}while(0);i=0==(E|0)?0==(i|0)?34:31:0!=(Yc(a+A+w|0,D-A|0)|0)&0==(i|0)?34:31;do{if(31==i){var I=r?1:q;if((A|0)==(j|0)){x=I;break a}var M=0!=(l|0)?l:v[h]}else{if(34==i){if(r&0==(A|0)){v[f]|=8;x=q;break a}r?(O(g,10),I=1):I=q;M=l}}}while(0);L(g,a+A+w|0,D-A|0);q=I;i=y;l=M}a=v[f];0==(x|0)?x=a:(x=a|2,v[f]=x);a=B[h];e=0!=(l|0)&l>>>0>>0;g=(g|0)>>2;y=v[g];0==(x&2|0)?e?(kd(k,d,y,l),Tc(k,d,v[g]+l|0,v[h]-l|0)):kd(k,d,y,a):e?(Tc(k,d,y,l),Tc(k,d,v[g]+l|0,v[h]-l|0)):Tc(k,d,y,a);h=v[d+24>>2];if(0!=(h|0)){H[h](b,k,v[f],v[d+104>>2])}R(d,1);R(d,1);k=w}return k}wd.X=1;function rd(b,d,a,e,f,g){for(var h,i=0,j=0;i>>>0>>0;){var k=z[a+i|0];if(10==k<<24>>24){break}j=(124==k<<24>>24&1)+j|0;i=i+1|0}k=(i|0)==(e|0)|0==(j|0);do{if(k){var l=0}else{for(l=i;;){if(0==(l|0)){var o=((124==u[a]<<24>>24)<<31>>31)+j|0,t=0;break}var q=l-1|0,r=z[a+q|0];if(0!=(V(r&255)|0)){l=q}else{o=((124==u[a]<<24>>24)<<31>>31)+((124==r<<24>>24)<<31>>31)+j|0;t=l;break}}l=o+1|0;v[f>>2]=l;l=Uc(l,4);v[g>>2]=l;l=i+1|0;for(l=q=l>>>0>>0?124==u[a+l|0]<<24>>24?i+2|0:l:l;;){if(l>>>0>=e>>>0){var w=0,x=q;break}if(10==u[a+l|0]<<24>>24){w=0;x=q;break}l=l+1|0}a:for(;w>>>0>2]>>>0&x>>>0>>0;){for(q=x;;){var D=u[a+q|0];if(q>>>0>=l>>>0){h=19;break}if(32==D<<24>>24){q=q+1|0}else{if(58==D<<24>>24){h=20}else{var y=0,A=q;h=21}break}}19==h&&(58==D<<24>>24?h=20:(y=0,A=q,h=21));20==h&&(y=(w<<2)+v[g>>2]|0,v[y>>2]|=1,y=1,A=q+1|0);for(;;){if(A>>>0>=l>>>0){var E=y,G=A;break}q=u[a+A|0];if(45==q<<24>>24){y=y+1|0,A=A+1|0}else{58==q<<24>>24?(E=(w<<2)+v[g>>2]|0,v[E>>2]|=2,E=y+1|0,G=A+1|0):(E=y,G=A);break}}for(r=G;;){if(r>>>0>=l>>>0){if(3>E>>>0){break a}var N=r+1|0;break}q=z[a+r|0];r=r+1|0;if(32!=q<<24>>24){if(124!=q<<24>>24|3>E>>>0){break a}N=r;break}}w=w+1|0;x=N}q=B[f>>2];w>>>0>>0?l=0:(sd(b,d,a,t,q,v[g>>2],4),l=l+1|0)}}while(0);return l}rd.X=1;function sd(b,d,a,e,f,g,h){var i,j,k=s;s+=16;j=(d+40|0)>>2;var l=0==(v[j]|0);do{if(!l){var o=d+36|0;if(0!=(v[o>>2]|0)){var t=P(d,1);i=0==(e|0)?0:124==u[a]<<24>>24&1;var q=0!=(f|0)&i>>>0>>0;a:do{if(q){for(var r=d+104|0,w=i,x=0;;){for(var D=P(d,1);;){if(w>>>0>=e>>>0){var y=w;break}if(0==(V(z[a+w|0]&255)|0)){y=w;break}w=w+1|0}for(;;){if(y>>>0>=e>>>0){var A=y;break}if(124==u[a+y|0]<<24>>24){A=y;break}y=y+1|0}for(;;){var E=A-1|0;if(E>>>0<=w>>>0){break}if(0==(V(z[a+E|0]&255)|0)){break}A=E}kd(D,d,a+w|0,A-w|0);H[v[j]](t,D,v[g+(x<<2)>>2]|h,v[r>>2]);R(d,1);D=y+1|0;x=x+1|0;if(!(x>>>0>>0&D>>>0>>0)){var G=x;break a}w=D}}else{G=0}}while(0);q=G>>>0>>0;a:do{if(q){i=k>>2;r=d+104|0;for(x=G;;){if(v[i]=0,v[i+1]=0,v[i+2]=0,v[i+3]=0,H[v[j]](t,k,v[g+(x<<2)>>2]|h,v[r>>2]),x=x+1|0,(x|0)==(f|0)){var N=r;break a}}}else{N=d+104|0}}while(0);H[v[o>>2]](b,t,v[N>>2]);R(d,1)}}}while(0);s=k}sd.X=1;function od(b,d,a,e){var f,g=uc(b),e=0==(e|0),h=g+3|0,i=a+1|0;a:do{if(e){for(var j=1;;){if(j>>>0>=a>>>0){var k=0;f=18;break a}for(;;){var l=j+1|0;if(l>>>0>=a>>>0){break}if(60==u[d+j|0]<<24>>24&&47==u[d+l|0]<<24>>24){break}j=l}if((h+j|0)>>>0>=a>>>0){k=0;f=18;break a}var o=Sd(b,g,d+j|0,i+(j^-1)|0);if(0!=(o|0)){var t=o,q=j;f=17;break a}j=l}}else{j=0;for(o=1;;){if(o>>>0>=a>>>0){k=0;f=18;break a}for(;;){var r=o+1|0;if(r>>>0>=a>>>0){break}var w=z[d+r|0];if(60==u[d+o|0]<<24>>24&47==w<<24>>24){break}j=(10==w<<24>>24&1)+j|0;o=r}if(!(0<(j|0)&&10!=u[d+(o-1)|0]<<24>>24)){if((h+o|0)>>>0>=a>>>0){k=0;f=18;break a}w=Sd(b,g,d+o|0,i+(o^-1)|0);if(0!=(w|0)){t=w;q=o;f=17;break a}}o=r}}}while(0);17==f&&(k=t+q|0);return k}od.X=1;function Sd(b,d,a,e){var f=d+3|0;f>>>0>>0?0!=(nd(a+2|0,b,d)|0)?a=0:62!=u[d+(a+2)|0]<<24>>24?a=0:(b=Xc(a+f|0,e-f|0),0==(b|0)?a=0:(f=b+f|0,a=(f>>>0>>0?Xc(a+f|0,e-f|0):0)+f|0)):a=0;return a}function zd(b,d){var a;a=(b+8|0)>>2;if(B[a]>>>0>>0){var e=b|0,f=Td(v[e>>2],d<<2);if(0==(f|0)){a=-1}else{var g=v[a];rb((g<<2)+f|0,d-g<<2);v[e>>2]=f;v[a]=d;a=b+4|0;B[a>>2]>>>0>d>>>0&&(v[a>>2]=d);a=0}}else{a=0}return a}function Mc(b){if(0!=(b|0)){var d=b|0;Nc(v[d>>2]);v[d>>2]=0;v[b+4>>2]=0;v[b+8>>2]=0}}function Qc(b,d){v[b>>2]=0;v[b+4>>2]=0;v[b+8>>2]=0;zd(b,0==(d|0)?8:d)}function Pc(b,d){4==(0==(b|0)?4:0==(v[b+12>>2]|0)?4:5)&&Oc(K.c|0,58,K.$|0,K.b|0);var a=16777216>>0;do{if(a){var e=-1}else{var e=b+8|0,f=B[e>>2];if(f>>>0>>0){var g=B[b+12>>2],f=g+f|0,h=f>>>0>>0;a:do{if(h){for(var i=f;;){if(i=g+i|0,i>>>0>=d>>>0){var j=i;break a}}}else{j=f}}while(0);g=b|0;f=Td(v[g>>2],j);0==(f|0)?e=-1:(v[g>>2]=f,v[e>>2]=j,e=0)}else{e=0}}}while(0);return e}function Ac(b){var d,a=qb(16);d=a>>2;0!=(a|0)&&(v[d]=0,v[d+2]=0,v[d+1]=0,v[d+3]=b);return a}function Ud(b,d){var a,e,f=s;s+=4;var g;g=0==(b|0)?4:0==(v[b+12>>2]|0)?4:5;4==g&&Oc(K.c|0,119,K.ba|0,K.b|0);e=(b+4|0)>>2;g=B[e];a=(b+8|0)>>2;g=g>>>0>>0?7:0>(Pc(b,g+1|0)|0)?13:7;do{if(7==g){var h=f;v[h>>2]=arguments[Ud.length];var i=b|0,j=v[e],k=Vd(v[i>>2]+j|0,v[a]-j|0,d,v[f>>2]);if(0<=(k|0)){j=B[e];if(k>>>0<(v[a]-j|0)>>>0){i=k,h=j}else{if(0>(Pc(b,j+(k+1)|0)|0)){break}v[h>>2]=arguments[Ud.length];h=v[e];i=Vd(v[i>>2]+h|0,v[a]-h|0,d,v[f>>2]);if(0>(i|0)){break}h=v[e]}v[e]=h+i|0}}}while(0);s=f}Ud.X=1;function L(b,d,a){var e,f;f=0==(b|0)?4:0==(v[b+12>>2]|0)?4:5;4==f&&Oc(K.c|0,157,K.ca|0,K.b|0);e=(b+4|0)>>2;f=B[e];var g=f+a|0;if(g>>>0>B[b+8>>2]>>>0){if(0>(Pc(b,g)|0)){f=9}else{var h=v[e];f=8}}else{h=f,f=8}8==f&&(ud(v[b>>2]+h|0,d,a),v[e]=v[e]+a|0)}function Wd(b,d){L(b,d,uc(d))}function O(b,d){var a,e;e=0==(b|0)?4:0==(v[b+12>>2]|0)?4:5;4==e&&Oc(K.c|0,178,K.da|0,K.b|0);a=(b+4|0)>>2;e=B[a];var f=e+1|0;if(f>>>0>B[b+8>>2]>>>0){if(0>(Pc(b,f)|0)){e=9}else{var g=v[a];e=8}}else{g=e,e=8}8==e&&(u[v[b>>2]+g|0]=d&255,v[a]=v[a]+1|0)}function Lc(b){0!=(b|0)&&(Nc(v[b>>2]),Nc(b))}function Xd(b,d){var a=0;a:for(;;){if(5<=a>>>0){var e=0;break}var f=B[Yd+(a<<2)>>2],g=uc(f),h=g>>>0>>0;do{if(h&&0==(nd(b,f,g)|0)&&0!=(xd(z[b+g|0]&255)|0)){e=1;break a}}while(0);a=a+1|0}return e}function Md(b,d,a){var e=0==(xd(z[b]&255)|0);do{if(e){var f=0}else{var f=d-1|0,g=0,h=1;a:for(;h>>>0>>0;){var i=b+h|0,j=z[i],k=46==j<<24>>24;do{if(k){var l=g+1|0}else{if(0==(xd(j&255)|0)&&45!=u[i]<<24>>24){break a}l=g}}while(0);g=l;h=h+1|0}f=0!=(a|0)?h:0!=(g|0)?h:0}}while(0);return f}function Nd(b,d){for(var a,e=0;;){if(e>>>0>=d>>>0){var f=d;break}if(60==u[b+e|0]<<24>>24){f=e;break}e=e+1|0}for(;;){if(0==(f|0)){var g=0;a=24;break}var h=f-1|0,i=z[b+h|0],j=i&255;if(0==(Zd(K.Yb|0,j,5)|0)){if(59!=i<<24>>24){a=14;break}for(e=f=f-2|0;0!=(e|0)&&0!=((97<=(z[b+e|0]&255)&&122>=(z[b+e|0]&255)||65<=(z[b+e|0]&255)&&90>=(z[b+e|0]&255))|0);){e=e-1|0}if(e>>>0>>0&&38==u[b+e|0]<<24>>24){f=e;continue}}f=h}do{if(14==a){if(34==(j|0)||39==(j|0)){a=j}else{if(41==(j|0)){a=40}else{if(93==(j|0)){a=91}else{if(125==(j|0)){a=123}else{g=f;break}}}}for(e=j=g=0;;){var k=z[b+e|0];if((k&255|0)==(a|0)){var l=j+1|0,k=g}else{l=j,k=(k<<24>>24==i<<24>>24&1)+g|0}e=e+1|0;if((e|0)==(f|0)){break}g=k;j=l}return(k|0)==(l|0)?f:h}}while(0);return g}Nd.X=1;function $d(b,d,a,e,f){for(var g=0;g>>>0>>0;){var h=z[a+(g^-1)|0]&255;if(0==(xd(h)|0)&&0==(Zd(K.Xb|0,h,5)|0)){break}g=g+1|0}e=0==(g|0);do{if(e){h=0}else{var h=f-1|0,i=0,j=0,k=0;a:for(;k>>>0>>0;){var l=z[a+k|0],o=0==(xd(l&255)|0);do{if(o){if(64==l<<24>>24){var t=i,q=j+1|0}else{if(46==l<<24>>24){if(k>>>0>=h>>>0){break a}t=i+1|0;q=j}else{if(45==l<<24>>24||95==l<<24>>24){t=i,q=j}else{break a}}}}else{t=i,q=j}}while(0);i=t;j=q;k=k+1|0}1!=(j|0)|2>k>>>0|0==(i|0)?h=0:(h=Nd(a,k),0==(h|0)?h=0:(L(d,a+ -g|0,h+g|0),v[b>>2]=g))}}while(0);return h}$d.X=1;function ae(b,d,a,e,f,g){var h=4>f>>>0;if(h){var i=0}else{if(47!=u[a+1|0]<<24>>24){i=0}else{if(47!=u[a+2|0]<<24>>24){i=0}else{for(i=0;i>>>0>>0&&0!=((97<=(z[a+(i^-1)|0]&255)&&122>=(z[a+(i^-1)|0]&255)||65<=(z[a+(i^-1)|0]&255)&&90>=(z[a+(i^-1)|0]&255))|0);){i=i+1|0}var j=a+ -i|0;if(0==(Xd(j,i+f|0)|0)){i=0}else{var k=Md(a+3|0,f-3|0,g&1);if(0==(k|0)){i=0}else{for(k=k+3|0;k>>>0>>0&&0==(Ld(z[a+k|0]&255)|0);){k=k+1|0}k=Nd(a,k);0==(k|0)?i=0:(L(d,j,k+i|0),v[b>>2]=i,i=k)}}}}}return i}ae.X=1;function be(b,d,a){var e=3>d>>>0;a:do{if(e){var f=0}else{if(60!=u[b]<<24>>24){f=0}else{for(var g=f=47==u[b+1|0]<<24>>24?2:1,h=a;g>>>0>>0;){var i=z[h];if(0==i<<24>>24){break}if((z[b+g|0]&255|0)!=(i<<24>>24|0)){f=0;break a}g=g+1|0;h=h+1|0}(g|0)==(d|0)?f=0:(g=b+g|0,f=0==(Ld(z[g]&255)|0)&&62!=u[g]<<24>>24?0:f)}}}while(0);return f}function ce(b,d,a,e){var f;f=(e+4|0)>>2;var g=v[f];if(0==(g|0)){var h=a-1|0;v[e+8>>2]=h}else{h=v[e+8>>2]}a=a-h|0;h=(a|0)>(g|0);a:do{if(h){for(;;){L(b,K.Pb|0,10);var i=v[f]+1|0;v[f]=i;if((a|0)<=(i|0)){break a}}}else{if((a|0)<(g|0)){L(b,K.A|0,6);i=(a|0)<(v[f]|0);b:do{if(i){for(;;){L(b,K.Qb|0,12);var j=v[f]-1|0;v[f]=j;if((a|0)>=(j|0)){break b}}}}while(0);L(b,K.Rb|0,5)}else{L(b,K.Tb|0,11)}}}while(0);f=v[e>>2];v[e>>2]=f+1|0;Ud(b,K.Ub|0,($a=s,s+=4,v[$a>>2]=f,$a));0!=(d|0)&&de(b,v[d>>2],v[d+4>>2],0);L(b,K.Wb|0,5)}ce.X=1;function ee(b,d,a){var e,f;0!=(v[b+4>>2]|0)&&O(b,10);var g=0==(a|0);do{if(g){e=22}else{if(f=(a+4|0)>>2,0==(v[f]|0)){e=22}else{L(b,K.sb|0,18);var h=v[f],i=0==(h|0);a:do{if(!i){e=(a|0)>>2;for(var j=0,k=0,l=h;;){for(var o=j,j=l;;){if(o>>>0>=j>>>0){var t=j;break}if(0==(Ld(z[v[e]+o|0]&255)|0)){t=v[f];break}o=o+1|0;j=v[f]}if(o>>>0>>0){j=o;for(l=t;j>>>0>>0&&0==(Ld(z[v[e]+j|0]&255)|0);){j=j+1|0,l=v[f]}l=B[e];o=(46==u[l+o|0]<<24>>24&1)+o|0;0!=(k|0)&&(O(b,32),l=v[e]);de(b,l+o|0,j-o|0,0);o=v[f]}else{j=o,o=t}j=j+1|0;if(j>>>0>=o>>>0){break a}k=k+1|0;l=o}}}while(0);L(b,K.g|0,2);e=23}}}while(0);22==e&&L(b,K.ub|0,11);0!=(d|0)&&de(b,v[d>>2],v[d+4>>2],0);L(b,K.vb|0,14)}ee.X=1;function fe(b,d,a){var e,f;0!=(v[b+4>>2]|0)&&O(b,10);var g=0==(d|0);do{if(!g){f=(d+4|0)>>2;var h=v[f];if(0!=(h|0)){e=(d|0)>>2;for(var i=0;;){if(i>>>0>=h>>>0){var j=h;break}if(0==(Ld(z[v[e]+i|0]&255)|0)){j=v[f];break}i=i+1|0;h=v[f]}if((i|0)!=(j|0)){L(b,K.Va|0,3);h=0==(v[a+12>>2]&128|0);a:do{if(h){L(b,v[e]+i|0,v[f]-i|0)}else{for(var k=i;;){var l=B[f];if(k>>>0>=l>>>0){break a}for(var o=k;o>>>0>>0&&10!=u[v[e]+o|0]<<24>>24;){o=o+1|0}o>>>0>k>>>0?(L(b,v[e]+k|0,o-k|0),k=v[f]):k=l;if(o>>>0>=(k-1|0)>>>0){break a}ge(b,a);k=o+1|0}}}while(0);L(b,K.Xa|0,5)}}}}while(0)}fe.X=1;function he(b,d,a,e){var f;if(0==(d|0)){b=0}else{f=(d+4|0)>>2;var g=v[f];if(0==(g|0)){b=0}else{if(0!=(v[e+12>>2]&32|0)&&!(0!=(Xd(v[d>>2],g)|0)|2==(a|0))){b=0}else{L(b,K.f|0,9);2==(a|0)&&L(b,K.k|0,7);a=d|0;ie(b,v[a>>2],v[f]);g=e+16|0;0==(v[g>>2]|0)?L(b,K.g|0,2):(O(b,34),H[v[g>>2]](b,d,e),O(b,62));e=K.k|0;4==(0==(d|0)?4:0==(v[d+12>>2]|0)?4:5)&&Oc(K.c|0,38,K.aa|0,K.b|0);for(var g=B[d+4>>2],d=d|0,h=0;;){if(h>>>0>=g>>>0){var i=0;break}var j=u[e+h|0],k=j<<24>>24;if(0==j<<24>>24){i=0;break}j=z[v[d>>2]+h|0]&255;if((j|0)==(k|0)){h=h+1|0}else{i=j-k|0;break}}a=v[a>>2];0==(i|0)?de(b,a+7|0,v[f]-7|0,0):de(b,a,v[f],0);L(b,K.D|0,4);b=1}}}return b}he.X=1;function ge(b,d){Wd(b,0!=(v[d+12>>2]&256|0)?K.Zb|0:K.ac|0);return 1}function je(b,d,a,e,f){var g,h=0==(d|0);do{if(h){L(b,K.f|0,9)}else{if(0==(v[f+12>>2]&32|0)){L(b,K.f|0,9),g=d+4|0}else{g=d+4|0;if(0==(Xd(v[d>>2],v[g>>2])|0)){var i=0;g=20;break}L(b,K.f|0,9)}g=v[g>>2];0!=(g|0)&&ie(b,v[d>>2],g)}g=10}while(0);10==g&&(0!=(a|0)&&(h=a+4|0,0!=(v[h>>2]|0)&&(L(b,K.B|0,9),de(b,v[a>>2],v[h>>2],0))),a=f+16|0,0==(v[a>>2]|0)?L(b,K.g|0,2):(O(b,34),H[v[a>>2]](b,d,f),O(b,62)),0!=(e|0)&&(d=v[e+4>>2],0!=(d|0)&&L(b,v[e>>2],d)),L(b,K.D|0,4),i=1);return i}je.X=1;function ke(b,d,a){var e=d>>2,a=(a+12|0)>>2,f=v[a],g=0==(f&512|0);do{if(g){if(0==(f&1|0)){if(0==(f&2|0)){var h=f}else{if(0!=(be(v[e],v[e+1],K.m|0)|0)){break}h=v[a]}var i=d|0;if(0!=(h&8|0)){if(0!=(be(v[i>>2],v[e+1],K.va|0)|0)){break}h=v[a]}if(0==(h&4|0)){h=d+4|0}else{if(h=d+4|0,0!=(be(v[i>>2],v[h>>2],K.Ua|0)|0)){break}}L(b,v[i>>2],v[h>>2])}}else{de(b,v[e],v[e+1],0)}}while(0);return 1}ke.X=1;function le(b,d,a,e,f){var g,h=1>>0;a:do{if(h){g=Qd(z[e+1|0]&255)&255;do{if(39==(g|0)){if(0!=(me(b,a,2>>0?u[e+2|0]:0,100,d+4|0)|0)){var i=1;g=22;break a}}else{if((115==(g|0)||116==(g|0)||109==(g|0)||100==(g|0))&&!(3!=(f|0)&&0==(ne(u[e+2|0])|0))){L(b,K.v|0,7);i=0;g=22;break a}}}while(0);if(2>>0){var j=Qd(z[e+2|0]&255);if(114==(g|0)){if(101!=(j&255|0)){g=18;break}}else{if(108==(g|0)){if(108!=(j&255|0)){g=18;break}}else{if(118==(g|0)){if(101!=(j&255|0)){g=18;break}}else{g=18;break}}}4!=(f|0)&&0==(ne(u[e+3|0])|0)?g=18:(L(b,K.v|0,7),i=0,g=22)}else{g=18}}else{g=18}}while(0);18==g&&(0==(me(b,a,0==(f|0)?0:u[e+1|0],115,d|0)|0)&&O(b,z[e]&255),i=0);return i}le.X=1;function oe(b,d,a,e,f){d=0!=(ne(a)|0)&2>>0;a:do{if(d){var g=49==u[e]<<24>>24;b:do{if(g){a=e+1|0;if(47!=u[a]<<24>>24){a=19;break}var g=e+2|0,h=z[g],i=50==h<<24>>24;c:do{if(i){h=3==(f|0);do{if(!h&&0==(ne(u[e+3|0])|0)){h=z[e];if(49!=h<<24>>24){var j=h,a=20;break b}if(47!=u[a]<<24>>24){a=19;break b}var k=u[g];break c}}while(0);L(b,K.cc|0,8);var l=2,a=31;break a}k=h}while(0);if(52!=k<<24>>24){a=19;break}a=3==(f|0);do{if(!a&&(g=e+3|0,0==(ne(u[g])|0))){if(4>=f>>>0){a=19;break b}if(116!=(Qd(z[g]&255)|0)){a=19;break b}if(104!=(Qd(z[e+4|0]&255)|0)){a=19;break b}}}while(0);L(b,K.ha|0,8);l=2;a=31;break a}a=19}while(0);19==a&&(j=u[e]);if(51!=j<<24>>24){a=30}else{if(47!=u[e+1|0]<<24>>24){a=30}else{if(52!=u[e+2|0]<<24>>24){a=30}else{a=3==(f|0);do{if(!a&&(g=e+3|0,0==(ne(u[g])|0))){if(5>=f>>>0){a=30;break a}if(116!=(Qd(z[g]&255)|0)){a=30;break a}if(104!=(Qd(z[e+4|0]&255)|0)){a=30;break a}if(115!=(Qd(z[e+5|0]&255)|0)){a=30;break a}}}while(0);L(b,K.ka|0,8);l=2;a=31}}}}else{a=30}}while(0);30==a&&(O(b,z[e]&255),l=0);return l}oe.X=1;function me(b,d,a,e,f){var f=f>>2,g=s;s+=8;if(0==(v[f]|0)){a=5}else{if(0==(ne(a)|0)){var h=0,a=8}else{if(a=v[f],0==(a|0)){a=5}else{var i=a,a=7}}}5==a&&(0==(ne(d)|0)?(h=0,a=8):(i=v[f],a=7));7==a&&(d=g|0,pe(d,8,K.dc|0,($a=s,s+=8,v[$a>>2]=0!=(i|0)?114:108,v[$a+4>>2]=e&255,$a)),v[f]=0==(v[f]|0)&1,Wd(b,d),h=1);s=g;return h}function ne(b){var d=b&255;return(0==b<<24>>24?1:0!=(Ld(d)|0)?1:0!=(Kd(d)|0))&1}function de(b,d,a,e){Pc(b,Math.floor(((12*a|0)>>>0)/10));e=0==(e|0);a:do{if(e){for(var f=0,g=0;;){if(g>>>0>=a>>>0){break a}for(var h=g;;){if(h>>>0>=a>>>0){var i=f,j=0;break}var f=z[K.q+(z[d+h|0]&255)|0],k=f<<24>>24;if(0!=f<<24>>24){i=k;j=1;break}f=k;h=h+1|0}h>>>0>g>>>0&&L(b,d+g|0,h-g|0);if(!j){break a}47==u[d+h|0]<<24>>24?O(b,47):Wd(b,v[qe+(i<<2)>>2]);f=i;g=h+1|0}}else{for(g=f=0;;){if(g>>>0>=a>>>0){break a}for(h=g;;){if(h>>>0>=a>>>0){var l=f,o=0;break}f=z[K.q+(z[d+h|0]&255)|0];k=f<<24>>24;if(0!=f<<24>>24){l=k;o=1;break}f=k;h=h+1|0}h>>>0>g>>>0&&L(b,d+g|0,h-g|0);if(!o){break a}Wd(b,v[qe+(l<<2)>>2]);f=l;g=h+1|0}}}while(0)}de.X=1;function ie(b,d,a){var e=s;s+=4;Pc(b,Math.floor(((12*a|0)>>>0)/10));var f=e|0;u[f]=37;for(var g=e+1|0,h=e+2|0,i=0;i>>>0>>0;){for(var j=i;;){if(j>>>0>=a>>>0){var k=0;break}if(0==u[K.V+(z[d+j|0]&255)|0]<<24>>24){k=1;break}j=j+1|0}j>>>0>i>>>0&&L(b,d+i|0,j-i|0);if(!k){break}i=z[d+j|0]&255;38==(i|0)?L(b,K.t|0,5):39==(i|0)?L(b,K.la|0,6):(u[g]=u[K.I+(i>>>4)|0],u[h]=u[K.I+(i&15)|0],L(b,f,3));i=j+1|0}s=e}ie.X=1;function qb(b){if(245>b>>>0){var d=11>b>>>0?16:b+11&-8,a=d>>>3,b=B[X>>2],e=b>>>(a>>>0);if(0!=(e&3|0)){var f=(e&1^1)+a|0,d=f<<1,a=(d<<2)+X+40|0,g=(d+2<<2)+X+40|0,e=B[g>>2],d=e+8|0,h=B[d>>2];(a|0)==(h|0)?v[X>>2]=b&(1<>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[g>>2]=h,v[h+12>>2]=a);b=f<<3;v[e+4>>2]=b|3;b=e+(b|4)|0;v[b>>2]|=1;f=d;b=39}else{if(d>>>0>B[X+8>>2]>>>0){if(0!=(e|0)){var f=2<>>12&16,e=a>>>(f>>>0),a=e>>>5&8,g=e>>>(a>>>0),e=g>>>2&4,h=g>>>(e>>>0),g=h>>>1&2,h=h>>>(g>>>0),i=h>>>1&1,a=(a|f|e|g|i)+(h>>>(i>>>0))|0,f=a<<1,g=(f<<2)+X+40|0,h=(f+2<<2)+X+40|0,e=B[h>>2],f=e+8|0,i=B[f>>2];(g|0)==(i|0)?v[X>>2]=b&(1<>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[h>>2]=i,v[i+12>>2]=g);g=a<<3;b=g-d|0;v[e+4>>2]=d|3;a=e+d|0;v[e+(d|4)>>2]=b|1;v[e+g>>2]=b;i=B[X+8>>2];0!=(i|0)&&(d=v[X+20>>2],g=i>>>2&1073741822,e=(g<<2)+X+40|0,h=B[X>>2],i=1<<(i>>>3),0==(h&i|0)?(v[X>>2]=h|i,h=e,g=(g+2<<2)+X+40|0):(g=(g+2<<2)+X+40|0,h=B[g>>2],h>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"))),v[g>>2]=d,v[h+12>>2]=d,v[(d+8|0)>>2]=h,v[(d+12|0)>>2]=e);v[X+8>>2]=b;v[X+20>>2]=a;b=39}else{0==(v[X+4>>2]|0)?(j=d,b=31):(b=re(d),0==(b|0)?(j=d,b=31):(f=b,b=39))}}else{var j=d,b=31}}}else{4294967231>>0?(j=-1,b=31):(b=b+11&-8,0==(v[X+4>>2]|0)?(j=b,b=31):(d=se(b),0==(d|0)?(j=b,b=31):(f=d,b=39)))}31==b&&(d=B[X+8>>2],j>>>0>d>>>0?(b=B[X+12>>2],j>>>0>>0?(b=b-j|0,v[X+12>>2]=b,d=B[X+24>>2],v[X+24>>2]=d+j|0,v[j+(d+4)>>2]=b|1,v[d+4>>2]=j|3,f=d+8|0):f=te(j)):(f=d-j|0,b=B[X+20>>2],15>>0?(v[X+20>>2]=b+j|0,v[X+8>>2]=f,v[j+(b+4)>>2]=f|1,v[b+d>>2]=f,v[b+4>>2]=j|3):(v[X+8>>2]=0,v[X+20>>2]=0,v[b+4>>2]=d|3,j=d+(b+4)|0,v[j>>2]|=1),f=b+8|0));return f}Module._malloc=qb;qb.X=1;function re(b){var d,a,e=v[X+4>>2],f=(e&-e)-1|0,e=f>>>12&16,g=f>>>(e>>>0),f=g>>>5&8;a=g>>>(f>>>0);var g=a>>>2&4,h=a>>>(g>>>0);a=h>>>1&2;var h=h>>>(a>>>0),i=h>>>1&1,e=g=f=B[X+((f|e|g|a|i)+(h>>>(i>>>0))<<2)+304>>2];a=e>>2;for(f=(v[f+4>>2]&-8)-b|0;;){h=v[g+16>>2];if(0==(h|0)){if(g=v[g+20>>2],0==(g|0)){break}}else{g=h}h=(v[g+4>>2]&-8)-b|0;f=(a=h>>>0>>0)?h:f;e=a?g:e;a=e>>2}var h=e,j=B[X+16>>2],i=h>>>0>>0;do{if(!i){var k=h+b|0,g=k;if(h>>>0>>0){var i=B[a+6],k=B[a+3],l=(k|0)==(e|0);do{if(l){d=e+20|0;var o=v[d>>2];if(0==(o|0)&&(d=e+16|0,o=v[d>>2],0==(o|0))){o=0;d=o>>2;break}for(;;){var t=o+20|0,q=v[t>>2];if(0==(q|0)&&(t=o+16|0,q=B[t>>2],0==(q|0))){break}d=t;o=q}d>>>0>>0&&(Z(),c("Reached an unreachable!"));v[d>>2]=0}else{d=B[a+2],d>>>0>>0&&(Z(),c("Reached an unreachable!")),v[d+12>>2]=k,v[k+8>>2]=d,o=k}d=o>>2}while(0);j=0==(i|0);a:do{if(!j){k=e+28|0;l=(v[k>>2]<<2)+X+304|0;t=(e|0)==(v[l>>2]|0);do{if(t){v[l>>2]=o;if(0!=(o|0)){break}v[X+4>>2]&=1<>2]^-1;break a}i>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));q=i+16|0;(v[q>>2]|0)==(e|0)?v[q>>2]=o:v[i+20>>2]=o;if(0==(o|0)){break a}}while(0);o>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[d+6]=i;k=B[a+4];0!=(k|0)&&(k>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[d+4]=k,v[k+24>>2]=o);k=B[a+5];0!=(k|0)&&(k>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[d+5]=k,v[k+24>>2]=o)}}while(0);16>f>>>0?(b=f+b|0,v[a+1]=b|3,b=b+(h+4)|0,v[b>>2]|=1):(v[a+1]=b|3,v[b+(h+4)>>2]=f|1,v[h+f+b>>2]=f,j=B[X+8>>2],0!=(j|0)&&(b=B[X+20>>2],h=j>>>2&1073741822,a=(h<<2)+X+40|0,i=B[X>>2],j=1<<(j>>>3),0==(i&j|0)?(v[X>>2]=i|j,i=a,h=(h+2<<2)+X+40|0):(h=(h+2<<2)+X+40|0,i=B[h>>2],i>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"))),v[h>>2]=b,v[i+12>>2]=b,v[b+8>>2]=i,v[b+12>>2]=a),v[X+8>>2]=f,v[X+20>>2]=g);return e+8|0}}}while(0);Z();c("Reached an unreachable!")}re.X=1;function se(b){var d,a,e,f,g,h=b>>2,i,j=-b|0,k=b>>>8;if(0==(k|0)){var l=0}else{if(16777215>>0){l=31}else{var o=(k+1048320|0)>>>16&8,t=k<>>16&4,r=t<>>16&2,x=14-(q|o|w)+(r<>>15)|0,l=b>>>((x+7|0)>>>0)&1|x<<1}}var D=B[X+(l<<2)+304>>2],y=0==(D|0);a:do{if(y){var A=0,E=j,G=0}else{var N=31==(l|0)?0:25-(l>>>1)|0,I=0,M=j,J=D;g=J>>2;for(var S=b<>>0>>0){if(($|0)==(b|0)){A=J;E=Ha;G=J;break a}var Qa=J,pa=Ha}else{Qa=I,pa=M}var ka=B[g+5],qa=B[((S>>>31<<2)+16>>2)+g],eb=0==(ka|0)|(ka|0)==(qa|0)?Q:ka;if(0==(qa|0)){A=Qa;E=pa;G=eb;break a}I=Qa;M=pa;J=qa;g=J>>2;S<<=1;Q=eb}}}while(0);if(0==(G|0)&0==(A|0)){var Y=2<>2]&(Y|-Y);if(0==(Ia|0)){var tb=0;i=80}else{var Qb=(Ia&-Ia)-1|0,fa=Qb>>>12&16,Ta=Qb>>>(fa>>>0),Ja=Ta>>>5&8,Rb=Ta>>>(Ja>>>0),Sb=Rb>>>2&4,Tb=Rb>>>(Sb>>>0),Ub=Tb>>>1&2,ub=Tb>>>(Ub>>>0),Vb=ub>>>1&1,vb=v[X+((Ja|fa|Sb|Ub|Vb)+(ub>>>(Vb>>>0))<<2)+304>>2];i=15}}else{vb=G,i=15}a:do{if(15==i){var ld=0==(vb|0);b:do{if(ld){var ca=E,aa=A;f=aa>>2}else{var ya=vb;e=ya>>2;for(var Ua=E,Wb=A;;){var za=(v[e+1]&-8)-b|0,Ec=za>>>0>>0,wb=Ec?za:Ua,hb=Ec?ya:Wb,Va=B[e+4];if(0!=(Va|0)){ya=Va}else{var Fc=B[e+5];if(0==(Fc|0)){ca=wb;aa=hb;f=aa>>2;break b}ya=Fc}e=ya>>2;Ua=wb;Wb=hb}}}while(0);if(0!=(aa|0)&&ca>>>0<(v[X+8>>2]-b|0)>>>0){var Wa=aa;a=Wa>>2;var Ka=B[X+16>>2],ib=Wa>>>0>>0;do{if(!ib){var xb=Wa+b|0,yb=xb;if(Wa>>>0>>0){var ta=B[f+6],La=B[f+3],md=(La|0)==(aa|0);do{if(md){var Xb=aa+20|0,Yb=v[Xb>>2];if(0==(Yb|0)){var Zb=aa+16|0,$b=v[Zb>>2];if(0==($b|0)){var W=0;d=W>>2;break}var ua=Zb,la=$b}else{ua=Xb,la=Yb,i=28}for(;;){var ac=la+20|0,bc=v[ac>>2];if(0!=(bc|0)){ua=ac,la=bc}else{var cc=la+16|0,dc=B[cc>>2];if(0==(dc|0)){break}ua=cc;la=dc}}ua>>>0>>0&&(Z(),c("Reached an unreachable!"));v[ua>>2]=0;W=la}else{var jb=B[f+2];jb>>>0>>0&&(Z(),c("Reached an unreachable!"));v[jb+12>>2]=La;v[La+8>>2]=jb;W=La}d=W>>2}while(0);var Gc=0==(ta|0);b:do{if(Gc){var Ma=aa}else{var Hc=aa+28|0,ec=(v[Hc>>2]<<2)+X+304|0,zb=(aa|0)==(v[ec>>2]|0);do{if(zb){v[ec>>2]=W;if(0!=(W|0)){break}v[X+4>>2]&=1<>2]^-1;Ma=aa;break b}ta>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));var kb=ta+16|0;(v[kb>>2]|0)==(aa|0)?v[kb>>2]=W:v[ta+20>>2]=W;if(0==(W|0)){Ma=aa;break b}}while(0);W>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[d+6]=ta;var ha=B[f+4];0!=(ha|0)&&(ha>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[d+4]=ha,v[ha+24>>2]=W);var Xa=B[f+5];0!=(Xa|0)&&(Xa>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[d+5]=Xa,v[Xa+24>>2]=W);Ma=aa}}while(0);var Ic=16>ca>>>0;b:do{if(Ic){var fc=ca+b|0;v[Ma+4>>2]=fc|3;var gc=fc+(Wa+4)|0;v[gc>>2]|=1}else{if(v[Ma+4>>2]=b|3,v[h+(a+1)]=ca|1,v[(ca>>2)+a+h]=ca,256>ca>>>0){var lb=ca>>>2&1073741822,hc=(lb<<2)+X+40|0,ic=B[X>>2],jc=1<<(ca>>>3);if(0==(ic&jc|0)){v[X>>2]=ic|jc;var Ya=hc,Ab=(lb+2<<2)+X+40|0}else{var Aa=(lb+2<<2)+X+40|0,kc=B[Aa>>2];kc>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));Ya=kc;Ab=Aa}v[Ab>>2]=yb;v[Ya+12>>2]=yb;v[h+(a+2)]=Ya;v[h+(a+3)]=hc}else{var va=xb,Bb=ca>>>8;if(0==(Bb|0)){var Ba=0}else{if(16777215>>0){Ba=31}else{var lc=(Bb+1048320|0)>>>16&8,mc=Bb<>>16&4,nc=mc<>>16&2,Jc=14-(Cb|lc|oc)+(nc<>>15)|0,Ba=ca>>>((Jc+7|0)>>>0)&1|Jc<<1}}var mb=(Ba<<2)+X+304|0;v[h+(a+7)]=Ba;var Na=b+(Wa+16)|0;v[h+(a+5)]=0;v[Na>>2]=0;var pc=v[X+4>>2],Db=1<>2]=pc|Db,v[mb>>2]=va,v[h+(a+6)]=mb,v[h+(a+3)]=va,v[h+(a+2)]=va}else{for(var Eb=ca<<(31==(Ba|0)?0:25-(Ba>>>1)|0),Oa=v[mb>>2];;){if((v[Oa+4>>2]&-8|0)==(ca|0)){var Fb=Oa+8|0,Gb=B[Fb>>2],qc=B[X+16>>2],Kc=Oa>>>0>>0;do{if(!Kc&&Gb>>>0>=qc>>>0){v[Gb+12>>2]=va;v[Fb>>2]=va;v[h+(a+2)]=Gb;v[h+(a+3)]=Oa;v[h+(a+6)]=0;break b}}while(0);Z();c("Reached an unreachable!")}var Hb=(Eb>>>31<<2)+Oa+16|0,Me=B[Hb>>2];if(0!=(Me|0)){Eb<<=1,Oa=Me}else{if(Hb>>>0>=B[X+16>>2]>>>0){v[Hb>>2]=va;v[h+(a+6)]=Oa;v[h+(a+3)]=va;v[h+(a+2)]=va;break b}Z();c("Reached an unreachable!")}}}}}}while(0);tb=Ma+8|0;break a}}}while(0);Z();c("Reached an unreachable!")}tb=0}}while(0);return tb}se.X=1;function te(b){var d,a;0==(v[ue>>2]|0)&&ve();var e=0==(v[X+440>>2]&4|0);a:do{if(e){a=v[X+24>>2];if(0==(a|0)){a=7}else{if(a=we(a),0==(a|0)){a=7}else{var f=v[ue+8>>2],f=b+47-v[X+12>>2]+f&-f;if(2147483647>f>>>0){var g=xe(f),h=(d=(g|0)==(v[a>>2]+v[a+4>>2]|0))?g:-1;d=d?f:0;var i=f;a=14}else{var j=0;a=22}}}if(7==a){if(a=xe(0),-1==(a|0)){j=0,a=22}else{var f=v[ue+8>>2],f=f+(b+47)&-f,k=a,l=v[ue+4>>2],o=l-1|0,f=0==(o&k|0)?f:f-k+(o+k&-l)|0;2147483647>f>>>0?(g=xe(f),d=(h=(g|0)==(a|0))?f:0,h=h?a:-1,i=f,a=14):(j=0,a=22)}}b:do{if(14==a){j=-i|0;if(-1!=(h|0)){var t=d,q=h;a=27;break a}a=-1!=(g|0)&2147483647>i>>>0;do{if(a){if(i>>>0<(b+48|0)>>>0){if(f=v[ue+8>>2],f=b+47-i+f&-f,2147483647>f>>>0){if(-1==(xe(f)|0)){xe(j);j=d;break b}f=f+i|0}else{f=i}}else{f=i}}else{f=i}}while(0);if(-1!=(g|0)){t=f;q=g;a=27;break a}v[X+440>>2]|=4;var r=d;a=24;break a}}while(0);v[X+440>>2]|=4;r=j}else{r=0}a=24}while(0);24==a&&(e=v[ue+8>>2],e=e+(b+47)&-e,2147483647>e>>>0?(e=xe(e),h=xe(0),-1!=(h|0)&-1!=(e|0)&e>>>0>>0?(d=h-e|0,r=(h=d>>>0>(b+40|0)>>>0)?d:r,e=h?e:-1,-1==(e|0)?a=50:(t=r,q=e,a=27)):a=50):a=50);a:do{if(27==a){r=v[X+432>>2]+t|0;v[X+432>>2]=r;r>>>0>B[X+436>>2]>>>0&&(v[X+436>>2]=r);r=B[X+24>>2];e=0==(r|0);b:do{if(e){h=B[X+16>>2];0==(h|0)|q>>>0>>0&&(v[X+16>>2]=q);v[X+444>>2]=q;v[X+448>>2]=t;v[X+456>>2]=0;v[X+36>>2]=v[ue>>2];v[X+32>>2]=-1;for(h=0;!(d=h<<1,i=(d<<2)+X+40|0,v[X+(d+3<<2)+40>>2]=i,v[X+(d+2<<2)+40>>2]=i,h=h+1|0,32==(h|0));){}ye(q,t-40|0)}else{i=X+444|0;for(d=i>>2;0!=(i|0);){h=B[d];i=i+4|0;g=B[i>>2];if((q|0)==(h+g|0)){if(0!=(v[d+3]&8|0)){break}d=r;if(!(d>>>0>=h>>>0&d>>>0>>0)){break}v[i>>2]=g+t|0;ye(v[X+24>>2],v[X+12>>2]+t|0);break b}i=v[d+2];d=i>>2}q>>>0>2]>>>0&&(v[X+16>>2]=q);h=q+t|0;for(d=X+444|0;0!=(d|0);){i=d|0;if((v[i>>2]|0)==(h|0)){if(0!=(v[d+12>>2]&8|0)){break}v[i>>2]=q;var w=d+4|0;v[w>>2]=v[w>>2]+t|0;w=ze(q,h,b);a=51;break a}d=v[d+8>>2]}Ae(q,t)}}while(0);r=B[X+12>>2];r>>>0>b>>>0?(w=r-b|0,v[X+12>>2]=w,e=r=B[X+24>>2],v[X+24>>2]=e+b|0,v[b+(e+4)>>2]=w|1,v[r+4>>2]=b|3,w=r+8|0,a=51):a=50}}while(0);50==a&&(v[Be>>2]=12,w=0);return w}te.X=1;function Ce(b){var d;0==(v[ue>>2]|0)&&ve();var a=4294967232>b>>>0;a:do{if(a){var e=B[X+24>>2];if(0!=(e|0)){var f=B[X+12>>2],g=f>>>0>(b+40|0)>>>0;do{if(g){var h=B[ue+8>>2],i=(Math.floor(((-40-b-1+f+h|0)>>>0)/(h>>>0))-1)*h|0,j=we(e);if(0==(v[j+12>>2]&8|0)){var k=xe(0);d=(j+4|0)>>2;if((k|0)==(v[j>>2]+v[d]|0)&&(i=xe(-(2147483646>>0?-2147483648-h|0:i)|0),h=xe(0),-1!=(i|0)&h>>>0>>0&&(i=k-h|0,(k|0)!=(h|0)))){v[d]=v[d]-i|0;v[X+432>>2]=v[X+432>>2]-i|0;ye(v[X+24>>2],v[X+12>>2]-i|0);d=1;break a}}}}while(0);B[X+12>>2]>>>0>B[X+28>>2]>>>0&&(v[X+28>>2]=-1)}}d=0}while(0);return d}Ce.X=1;function Nc(b){var d,a,e,f,g,h,i=b>>2,j,k=0==(b|0);a:do{if(!k){var l=b-8|0,o=l,t=B[X+16>>2],q=l>>>0>>0;b:do{if(!q){var r=B[b-4>>2],w=r&3;if(1!=(w|0)){var x=r&-8;h=x>>2;var D=b+(x-8)|0,y=D,A=0==(r&1|0);c:do{if(A){var E=B[l>>2];if(0==(w|0)){break a}var G=-8-E|0;g=G>>2;var N=b+G|0,I=N,M=E+x|0;if(N>>>0>>0){break b}if((I|0)==(v[X+20>>2]|0)){f=(b+(x-4)|0)>>2;if(3!=(v[f]&3|0)){var J=I;e=J>>2;var S=M;break}v[X+8>>2]=M;v[f]&=-2;v[g+(i+1)]=M|1;v[D>>2]=M;break a}if(256>E>>>0){var Q=B[g+(i+2)],$=B[g+(i+3)];if((Q|0)==($|0)){v[X>>2]&=1<<(E>>>3)^-1,J=I,e=J>>2,S=M}else{var Ha=((E>>>2&1073741822)<<2)+X+40|0,Qa=(Q|0)!=(Ha|0)&Q>>>0>>0;do{if(!Qa&&($|0)==(Ha|0)|$>>>0>=t>>>0){v[Q+12>>2]=$;v[$+8>>2]=Q;J=I;e=J>>2;S=M;break c}}while(0);Z();c("Reached an unreachable!")}}else{var pa=N,ka=B[g+(i+6)],qa=B[g+(i+3)],eb=(qa|0)==(pa|0);do{if(eb){var Y=G+(b+20)|0,Ia=v[Y>>2];if(0==(Ia|0)){var tb=G+(b+16)|0,Qb=v[tb>>2];if(0==(Qb|0)){var fa=0;a=fa>>2;break}var Ta=tb,Ja=Qb}else{Ta=Y,Ja=Ia,j=22}for(;;){var Rb=Ja+20|0,Sb=v[Rb>>2];if(0!=(Sb|0)){Ta=Rb,Ja=Sb}else{var Tb=Ja+16|0,Ub=B[Tb>>2];if(0==(Ub|0)){break}Ta=Tb;Ja=Ub}}Ta>>>0>>0&&(Z(),c("Reached an unreachable!"));v[Ta>>2]=0;fa=Ja}else{var ub=B[g+(i+2)];ub>>>0>>0&&(Z(),c("Reached an unreachable!"));v[ub+12>>2]=qa;v[qa+8>>2]=ub;fa=qa}a=fa>>2}while(0);if(0!=(ka|0)){var Vb=G+(b+28)|0,vb=(v[Vb>>2]<<2)+X+304|0,ld=(pa|0)==(v[vb>>2]|0);do{if(ld){v[vb>>2]=fa;if(0!=(fa|0)){break}v[X+4>>2]&=1<>2]^-1;J=I;e=J>>2;S=M;break c}ka>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));var ca=ka+16|0;(v[ca>>2]|0)==(pa|0)?v[ca>>2]=fa:v[ka+20>>2]=fa;if(0==(fa|0)){J=I;e=J>>2;S=M;break c}}while(0);fa>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[a+6]=ka;var aa=B[g+(i+4)];0!=(aa|0)&&(aa>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[a+4]=aa,v[aa+24>>2]=fa);var ya=B[g+(i+5)];0!=(ya|0)&&(ya>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[a+5]=ya,v[ya+24>>2]=fa)}J=I;e=J>>2;S=M}}else{J=o,e=J>>2,S=x}}while(0);var Ua=J;if(Ua>>>0>>0){var Wb=b+(x-4)|0,za=B[Wb>>2];if(0!=(za&1|0)){var Ec=0==(za&2|0);do{if(Ec){if((y|0)==(v[X+24>>2]|0)){var wb=v[X+12>>2]+S|0;v[X+12>>2]=wb;v[X+24>>2]=J;v[e+1]=wb|1;(J|0)==(v[X+20>>2]|0)&&(v[X+20>>2]=0,v[X+8>>2]=0);if(wb>>>0<=B[X+28>>2]>>>0){break a}Ce(0);break a}if((y|0)==(v[X+20>>2]|0)){var hb=v[X+8>>2]+S|0;v[X+8>>2]=hb;v[X+20>>2]=J;v[e+1]=hb|1;v[(Ua+hb|0)>>2]=hb;break a}var Va=(za&-8)+S|0,Fc=za>>>3,Wa=256>za>>>0;c:do{if(Wa){var Ka=B[i+h],ib=B[((x|4)>>2)+i];if((Ka|0)==(ib|0)){v[X>>2]&=1<>>2&1073741822)<<2)+X+40|0;j=(Ka|0)==(xb|0)?64:Ka>>>0>2]>>>0?67:64;do{if(64==j&&!((ib|0)!=(xb|0)&&ib>>>0>2]>>>0)){v[Ka+12>>2]=ib;v[ib+8>>2]=Ka;break c}}while(0);Z();c("Reached an unreachable!")}}else{var yb=D,ta=B[h+(i+4)],La=B[((x|4)>>2)+i],md=(La|0)==(yb|0);do{if(md){var Xb=x+(b+12)|0,Yb=v[Xb>>2];if(0==(Yb|0)){var Zb=x+(b+8)|0,$b=v[Zb>>2];if(0==($b|0)){var W=0;d=W>>2;break}var ua=Zb,la=$b}else{ua=Xb,la=Yb,j=74}for(;;){var ac=la+20|0,bc=v[ac>>2];if(0!=(bc|0)){ua=ac,la=bc}else{var cc=la+16|0,dc=B[cc>>2];if(0==(dc|0)){break}ua=cc;la=dc}}ua>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[ua>>2]=0;W=la}else{var jb=B[i+h];jb>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[jb+12>>2]=La;v[La+8>>2]=jb;W=La}d=W>>2}while(0);if(0!=(ta|0)){var Gc=x+(b+20)|0,Ma=(v[Gc>>2]<<2)+X+304|0,Hc=(yb|0)==(v[Ma>>2]|0);do{if(Hc){v[Ma>>2]=W;if(0!=(W|0)){break}v[X+4>>2]&=1<>2]^-1;break c}ta>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));var ec=ta+16|0;(v[ec>>2]|0)==(yb|0)?v[ec>>2]=W:v[ta+20>>2]=W;if(0==(W|0)){break c}}while(0);W>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[d+6]=ta;var zb=B[h+(i+2)];0!=(zb|0)&&(zb>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[d+4]=zb,v[zb+24>>2]=W);var kb=B[h+(i+3)];0!=(kb|0)&&(kb>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[d+5]=kb,v[kb+24>>2]=W)}}}while(0);v[e+1]=Va|1;v[Ua+Va>>2]=Va;if((J|0)!=(v[X+20>>2]|0)){var ha=Va}else{v[X+8>>2]=Va;break a}}else{v[Wb>>2]=za&-2,v[e+1]=S|1,ha=v[Ua+S>>2]=S}}while(0);if(256>ha>>>0){var Xa=ha>>>2&1073741822,Ic=(Xa<<2)+X+40|0,fc=B[X>>2],gc=1<<(ha>>>3);if(0==(fc&gc|0)){v[X>>2]=fc|gc;var lb=Ic,hc=(Xa+2<<2)+X+40|0}else{var ic=(Xa+2<<2)+X+40|0,jc=B[ic>>2];jc>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));lb=jc;hc=ic}v[hc>>2]=J;v[lb+12>>2]=J;v[e+2]=lb;v[e+3]=Ic;break a}var Ya=J,Ab=ha>>>8;if(0==(Ab|0)){var Aa=0}else{if(16777215>>0){Aa=31}else{var kc=(Ab+1048320|0)>>>16&8,va=Ab<>>16&4,Ba=va<>>16&2,mc=14-(Bb|kc|lc)+(Ba<>>15)|0,Aa=ha>>>((mc+7|0)>>>0)&1|mc<<1}}var Cb=(Aa<<2)+X+304|0;v[e+7]=Aa;v[e+5]=0;v[e+4]=0;var nc=v[X+4>>2],oc=1<>2]=nc|oc,v[Cb>>2]=Ya,v[e+6]=Cb,v[e+3]=J,v[e+2]=J}else{for(var mb=ha<<(31==(Aa|0)?0:25-(Aa>>>1)|0),Na=v[Cb>>2];;){if((v[Na+4>>2]&-8|0)==(ha|0)){var pc=Na+8|0,Db=B[pc>>2],Eb=B[X+16>>2],Oa=Na>>>0>>0;do{if(!Oa&&Db>>>0>=Eb>>>0){v[Db+12>>2]=Ya;v[pc>>2]=Ya;v[e+2]=Db;v[e+3]=Na;v[e+6]=0;break c}}while(0);Z();c("Reached an unreachable!")}var Fb=(mb>>>31<<2)+Na+16|0,Gb=B[Fb>>2];if(0!=(Gb|0)){mb<<=1,Na=Gb}else{if(Fb>>>0>=B[X+16>>2]>>>0){v[Fb>>2]=Ya;v[e+6]=Na;v[e+3]=J;v[e+2]=J;break c}Z();c("Reached an unreachable!")}}}}while(0);var qc=v[X+32>>2]-1|0;v[X+32>>2]=qc;if(0!=(qc|0)){break a}for(var Kc=X+452|0;;){var Hb=v[Kc>>2];if(0==(Hb|0)){break}Kc=Hb+8|0}v[X+32>>2]=-1;break a}}}}}while(0);Z();c("Reached an unreachable!")}}while(0)}Module._free=Nc;Nc.X=1;function Uc(b,d){if(0==(b|0)){var a=0}else{a=d*b|0,a=65535<(d|b)>>>0?(Math.floor((a>>>0)/(b>>>0))|0)==(d|0)?a:-1:a}var e=qb(a);0!=(e|0)&&0!=(v[e-4>>2]&3|0)&&rb(e,a);return e}function Td(b,d){return 0==(b|0)?qb(d):De(b,d)}Module._realloc=Td;function De(b,d){var a,e,f,g=4294967231>>0;a:do{if(g){v[Be>>2]=12;var h=0}else{f=a=b-8|0;e=(b-4|0)>>2;var i=B[e],j=i&-8,k=j-8|0,l=b+k|0,o=a>>>0>2]>>>0;do{if(!o){var t=i&3;if(1!=(t|0)&-8<(k|0)&&(a=(b+(j-4)|0)>>2,0!=(v[a]&1|0))){g=11>d>>>0?16:d+11&-8;if(0==(t|0)){var q=0,r,i=v[f+4>>2]&-8;r=256>g>>>0?0:i>>>0>=(g+4|0)>>>0&&(i-g|0)>>>0<=v[ue+8>>2]<<1>>>0?f:0;f=18}else{j>>>0>>0?(l|0)!=(v[X+24>>2]|0)?f=22:(a=v[X+12>>2]+j|0,a>>>0>g>>>0?(q=a-g|0,r=b+(g-8)|0,v[e]=g|i&1|2,v[b+(g-4)>>2]=q|1,v[X+24>>2]=r,v[X+12>>2]=q,q=0,r=f,f=18):f=22):(q=j-g|0,15>>0?(v[e]=g|i&1|2,v[b+(g-4)>>2]=q|3,v[a]|=1,q=b+g|0):q=0,r=f,f=18)}do{if(18==f&&0!=(r|0)){0!=(q|0)&&Nc(q);h=r+8|0;break a}}while(0);f=qb(d);if(0==(f|0)){h=0;break a}e=j-(0==(v[e]&3|0)?8:4)|0;ud(f,b,e>>>0>>0?e:d);Nc(b);h=f;break a}}}while(0);Z();c("Reached an unreachable!")}}while(0);return h}De.X=1;function ve(){if(0==(v[ue>>2]|0)){var b=Ee();0==(b-1&b|0)?(v[ue+8>>2]=b,v[ue+4>>2]=b,v[ue+12>>2]=-1,v[ue+16>>2]=2097152,v[ue+20>>2]=0,v[X+440>>2]=0,v[ue>>2]=Math.floor(Date.now()/1e3)&-16^1431655768):(Z(),c("Reached an unreachable!"))}}function we(b){var d,a=X+444|0;for(d=a>>2;;){var e=B[d];if(e>>>0<=b>>>0&&(e+v[d+1]|0)>>>0>b>>>0){var f=a;break}d=B[d+2];if(0==(d|0)){f=0;break}a=d;d=a>>2}return f}function ye(b,d){var a=b+8|0,a=0==(a&7|0)?0:-a&7,e=d-a|0;v[X+24>>2]=b+a|0;v[X+12>>2]=e;v[a+(b+4)>>2]=e|1;v[d+(b+4)>>2]=40;v[X+28>>2]=v[ue+16>>2]}function ze(b,d,a){var e,f,g,h=d>>2,i=b>>2,j,k=b+8|0,k=0==(k&7|0)?0:-k&7;f=d+8|0;var l=0==(f&7|0)?0:-f&7;g=l>>2;var o=d+l|0,t=k+a|0;f=t>>2;var q=b+t|0,r=o-(b+k)-a|0;v[(k+4>>2)+i]=a|3;a=(o|0)==(v[X+24>>2]|0);a:do{if(a){var w=v[X+12>>2]+r|0;v[X+12>>2]=w;v[X+24>>2]=q;v[f+(i+1)]=w|1}else{if((o|0)==(v[X+20>>2]|0)){w=v[X+8>>2]+r|0,v[X+8>>2]=w,v[X+20>>2]=q,v[f+(i+1)]=w|1,v[(b+w+t|0)>>2]=w}else{var x=B[g+(h+1)];if(1==(x&3|0)){var w=x&-8,D=x>>>3,y=256>x>>>0;b:do{if(y){var A=B[((l|8)>>2)+h],E=B[g+(h+3)];if((A|0)==(E|0)){v[X>>2]&=1<>>2&1073741822)<<2)+X+40|0;j=(A|0)==(G|0)?16:A>>>0>2]>>>0?19:16;do{if(16==j&&!((E|0)!=(G|0)&&E>>>0>2]>>>0)){v[A+12>>2]=E;v[E+8>>2]=A;break b}}while(0);Z();c("Reached an unreachable!")}}else{j=o;A=B[((l|24)>>2)+h];E=B[g+(h+3)];G=(E|0)==(j|0);do{if(G){e=l|16;var N=e+(d+4)|0,I=v[N>>2];if(0==(I|0)){if(e=d+e|0,I=v[e>>2],0==(I|0)){I=0;e=I>>2;break}}else{e=N}for(;;){var N=I+20|0,M=v[N>>2];if(0==(M|0)&&(N=I+16|0,M=B[N>>2],0==(M|0))){break}e=N;I=M}e>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[e>>2]=0}else{e=B[((l|8)>>2)+h],e>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[e+12>>2]=E,v[E+8>>2]=e,I=E}e=I>>2}while(0);if(0!=(A|0)){E=l+(d+28)|0;G=(v[E>>2]<<2)+X+304|0;N=(j|0)==(v[G>>2]|0);do{if(N){v[G>>2]=I;if(0!=(I|0)){break}v[X+4>>2]&=1<>2]^-1;break b}A>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));M=A+16|0;(v[M>>2]|0)==(j|0)?v[M>>2]=I:v[A+20>>2]=I;if(0==(I|0)){break b}}while(0);I>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"));v[e+6]=A;j=l|16;A=B[(j>>2)+h];0!=(A|0)&&(A>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[e+4]=A,v[A+24>>2]=I);j=B[(j+4>>2)+h];0!=(j|0)&&(j>>>0>2]>>>0&&(Z(),c("Reached an unreachable!")),v[e+5]=j,v[j+24>>2]=I)}}}while(0);x=d+(w|l)|0;w=w+r|0}else{x=o,w=r}x=x+4|0;v[x>>2]&=-2;v[f+(i+1)]=w|1;v[(w>>2)+i+f]=w;if(256>w>>>0){D=w>>>2&1073741822,x=(D<<2)+X+40|0,y=B[X>>2],w=1<<(w>>>3),0==(y&w|0)?(v[X>>2]=y|w,w=x,D=(D+2<<2)+X+40|0):(D=(D+2<<2)+X+40|0,w=B[D>>2],w>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"))),v[D>>2]=q,v[w+12>>2]=q,v[f+(i+2)]=w,v[f+(i+3)]=x}else{if(x=q,y=w>>>8,0==(y|0)?D=0:16777215>>0?D=31:(D=(y+1048320|0)>>>16&8,j=y<>>16&4,j<<=y,A=(j+245760|0)>>>16&2,D=14-(y|D|A)+(j<>>15)|0,D=w>>>((D+7|0)>>>0)&1|D<<1),y=(D<<2)+X+304|0,v[f+(i+7)]=D,j=t+(b+16)|0,v[f+(i+5)]=0,v[j>>2]=0,j=v[X+4>>2],A=1<>2]=j|A,v[y>>2]=x,v[f+(i+6)]=y,v[f+(i+3)]=x,v[f+(i+2)]=x}else{D=w<<(31==(D|0)?0:25-(D>>>1)|0);for(y=v[y>>2];;){if((v[y+4>>2]&-8|0)==(w|0)){j=y+8|0;A=B[j>>2];E=B[X+16>>2];G=y>>>0>>0;do{if(!G&&A>>>0>=E>>>0){v[A+12>>2]=x;v[j>>2]=x;v[f+(i+2)]=A;v[f+(i+3)]=y;v[f+(i+6)]=0;break a}}while(0);Z();c("Reached an unreachable!")}j=(D>>>31<<2)+y+16|0;A=B[j>>2];if(0!=(A|0)){D<<=1,y=A}else{if(j>>>0>=B[X+16>>2]>>>0){v[j>>2]=x;v[f+(i+6)]=y;v[f+(i+3)]=x;v[f+(i+2)]=x;break a}Z();c("Reached an unreachable!")}}}}}}}while(0);return b+(k|8)|0}ze.X=1;function Ae(b,d){var a,e,f=B[X+24>>2];e=f>>2;var g=we(f),h=v[g>>2];a=v[g+4>>2];var g=h+a|0,i=h+(a-39)|0,h=h+(a-47)+(0==(i&7|0)?0:-i&7)|0,h=h>>>0<(f+16|0)>>>0?f:h,i=h+8|0;a=i>>2;ye(b,d-40|0);v[(h+4|0)>>2]=27;v[a]=v[X+444>>2];v[a+1]=v[X+448>>2];v[a+2]=v[X+452>>2];v[a+3]=v[X+456>>2];v[X+444>>2]=b;v[X+448>>2]=d;v[X+456>>2]=0;v[X+452>>2]=i;a=h+28|0;v[a>>2]=7;i=(h+32|0)>>>0>>0;a:do{if(i){for(var j=a;;){var k=j+4|0;v[k>>2]=7;if((j+8|0)>>>0>=g>>>0){break a}j=k}}}while(0);g=(h|0)==(f|0);a:do{if(!g){if(a=h-f|0,i=f+a|0,j=a+(f+4)|0,v[j>>2]&=-2,v[e+1]=a|1,v[i>>2]=a,256>a>>>0){j=a>>>2&1073741822,i=(j<<2)+X+40|0,k=B[X>>2],a=1<<(a>>>3),0==(k&a|0)?(v[X>>2]=k|a,a=i,j=(j+2<<2)+X+40|0):(j=(j+2<<2)+X+40|0,a=B[j>>2],a>>>0>2]>>>0&&(Z(),c("Reached an unreachable!"))),v[j>>2]=f,v[a+12>>2]=f,v[e+2]=a,v[e+3]=i}else{i=f;k=a>>>8;if(0==(k|0)){j=0}else{if(16777215>>0){j=31}else{var j=(k+1048320|0)>>>16&8,l=k<>>16&4,l=l<>>16&2,j=14-(k|j|o)+(l<>>15)|0,j=a>>>((j+7|0)>>>0)&1|j<<1}}k=(j<<2)+X+304|0;v[e+7]=j;v[e+5]=0;v[e+4]=0;l=v[X+4>>2];o=1<>2]=l|o,v[k>>2]=i,v[e+6]=k,v[e+3]=f,v[e+2]=f}else{j=a<<(31==(j|0)?0:25-(j>>>1)|0);for(k=v[k>>2];;){if((v[k+4>>2]&-8|0)==(a|0)){var l=k+8|0,o=B[l>>2],t=B[X+16>>2],q=k>>>0>>0;do{if(!q&&o>>>0>=t>>>0){v[o+12>>2]=i;v[l>>2]=i;v[e+2]=o;v[e+3]=k;v[e+6]=0;break a}}while(0);Z();c("Reached an unreachable!")}l=(j>>>31<<2)+k+16|0;o=B[l>>2];if(0!=(o|0)){j<<=1,k=o}else{if(l>>>0>=B[X+16>>2]>>>0){v[l>>2]=i;v[e+6]=k;v[e+3]=f;v[e+2]=f;break a}Z();c("Reached an unreachable!")}}}}}}while(0)}Ae.X=1;function Fe(b){v[b>>2]=Ge+8|0}function He(b){Ie(b|0)}var Je=n;function Qd(b){return 65<=b&&90>=b?b-65+97:b}function nd(b,d,a){for(var e=0;eg?1:-1}}return 0}function Oc(b,d,a,e){c("Assertion failed: "+gb(e)+", at: "+[gb(b),d,gb(a)])}function ud(b,d,a){if(20<=a&&d%2==b%2){if(d%4==b%4){for(a=d+a;d%4;){u[b++]=u[d++]}for(var d=d>>2,b=b>>2,e=a>>2;d>=1;b>>=1;for(e=a>>1;da&&(a+=256);for(var f=b>>2,g=e>>2,h=a|a<<8|a<<16|a<<24;fg?1:-1}}return 0}function xd(b){return 48<=b&&57>=b||97<=b&&122>=b||65<=b&&90>=b}function Kd(b){return 33<=b&&47>=b||58<=b&&64>=b||91<=b&&96>=b||123<=b&&126>=b}function pd(b,d){for(var a=Fa,e=0;eg?1:-1}}return 0}function Ke(b,d){function a(a){var b;"double"===a?b=(pb[0]=v[d+f>>2],pb[1]=v[d+(f+4)>>2],ob[0]):"i64"==a?b=[v[d+f>>2],v[d+(f+4)>>2]]:(a="i32",b=v[d+f>>2]);f+=Math.max(ra(a),sa);return b}for(var e=b,f=0,g=[],h,i;;){var j=e;h=u[e];if(0===h){break}i=u[e+1];if(37==h){var k=p,l=p,o=p,t=p;a:for(;;){switch(i){case 43:k=m;break;case 45:l=m;break;case 35:o=m;break;case 48:if(t){break a}else{t=m;break};default:break a}e++;i=u[e+1]}var q=0;if(42==i){q=a("i32"),e++,i=u[e+1]}else{for(;48<=i&&57>=i;){q=10*q+(i-48),e++,i=u[e+1]}}var r=p;if(46==i){var w=0,r=m;e++;i=u[e+1];if(42==i){w=a("i32"),e++}else{for(;;){i=u[e+1];if(48>i||57>>0)+4294967296*(h[1]>>>0):(h[0]>>>0)+4294967296*(h[1]|0));4>=x&&(h=(j?wc:vc)(h&Math.pow(256,x)-1,8*x));var A=Math.abs(h),j="";if(100==i||105==i){y=8==x&&Je?Je.stringify(D[0],D[1]):wc(h,8*x).toString(10)}else{if(117==i){y=8==x&&Je?Je.stringify(D[0],D[1],m):vc(h,8*x).toString(10),h=Math.abs(h)}else{if(111==i){y=(o?"0":"")+A.toString(8)}else{if(120==i||88==i){j=o?"0x":"";if(0>h){h=-h;y=(A-1).toString(16);D=[];for(o=0;oh?"-"+j:"+"+j);j.length+y.lengthx&&-4<=x?(i=(103==i?"f":"F").charCodeAt(0),w-=x+1):(i=(103==i?"e":"E").charCodeAt(0),w--),x=Math.min(w,20)}if(101==i||69==i){y=h.toExponential(x),/[eE][-+]\d$/.test(y)&&(y=y.slice(0,-1)+"0"+y.slice(-1))}else{if(102==i||70==i){y=h.toFixed(x)}}j=y.split("e");if(r&&!o){for(;1x++;){j[0]+="0"}}y=j[0]+(1h?"-":"")+"inf",t=p}}for(;y.lengthi&&(y=y.toUpperCase());y.split("").forEach((function(a){g.push(a.charCodeAt(0))}))}else{if(115==i){k=a("i8*")||0;t=uc(k);r&&(t=Math.min(uc(k),w));if(!l){for(;t>2]=g.length}else{if(37==i){g.push(h)}else{for(o=j;o>2]=b}var Be,Oe=0,Pe=0,Qe=0,Re=2,Se=[n],Te=m;function Ue(b,d){if("string"!==typeof b){return n}d===ba&&(d="/");b&&"/"==b[0]&&(d="");for(var a=(d+"/"+b).split("/").reverse(),e=[""];a.length;){var f=a.pop();""==f||"."==f||(".."==f?1>12<<12,ff=m);var d=Ea;0!=b&&Da(b);return d}var ff,Ie;function Zd(b,d,a){for(var d=vc(d),e=0;ea;a++){e.push(0)}}var a=b.length+1,e=[F(Lb("/bin/this.program"),"i8",C)];d();for(var f=0;f>2]=kf|0;v[U+4>>2]=K.fa|0;v[U+8>>2]=K.Ga|0;v[U+12>>2]=K.ab|0;v[U+16>>2]=K.C|0;v[U+20>>2]=K.Eb|0;v[U+24>>2]=kf|0;v[U+28>>2]=K.Sb|0;v[U+32>>2]=K.F|0;v[U+36>>2]=K.$b|0;v[U+40>>2]=K.bc|0;v[U+44>>2]=K.ga|0;v[U+48>>2]=K.ja|0;v[U+52>>2]=K.na|0;v[U+56>>2]=kf|0;v[U+60>>2]=K.oa|0;v[U+64>>2]=kf|0;v[U+68>>2]=K.qa|0;v[U+72>>2]=K.w|0;v[U+76>>2]=kf|0;v[U+80>>2]=kf|0;v[U+84>>2]=K.G|0;v[U+88>>2]=K.ya|0;v[U+92>>2]=K.Ba|0;v[U+96>>2]=kf|0;v[U+100>>2]=K.m|0;v[U+104>>2]=K.Ha|0;v[U+108>>2]=K.Ka|0;v[U+112>>2]=K.z|0;v[U+116>>2]=kf|0;v[U+120>>2]=kf|0;v[U+124>>2]=kf|0;v[U+128>>2]=K.Na|0;v[U+132>>2]=kf|0;v[U+136>>2]=kf|0;v[U+140>>2]=kf|0;v[U+144>>2]=kf|0;v[U+148>>2]=K.Pa|0;v[Yd>>2]=K.xb|0;v[Yd+4>>2]=K.u|0;v[Yd+8>>2]=K.Qa|0;v[Yd+12>>2]=K.jb|0;v[Yd+16>>2]=K.k|0;v[jf>>2]=K.w|0;v[jf+4>>2]=K.$a|0;v[jf+8>>2]=K.qb|0;v[jf+12>>2]=K.Db|0;v[jf+16>>2]=K.Hb|0;v[jf+20>>2]=K.C|0;v[jf+24>>2]=K.G|0;v[jf+28>>2]=K.m|0;v[qe>>2]=kf|0;v[qe+4>>2]=K.j|0;v[qe+8>>2]=K.t|0;v[qe+12>>2]=K.eb|0;v[qe+16>>2]=K.tb|0;v[qe+20>>2]=K.Ib|0;v[qe+24>>2]=K.Vb|0;v[Ge+4>>2]=nf;v[lf+4>>2]=of;mf=F([2,0,0,0],["i8*",0,0,0],C);v[nf>>2]=mf+8|0;v[nf+4>>2]=K.Y|0;v[nf+8>>2]=ba;v[of>>2]=mf+8|0;v[of+4>>2]=K.W|0;v[of+8>>2]=nf;H=[0,0,He,0,Bd,0,Fd,0,(function(b,d,a,e){e=2>e>>>0;do{if(e){var f=0}else{if(32!=u[a-1|0]<<24>>24){f=0}else{if(32!=u[a-2|0]<<24>>24){f=0}else{for(var f=b+4|0,g=b|0,h=v[f>>2];0!=(h|0);){h=h-1|0;if(32!=u[v[g>>2]+h|0]<<24>>24){break}v[f>>2]=h}f=0!=(H[v[d+64>>2]](b,v[d+104>>2])|0)&1}}}}while(0);return f}),0,Gd,0,(function(b,d,a,e,f){e=s;s+=20;var g=e+4;v[e>>2]=0;var f=Pd(a,f,e),h=g|0;v[h>>2]=a;var i=g+4|0;v[i>>2]=f;v[g+8>>2]=0;v[g+12>>2]=0;var j=2>>0;a:do{if(j){var k=d+44|0,l=0==(v[k>>2]|0);do{if(!l){var o=B[e>>2];if(0!=(o|0)){j=P(d,1);v[h>>2]=a+1|0;v[i>>2]=f-2|0;Id(j,g);b=H[v[k>>2]](b,j,o,v[d+104>>2]);R(d,1);k=b;break a}}}while(0);k=v[d+72>>2];k=0==(k|0)?0:H[k](b,g,v[d+104>>2])}else{k=0}}while(0);s=e;return 0==(k|0)?0:f}),0,(function(b,d,a,e,f){var g,e=s;s+=16;g=e>>2;v[g]=0;v[g+1]=0;v[g+2]=0;v[g+3]=0;1>>0?(a=a+1|0,f=z[a]&255,0==(Zd(K.bb|0,f,23)|0)?b=0:(g=B[d+92>>2],0==(g|0)?O(b,f):(v[e>>2]=a,v[e+4>>2]=1,H[g](b,e,v[d+104>>2])),b=2)):(1==(f|0)&&O(b,z[a]&255),b=2);s=e;return b}),0,(function(b,d,a,e,f){var g,e=s;s+=16;g=e>>2;v[g]=0;v[g+1]=0;v[g+2]=0;v[g+3]=0;for(var h=1>>0?35==u[a+1|0]<<24>>24?2:1:1;;){if(h>>>0>=f>>>0){var i=0;break}g=a+h|0;h=h+1|0;if(0==(xd(z[g]&255)|0)){if(59!=u[g]<<24>>24){i=0;break}f=B[d+88>>2];if(0==(f|0)){L(b,a,h);i=h;break}v[e>>2]=a;v[e+4>>2]=h;H[f](b,e,v[d+104>>2]);i=h;break}}s=e;return i}),0,(function(b,d,a,e,f){var g=s;s+=4;var h=d+44|0;if(0==(v[h>>2]|0)){b=0}else{if(0!=(v[d+428>>2]|0)){b=0}else{var i=P(d,1),a=ae(g,i,a,e,f,0);0!=(a|0)&&(e=b+4|0,v[e>>2]=v[e>>2]-v[g>>2]|0,H[v[h>>2]](b,i,1,v[d+104>>2]));R(d,1);b=a}}s=g;return b}),0,(function(b,d,a,e,f){var g=s;s+=4;var h=d+44|0;if(0==(v[h>>2]|0)){b=0}else{if(0!=(v[d+428>>2]|0)){b=0}else{var i=P(d,1),a=$d(g,i,a,e,f);0!=(a|0)&&(e=b+4|0,v[e>>2]=v[e>>2]-v[g>>2]|0,H[v[h>>2]](b,i,2,v[d+104>>2]));R(d,1);b=a}}s=g;return b}),0,Jd,0,Od,0,ce,0,(function(b,d){L(b,K.Mb|0,6);0!=(d|0)&&de(b,v[d>>2],v[d+4>>2],0);L(b,K.Ob|0,7);return 1}),0,(function(b,d){if(0==(d|0)){var a=0}else{a=d+4|0,0==(v[a>>2]|0)?a=0:(L(b,K.Kb|0,8),L(b,v[d>>2],v[a>>2]),L(b,K.Lb|0,9),a=1)}return a}),0,(function(b,d){if(0==(d|0)){var a=0}else{a=d+4|0,0==(v[a>>2]|0)?a=0:(L(b,K.Gb|0,4),L(b,v[d>>2],v[a>>2]),L(b,K.Jb|0,5),a=1)}return a}),0,(function(b,d,a,e){0!=(e|0)&&(d=v[e+4>>2],0!=(d|0)&&L(b,v[e>>2],d));return 1}),0,(function(b,d){if(0==(d|0)){var a=0}else{a=d+4|0,0==(v[a>>2]|0)?a=0:(L(b,K.Cb|0,12),L(b,v[d>>2],v[a>>2]),L(b,K.Fb|0,14),a=1)}return a}),0,(function(b,d){if(0==(d|0)){var a=0}else{a=d+4|0,0==(v[a>>2]|0)?a=0:(L(b,K.Ab|0,5),L(b,v[d>>2],v[a>>2]),L(b,K.Bb|0,6),a=1)}return a}),0,(function(b,d){if(0==(d|0)){var a=0}else{a=d+4|0,0==(v[a>>2]|0)?a=0:(L(b,K.yb|0,5),L(b,v[d>>2],v[a>>2]),L(b,K.zb|0,6),a=1)}return a}),0,(function(b,d){var a;a=(d+4|0)>>2;var e=0<(v[a]|0);a:do{if(e){for(;;){L(b,K.wb|0,12);var f=v[a]-1|0;v[a]=f;if(0>=(f|0)){break a}}}}while(0)}),0,ee,0,(function(b,d){0!=(v[b+4>>2]|0)&&O(b,10);L(b,K.pb|0,13);0!=(d|0)&&L(b,v[d>>2],v[d+4>>2]);L(b,K.rb|0,14)}),0,(function(b,d){var a,e=0==(d|0);a:do{if(!e){a=(d|0)>>2;for(var f=v[d+4>>2];;){if(0==(f|0)){var g=0;break}var h=f-1|0;if(10!=u[v[a]+h|0]<<24>>24){g=0;break}f=h}for(;;){if(g>>>0>=f>>>0){break a}var i=B[a];if(10!=u[i+g|0]<<24>>24){break}g=g+1|0}0==(v[b+4>>2]|0)?a=i:(O(b,10),a=v[a]);L(b,a+g|0,f-g|0);O(b,10)}}while(0)}),0,(function(b,d,a,e){0!=(v[b+4>>2]|0)&&O(b,10);if(0==(v[e+12>>2]&64|0)){Ud(b,K.nb|0,($a=s,s+=4,v[$a>>2]=a,$a))}else{var f=v[e>>2];v[e>>2]=f+1|0;Ud(b,K.lb|0,($a=s,s+=8,v[$a>>2]=a,v[$a+4>>2]=f,$a))}0!=(d|0)&&L(b,v[d>>2],v[d+4>>2]);Ud(b,K.ob|0,($a=s,s+=4,v[$a>>2]=a,$a))}),0,(function(b,d){0!=(v[b+4>>2]|0)&&O(b,10);Wd(b,0!=(v[d+12>>2]&256|0)?K.ib|0:K.kb|0)}),0,(function(b,d,a){0!=(v[b+4>>2]|0)&&O(b,10);a=0!=(a&1|0);L(b,a?K.cb|0:K.fb|0,5);0!=(d|0)&&L(b,v[d>>2],v[d+4>>2]);L(b,a?K.gb|0:K.hb|0,6)}),0,(function(b,d){L(b,K.Za|0,4);if(0!=(d|0)){for(var a=d|0,e=v[d+4>>2];;){if(0==(e|0)){var f=v[a>>2];break}var g=e-1|0,h=v[a>>2];if(10!=u[h+g|0]<<24>>24){f=h;break}e=g}L(b,f,e)}L(b,K.A|0,6)}),0,fe,0,(function(b,d,a){0!=(v[b+4>>2]|0)&&O(b,10);L(b,K.Oa|0,15);0!=(d|0)&&L(b,v[d>>2],v[d+4>>2]);L(b,K.Ra|0,16);0!=(a|0)&&L(b,v[a>>2],v[a+4>>2]);L(b,K.Sa|0,17)}),0,(function(b,d){L(b,K.La|0,5);0!=(d|0)&&L(b,v[d>>2],v[d+4>>2]);L(b,K.Ma|0,6)}),0,(function(b,d,a){var e=0!=(a&4|0);e?L(b,K.pa|0,3):L(b,K.ta|0,3);a&=3;3==(a|0)?L(b,K.ua|0,16):1==(a|0)?L(b,K.xa|0,14):2==(a|0)?L(b,K.Aa|0,15):L(b,K.Da|0,1);0!=(d|0)&&L(b,v[d>>2],v[d+4>>2]);e?L(b,K.Fa|0,6):L(b,K.Ja|0,6)}),0,he,0,(function(b,d,a,e,f){if(0==(d|0)){b=0}else{var g=d+4|0;0==(v[g>>2]|0)?b=0:(L(b,K.ec|0,10),ie(b,v[d>>2],v[g>>2]),L(b,K.ia|0,7),0!=(e|0)&&(d=v[e+4>>2],0!=(d|0)&&de(b,v[e>>2],d,0)),0!=(a|0)&&(e=a+4|0,0!=(v[e>>2]|0)&&(L(b,K.B|0,9),de(b,v[a>>2],v[e>>2],0))),Wd(b,0!=(v[f+12>>2]&256|0)?K.ma|0:K.g|0),b=1)}return b}),0,ge,0,je,0,ke,0,(function(b,d){0!=(d|0)&&de(b,v[d>>2],v[d+4>>2],0)}),0,(function(b,d,a,e,f){if(2>>0){if(45!=u[e+1|0]<<24>>24){d=6}else{if(45!=u[e+2|0]<<24>>24){d=6}else{L(b,K.Ea|0,7);var g=2,d=10}}}else{d=6}a:do{if(6==d){g=1>>0;do{if(g&&45==u[e+1|0]<<24>>24){L(b,K.Ia|0,7);g=1;break a}}while(0);O(b,z[e]&255);g=0}}while(0);return g}),0,(function(b,d,a,e,f){if(2>>0){if(d=Qd(z[e+2|0]&255),a=Qd(z[e+1|0]&255)&255,99==(a|0)){if(41!=(d&255|0)){f=12}else{L(b,K.wa|0,6);var g=2,f=13}}else{114==(a|0)?41!=(d&255|0)?f=12:(L(b,K.za|0,5),g=2,f=13):3>>0&116==(a|0)?109!=(d&255|0)?f=12:41!=u[e+3|0]<<24>>24?f=12:(L(b,K.Ca|0,7),g=3,f=13):f=12}}else{f=12}12==f&&(O(b,z[e]&255),g=0);return g}),0,le,0,(function(b,d,a,e,f){0==(me(b,a,0==(f|0)?0:u[e+1|0],100,d+4|0)|0)&&L(b,K.j|0,6);return 0}),0,(function(b,d,a,e,f){if(5>>0){if(0!=(Rc(e,K.j|0,6)|0)){d=7}else{if(0==(me(b,a,6>>0?u[e+6|0]:0,100,d+4|0)|0)){d=7}else{var g=5,d=10}}}else{d=7}7==d&&(3>>0&&0==(Rc(e,K.ra|0,4)|0)?g=3:(O(b,38),g=0));return g}),0,(function(b,d,a,e,f){if(2>>0){if(d=z[e+1|0],46==d<<24>>24){if(46!=u[e+2|0]<<24>>24){f=11}else{L(b,K.s|0,8);var g=2,f=12}}else{4>>0&32==d<<24>>24?46!=u[e+2|0]<<24>>24?f=11:32!=u[e+3|0]<<24>>24?f=11:46!=u[e+4|0]<<24>>24?f=11:(L(b,K.s|0,8),g=4,f=12):f=11}}else{f=11}11==f&&(O(b,z[e]&255),g=0);return g}),0,oe,0,(function(b,d,a,e,f){for(var g,d=0;;){if(d>>>0>=f>>>0){var h=0;break}if(62==u[e+d|0]<<24>>24){h=0;break}d=d+1|0}for(;;){if(8<=h>>>0){var i=d;g=14;break}var j=B[jf+(h<<2)>>2];if(1==(be(e,f,j)|0)){var k=d;g=7;break}h=h+1|0}a:do{if(7==g){for(;;){g=k>>>0>>0?60==u[e+k|0]<<24>>24?10:9:10;if(10==g){if((k|0)==(f|0)){var l=k;break}if(2==(be(e+k|0,f-k|0,j)|0)){l=k;break}}k=k+1|0}for(;;){if(l>>>0>=f>>>0){i=l;break a}if(62==u[e+l|0]<<24>>24){i=l;break a}l=l+1|0}}}while(0);L(b,e,i+1|0);return i}),0,(function(b,d,a,e,f){if(1>>0){if(96!=u[e+1|0]<<24>>24){b=7}else{if(0==(me(b,a,2>>0?u[e+2|0]:0,100,d+4|0)|0)){b=7}else{var g=1,b=8}}}else{b=7}7==b&&(g=0);return g}),0,(function(b,d,a,e,f){2>f>>>0?b=0:(d=z[e+1|0]&255,92==(d|0)||34==(d|0)||39==(d|0)||46==(d|0)||45==(d|0)||96==(d|0)?(O(b,d),b=1):(O(b,92),b=0));return b}),0,(function(b){He(b);0!=(b|0)&&Nc(b)}),0,(function(){return K.mb|0}),0,(function(b){He(b|0);0!=(b|0)&&Nc(b)}),0,(function(){return K.sa|0}),0,Fe,0,(function(b){Fe(b|0);v[b>>2]=lf+8|0}),0];Module.FUNCTION_TABLE=H;function zc(b){function d(){var a=0;Module._main&&(Pb(sc),a=Module.hc(b),Module.noExitRuntime||Pb(tc));if(Module.postRun){for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);0 nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY John Resig ''AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -GPL License ----- - -The GNU General Public License (GPL) -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. - -Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification follow. - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. - - c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -END OF TERMS AND CONDITIONS diff --git a/lib/gollum/public/gollum/livepreview/licenses/sundown/sundown.txt b/lib/gollum/public/gollum/livepreview/licenses/sundown/sundown.txt deleted file mode 100644 index a53a750d..00000000 --- a/lib/gollum/public/gollum/livepreview/licenses/sundown/sundown.txt +++ /dev/null @@ -1,4 +0,0 @@ -License -Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/lib/gollum/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt b/lib/gollum/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt deleted file mode 100644 index 60d6a3fa..00000000 --- a/lib/gollum/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt +++ /dev/null @@ -1,40 +0,0 @@ -Read the license: -http://creativecommons.org/licenses/by/3.0/ ** - -Basicaly, use it anyway you want but include this license file in the source if your project is open source. Nothing is needed in the front facing project. Commercial use is not only allowed but encouraged. This pack was made to promote consistency in applications. - -Creator -- Austin Andrews (@templarian) - -Contributor* -- Oren Nachman - - appbar.chevron.down - - appbar.chevron.up - - appbar.chevron.left - - appbar.chevron.right -- Kris Vandermotten (@kvandermotten) - - appbar.medical.pulse -- Constantin Kichinsky (@kichinsky) - - appbar.currency.rubles - - appbar.currency.grivna -- Massimo Savazzi (@msavazzi) - - List of missing exported icons -- Proletkult Graphik, from The Noun Project - - appbar.draw.pen (inspired) -- Olivier Guin, from The Noun Project - - appbar.draw.marker -- Gibran Bisio, from The Noun Project - - appbar.draw.bucket - -* Developers and designers that emailed Templarian the source .design icons to be added into the package. PNGs also accepted, but may take longer to be added. - - -Contact -- http://templarian.com/ -- admin[@]templarian[.]com - -** Does not apply to copyrighted logos -- Skype -- Facebook -- Twitter -- etc... \ No newline at end of file diff --git a/lib/gollum/public/gollum/livepreview/readme.md b/lib/gollum/public/gollum/livepreview/readme.md deleted file mode 100644 index 296b5bb4..00000000 --- a/lib/gollum/public/gollum/livepreview/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -- [sundown + livepreview](http://bootstraponline.github.com/livepreview/public) -- [markdowndeep + livepreview](http://bootstraponline.github.com/livepreview/public/index_deep.html) - -Uses code/assets from: - -0. [ace](https://github.com/ajaxorg/ace) -0. [gollum](https://github.com/gollum/gollum) -0. [jquery](https://github.com/jquery/jquery) -0. [sizzle](https://github.com/jquery/sizzle) -0. [notepages](https://github.com/fivesixty/notepages) -0. [retina_display_icon_set](http://blog.twg.ca/2010/11/retina-display-icon-set/) -0. [debounce](https://github.com/cowboy/jquery-throttle-debounce) -0. [requirejs](https://github.com/jrburke/requirejs) -0. [emscripten](https://github.com/kripken/emscripten) -0. [sundown](https://github.com/bootstraponline/sundown) -0. [markdowndeep](https://github.com/toptensoftware/markdowndeep) - -See licenses folder for details. - -# Updating gollum - - - /public/css/custom.css (not css/gollum/) - - /public/images/* - - /public/js/* - - /public/licenses/* - - /public/index.html - - readme.md - - replace template.css link in index.html - -# Dependency Notes - -## Ace -Using master branch at [63178a05119ec425908514a16007743905672dbf](https://github.com/ajaxorg/ace/commit/63178a05119ec425908514a16007743905672dbf). - -- Copy `ajaxorg/ace/lib/ace` to `/public/js/ace/lib/ace` - -All changes to Ace for livepreview have been upstreamed. -- Gutter control [#799](https://github.com/ajaxorg/ace/pull/799) -- GitHub theme [#798](https://github.com/ajaxorg/ace/pull/798) - -## jQuery & Sizzle -Using jQuery v1.7.2. - -- Download latest production version from [jquery.com](http://www.jquery.com). diff --git a/lib/gollum/templates/livepreview.mustache b/lib/gollum/templates/livepreview.mustache deleted file mode 100644 index ab327315..00000000 --- a/lib/gollum/templates/livepreview.mustache +++ /dev/null @@ -1,66 +0,0 @@ - - - -Live Preview - - - - - -
    -
    - -
    - -
    -
    - -
    - Confirm save with comment - Cancel save with comment -
    -
    -
    - - - - - - - - -{{#mathjax}} -{{^mathjax_config}} - -{{/mathjax_config}} -{{#mathjax_config}} - -{{/mathjax_config}} -{{/mathjax}} - - diff --git a/lib/gollum/views/livepreview.rb b/lib/gollum/views/livepreview.rb deleted file mode 100644 index ee4c1249..00000000 --- a/lib/gollum/views/livepreview.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Precious - module Views - class Livepreview < Layout - def mathjax - @mathjax - end - - def mathjax_config - @mathjax_config - end - end - end -end