From 3adeac683d54f6285fbce72d79059ae805b520ce Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Tue, 9 Nov 2010 08:48:19 +0100 Subject: [PATCH] apply Kevin's refactoring - lower case file names - use define(function(require, exports, module) {..}) --- lib/ace/PluginManager.js | 19 ---- lib/ace/RenderLoop.js | 62 ----------- lib/ace/ScrollBar.js | 58 ---------- lib/ace/UndoManager.js | 47 -------- lib/ace/{Document.js => _document.js} | 71 ++++++++---- lib/ace/{Editor.js => _editor.js} | 65 +++++++---- lib/ace/{KeyBinding.js => _keybinding.js} | 53 ++++++--- lib/ace/{Range.js => _range.js} | 43 ++++++-- lib/ace/_renderloop.js | 93 ++++++++++++++++ lib/ace/_scrollbar.js | 87 +++++++++++++++ lib/ace/{Search.js => _search.js} | 48 +++++++-- lib/ace/{Selection.js => _selection.js} | 50 +++++++-- lib/ace/{TextInput.js => _textinput.js} | 44 ++++++-- lib/ace/{Tokenizer.js => _tokenizer.js} | 42 ++++++-- lib/ace/_undomanager.js | 78 ++++++++++++++ lib/ace/background_tokenizer.js | 46 ++++++-- lib/ace/commands/default_commands.js | 45 ++++++-- lib/ace/conf/keybindings/default_mac.js | 43 ++++++-- lib/ace/conf/keybindings/default_win.js | 43 ++++++-- lib/ace/event_emitter.js | 85 +++++++++++++++ lib/ace/layer/Gutter.js | 55 ---------- lib/ace/layer/{Cursor.js => _cursor.js} | 43 ++++++-- lib/ace/layer/_gutter.js | 85 +++++++++++++++ lib/ace/layer/{Marker.js => _marker.js} | 44 ++++++-- lib/ace/layer/{Text.js => _text.js} | 48 +++++++-- lib/ace/lib/_core.js | 63 +++++++++++ lib/ace/lib/{dom.js => _dom.js} | 43 ++++++-- lib/ace/lib/{event.js => _event.js} | 43 ++++++-- lib/ace/lib/{lang.js => _lang.js} | 43 ++++++-- lib/ace/lib/_oop.js | 61 +++++++++++ lib/ace/lib/core.js | 31 ------ lib/ace/lib/oop.js | 31 ------ lib/ace/mevent_emitter.js | 55 ---------- lib/ace/mode/Css.js | 52 --------- lib/ace/mode/Html.js | 71 ------------ lib/ace/mode/Text.js | 50 --------- lib/ace/mode/Xml.js | 30 ------ lib/ace/mode/_css.js | 82 ++++++++++++++ lib/ace/mode/_html.js | 101 ++++++++++++++++++ .../mode/{JavaScript.js => _javascript.js} | 53 ++++++--- lib/ace/mode/_text.js | 80 ++++++++++++++ lib/ace/mode/_xml.js | 60 +++++++++++ lib/ace/mode/css_highlight_rules.js | 55 +++++++--- lib/ace/mode/doc_comment_highlight_rules.js | 46 ++++++-- lib/ace/mode/html_highlight_rules.js | 51 +++++++-- lib/ace/mode/javascript_highlight_rules.js | 64 +++++++---- lib/ace/mode/matching_brace_outdent.js | 44 ++++++-- lib/ace/mode/text_highlight_rules.js | 42 ++++++-- lib/ace/mode/xml_highlight_rules.js | 47 ++++++-- lib/ace/plugin_manager.js | 49 +++++++++ lib/ace/test/{all.js => _all.js} | 0 .../test/{assertions.js => _assertions.js} | 0 .../{MockRenderer.js => _mockrenderer.js} | 0 ...ocumentTest.js => change_document_test.js} | 0 .../{DocumentTest.js => document_test.js} | 0 ...ntEmitterTest.js => event_emitter_test.js} | 0 lib/ace/test/mode/{CssTest.js => css_test.js} | 0 ...TokenizerTest.js => css_tokenizer_test.js} | 0 .../test/mode/{HtmlTest.js => html_test.js} | 0 ...okenizerTest.js => html_tokenizer_test.js} | 0 .../{JavaScriptTest.js => javascript_test.js} | 0 ...erTest.js => javascript_tokenizer_test.js} | 0 .../test/mode/{TextTest.js => text_test.js} | 0 lib/ace/test/mode/{XmlTest.js => xml_test.js} | 0 ...TokenizerTest.js => xml_tokenizer_test.js} | 0 .../{NavigationTest.js => navigation_test.js} | 0 lib/ace/test/{RangeTest.js => range_test.js} | 0 .../test/{SearchTest.js => search_test.js} | 0 .../{SelectionTest.js => selection_test.js} | 0 .../{TextEditTest.js => text_edit_test.js} | 0 ...ndererTest.js => virtual_renderer_test.js} | 0 lib/ace/theme/Eclipse.js | 9 -- lib/ace/theme/TextMate.js | 9 -- lib/ace/theme/{Clouds.js => _clouds.js} | 5 +- lib/ace/theme/{Cobalt.js => _cobalt.js} | 6 +- lib/ace/theme/{Dawn.js => _dawn.js} | 5 +- lib/ace/theme/{eclipse.css => _eclipse.css} | 0 lib/ace/theme/_eclipse.js | 12 +++ lib/ace/theme/{Monokai.js => _monokai.js} | 6 +- lib/ace/theme/_textmate.js | 12 +++ lib/ace/theme/{tm.css => _tm.css} | 0 lib/ace/theme/{Twilight.js => _twilight.js} | 5 +- ...{clouds_midnight.js => clouds_mignight.js} | 5 +- .../theme/{IdleFingers.js => idle_fingers.js} | 6 +- lib/ace/theme/{KrTheme.js => kr_theme.js} | 6 +- .../{MonoIndustrial.js => mono_industrial.js} | 6 +- lib/ace/virtual_renderer.js | 73 +++++++++---- 87 files changed, 2039 insertions(+), 870 deletions(-) delete mode 100644 lib/ace/PluginManager.js delete mode 100644 lib/ace/RenderLoop.js delete mode 100644 lib/ace/ScrollBar.js delete mode 100644 lib/ace/UndoManager.js rename lib/ace/{Document.js => _document.js} (89%) rename lib/ace/{Editor.js => _editor.js} (93%) rename lib/ace/{KeyBinding.js => _keybinding.js} (60%) rename lib/ace/{Range.js => _range.js} (62%) create mode 100644 lib/ace/_renderloop.js create mode 100644 lib/ace/_scrollbar.js rename lib/ace/{Search.js => _search.js} (81%) rename lib/ace/{Selection.js => _selection.js} (85%) rename lib/ace/{TextInput.js => _textinput.js} (61%) rename lib/ace/{Tokenizer.js => _tokenizer.js} (58%) create mode 100644 lib/ace/_undomanager.js create mode 100644 lib/ace/event_emitter.js delete mode 100644 lib/ace/layer/Gutter.js rename lib/ace/layer/{Cursor.js => _cursor.js} (62%) create mode 100644 lib/ace/layer/_gutter.js rename lib/ace/layer/{Marker.js => _marker.js} (73%) rename lib/ace/layer/{Text.js => _text.js} (82%) create mode 100644 lib/ace/lib/_core.js rename lib/ace/lib/{dom.js => _dom.js} (62%) rename lib/ace/lib/{event.js => _event.js} (77%) rename lib/ace/lib/{lang.js => _lang.js} (53%) create mode 100644 lib/ace/lib/_oop.js delete mode 100644 lib/ace/lib/core.js delete mode 100644 lib/ace/lib/oop.js delete mode 100644 lib/ace/mevent_emitter.js delete mode 100644 lib/ace/mode/Css.js delete mode 100644 lib/ace/mode/Html.js delete mode 100644 lib/ace/mode/Text.js delete mode 100644 lib/ace/mode/Xml.js create mode 100644 lib/ace/mode/_css.js create mode 100644 lib/ace/mode/_html.js rename lib/ace/mode/{JavaScript.js => _javascript.js} (53%) create mode 100644 lib/ace/mode/_text.js create mode 100644 lib/ace/mode/_xml.js create mode 100644 lib/ace/plugin_manager.js rename lib/ace/test/{all.js => _all.js} (100%) rename lib/ace/test/{assertions.js => _assertions.js} (100%) rename lib/ace/test/{MockRenderer.js => _mockrenderer.js} (100%) rename lib/ace/test/{ChangeDocumentTest.js => change_document_test.js} (100%) rename lib/ace/test/{DocumentTest.js => document_test.js} (100%) rename lib/ace/test/{EventEmitterTest.js => event_emitter_test.js} (100%) rename lib/ace/test/mode/{CssTest.js => css_test.js} (100%) rename lib/ace/test/mode/{CssTokenizerTest.js => css_tokenizer_test.js} (100%) rename lib/ace/test/mode/{HtmlTest.js => html_test.js} (100%) rename lib/ace/test/mode/{HtmlTokenizerTest.js => html_tokenizer_test.js} (100%) rename lib/ace/test/mode/{JavaScriptTest.js => javascript_test.js} (100%) rename lib/ace/test/mode/{JavaScriptTokenizerTest.js => javascript_tokenizer_test.js} (100%) rename lib/ace/test/mode/{TextTest.js => text_test.js} (100%) rename lib/ace/test/mode/{XmlTest.js => xml_test.js} (100%) rename lib/ace/test/mode/{XmlTokenizerTest.js => xml_tokenizer_test.js} (100%) rename lib/ace/test/{NavigationTest.js => navigation_test.js} (100%) rename lib/ace/test/{RangeTest.js => range_test.js} (100%) rename lib/ace/test/{SearchTest.js => search_test.js} (100%) rename lib/ace/test/{SelectionTest.js => selection_test.js} (100%) rename lib/ace/test/{TextEditTest.js => text_edit_test.js} (100%) rename lib/ace/test/{VirtualRendererTest.js => virtual_renderer_test.js} (100%) delete mode 100644 lib/ace/theme/Eclipse.js delete mode 100644 lib/ace/theme/TextMate.js rename lib/ace/theme/{Clouds.js => _clouds.js} (96%) rename lib/ace/theme/{Cobalt.js => _cobalt.js} (96%) rename lib/ace/theme/{Dawn.js => _dawn.js} (96%) rename lib/ace/theme/{eclipse.css => _eclipse.css} (100%) create mode 100644 lib/ace/theme/_eclipse.js rename lib/ace/theme/{Monokai.js => _monokai.js} (96%) create mode 100644 lib/ace/theme/_textmate.js rename lib/ace/theme/{tm.css => _tm.css} (100%) rename lib/ace/theme/{Twilight.js => _twilight.js} (97%) rename lib/ace/theme/{clouds_midnight.js => clouds_mignight.js} (97%) rename lib/ace/theme/{IdleFingers.js => idle_fingers.js} (97%) rename lib/ace/theme/{KrTheme.js => kr_theme.js} (96%) rename lib/ace/theme/{MonoIndustrial.js => mono_industrial.js} (97%) diff --git a/lib/ace/PluginManager.js b/lib/ace/PluginManager.js deleted file mode 100644 index 338a5c20..00000000 --- a/lib/ace/PluginManager.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var PluginManager = { - commands : {}, - - registerCommand : function(name, command) { - this.commands[name] = command; - } -}; - -return PluginManager; -}); \ No newline at end of file diff --git a/lib/ace/RenderLoop.js b/lib/ace/RenderLoop.js deleted file mode 100644 index d27d46ce..00000000 --- a/lib/ace/RenderLoop.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var RenderLoop = function(onRender) { - this.onRender = onRender; - this.pending = false; - this.changes = 0; -}; - -(function() { - - this.schedule = function(change) { -// this.onRender(change); -// return; - this.changes = this.changes | change; - if (!this.pending) { - this.pending = true; - var _self = this; - this.setTimeoutZero(function() { - _self.pending = false; - _self.onRender(_self.changes); - _self.changes = 0; - }) - } - }; - - if (window.postMessage) { - - this.messageName = "zero-timeout-message"; - - this.setTimeoutZero = function(callback) { - if (!this.attached) { - var _self = this; - window.addEventListener("message", function(e) { - if (e.source == window && _self.callback && e.data == _self.messageName) { - e.stopPropagation(); - _self.callback(); - } - }, false); - this.attached = true; - } - this.callback = callback; - window.postMessage(this.messageName, "*"); - } - - } else { - - this.setTimeoutZero = function(callback) { - setTimeout(callback, 0); - } - } - -}).call(RenderLoop.prototype); - -return RenderLoop; -}); \ No newline at end of file diff --git a/lib/ace/ScrollBar.js b/lib/ace/ScrollBar.js deleted file mode 100644 index 6012a8cf..00000000 --- a/lib/ace/ScrollBar.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ - -define(function(require, exports, module) { - -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var dom = require("./lib/dom"); -var event = require("./lib/event"); -var MEventEmitter = require("./mevent_emitter"); - -var ScrollBar = function(parent) { - this.element = document.createElement("div"); - this.element.className = "ace_sb"; - - this.inner = document.createElement("div"); - this.element.appendChild(this.inner); - - parent.appendChild(this.element); - - this.width = dom.scrollbarWidth(); - this.element.style.width = this.width; - - event.addListener(this.element, "scroll", lang.bind(this.onScroll, this)); -}; - -(function() { - oop.implement(this, MEventEmitter); - - this.onScroll = function() { - this.$dispatchEvent("scroll", {data: this.element.scrollTop}); - }; - - this.getWidth = function() { - return this.width; - }; - - this.setHeight = function(height) { - this.element.style.height = Math.max(0, height - this.width) + "px"; - }; - - this.setInnerHeight = function(height) { - this.inner.style.height = height + "px"; - }; - - this.setScrollTop = function(scrollTop) { - this.element.scrollTop = scrollTop; - }; - -}).call(ScrollBar.prototype); - -return ScrollBar; -}); diff --git a/lib/ace/UndoManager.js b/lib/ace/UndoManager.js deleted file mode 100644 index c0a8ec76..00000000 --- a/lib/ace/UndoManager.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var UndoManager = function() { - this.$undoStack = []; - this.$redoStack = []; -}; - -(function() { - - /*this.$doc = null; - this.setDocument = function(doc) { - this.$doc = doc; - };*/ - - this.execute = function(options) { - var deltas = options.args[0]; - this.$doc = options.args[1]; - this.$undoStack.push(deltas); - }; - - this.undo = function() { - var deltas = this.$undoStack.pop(); - if (deltas) { - this.$doc.undoChanges(deltas); - this.$redoStack.push(deltas); - } - }; - - this.redo = function() { - var deltas = this.$redoStack.pop(); - if (deltas) { - this.$doc.redoChanges(deltas); - this.$undoStack.push(deltas); - } - }; - -}).call(UndoManager.prototype); - -return UndoManager; -}); \ No newline at end of file diff --git a/lib/ace/Document.js b/lib/ace/_document.js similarity index 89% rename from lib/ace/Document.js rename to lib/ace/_document.js index 979fef65..e08b05d7 100644 --- a/lib/ace/Document.js +++ b/lib/ace/_document.js @@ -1,18 +1,48 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { - -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var MEventEmitter = require("./mevent_emitter"); -var Selection = require("./selection"); -var TextMode = require("./mode/text"); -var Range = require("./range"); + +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var MEventEmitter = require("ace/event_emitter"); +var Selection = require("ace/selection"); +var TextMode = require("ace/mode/text"); +var Range = require("ace/range"); var Document = function(text, mode) { this.modified = true; @@ -32,6 +62,7 @@ var Document = function(text, mode) { } }; + (function() { oop.implement(this, MEventEmitter); @@ -360,14 +391,14 @@ var Document = function(text, mode) { while (true) { while(column >= 0) { - var chr = line.charAt(column); - if (chr == openBracket) { + var ch = line.chAt(column); + if (ch == openBracket) { depth -= 1; if (depth == 0) { return {row: row, column: column}; } } - else if (chr == bracket) { + else if (ch == bracket) { depth +=1; } column -= 1; @@ -393,14 +424,14 @@ var Document = function(text, mode) { while (true) { while(column < line.length) { - var chr = line.charAt(column); - if (chr == closingBracket) { + var ch = line.chAt(column); + if (ch == closingBracket) { depth -= 1; if (depth == 0) { return {row: row, column: column}; } } - else if (chr == bracket) { + else if (ch == bracket) { depth +=1; } column += 1; @@ -716,4 +747,4 @@ var Document = function(text, mode) { }).call(Document.prototype); return Document; -}); \ No newline at end of file +}); diff --git a/lib/ace/Editor.js b/lib/ace/_editor.js similarity index 93% rename from lib/ace/Editor.js rename to lib/ace/_editor.js index af558db0..fb8993ce 100644 --- a/lib/ace/Editor.js +++ b/lib/ace/_editor.js @@ -1,24 +1,53 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ - define(function(require, exports, module) { +define(function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var event = require("ace/lib/event"); +var lang = require("ace/lib/lang"); +var TextInput = require("ace/textinput"); +var KeyBinding = require("ace/keybinding"); +var Document = require("ace/document"); +var Search = require("ace/search"); +var BackgroundTokenizer = require("ace/background_tokenizer"); +var Range = require("ace/range"); +var MEventEmitter = require("ace/event_emitter"); - var oop = require("./lib/oop"); - var event = require("./lib/event"); - var lang = require("./lib/lang"); - var TextInput = require("./textinput"); - var KeyBinding = require("./keybinding"); - var Document = require("./document"); - var Search = require("./search"); - var BackgroundTokenizer = require("./background_tokenizer"); - var Range = require("./range"); - var MEventEmitter = require("./mevent_emitter"); - var Editor =function(renderer, doc) { var container = renderer.getContainerElement(); this.container = container; diff --git a/lib/ace/KeyBinding.js b/lib/ace/_keybinding.js similarity index 60% rename from lib/ace/KeyBinding.js rename to lib/ace/_keybinding.js index 8621cf78..ab9fbbb3 100644 --- a/lib/ace/KeyBinding.js +++ b/lib/ace/_keybinding.js @@ -1,19 +1,48 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { -var core = require("./lib/core"); -var event = require("./lib/event"); -var default_mac = require("./conf/keybindings/default_mac"); -var default_win = require("./conf/keybindings/default_win"); -var PluginManager = require("./pluginmanager"); -var DefaultCommands = require("./commands/default_commands"); +var core = require("ace/lib/core"); +var event = require("ace/lib/event"); +var default_mac = require("ace/conf/keybindings/default_mac"); +var default_win = require("ace/conf/keybindings/default_win"); +var PluginManager = require("ace/plugin_manager"); + var KeyBinding = function(element, editor, config) { this.setConfig(config); diff --git a/lib/ace/Range.js b/lib/ace/_range.js similarity index 62% rename from lib/ace/Range.js rename to lib/ace/_range.js index 1724fc59..2f93e43b 100644 --- a/lib/ace/Range.js +++ b/lib/ace/_range.js @@ -1,12 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { + var Range = function(startRow, startColumn, endRow, endColumn) { this.start = { row: startRow, diff --git a/lib/ace/_renderloop.js b/lib/ace/_renderloop.js new file mode 100644 index 00000000..c581fbc1 --- /dev/null +++ b/lib/ace/_renderloop.js @@ -0,0 +1,93 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + + +var RenderLoop = function(onRender) { + this.onRender = onRender; + this.pending = false; + this.changes = 0; +}; + +(function() { + + this.schedule = function(change) { +// this.onRender(change); +// return; + this.changes = this.changes | change; + if (!this.pending) { + this.pending = true; + var _self = this; + this.setTimeoutZero(function() { + _self.pending = false; + _self.onRender(_self.changes); + _self.changes = 0; + }) + } + }; + + if (window.postMessage) { + + this.messageName = "zero-timeout-message"; + + this.setTimeoutZero = function(callback) { + if (!this.attached) { + var _self = this; + window.addEventListener("message", function(e) { + if (e.source == window && _self.callback && e.data == _self.messageName) { + e.stopPropagation(); + _self.callback(); + } + }, false); + this.attached = true; + } + this.callback = callback; + window.postMessage(this.messageName, "*"); + } + + } else { + + this.setTimeoutZero = function(callback) { + setTimeout(callback, 0); + } + } + +}).call(RenderLoop.prototype); + +return RenderLoop; +}); \ No newline at end of file diff --git a/lib/ace/_scrollbar.js b/lib/ace/_scrollbar.js new file mode 100644 index 00000000..ba7acd0d --- /dev/null +++ b/lib/ace/_scrollbar.js @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var dom = require("ace/lib/dom"); +var event = require("ace/lib/event"); +var MEventEmitter = require("ace/event_emitter"); + +var ScrollBar = function(parent) { + this.element = document.createElement("div"); + this.element.className = "ace_sb"; + + this.inner = document.createElement("div"); + this.element.appendChild(this.inner); + + parent.appendChild(this.element); + + this.width = dom.scrollbarWidth(); + this.element.style.width = this.width; + + event.addListener(this.element, "scroll", lang.bind(this.onScroll, this)); +}; + +(function() { + oop.implement(this, MEventEmitter); + + this.onScroll = function() { + this.$dispatchEvent("scroll", {data: this.element.scrollTop}); + }; + + this.getWidth = function() { + return this.width; + }; + + this.setHeight = function(height) { + this.element.style.height = Math.max(0, height - this.width) + "px"; + }; + + this.setInnerHeight = function(height) { + this.inner.style.height = height + "px"; + }; + + this.setScrollTop = function(scrollTop) { + this.element.scrollTop = scrollTop; + }; + +}).call(ScrollBar.prototype); + +return ScrollBar; +}); diff --git a/lib/ace/Search.js b/lib/ace/_search.js similarity index 81% rename from lib/ace/Search.js rename to lib/ace/_search.js index d549a65a..d751e399 100644 --- a/lib/ace/Search.js +++ b/lib/ace/_search.js @@ -1,15 +1,45 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var Range = require("./range"); +var lang = require("ace/lib/lang"); +var oop = require("ace/lib/oop"); +var Range = require("ace/range"); var Search = function() { this.$options = { diff --git a/lib/ace/Selection.js b/lib/ace/_selection.js similarity index 85% rename from lib/ace/Selection.js rename to lib/ace/_selection.js index a6bd7d98..8a7f9c19 100644 --- a/lib/ace/Selection.js +++ b/lib/ace/_selection.js @@ -1,16 +1,46 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("./lib/oop"); -var lang = require("./lib/lang"); -var MEventEmitter = require("./mevent_emitter"); -var Range = require("./range"); +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var MEventEmitter = require("ace/event_emitter"); +var Range = require("ace/range"); var Selection = function(doc) { this.doc = doc; diff --git a/lib/ace/TextInput.js b/lib/ace/_textinput.js similarity index 61% rename from lib/ace/TextInput.js rename to lib/ace/_textinput.js index 755429d4..629c0e95 100644 --- a/lib/ace/TextInput.js +++ b/lib/ace/_textinput.js @@ -1,13 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var event = require("./lib/event"); +var event = require("ace/lib/event"); var TextInput = function(parentNode, host) { diff --git a/lib/ace/Tokenizer.js b/lib/ace/_tokenizer.js similarity index 58% rename from lib/ace/Tokenizer.js rename to lib/ace/_tokenizer.js index aedc5546..79e9082d 100644 --- a/lib/ace/Tokenizer.js +++ b/lib/ace/_tokenizer.js @@ -1,10 +1,40 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { var Tokenizer = function(rules) { diff --git a/lib/ace/_undomanager.js b/lib/ace/_undomanager.js new file mode 100644 index 00000000..ee649a93 --- /dev/null +++ b/lib/ace/_undomanager.js @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + + +var UndoManager = function() { + this.$undoStack = []; + this.$redoStack = []; +}; + +(function() { + + /*this.$doc = null; + this.setDocument = function(doc) { + this.$doc = doc; + };*/ + + this.execute = function(options) { + var deltas = options.args[0]; + this.$doc = options.args[1]; + this.$undoStack.push(deltas); + }; + + this.undo = function() { + var deltas = this.$undoStack.pop(); + if (deltas) { + this.$doc.undoChanges(deltas); + this.$redoStack.push(deltas); + } + }; + + this.redo = function() { + var deltas = this.$redoStack.pop(); + if (deltas) { + this.$doc.redoChanges(deltas); + this.$undoStack.push(deltas); + } + }; + +}).call(UndoManager.prototype); + +return UndoManager; +}); \ No newline at end of file diff --git a/lib/ace/background_tokenizer.js b/lib/ace/background_tokenizer.js index d278c738..35f73f9d 100644 --- a/lib/ace/background_tokenizer.js +++ b/lib/ace/background_tokenizer.js @@ -1,14 +1,44 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("./lib/oop"); -var MEventEmitter = require("./mevent_emitter"); +var oop = require("ace/lib/oop"); +var MEventEmitter = require("ace/event_emitter"); var BackgroundTokenizer = function(tokenizer, editor) { this.running = false; diff --git a/lib/ace/commands/default_commands.js b/lib/ace/commands/default_commands.js index db3ea4ab..a83a464b 100644 --- a/lib/ace/commands/default_commands.js +++ b/lib/ace/commands/default_commands.js @@ -1,14 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ - + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var PluginManager = require("../PluginManager"); +var PluginManager = require("ace/plugin_manager"); PluginManager.registerCommand("selectall", function(editor, selection) { selection.selectAll(); diff --git a/lib/ace/conf/keybindings/default_mac.js b/lib/ace/conf/keybindings/default_mac.js index 91699d52..3c1a9260 100644 --- a/lib/ace/conf/keybindings/default_mac.js +++ b/lib/ace/conf/keybindings/default_mac.js @@ -1,12 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { + return { "selectall": "Command-A", "removeline": "Command-D", diff --git a/lib/ace/conf/keybindings/default_win.js b/lib/ace/conf/keybindings/default_win.js index 781bf696..b899965b 100644 --- a/lib/ace/conf/keybindings/default_win.js +++ b/lib/ace/conf/keybindings/default_win.js @@ -1,12 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { + return { "selectall": "Ctrl-A", "removeline": "Ctrl-D", diff --git a/lib/ace/event_emitter.js b/lib/ace/event_emitter.js new file mode 100644 index 00000000..29b0b170 --- /dev/null +++ b/lib/ace/event_emitter.js @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + + var lang = require("ace/lib/lang"); + + var MEventEmitter = {} + + MEventEmitter.$dispatchEvent = function(eventName, e) { + this.$eventRegistry = this.$eventRegistry || {}; + + var listeners = this.$eventRegistry[eventName]; + if (!listeners || !listeners.length) return; + + var e = e || {}; + e.type = eventName; + + for (var i=0; i - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var Gutter = function(parentEl) { - this.element = document.createElement("div"); - this.element.className = "ace_layer ace_gutter-layer"; - parentEl.appendChild(this.element); - - this.$breakpoints = []; - this.$decorations = []; -}; - -(function() { - - this.addGutterDecoration = function(row, className){ - if (!this.$decorations[row]) - this.$decorations[row] = ""; - this.$decorations[row] += " ace_" + className; - } - - this.removeGutterDecoration = function(row, className){ - this.$decorations[row] = - this.$decorations[row].replace(" ace_" + className, ""); - } - - this.setBreakpoints = function(rows) { - this.$breakpoints = rows.concat(); - }; - - this.update = function(config) { - this.$config = config; - - var html = []; - for ( var i = config.firstRow; i <= config.lastRow; i++) { - html.push("
", (i+1), "
"); - html.push(""); - } - - this.element.innerHTML = html.join(""); - this.element.style.height = config.minHeight + "px"; - }; - -}).call(Gutter.prototype); - -return Gutter; -}); diff --git a/lib/ace/layer/Cursor.js b/lib/ace/layer/_cursor.js similarity index 62% rename from lib/ace/layer/Cursor.js rename to lib/ace/layer/_cursor.js index a8a74232..04402481 100644 --- a/lib/ace/layer/Cursor.js +++ b/lib/ace/layer/_cursor.js @@ -1,14 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { -var dom = require("../lib/dom"); +var dom = require("ace/lib/dom"); var Cursor = function(parentEl) { this.element = document.createElement("div"); diff --git a/lib/ace/layer/_gutter.js b/lib/ace/layer/_gutter.js new file mode 100644 index 00000000..87db1632 --- /dev/null +++ b/lib/ace/layer/_gutter.js @@ -0,0 +1,85 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var Gutter = function(parentEl) { + this.element = document.createElement("div"); + this.element.className = "ace_layer ace_gutter-layer"; + parentEl.appendChild(this.element); + + this.$breakpoints = []; + this.$decorations = []; +}; + +(function() { + + this.addGutterDecoration = function(row, className){ + if (!this.$decorations[row]) + this.$decorations[row] = ""; + this.$decorations[row] += " ace_" + className; + } + + this.removeGutterDecoration = function(row, className){ + this.$decorations[row] = + this.$decorations[row].replace(" ace_" + className, ""); + } + + this.setBreakpoints = function(rows) { + this.$breakpoints = rows.concat(); + }; + + this.update = function(config) { + this.$config = config; + + var html = []; + for ( var i = config.firstRow; i <= config.lastRow; i++) { + html.push("
", (i+1), "
"); + html.push(""); + } + + this.element.innerHTML = html.join(""); + this.element.style.height = config.minHeight + "px"; + }; + +}).call(Gutter.prototype); + +return Gutter; +}); diff --git a/lib/ace/layer/Marker.js b/lib/ace/layer/_marker.js similarity index 73% rename from lib/ace/layer/Marker.js rename to lib/ace/layer/_marker.js index 818ce8fb..0466f4be 100644 --- a/lib/ace/layer/Marker.js +++ b/lib/ace/layer/_marker.js @@ -1,13 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var Range = require("../range"); +var Range = require("ace/range"); var Marker = function(parentEl) { this.element = document.createElement("div"); diff --git a/lib/ace/layer/Text.js b/lib/ace/layer/_text.js similarity index 82% rename from lib/ace/layer/Text.js rename to lib/ace/layer/_text.js index b8a3dd95..eb632a68 100644 --- a/lib/ace/layer/Text.js +++ b/lib/ace/layer/_text.js @@ -1,15 +1,45 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("../lib/oop"); -var dom = require("../lib/dom"); -var MEventEmitter = require("../mevent_emitter"); +var oop = require("ace/lib/oop"); +var dom = require("ace/lib/dom"); +var MEventEmitter = require("ace/event_emitter"); var Text = function(parentEl) { this.element = document.createElement("div"); diff --git a/lib/ace/lib/_core.js b/lib/ace/lib/_core.js new file mode 100644 index 00000000..295be086 --- /dev/null +++ b/lib/ace/lib/_core.js @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + + var core = {}; + var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); + + core.isWin = (os == "win"); + core.isMac = (os == "mac"); + core.isLinux = (os == "linux"); + core.isIE = ! + "\v1"; + core.isGecko = window.controllers && window.navigator.product === "Gecko"; + + core.provide = function(namespace) { + var parts = namespace.split("."); + var obj = window; + for (var i=0; i - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { - var lang = require("./lang"); +var lang = require("ace/lib/lang"); var dom = {}; diff --git a/lib/ace/lib/event.js b/lib/ace/lib/_event.js similarity index 77% rename from lib/ace/lib/event.js rename to lib/ace/lib/_event.js index 31a0be68..acc083c0 100644 --- a/lib/ace/lib/event.js +++ b/lib/ace/lib/_event.js @@ -1,15 +1,44 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { - var core = require("./core"); +var core = require("ace/lib/core"); var event = {}; event.addListener = function(elem, type, callback) { diff --git a/lib/ace/lib/lang.js b/lib/ace/lib/_lang.js similarity index 53% rename from lib/ace/lib/lang.js rename to lib/ace/lib/_lang.js index fd8eb0de..d3922ed1 100644 --- a/lib/ace/lib/lang.js +++ b/lib/ace/lib/_lang.js @@ -1,12 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { + var lang = {}; lang.stringReverse = function(string) { diff --git a/lib/ace/lib/_oop.js b/lib/ace/lib/_oop.js new file mode 100644 index 00000000..8a825a27 --- /dev/null +++ b/lib/ace/lib/_oop.js @@ -0,0 +1,61 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + + var oop = {}; + + oop.inherits = function(ctor, superCtor) { + var tempCtor = function() {}; + tempCtor.prototype = superCtor.prototype; + ctor.super_ = superCtor.prototype; + ctor.prototype = new tempCtor(); + ctor.prototype.constructor = ctor; + }; + + oop.mixin = function(obj, mixin) { + for (var key in mixin) { + obj[key] = mixin[key]; + } + }; + + oop.implement = function(proto, mixin) { + oop.mixin(proto, mixin); + }; + + return oop; +}); \ No newline at end of file diff --git a/lib/ace/lib/core.js b/lib/ace/lib/core.js deleted file mode 100644 index 5ddb7b91..00000000 --- a/lib/ace/lib/core.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - var core = {}; - var os = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase(); - - core.isWin = (os == "win"); - core.isMac = (os == "mac"); - core.isLinux = (os == "linux"); - core.isIE = ! + "\v1"; - core.isGecko = window.controllers && window.navigator.product === "Gecko"; - - core.provide = function(namespace) { - var parts = namespace.split("."); - var obj = window; - for (var i=0; i - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - - var oop = {}; - - oop.inherits = function(ctor, superCtor) { - var tempCtor = function() {}; - tempCtor.prototype = superCtor.prototype; - ctor.super_ = superCtor.prototype; - ctor.prototype = new tempCtor(); - ctor.prototype.constructor = ctor; - }; - - oop.mixin = function(obj, mixin) { - for (var key in mixin) { - obj[key] = mixin[key]; - } - }; - - oop.implement = function(proto, mixin) { - oop.mixin(proto, mixin); - }; - - return oop; -}); \ No newline at end of file diff --git a/lib/ace/mevent_emitter.js b/lib/ace/mevent_emitter.js deleted file mode 100644 index f4e8417b..00000000 --- a/lib/ace/mevent_emitter.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - - var lang = require("./lib/lang"); - - var MEventEmitter = {} - - MEventEmitter.$dispatchEvent = function(eventName, e) { - this.$eventRegistry = this.$eventRegistry || {}; - - var listeners = this.$eventRegistry[eventName]; - if (!listeners || !listeners.length) return; - - var e = e || {}; - e.type = eventName; - - for (var i=0; i - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var oop = require("../lib/oop"); -var Text = require("./text"); -var Tokenizer = require("../tokenizer"); -var CssHighlightRules = require("./css_highlight_rules"); -var MatchingBraceOutdent = require("./matching_brace_outdent"); - -var Css = function() { - this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules()); - this.$outdent = new MatchingBraceOutdent(); -}; -oop.inherits(Css, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - // ignore braces in comments - var tokens = this.$tokenizer.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) { - return this.$outdent.autoOutdent(doc, row); - }; - -}).call(Css.prototype); - -return Css; -}); \ No newline at end of file diff --git a/lib/ace/mode/Html.js b/lib/ace/mode/Html.js deleted file mode 100644 index 8d90826f..00000000 --- a/lib/ace/mode/Html.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var oop = require("../lib/oop"); -var Text = require("./text"); -var JavaScript = require("./javascript"); -var Css = require("./css"); -var Tokenizer = require("../tokenizer"); -var HtmlHighlightRules = require("./html_highlight_rules"); - -var Html = function() { - this.$tokenizer = new Tokenizer(new HtmlHighlightRules().getRules()); - - this.$js = new JavaScriptMode(); - this.$css = new CssMode(); -}; -oop.inherits(Html, TextMode); - -(function() { - - this.toggleCommentLines = function(state, doc, range) { - return this.$delegate("toggleCommentLines", arguments, function() { - return 0; - }); - }; - - this.getNextLineIndent = function(state, line, tab) { - var self = this; - return this.$delegate("getNextLineIndent", arguments, function() { - return self.$getIndent(line); - }); - }; - - this.checkOutdent = function(state, line, input) { - return this.$delegate("checkOutdent", arguments, function() { - return false; - }); - }; - - this.autoOutdent = function(state, doc, row) { - return this.$delegate("autoOutdent", arguments); - }; - - this.$delegate = function(method, args, defaultHandler) { - var state = args[0]; - var split = state.split("js-"); - - if (!split[0] && split[1]) { - args[0] = split[1]; - return this.$js[method].apply(this.$js, args); - } - - var split = state.split("css-"); - if (!split[0] && split[1]) { - args[0] = split[1]; - return this.$css[method].apply(this.$css, args); - } - - return defaultHandler ? defaultHandler() : undefined; - }; - -}).call(Html.prototype); - -return Html; -}); diff --git a/lib/ace/mode/Text.js b/lib/ace/mode/Text.js deleted file mode 100644 index fba2c7d2..00000000 --- a/lib/ace/mode/Text.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var Tokenizer = require("../tokenizer"); -var TextHighlightRules = require("./text_highlight_rules"); - -var Text = function() { - this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); -}; - -(function() { - - this.getTokenizer = function() { - return this.$tokenizer; - }; - - this.toggleCommentLines = function(state, doc, range) { - return 0; - }; - - this.getNextLineIndent = function(state, line, tab) { - return ""; - }; - - this.checkOutdent = function(state, line, input) { - return false; - }; - - this.autoOutdent = function(state, doc, row) { - }; - - this.$getIndent = function(line) { - var match = line.match(/^(\s+)/); - if (match) { - return match[1]; - } - - return ""; - }; - -}).call(Text.prototype); - -return Text; -}); \ No newline at end of file diff --git a/lib/ace/mode/Xml.js b/lib/ace/mode/Xml.js deleted file mode 100644 index d17f7532..00000000 --- a/lib/ace/mode/Xml.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Ajax.org Code Editor (ACE) - * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define(function(require, exports, module) { - -var oop = require("../lib/oop"); -var Text = require("./text"); -var Tokenizer = require("../tokenizer"); -var XmlHighlightRules = require("./xml_highlight_rules"); - -var Xml = function() { - this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules()); -}; - -oop.inherits(Xml, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - return this.$getIndent(line); - }; - -}).call(Xml.prototype); - -return Xml; -}); \ No newline at end of file diff --git a/lib/ace/mode/_css.js b/lib/ace/mode/_css.js new file mode 100644 index 00000000..a869fd8b --- /dev/null +++ b/lib/ace/mode/_css.js @@ -0,0 +1,82 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text"); +var Tokenizer = require("ace/tokenizer"); +var CssHighlightRules = require("ace/mode/css_highlight_rules"); +var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent"); + +var Css = function() { + this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules()); + this.$outdent = new MatchingBraceOutdent(); +}; +oop.inherits(Css, TextMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + // ignore braces in comments + var tokens = this.$tokenizer.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) { + return this.$outdent.autoOutdent(doc, row); + }; + +}).call(Css.prototype); + +return Css; +}); \ No newline at end of file diff --git a/lib/ace/mode/_html.js b/lib/ace/mode/_html.js new file mode 100644 index 00000000..15e9cea1 --- /dev/null +++ b/lib/ace/mode/_html.js @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text"); +var JavaScriptMode = require("ace/mode/javascript"); +var CssMode = require("ace/mode/css"); +var Tokenizer = require("ace/tokenizer"); +var HtmlHighlightRules = require("ace/mode/html_highlight_rules"); + +var Html = function() { + this.$tokenizer = new Tokenizer(new HtmlHighlightRules().getRules()); + + this.$js = new JavaScriptMode(); + this.$css = new CssMode(); +}; +oop.inherits(Html, TextMode); + +(function() { + + this.toggleCommentLines = function(state, doc, range) { + return this.$delegate("toggleCommentLines", arguments, function() { + return 0; + }); + }; + + this.getNextLineIndent = function(state, line, tab) { + var self = this; + return this.$delegate("getNextLineIndent", arguments, function() { + return self.$getIndent(line); + }); + }; + + this.checkOutdent = function(state, line, input) { + return this.$delegate("checkOutdent", arguments, function() { + return false; + }); + }; + + this.autoOutdent = function(state, doc, row) { + return this.$delegate("autoOutdent", arguments); + }; + + this.$delegate = function(method, args, defaultHandler) { + var state = args[0]; + var split = state.split("js-"); + + if (!split[0] && split[1]) { + args[0] = split[1]; + return this.$js[method].apply(this.$js, args); + } + + var split = state.split("css-"); + if (!split[0] && split[1]) { + args[0] = split[1]; + return this.$css[method].apply(this.$css, args); + } + + return defaultHandler ? defaultHandler() : undefined; + }; + +}).call(Html.prototype); + +return Html; +}); diff --git a/lib/ace/mode/JavaScript.js b/lib/ace/mode/_javascript.js similarity index 53% rename from lib/ace/mode/JavaScript.js rename to lib/ace/mode/_javascript.js index 9ad1945c..828bf3c4 100644 --- a/lib/ace/mode/JavaScript.js +++ b/lib/ace/mode/_javascript.js @@ -1,19 +1,48 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { -var oop = require("../lib/oop"); -var Text = require("./text"); -var Tokenizer = require("../tokenizer"); -var JavaScriptHighlightRules = require("./javascript_highlight_rules"); -var MatchingBraceOutdent = require("./matching_brace_outdent"); -var Range = require("../range"); +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text"); +var Tokenizer = require("ace/tokenizer"); +var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules"); +var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent"); +var Range = require("ace/range"); var JavaScript = function() { this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules()); diff --git a/lib/ace/mode/_text.js b/lib/ace/mode/_text.js new file mode 100644 index 00000000..3ee899d1 --- /dev/null +++ b/lib/ace/mode/_text.js @@ -0,0 +1,80 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var Tokenizer = require("ace/tokenizer"); +var TextHighlightRules = require("ace/mode/text_highlight_rules"); + +var Text = function() { + this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules()); +}; + +(function() { + + this.getTokenizer = function() { + return this.$tokenizer; + }; + + this.toggleCommentLines = function(state, doc, range) { + return 0; + }; + + this.getNextLineIndent = function(state, line, tab) { + return ""; + }; + + this.checkOutdent = function(state, line, input) { + return false; + }; + + this.autoOutdent = function(state, doc, row) { + }; + + this.$getIndent = function(line) { + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; + }; + +}).call(Text.prototype); + +return Text; +}); \ No newline at end of file diff --git a/lib/ace/mode/_xml.js b/lib/ace/mode/_xml.js new file mode 100644 index 00000000..545e487e --- /dev/null +++ b/lib/ace/mode/_xml.js @@ -0,0 +1,60 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text"); +var Tokenizer = require("ace/tokenizer"); +var XmlHighlightRules = require("ace/mode/xml_highlight_rules"); + +var Xml = function() { + this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules()); +}; + +oop.inherits(Xml, TextMode); + +(function() { + + this.getNextLineIndent = function(state, line, tab) { + return this.$getIndent(line); + }; + +}).call(Xml.prototype); + +return Xml; +}); \ No newline at end of file diff --git a/lib/ace/mode/css_highlight_rules.js b/lib/ace/mode/css_highlight_rules.js index cd94676e..992850a5 100644 --- a/lib/ace/mode/css_highlight_rules.js +++ b/lib/ace/mode/css_highlight_rules.js @@ -1,22 +1,45 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules"); - -require.def("ace/mode/CssHighlightRules", - [ - "ace/lib/oop", - "ace/lib/lang", - "ace/mode/TextHighlightRules" - ], function(oop, lang, TextHighlightRules) { +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var TextHighlightRules = require("ace/mode/text_highlight_rules"); var CssHighlightRules = function() { diff --git a/lib/ace/mode/doc_comment_highlight_rules.js b/lib/ace/mode/doc_comment_highlight_rules.js index 8a6758d5..ad156c1d 100644 --- a/lib/ace/mode/doc_comment_highlight_rules.js +++ b/lib/ace/mode/doc_comment_highlight_rules.js @@ -1,14 +1,44 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules"); +var oop = require("ace/lib/oop"); +var TextHighlightRules = require("ace/mode/text_highlight_rules"); var DocCommentHighlightRules = function() { diff --git a/lib/ace/mode/html_highlight_rules.js b/lib/ace/mode/html_highlight_rules.js index 06b901b9..63eae027 100644 --- a/lib/ace/mode/html_highlight_rules.js +++ b/lib/ace/mode/html_highlight_rules.js @@ -1,17 +1,46 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ - + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("../lib/oop"); -var CssHighlightRules = require("./css_highlight_rules"); -var JavaScriptHighlightRules = require("./javascript_highlight_rules"); -var TextHighlightRules = require("./text_highlight_rules"); +var oop = require("ace/lib/oop"); +var CssHighlightRules = require("ace/mode/css_highlight_rules"); +var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules"); +var TextHighlightRules = require("ace/mode/text_highlight_rules"); var HtmlHighlightRules = function() { diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index f34e79ee..893e762f 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -1,17 +1,46 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ - + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules"); -var TextHighlightRules = require("./text_highlight_rules"); +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules"); +var TextHighlightRules = require("ace/mode/text_highlight_rules"); JavaScriptHighlightRules = function() { @@ -26,19 +55,10 @@ JavaScriptHighlightRules = function() { ("true|false|null|undefined|Infinity|NaN|undefined").split("|") ); - // ES3 future reserved var futureReserved = lang.arrayToMap( - ("abstract|boolean|byte|char|class|const|enum|export|extends|final|" + - "float|goto|implements|int|interface|long|native|package|private|" + - "protected|short|static|super|synchronized|throws|transient|volatile" + - "double|import|public").split("|") + ("class|enum|extends|super|const|export|import|implements|let|private|" + + "public|yield|interface|package|protected|static").split("|") ); - -// ES5 future reserved -// var futureReserved = lang.arrayToMap( -// ("class|enum|extends|super|const|export|import|implements|let|private|" + -// "public|yield|interface|package|protected|static").split("|") -// ); // regexp must not have capturing parentheses. Use (?:) instead. // regexps are ordered -> the first match is used diff --git a/lib/ace/mode/matching_brace_outdent.js b/lib/ace/mode/matching_brace_outdent.js index 9418d206..3c871a14 100644 --- a/lib/ace/mode/matching_brace_outdent.js +++ b/lib/ace/mode/matching_brace_outdent.js @@ -1,13 +1,43 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var Range = require("../range"); +var Range = require("ace/range"); var MatchingBraceOutdent = function() {}; diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index 399cc209..c5331061 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -1,10 +1,40 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { var TextHighlightRules = function() { diff --git a/lib/ace/mode/xml_highlight_rules.js b/lib/ace/mode/xml_highlight_rules.js index a64eac84..b1421791 100644 --- a/lib/ace/mode/xml_highlight_rules.js +++ b/lib/ace/mode/xml_highlight_rules.js @@ -1,15 +1,44 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ - + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules"); +var oop = require("ace/lib/oop"); +var TextHighlightRules = require("ace/mode/text_highlight_rules"); var XmlHighlightRules = function() { diff --git a/lib/ace/plugin_manager.js b/lib/ace/plugin_manager.js new file mode 100644 index 00000000..2bd5abc6 --- /dev/null +++ b/lib/ace/plugin_manager.js @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var PluginManager = { + commands : {}, + + registerCommand : function(name, command) { + this.commands[name] = command; + } +}; + +return PluginManager; +}); \ No newline at end of file diff --git a/lib/ace/test/all.js b/lib/ace/test/_all.js similarity index 100% rename from lib/ace/test/all.js rename to lib/ace/test/_all.js diff --git a/lib/ace/test/assertions.js b/lib/ace/test/_assertions.js similarity index 100% rename from lib/ace/test/assertions.js rename to lib/ace/test/_assertions.js diff --git a/lib/ace/test/MockRenderer.js b/lib/ace/test/_mockrenderer.js similarity index 100% rename from lib/ace/test/MockRenderer.js rename to lib/ace/test/_mockrenderer.js diff --git a/lib/ace/test/ChangeDocumentTest.js b/lib/ace/test/change_document_test.js similarity index 100% rename from lib/ace/test/ChangeDocumentTest.js rename to lib/ace/test/change_document_test.js diff --git a/lib/ace/test/DocumentTest.js b/lib/ace/test/document_test.js similarity index 100% rename from lib/ace/test/DocumentTest.js rename to lib/ace/test/document_test.js diff --git a/lib/ace/test/EventEmitterTest.js b/lib/ace/test/event_emitter_test.js similarity index 100% rename from lib/ace/test/EventEmitterTest.js rename to lib/ace/test/event_emitter_test.js diff --git a/lib/ace/test/mode/CssTest.js b/lib/ace/test/mode/css_test.js similarity index 100% rename from lib/ace/test/mode/CssTest.js rename to lib/ace/test/mode/css_test.js diff --git a/lib/ace/test/mode/CssTokenizerTest.js b/lib/ace/test/mode/css_tokenizer_test.js similarity index 100% rename from lib/ace/test/mode/CssTokenizerTest.js rename to lib/ace/test/mode/css_tokenizer_test.js diff --git a/lib/ace/test/mode/HtmlTest.js b/lib/ace/test/mode/html_test.js similarity index 100% rename from lib/ace/test/mode/HtmlTest.js rename to lib/ace/test/mode/html_test.js diff --git a/lib/ace/test/mode/HtmlTokenizerTest.js b/lib/ace/test/mode/html_tokenizer_test.js similarity index 100% rename from lib/ace/test/mode/HtmlTokenizerTest.js rename to lib/ace/test/mode/html_tokenizer_test.js diff --git a/lib/ace/test/mode/JavaScriptTest.js b/lib/ace/test/mode/javascript_test.js similarity index 100% rename from lib/ace/test/mode/JavaScriptTest.js rename to lib/ace/test/mode/javascript_test.js diff --git a/lib/ace/test/mode/JavaScriptTokenizerTest.js b/lib/ace/test/mode/javascript_tokenizer_test.js similarity index 100% rename from lib/ace/test/mode/JavaScriptTokenizerTest.js rename to lib/ace/test/mode/javascript_tokenizer_test.js diff --git a/lib/ace/test/mode/TextTest.js b/lib/ace/test/mode/text_test.js similarity index 100% rename from lib/ace/test/mode/TextTest.js rename to lib/ace/test/mode/text_test.js diff --git a/lib/ace/test/mode/XmlTest.js b/lib/ace/test/mode/xml_test.js similarity index 100% rename from lib/ace/test/mode/XmlTest.js rename to lib/ace/test/mode/xml_test.js diff --git a/lib/ace/test/mode/XmlTokenizerTest.js b/lib/ace/test/mode/xml_tokenizer_test.js similarity index 100% rename from lib/ace/test/mode/XmlTokenizerTest.js rename to lib/ace/test/mode/xml_tokenizer_test.js diff --git a/lib/ace/test/NavigationTest.js b/lib/ace/test/navigation_test.js similarity index 100% rename from lib/ace/test/NavigationTest.js rename to lib/ace/test/navigation_test.js diff --git a/lib/ace/test/RangeTest.js b/lib/ace/test/range_test.js similarity index 100% rename from lib/ace/test/RangeTest.js rename to lib/ace/test/range_test.js diff --git a/lib/ace/test/SearchTest.js b/lib/ace/test/search_test.js similarity index 100% rename from lib/ace/test/SearchTest.js rename to lib/ace/test/search_test.js diff --git a/lib/ace/test/SelectionTest.js b/lib/ace/test/selection_test.js similarity index 100% rename from lib/ace/test/SelectionTest.js rename to lib/ace/test/selection_test.js diff --git a/lib/ace/test/TextEditTest.js b/lib/ace/test/text_edit_test.js similarity index 100% rename from lib/ace/test/TextEditTest.js rename to lib/ace/test/text_edit_test.js diff --git a/lib/ace/test/VirtualRendererTest.js b/lib/ace/test/virtual_renderer_test.js similarity index 100% rename from lib/ace/test/VirtualRendererTest.js rename to lib/ace/test/virtual_renderer_test.js diff --git a/lib/ace/theme/Eclipse.js b/lib/ace/theme/Eclipse.js deleted file mode 100644 index 8f29c75f..00000000 --- a/lib/ace/theme/Eclipse.js +++ /dev/null @@ -1,9 +0,0 @@ -define(["./lib/dom", "text!./theme/eclipse.css"], function(dom, cssText) { - - // import CSS once - dom.importCssString(cssText); - - return { - cssClass: "ace-eclipse" - }; -}) \ No newline at end of file diff --git a/lib/ace/theme/TextMate.js b/lib/ace/theme/TextMate.js deleted file mode 100644 index b1b64eb9..00000000 --- a/lib/ace/theme/TextMate.js +++ /dev/null @@ -1,9 +0,0 @@ -define(["./lib/dom", "text!./theme/tm.css"], function(dom, cssText) { - - // import CSS once - dom.importCssString(cssText); - - return { - cssClass: "ace-tm" - }; -}) \ No newline at end of file diff --git a/lib/ace/theme/Clouds.js b/lib/ace/theme/_clouds.js similarity index 96% rename from lib/ace/theme/Clouds.js rename to lib/ace/theme/_clouds.js index ca6ae73b..2b8436e1 100644 --- a/lib/ace/theme/Clouds.js +++ b/lib/ace/theme/_clouds.js @@ -1,5 +1,6 @@ -require.def("ace/theme/Clouds", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); var cssText = ".ace-clouds .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/Cobalt.js b/lib/ace/theme/_cobalt.js similarity index 96% rename from lib/ace/theme/Cobalt.js rename to lib/ace/theme/_cobalt.js index ae177aad..433214b3 100644 --- a/lib/ace/theme/Cobalt.js +++ b/lib/ace/theme/_cobalt.js @@ -1,5 +1,7 @@ -require.def("ace/theme/Cobalt", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); + var cssText = ".ace-cobalt .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/Dawn.js b/lib/ace/theme/_dawn.js similarity index 96% rename from lib/ace/theme/Dawn.js rename to lib/ace/theme/_dawn.js index e4c59257..ed6d33f1 100644 --- a/lib/ace/theme/Dawn.js +++ b/lib/ace/theme/_dawn.js @@ -1,5 +1,6 @@ -require.def("ace/theme/Dawn", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); var cssText = ".ace-dawn .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/eclipse.css b/lib/ace/theme/_eclipse.css similarity index 100% rename from lib/ace/theme/eclipse.css rename to lib/ace/theme/_eclipse.css diff --git a/lib/ace/theme/_eclipse.js b/lib/ace/theme/_eclipse.js new file mode 100644 index 00000000..4bc7b13d --- /dev/null +++ b/lib/ace/theme/_eclipse.js @@ -0,0 +1,12 @@ +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); +var cssText = require("text!ace/theme/eclipse.css"); + + // import CSS once + dom.importCssString(cssText); + + return { + cssClass: "ace-eclipse" + }; +}) \ No newline at end of file diff --git a/lib/ace/theme/Monokai.js b/lib/ace/theme/_monokai.js similarity index 96% rename from lib/ace/theme/Monokai.js rename to lib/ace/theme/_monokai.js index a992134c..e7122013 100644 --- a/lib/ace/theme/Monokai.js +++ b/lib/ace/theme/_monokai.js @@ -1,5 +1,7 @@ -require.def("ace/theme/Monokai", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); + var cssText = ".ace-monokai .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/_textmate.js b/lib/ace/theme/_textmate.js new file mode 100644 index 00000000..80599f10 --- /dev/null +++ b/lib/ace/theme/_textmate.js @@ -0,0 +1,12 @@ +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); +var cssText = require("text!ace/theme/tm.css"); + + // import CSS once + dom.importCssString(cssText); + + return { + cssClass: "ace-tm" + }; +}) \ No newline at end of file diff --git a/lib/ace/theme/tm.css b/lib/ace/theme/_tm.css similarity index 100% rename from lib/ace/theme/tm.css rename to lib/ace/theme/_tm.css diff --git a/lib/ace/theme/Twilight.js b/lib/ace/theme/_twilight.js similarity index 97% rename from lib/ace/theme/Twilight.js rename to lib/ace/theme/_twilight.js index 61b9c6ac..42b636ed 100644 --- a/lib/ace/theme/Twilight.js +++ b/lib/ace/theme/_twilight.js @@ -1,5 +1,6 @@ -require.def("ace/theme/Twilight", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); var cssText = ".ace-twilight .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/clouds_midnight.js b/lib/ace/theme/clouds_mignight.js similarity index 97% rename from lib/ace/theme/clouds_midnight.js rename to lib/ace/theme/clouds_mignight.js index f3c092c5..b42978c8 100644 --- a/lib/ace/theme/clouds_midnight.js +++ b/lib/ace/theme/clouds_mignight.js @@ -1,5 +1,6 @@ -require.def("ace/theme/CloudsMidnight", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); var cssText = ".ace-clouds-midnight .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/IdleFingers.js b/lib/ace/theme/idle_fingers.js similarity index 97% rename from lib/ace/theme/IdleFingers.js rename to lib/ace/theme/idle_fingers.js index 48ca72f7..f922c9fa 100644 --- a/lib/ace/theme/IdleFingers.js +++ b/lib/ace/theme/idle_fingers.js @@ -1,5 +1,7 @@ -require.def("ace/theme/IdleFingers", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); + var cssText = ".ace-idle-fingers .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/KrTheme.js b/lib/ace/theme/kr_theme.js similarity index 96% rename from lib/ace/theme/KrTheme.js rename to lib/ace/theme/kr_theme.js index e201c5bb..684fd02e 100644 --- a/lib/ace/theme/KrTheme.js +++ b/lib/ace/theme/kr_theme.js @@ -1,5 +1,7 @@ -require.def("ace/theme/KrTheme", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); + var cssText = ".ace-kr-theme .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/theme/MonoIndustrial.js b/lib/ace/theme/mono_industrial.js similarity index 97% rename from lib/ace/theme/MonoIndustrial.js rename to lib/ace/theme/mono_industrial.js index 0a721576..1463ec4a 100644 --- a/lib/ace/theme/MonoIndustrial.js +++ b/lib/ace/theme/mono_industrial.js @@ -1,5 +1,7 @@ -require.def("ace/theme/MonoIndustrial", - ["ace/lib/dom"], function(dom) { +define(function(require, exports, module) { + +var dom = require("ace/lib/dom"); + var cssText = ".ace-mono-industrial .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index e644751e..33f6f62a 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -1,27 +1,54 @@ -/** - * Ajax.org Code Editor (ACE) +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * @copyright 2010, Ajax.org Services B.V. - * @license LGPLv3 - * @author Fabian Jakobs - */ -define( - [ - "./lib/oop", - "./lib/lang", - "./lib/dom", - "./lib/event", - "./layer/Gutter", - "./layer/Marker", - "./layer/Text", - "./layer/Cursor", - "./ScrollBar", - "./RenderLoop", - "./MEventEmitter", - "text!./css/editor.css" - ], function( - oop, lang, dom, event, GutterLayer, MarkerLayer, TextLayer, - CursorLayer, ScrollBar, RenderLoop, MEventEmitter, editorCss) { + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org Services B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); +var dom = require("ace/lib/dom"); +var event = require("ace/lib/event"); +var Gutter = require("ace/layer/gutter"); +var MarkerLayer = require("ace/layer/marker"); +var TextLayer = require("ace/layer/text"); +var CursorLayer = require("ace/layer/cursor"); +var ScrollBar = require("ace/scrollbar"); +var RenderLoop = require("ace/renderloop"); +var MEventEmitter = require("ace/event_emitter"); +var editorCss = require("text!ace/css/editor.css"); // import CSS once dom.importCssString(editorCss);