Merge remote branch 'remotes/mozilla/master'

Conflicts:
	demo/editor-build.html
	demo/editor.html
This commit is contained in:
Fabian Jakobs 2010-12-10 16:54:14 +01:00
commit f7c217d7a4
108 changed files with 8340 additions and 1335 deletions

View file

@ -37,8 +37,8 @@
define(function(require, exports, module) {
var oop = require("./lib/oop");
var MEventEmitter = require("./event_emitter");
var oop = require("pilot/oop").oop;
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var BackgroundTokenizer = function(tokenizer, editor) {
this.running = false;
@ -82,7 +82,7 @@ var BackgroundTokenizer = function(tokenizer, editor) {
(function(){
oop.implement(this, MEventEmitter);
oop.implement(this, EventEmitter);
this.setTokenizer = function(tokenizer) {
this.tokenizer = tokenizer;
@ -103,7 +103,7 @@ var BackgroundTokenizer = function(tokenizer, editor) {
first: firstRow,
last: lastRow
};
this.$dispatchEvent("update", {data: data});
this._dispatchEvent("update", {data: data});
};
this.start = function(startRow) {
@ -164,5 +164,5 @@ var BackgroundTokenizer = function(tokenizer, editor) {
}).call(BackgroundTokenizer.prototype);
return BackgroundTokenizer;
exports.BackgroundTokenizer = BackgroundTokenizer;
});

View file

@ -37,158 +37,211 @@
define(function(require, exports, module) {
var PluginManager = require("../plugin_manager");
var canon = require("pilot/canon");
PluginManager.registerCommand("selectall", function(editor, selection) {
selection.selectAll();
canon.addCommand({
name: "selectall",
exec: function(env, args, request) { env.selection.selectAll(); }
});
PluginManager.registerCommand("removeline", function(editor, selection) {
editor.removeLines();
canon.addCommand({
name: "removeline",
exec: function(env, args, request) { env.editor.removeLines(); }
});
PluginManager.registerCommand("gotoline", function(editor, selection) {
var line = parseInt(prompt("Enter line number:"));
if (!isNaN(line)) {
editor.gotoLine(line);
canon.addCommand({
name: "gotoline",
exec: function(env, args, request) {
var line = parseInt(prompt("Enter line number:"));
if (!isNaN(line)) {
env.editor.gotoLine(line);
}
}
});
PluginManager.registerCommand("togglecomment", function(editor, selection) {
editor.toggleCommentLines();
canon.addCommand({
name: "togglecomment",
exec: function(env, args, request) { env.editor.toggleCommentLines(); }
});
PluginManager.registerCommand("findnext", function(editor, selection) {
editor.findNext();
canon.addCommand({
name: "findnext",
exec: function(env, args, request) { env.editor.findNext(); }
});
PluginManager.registerCommand("findprevious", function(editor, selection) {
editor.findPrevious();
canon.addCommand({
name: "findprevious",
exec: function(env, args, request) { env.editor.findPrevious(); }
});
PluginManager.registerCommand("find", function(editor, selection) {
var needle = prompt("Find:");
editor.find(needle);
canon.addCommand({
name: "find",
exec: function(env, args, request) {
var needle = prompt("Find:");
env.editor.find(needle);
}
});
PluginManager.registerCommand("undo", function(editor, selection) {
editor.undo();
canon.addCommand({
name: "undo",
exec: function(env, args, request) { env.editor.undo(); }
});
PluginManager.registerCommand("redo", function(editor, selection) {
editor.redo();
canon.addCommand({
name: "redo",
exec: function(env, args, request) { env.editor.redo(); }
});
PluginManager.registerCommand("redo", function(editor, selection) {
editor.redo();
canon.addCommand({
name: "redo",
exec: function(env, args, request) { env.editor.redo(); }
});
PluginManager.registerCommand("overwrite", function(editor, selection) {
editor.toggleOverwrite();
canon.addCommand({
name: "overwrite",
exec: function(env, args, request) { env.editor.toggleOverwrite(); }
});
PluginManager.registerCommand("copylinesup", function(editor, selection) {
editor.copyLinesUp();
canon.addCommand({
name: "copylinesup",
exec: function(env, args, request) { env.editor.copyLinesUp(); }
});
PluginManager.registerCommand("movelinesup", function(editor, selection) {
editor.moveLinesUp();
canon.addCommand({
name: "movelinesup",
exec: function(env, args, request) { env.editor.moveLinesUp(); }
});
PluginManager.registerCommand("selecttostart", function(editor, selection) {
selection.selectFileStart();
canon.addCommand({
name: "selecttostart",
exec: function(env, args, request) { env.selection.selectFileStart(); }
});
PluginManager.registerCommand("gotostart", function(editor, selection) {
editor.navigateFileStart();
canon.addCommand({
name: "gotostart",
exec: function(env, args, request) { env.editor.navigateFileStart(); }
});
PluginManager.registerCommand("selectup", function(editor, selection) {
selection.selectUp();
canon.addCommand({
name: "selectup",
exec: function(env, args, request) { env.selection.selectUp(); }
});
PluginManager.registerCommand("golineup", function(editor, selection) {
editor.navigateUp();
canon.addCommand({
name: "golineup",
exec: function(env, args, request) { env.editor.navigateUp(); }
});
PluginManager.registerCommand("copylinesdown", function(editor, selection) {
editor.copyLinesDown();
canon.addCommand({
name: "copylinesdown",
exec: function(env, args, request) { env.editor.copyLinesDown(); }
});
PluginManager.registerCommand("movelinesdown", function(editor, selection) {
editor.moveLinesDown();
canon.addCommand({
name: "movelinesdown",
exec: function(env, args, request) { env.editor.moveLinesDown(); }
});
PluginManager.registerCommand("selecttoend", function(editor, selection) {
selection.selectFileEnd();
canon.addCommand({
name: "selecttoend",
exec: function(env, args, request) { env.selection.selectFileEnd(); }
});
PluginManager.registerCommand("gotoend", function(editor, selection) {
editor.navigateFileEnd();
canon.addCommand({
name: "gotoend",
exec: function(env, args, request) { env.editor.navigateFileEnd(); }
});
PluginManager.registerCommand("selectdown", function(editor, selection) {
selection.selectDown();
canon.addCommand({
name: "selectdown",
exec: function(env, args, request) { env.selection.selectDown(); }
});
PluginManager.registerCommand("godown", function(editor, selection) {
editor.navigateDown();
canon.addCommand({
name: "godown",
exec: function(env, args, request) { env.editor.navigateDown(); }
});
PluginManager.registerCommand("selectwordleft", function(editor, selection) {
selection.selectWordLeft();
canon.addCommand({
name: "selectwordleft",
exec: function(env, args, request) { env.selection.selectWordLeft(); }
});
PluginManager.registerCommand("gotowordleft", function(editor, selection) {
editor.navigateWordLeft();
canon.addCommand({
name: "gotowordleft",
exec: function(env, args, request) { env.editor.navigateWordLeft(); }
});
PluginManager.registerCommand("selecttolinestart", function(editor, selection) {
selection.selectLineStart();
canon.addCommand({
name: "selecttolinestart",
exec: function(env, args, request) { env.selection.selectLineStart(); }
});
PluginManager.registerCommand("gotolinestart", function(editor, selection) {
editor.navigateLineStart();
canon.addCommand({
name: "gotolinestart",
exec: function(env, args, request) { env.editor.navigateLineStart(); }
});
PluginManager.registerCommand("selectleft", function(editor, selection) {
selection.selectLeft();
canon.addCommand({
name: "selectleft",
exec: function(env, args, request) { env.selection.selectLeft(); }
});
PluginManager.registerCommand("gotoleft", function(editor, selection) {
editor.navigateLeft();
canon.addCommand({
name: "gotoleft",
exec: function(env, args, request) { env.editor.navigateLeft(); }
});
PluginManager.registerCommand("selectwordright", function(editor, selection) {
selection.selectWordRight();
canon.addCommand({
name: "selectwordright",
exec: function(env, args, request) { env.selection.selectWordRight(); }
});
PluginManager.registerCommand("gotowordright", function(editor, selection) {
editor.navigateWordRight();
canon.addCommand({
name: "gotowordright",
exec: function(env, args, request) { env.editor.navigateWordRight(); }
});
PluginManager.registerCommand("selecttolineend", function(editor, selection) {
selection.selectLineEnd();
canon.addCommand({
name: "selecttolineend",
exec: function(env, args, request) { env.selection.selectLineEnd(); }
});
PluginManager.registerCommand("gotolineend", function(editor, selection) {
editor.navigateLineEnd();
canon.addCommand({
name: "gotolineend",
exec: function(env, args, request) { env.editor.navigateLineEnd(); }
});
PluginManager.registerCommand("selectright", function(editor, selection) {
selection.selectRight();
canon.addCommand({
name: "selectright",
exec: function(env, args, request) { env.selection.selectRight(); }
});
PluginManager.registerCommand("gotoright", function(editor, selection) {
editor.navigateRight();
canon.addCommand({
name: "gotoright",
exec: function(env, args, request) { env.editor.navigateRight(); }
});
PluginManager.registerCommand("selectpagedown", function(editor, selection) {
editor.selectPageDown();
canon.addCommand({
name: "selectpagedown",
exec: function(env, args, request) { env.editor.selectPageDown(); }
});
PluginManager.registerCommand("pagedown", function(editor, selection) {
editor.scrollPageDown();
canon.addCommand({
name: "pagedown",
exec: function(env, args, request) { env.editor.scrollPageDown(); }
});
PluginManager.registerCommand("gotopagedown", function(editor, selection) {
editor.gotoPageDown();
canon.addCommand({
name: "gotopagedown",
exec: function(env, args, request) { env.editor.gotoPageDown(); }
});
PluginManager.registerCommand("selectpageup", function(editor, selection) {
editor.selectPageUp();
canon.addCommand({
name: "selectpageup",
exec: function(env, args, request) { env.editor.selectPageUp(); }
});
PluginManager.registerCommand("pageup", function(editor, selection) {
editor.scrollPageUp();
canon.addCommand({
name: "pageup",
exec: function(env, args, request) { env.editor.scrollPageUp(); }
});
PluginManager.registerCommand("gotopageup", function(editor, selection) {
editor.gotoPageUp();
canon.addCommand({
name: "gotopageup",
exec: function(env, args, request) { env.editor.gotoPageUp(); }
});
PluginManager.registerCommand("selectlinestart", function(editor, selection) {
selection.selectLineStart();
canon.addCommand({
name: "selectlinestart",
exec: function(env, args, request) { env.selection.selectLineStart(); }
});
PluginManager.registerCommand("gotolinestart", function(editor, selection) {
editor.navigateLineStart();
canon.addCommand({
name: "gotolinestart",
exec: function(env, args, request) { env.editor.navigateLineStart(); }
});
PluginManager.registerCommand("selectlineend", function(editor, selection) {
selection.selectLineEnd();
canon.addCommand({
name: "selectlineend",
exec: function(env, args, request) { env.selection.selectLineEnd(); }
});
PluginManager.registerCommand("gotolineend", function(editor, selection) {
editor.navigateLineEnd();
canon.addCommand({
name: "gotolineend",
exec: function(env, args, request) { env.editor.navigateLineEnd(); }
});
PluginManager.registerCommand("del", function(editor, selection) {
editor.removeRight();
canon.addCommand({
name: "del",
exec: function(env, args, request) { env.editor.removeRight(); }
});
PluginManager.registerCommand("backspace", function(editor, selection) {
editor.removeLeft();
canon.addCommand({
name: "backspace",
exec: function(env, args, request) { env.editor.removeLeft(); }
});
PluginManager.registerCommand("outdent", function(editor, selection) {
editor.blockOutdent();
canon.addCommand({
name: "outdent",
exec: function(env, args, request) { env.editor.blockOutdent(); }
});
PluginManager.registerCommand("indent", function(editor, selection) {
editor.indent();
canon.addCommand({
name: "indent",
exec: function(env, args, request) { env.editor.indent(); }
});
});
});

View file

@ -37,7 +37,7 @@
define(function(require, exports, module) {
return {
exports.bindings = {
"selectall": "Command-A",
"removeline": "Command-D",
"gotoline": "Command-L",

View file

@ -37,7 +37,7 @@
define(function(require, exports, module) {
return {
exports.bindings = {
"selectall": "Ctrl-A",
"removeline": "Ctrl-D",
"gotoline": "Ctrl-L",

View file

@ -37,12 +37,12 @@
define(function(require, exports, module) {
var oop = require("./lib/oop");
var lang = require("./lib/lang");
var MEventEmitter = require("./event_emitter");
var Selection = require("./selection");
var TextMode = require("./mode/text");
var Range = require("./range");
var oop = require("pilot/oop").oop;
var lang = require("pilot/lang").lang;
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var Selection = require("ace/selection").Selection;
var TextMode = require("ace/mode/text").Text;
var Range = require("ace/range").Range;
var Document = function(text, mode) {
@ -66,7 +66,7 @@ var Document = function(text, mode) {
(function() {
oop.implement(this, MEventEmitter);
oop.implement(this, EventEmitter);
this.$undoManager = null;
@ -74,13 +74,13 @@ var Document = function(text, mode) {
return text.split(/\r\n|\r|\n/);
};
this.setValue = function(text) {
var args = [0, this.lines.length];
args.push.apply(args, this.$split(text));
this.lines.splice.apply(this.lines, args);
this.modified = true;
this.fireChangeEvent(0);
};
this.setValue = function(text) {
var args = [0, this.lines.length];
args.push.apply(args, this.$split(text));
this.lines.splice.apply(this.lines, args);
this.modified = true;
this.fireChangeEvent(0);
};
this.toString = function() {
return this.lines.join(this.$getNewLineCharacter());
@ -95,7 +95,7 @@ var Document = function(text, mode) {
firstRow: firstRow,
lastRow: lastRow
};
this.$dispatchEvent("change", { data: data});
this._dispatchEvent("change", { data: data});
};
this.setUndoManager = function(undoManager) {
@ -154,7 +154,7 @@ var Document = function(text, mode) {
this.modified = true;
this.$tabSize = tabSize;
this.$dispatchEvent("changeTabSize");
this._dispatchEvent("changeTabSize");
};
this.getTabSize = function() {
@ -170,22 +170,22 @@ var Document = function(text, mode) {
for (var i=0; i<rows.length; i++) {
this.$breakpoints[rows[i]] = true;
}
this.$dispatchEvent("changeBreakpoint", {});
this._dispatchEvent("changeBreakpoint", {});
};
this.clearBreakpoints = function() {
this.$breakpoints = [];
this.$dispatchEvent("changeBreakpoint", {});
this._dispatchEvent("changeBreakpoint", {});
};
this.setBreakpoint = function(row) {
this.$breakpoints[row] = true;
this.$dispatchEvent("changeBreakpoint", {});
this._dispatchEvent("changeBreakpoint", {});
};
this.clearBreakpoint = function(row) {
delete this.$breakpoints[row];
this.$dispatchEvent("changeBreakpoint", {});
this._dispatchEvent("changeBreakpoint", {});
};
this.$detectNewLine = function(text) {
@ -261,7 +261,7 @@ var Document = function(text, mode) {
if (this.$mode === mode) return;
this.$mode = mode;
this.$dispatchEvent("changeMode");
this._dispatchEvent("changeMode");
};
this.getMode = function() {
@ -276,7 +276,7 @@ var Document = function(text, mode) {
if (this.$scrollTop === scrollTopRow) return;
this.$scrollTop = scrollTopRow;
this.$dispatchEvent("changeScrollTop");
this._dispatchEvent("changeScrollTop");
};
this.getScrollTopRow = function() {
@ -748,5 +748,5 @@ var Document = function(text, mode) {
}).call(Document.prototype);
return Document;
exports.Document = Document;
});

View file

@ -37,16 +37,16 @@
define(function(require, exports, module) {
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("./event_emitter");
var oop = require("pilot/oop").oop;
var event = require("pilot/event").event;
var lang = require("pilot/lang").lang;
var TextInput = require("ace/textinput").TextInput;
var KeyBinding = require("ace/keybinding").KeyBinding;
var Document = require("ace/document").Document;
var Search = require("ace/search").Search;
var BackgroundTokenizer = require("ace/background_tokenizer").BackgroundTokenizer;
var Range = require("ace/range").Range;
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var Editor =function(renderer, doc) {
var container = renderer.getContainerElement();
@ -84,7 +84,7 @@ var Editor =function(renderer, doc) {
(function(){
oop.implement(this, MEventEmitter);
oop.implement(this, EventEmitter);
this.$forwardEvents = {
gutterclick: 1,
@ -301,7 +301,7 @@ var Editor =function(renderer, doc) {
var pos = this.renderer.screenToTextCoordinates(pageX, pageY);
pos.row = Math.max(0, Math.min(pos.row, this.doc.getLength()-1));
if (event.getButton(e) != 0) {
if (this.selection.isEmpty()) {
this.moveCursorToPosition(pos);
@ -436,7 +436,7 @@ var Editor =function(renderer, doc) {
return;
}
*/
_self.bgTokenizer.getState(cursor.row, function(lineState) {
// multi line insert
if (cursor.row !== end.row) {
@ -450,14 +450,14 @@ var Editor =function(renderer, doc) {
for (var i = 0; i < line.length; ++i)
if (line.charAt(i) == '\t')
indent += size;
else if (line.charAt(i) == ' ')
else if (line.charAt(i) == ' ')
indent += 1;
else
break;
if (/[^\s]/.test(line))
minIndent = Math.min(indent, minIndent);
}
for (var row = cursor.row + 1; row <= end.row; ++row) {
var outdent = minIndent;
@ -470,7 +470,7 @@ var Editor =function(renderer, doc) {
_self.doc.replace(new Range(row, 0, row, line.length), line.substr(i));
}
end.column += _self.doc.indentRows(
new Range(cursor.row + 1, 0, end.row, end.column),
new Range(cursor.row + 1, 0, end.row, end.column),
lineIndent);
} else {
if (shouldOutdent) {
@ -494,7 +494,7 @@ var Editor =function(renderer, doc) {
this.onCursorChange();
this.$blockScrolling = false;
this.$dispatchEvent("changeOverwrite", {data: overwrite});
this._dispatchEvent("changeOverwrite", {data: overwrite});
};
this.getOverwrite = function() {
@ -521,7 +521,7 @@ var Editor =function(renderer, doc) {
this.$selectionStyle = style;
this.onSelectionChange();
this.$dispatchEvent("changeSelectionStyle", {data: style});
this._dispatchEvent("changeSelectionStyle", {data: style});
};
@ -605,21 +605,21 @@ var Editor =function(renderer, doc) {
var doc = this.doc,
range = this.getSelectionRange();
if (range.start.row < range.end.row ||
range.start.column < range.end.column) {
var count = doc.indentRows(this.getSelectionRange(), "\t");
this.selection.shiftSelection(count);
} else {
var indentString;
if (this.doc.getUseSoftTabs()) {
var size = doc.getTabSize(),
position = this.getCursorPosition(),
column = doc.documentToScreenColumn(position.row, position.column),
count = (size - column % size);
indentString = lang.stringRepeat(" ", count);
} else
indentString = "\t";
@ -633,7 +633,7 @@ var Editor =function(renderer, doc) {
var selection = this.doc.getSelection(),
range = this.doc.outdentRows(selection.getRange());
selection.setSelectionRange(range, selection.isBackwards());
this.$updateDesiredColumn();
};
@ -797,7 +797,7 @@ var Editor =function(renderer, doc) {
var row = this.getPageDownRow(),
column = Math.min(this.getCursorPosition().column,
this.doc.getLine(row).length);
this.scrollToRow(row);
this.getSelection().moveCursorTo(row, column);
};
@ -806,7 +806,7 @@ var Editor =function(renderer, doc) {
var row = this.getPageUpRow(),
column = Math.min(this.getCursorPosition().column,
this.doc.getLine(row).length);
this.scrollToRow(row);
this.getSelection().moveCursorTo(row, column);
};
@ -850,7 +850,7 @@ var Editor =function(renderer, doc) {
this.gotoLine = function(lineNumber, row) {
this.selection.clearSelection();
this.$blockScrolling = true;
this.moveCursorTo(lineNumber-1, row || 0);
this.$blockScrolling = false;
@ -948,7 +948,7 @@ var Editor =function(renderer, doc) {
this.replace = function(replacement, options) {
if (options)
this.$search.set(options);
var range = this.$search.find(this.doc);
this.$tryReplace(range, replacement);
if (range !== null)
@ -965,9 +965,9 @@ var Editor =function(renderer, doc) {
if (!ranges.length)
return;
this.clearSelection();
this.selection.moveCursorTo(0, 0);
this.clearSelection();
this.selection.moveCursorTo(0, 0);
for (var i = ranges.length - 1; i >= 0; --i)
this.$tryReplace(ranges[i], replacement);
if (ranges[0] !== null)
@ -1041,5 +1041,5 @@ var Editor =function(renderer, doc) {
}).call(Editor.prototype);
return Editor;
exports.Editor = Editor;
});

View file

@ -1,85 +0,0 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("./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<listeners.length; i++) {
listeners[i](e);
}
};
MEventEmitter.on =
MEventEmitter.addEventListener = function(eventName, callback) {
this.$eventRegistry = this.$eventRegistry || {};
var listeners = this.$eventRegistry[eventName];
if (!listeners) {
var listeners = this.$eventRegistry[eventName] = [];
}
if (lang.arrayIndexOf(listeners, callback) == -1) {
listeners.push(callback);
}
};
MEventEmitter.removeEventListener = function(eventName, callback) {
this.$eventRegistry = this.$eventRegistry || {};
var listeners = this.$eventRegistry[eventName];
if (!listeners) {
return;
}
var index = lang.arrayIndexOf(listeners, callback);
if (index !== -1) {
listeners.splice(index, 1);
}
};
return MEventEmitter;
});

View file

@ -37,12 +37,12 @@
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("./plugin_manager");
require("./commands/default_commands");
var core = require("pilot/core").core;
var event = require("pilot/event").event;
var default_mac = require("ace/conf/keybindings/default_mac").bindings;
var default_win = require("ace/conf/keybindings/default_win").bindings;
var canon = require("pilot/canon");
require("ace/commands/default_commands");
var KeyBinding = function(element, editor, config) {
this.setConfig(config);
@ -55,10 +55,9 @@ var KeyBinding = function(element, editor, config) {
var commandName = (_self.config.reverse[hashId] || {})[(key
|| String.fromCharCode(e.keyCode)).toLowerCase()];
var command = PluginManager.commands[commandName];
if (command) {
command(editor, editor.getSelection());
var success = canon.exec(commandName);
if (success) {
return event.stopEvent(e);
}
});
@ -149,5 +148,5 @@ var KeyBinding = function(element, editor, config) {
}).call(KeyBinding.prototype);
return KeyBinding;
exports.KeyBinding = KeyBinding;
});

View file

@ -37,7 +37,7 @@
define(function(require, exports, module) {
var dom = require("../lib/dom");
var dom = require("pilot/dom").dom;
var Cursor = function(parentEl) {
this.element = document.createElement("div");
@ -120,7 +120,7 @@ var Cursor = function(parentEl) {
this.update = function(config) {
if (!this.position)
return;
this.config = config;
var cursorLeft = Math.round(this.position.column * config.characterWidth);
@ -145,5 +145,6 @@ var Cursor = function(parentEl) {
}).call(Cursor.prototype);
return Cursor;
exports.Cursor = Cursor;
});

View file

@ -81,5 +81,6 @@ var Gutter = function(parentEl) {
}).call(Gutter.prototype);
return Gutter;
exports.Gutter = Gutter;
});

View file

@ -37,7 +37,7 @@
define(function(require, exports, module) {
var Range = require("../range");
var Range = require("ace/range").Range;
var Marker = function(parentEl) {
this.element = document.createElement("div");
@ -181,5 +181,6 @@ var Marker = function(parentEl) {
}).call(Marker.prototype);
return Marker;
exports.Marker = Marker;
});

View file

@ -37,9 +37,9 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var dom = require("../lib/dom");
var MEventEmitter = require("../event_emitter");
var oop = require("pilot/oop").oop;
var dom = require("pilot/dom").dom;
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var Text = function(parentEl) {
this.element = document.createElement("div");
@ -52,7 +52,7 @@ var Text = function(parentEl) {
(function() {
oop.implement(this, MEventEmitter);
oop.implement(this, EventEmitter);
this.EOF_CHAR = "&para;";
this.EOL_CHAR = "&not;";
@ -77,7 +77,7 @@ var Text = function(parentEl) {
var size = self.$measureSizes();
if (self.$characterSize.width !== size.width || self.$characterSize.height !== size.height) {
self.$characterSize = size;
self.$dispatchEvent("changeCharaterSize", {data: size});
self._dispatchEvent("changeCharaterSize", {data: size});
}
}, 500);
};
@ -155,7 +155,7 @@ var Text = function(parentEl) {
this.tokenizer.getTokens(first, last, function(tokens) {
for ( var i = first; i <= last; i++) {
var lineElement = lineElements[i - layerConfig.firstRow];
if (!lineElement)
if (!lineElement)
continue;
var html = [];
@ -299,5 +299,6 @@ var Text = function(parentEl) {
}).call(Text.prototype);
return Text;
exports.Text = Text;
});

View file

@ -1,63 +0,0 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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<parts.length; i++) {
var part = parts[i];
if (!obj[part]) {
obj[part] = {};
}
obj = obj[part];
}
};
return core;
});

View file

@ -1,141 +0,0 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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 dom = {};
dom.setText = function(elem, text) {
if (elem.innerText !== undefined) {
elem.innerText = text;
}
if (elem.textContent !== undefined) {
elem.textContent = text;
}
};
dom.hasCssClass = function(el, name) {
var classes = el.className.split(/\s+/g);
return lang.arrayIndexOf(classes, name) !== -1;
};
dom.addCssClass = function(el, name) {
if (!dom.hasCssClass(el, name)) {
el.className += " " + name;
}
};
dom.removeCssClass = function(el, name) {
var classes = el.className.split(/\s+/g);
while (true) {
var index = lang.arrayIndexOf(classes, name);
if (index == -1) {
break;
}
classes.splice(index, 1);
}
el.className = classes.join(" ");
};
dom.importCssString = function(cssText, doc){
doc = doc || document;
if (doc.createStyleSheet) {
var sheet = doc.createStyleSheet();
sheet.cssText = cssText;
}
else {
var style = doc.createElement("style");
style.appendChild(doc.createTextNode(cssText));
doc.getElementsByTagName("head")[0].appendChild(style);
}
};
dom.getInnerWidth = function(element) {
return (parseInt(dom.computedStyle(element, "paddingLeft"))
+ parseInt(dom.computedStyle(element, "paddingRight")) + element.clientWidth);
};
dom.getInnerHeight = function(element) {
return (parseInt(dom.computedStyle(element, "paddingTop"))
+ parseInt(dom.computedStyle(element, "paddingBottom")) + element.clientHeight);
};
dom.computedStyle = function(element, style) {
if (window.getComputedStyle) {
return (window.getComputedStyle(element, "") || {})[style] || "";
}
else {
return element.currentStyle[style];
}
};
dom.scrollbarWidth = function() {
var inner = document.createElement('p');
inner.style.width = "100%";
inner.style.height = "200px";
var outer = document.createElement("div");
var style = outer.style;
style.position = "absolute";
style.left = "-10000px";
style.overflow = "hidden";
style.width = "200px";
style.height = "150px";
outer.appendChild(inner);
document.body.appendChild(outer);
var noScrollbar = inner.offsetWidth;
style.overflow = "scroll";
var withScrollbar = inner.offsetWidth;
if (noScrollbar == withScrollbar) {
withScrollbar = outer.clientWidth;
}
document.body.removeChild(outer);
return noScrollbar-withScrollbar;
};
return dom;
});

View file

@ -1,242 +0,0 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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 event = {};
event.addListener = function(elem, type, callback) {
if (elem.addEventListener) {
return elem.addEventListener(type, callback, false);
}
if (elem.attachEvent) {
var wrapper = function() {
callback(window.event);
};
callback.$$wrapper = wrapper;
elem.attachEvent("on" + type, wrapper);
}
};
event.removeListener = function(elem, type, callback) {
if (elem.removeEventListener) {
return elem.removeEventListener(type, callback, false);
}
if (elem.detachEvent) {
elem.detachEvent("on" + type, callback.$$wrapper || callback);
}
};
event.stopEvent = function(e) {
event.stopPropagation(e);
event.preventDefault(e);
return false;
};
event.stopPropagation = function(e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
};
event.preventDefault = function(e) {
if (e.preventDefault)
e.preventDefault();
else
e.returnValue = false;
};
event.getDocumentX = function(e) {
if (e.clientX) {
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
return e.clientX + scrollLeft;
} else {
return e.pageX;
}
};
event.getDocumentY = function(e) {
if (e.clientY) {
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
return e.clientY + scrollTop;
} else {
return e.pageX;
}
};
/**
* @return {Number} 0 for left button, 1 for middle button, 2 for right button
*/
event.getButton = function(e) {
// DOM Event
if (e.preventDefault) {
return e.button;
}
// old IE
else {
return Math.max(e.button - 1, 2)
}
};
if (document.documentElement.setCapture) {
event.capture = function(el, eventHandler, releaseCaptureHandler) {
function onMouseMove(e) {
eventHandler(e);
return event.stopPropagation(e);
}
function onReleaseCapture(e) {
eventHandler && eventHandler(e);
releaseCaptureHandler && releaseCaptureHandler();
event.removeListener(el, "mousemove", eventHandler);
event.removeListener(el, "mouseup", onReleaseCapture);
event.removeListener(el, "losecapture", onReleaseCapture);
el.releaseCapture();
}
event.addListener(el, "mousemove", eventHandler);
event.addListener(el, "mouseup", onReleaseCapture);
event.addListener(el, "losecapture", onReleaseCapture);
el.setCapture();
};
}
else {
event.capture = function(el, eventHandler, releaseCaptureHandler) {
function onMouseMove(e) {
eventHandler(e);
e.stopPropagation();
}
function onMouseUp(e) {
eventHandler && eventHandler(e);
releaseCaptureHandler && releaseCaptureHandler();
document.removeEventListener("mousemove", onMouseMove, true);
document.removeEventListener("mouseup", onMouseUp, true);
e.stopPropagation();
}
document.addEventListener("mousemove", onMouseMove, true);
document.addEventListener("mouseup", onMouseUp, true);
};
}
event.addMouseWheelListener = function(el, callback) {
var listener = function(e) {
if (e.wheelDelta !== undefined) {
if (e.wheelDeltaX !== undefined) {
e.wheelX = -e.wheelDeltaX / 8;
e.wheelY = -e.wheelDeltaY / 8;
} else {
e.wheelX = 0;
e.wheelY = -e.wheelDelta / 8;
}
}
else {
if (e.axis && e.axis == e.HORIZONTAL_AXIS) {
e.wheelX = (e.detail || 0) * 5;
e.wheelY = 0;
} else {
e.wheelX = 0;
e.wheelY = (e.detail || 0) * 5;
}
}
callback(e);
};
event.addListener(el, "DOMMouseScroll", listener);
event.addListener(el, "mousewheel", listener);
};
event.addMultiMouseDownListener = function(el, button, count, timeout, callback) {
var clicks = 0;
var startX, startY;
var listener = function(e) {
clicks += 1;
if (clicks == 1) {
startX = e.clientX;
startY = e.clientY;
setTimeout(function() {
clicks = 0;
}, timeout || 600);
}
if (event.getButton(e) != button
|| Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5)
clicks = 0;
if (clicks == count) {
clicks = 0;
callback(e);
}
return event.preventDefault(e);
};
event.addListener(el, "mousedown", listener);
core.isIE && event.addListener(el, "dblclick", listener);
};
event.addKeyListener = function(el, callback) {
var lastDown = null;
event.addListener(el, "keydown", function(e) {
lastDown = e.keyIdentifier || e.keyCode;
return callback(e);
});
// repeated keys are fired as keypress and not keydown events
if (core.isMac && core.isGecko) {
event.addListener(el, "keypress", function(e) {
var keyId = e.keyIdentifier || e.keyCode;
if (lastDown !== keyId) {
return callback(e);
} else {
lastDown = null;
}
});
}
};
return event;
});

View file

@ -1,125 +0,0 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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) {
return string.split("").reverse().join("");
};
lang.stringRepeat = function (string, count) {
return new Array(count + 1).join(string);
}
if (Array.prototype.indexOf) {
lang.arrayIndexOf = function(array, searchElement) {
return array.indexOf(searchElement);
};
}
else {
lang.arrayIndexOf = function(array, searchElement) {
for (var i=0; i<array.length; i++) {
if (array[i] == searchElement) {
return i;
}
}
return -1;
};
}
lang.isArray = function(value) {
return Object.prototype.toString.call(value) == "[object Array]";
};
lang.copyObject = function(obj) {
var copy = {};
for (var key in obj) {
copy[key] = obj[key];
}
return copy;
};
lang.arrayToMap = function(arr) {
var map = {};
for (var i=0; i<arr.length; i++) {
map[arr[i]] = 1;
}
return map;
};
lang.escapeRegExp = function(str) {
return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
};
lang.bind = function(fcn, context) {
return function() {
return fcn.apply(context, arguments);
};
};
lang.deferredCall = function(fcn) {
var timer = null;
var callback = function() {
timer = null;
fcn();
};
return {
schedule: function() {
if (!timer) {
timer = setTimeout(callback, 0);
}
},
call: function() {
lang.cancel();
fcn();
},
cancel: function() {
clearTimeout(timer);
timer = null;
}
};
};
return lang;
});

View file

@ -1,61 +0,0 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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;
});

View file

@ -37,11 +37,11 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var TextMode = require("./text");
var Tokenizer = require("../tokenizer");
var CssHighlightRules = require("./css_highlight_rules");
var MatchingBraceOutdent = require("./matching_brace_outdent");
var oop = require("pilot/oop").oop;
var TextMode = require("ace/mode/text").Text;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var CssHighlightRules = require("ace/mode/css_highlight_rules").CssHighlightRules;
var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
var Css = function() {
this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules());
@ -78,5 +78,6 @@ oop.inherits(Css, TextMode);
}).call(Css.prototype);
return Css;
});
exports.Css = Css;
});

View file

@ -37,9 +37,9 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules");
var oop = require("pilot/oop").oop;
var lang = require("pilot/lang").lang;
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
var CssHighlightRules = function() {
@ -229,5 +229,6 @@ var CssHighlightRules = function() {
oop.inherits(CssHighlightRules, TextHighlightRules);
return CssHighlightRules;
exports.CssHighlightRules = CssHighlightRules;
});

View file

@ -37,8 +37,8 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules");
var oop = require("pilot/oop").oop;
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function() {
@ -77,5 +77,6 @@ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
}).call(DocCommentHighlightRules.prototype);
return DocCommentHighlightRules;
});
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});

View file

@ -37,12 +37,12 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var TextMode = require("./text");
var JavaScriptMode = require("./javascript");
var CssMode = require("./css");
var Tokenizer = require("../tokenizer");
var HtmlHighlightRules = require("./html_highlight_rules");
var oop = require("pilot/oop").oop;
var TextMode = require("ace/mode/text").Text;
var JavaScriptMode = require("ace/mode/javascript").JavaScript;
var CssMode = require("ace/mode/css").Css;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var HtmlHighlightRules = require("ace/mode/html_highlight_rules").HtmlHighlightRules;
var Html = function() {
this.$tokenizer = new Tokenizer(new HtmlHighlightRules().getRules());
@ -97,5 +97,5 @@ oop.inherits(Html, TextMode);
}).call(Html.prototype);
return Html;
exports.Html = Html;
});

View file

@ -37,10 +37,10 @@
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("pilot/oop").oop;
var CssHighlightRules = require("ace/mode/css_highlight_rules").CssHighlightRules;
var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
var HtmlHighlightRules = function() {
@ -178,5 +178,5 @@ var HtmlHighlightRules = function() {
oop.inherits(HtmlHighlightRules, TextHighlightRules);
return HtmlHighlightRules;
exports.HtmlHighlightRules = HtmlHighlightRules;
});

View file

@ -37,12 +37,12 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var TextMode = 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("pilot/oop").oop;
var TextMode = require("ace/mode/text").Text;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;
var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
var Range = require("ace/range").Range;
var JavaScript = function() {
this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
@ -123,5 +123,5 @@ oop.inherits(JavaScript, TextMode);
}).call(JavaScript.prototype);
return JavaScript;
exports.JavaScript = JavaScript;
});

View file

@ -37,10 +37,10 @@
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("pilot/oop").oop;
var lang = require("pilot/lang").lang;
var DocCommentHighlightRules = require("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
JavaScriptHighlightRules = function() {
@ -159,5 +159,5 @@ JavaScriptHighlightRules = function() {
oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
return JavaScriptHighlightRules;
});
exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
});

View file

@ -37,7 +37,7 @@
define(function(require, exports, module) {
var Range = require("../range");
var Range = require("ace/range").Range;
var MatchingBraceOutdent = function() {};
@ -78,5 +78,5 @@ var MatchingBraceOutdent = function() {};
}).call(MatchingBraceOutdent.prototype);
return MatchingBraceOutdent;
exports.MatchingBraceOutdent = MatchingBraceOutdent;
});

View file

@ -37,8 +37,8 @@
define(function(require, exports, module) {
var Tokenizer = require("../tokenizer");
var TextHighlightRules = require("./text_highlight_rules");
var Tokenizer = require("ace/tokenizer").Tokenizer;
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
var Text = function() {
this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules());
@ -76,5 +76,5 @@ var Text = function() {
}).call(Text.prototype);
return Text;
});
exports.Text = Text;
});

View file

@ -73,5 +73,5 @@ var TextHighlightRules = function() {
}).call(TextHighlightRules.prototype);
return TextHighlightRules;
});
exports.TextHighlightRules = TextHighlightRules;
});

View file

@ -37,10 +37,10 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var TextMode = require("./text");
var Tokenizer = require("../tokenizer");
var XmlHighlightRules = require("./xml_highlight_rules");
var oop = require("pilot/oop").oop;
var TextMode = require("ace/mode/text").Text;
var Tokenizer = require("ace/tokenizer").Tokenizer;
var XmlHighlightRules = require("ace/mode/xml_highlight_rules").XmlHighlightRules;
var Xml = function() {
this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
@ -56,5 +56,5 @@ oop.inherits(Xml, TextMode);
}).call(Xml.prototype);
return Xml;
});
exports.Xml = Xml;
});

View file

@ -37,8 +37,8 @@
define(function(require, exports, module) {
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules");
var oop = require("pilot/oop").oop;
var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
var XmlHighlightRules = function() {
@ -114,5 +114,5 @@ var XmlHighlightRules = function() {
oop.inherits(XmlHighlightRules, TextHighlightRules);
return XmlHighlightRules;
});
exports.XmlHighlightRules = XmlHighlightRules;
});

View file

@ -1,49 +0,0 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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;
});

View file

@ -152,5 +152,5 @@ Range.fromPoints = function(start, end) {
return new Range(start.row, start.column, end.row, end.column);
};
return Range;
})
exports.Range = Range;
});

View file

@ -37,7 +37,7 @@
define(function(require, exports, module) {
var event = require("./lib/event")
var event = require("pilot/event").event;
var RenderLoop = function(onRender) {
this.onRender = onRender;
@ -62,11 +62,11 @@ var RenderLoop = function(onRender) {
})
}
};
if (window.postMessage) {
this.messageName = "zero-timeout-message";
this.setTimeoutZero = function(callback) {
if (!this.attached) {
var _self = this;
@ -81,15 +81,15 @@ var RenderLoop = function(onRender) {
this.callback = callback;
window.postMessage(this.messageName, "*");
}
} else {
this.setTimeoutZero = function(callback) {
setTimeout(callback, 0);
}
}
}).call(RenderLoop.prototype);
return RenderLoop;
});
exports.RenderLoop = RenderLoop;
});

View file

@ -37,11 +37,11 @@
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("./event_emitter");
var oop = require("pilot/oop").oop;
var lang = require("pilot/lang").lang;
var dom = require("pilot/dom").dom;
var event = require("pilot/event").event;
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var ScrollBar = function(parent) {
this.element = document.createElement("div");
@ -59,7 +59,7 @@ var ScrollBar = function(parent) {
};
(function() {
oop.implement(this, MEventEmitter);
oop.implement(this, EventEmitter);
this.onScroll = function() {
this.$dispatchEvent("scroll", {data: this.element.scrollTop});
@ -83,5 +83,5 @@ var ScrollBar = function(parent) {
}).call(ScrollBar.prototype);
return ScrollBar;
exports.ScrollBar = ScrollBar;
});

View file

@ -37,9 +37,9 @@
define(function(require, exports, module) {
var lang = require("./lib/lang");
var oop = require("./lib/oop");
var Range = require("./range");
var lang = require("pilot/lang").lang;
var oop = require("pilot/oop").oop;
var Range = require("ace/range").Range;
var Search = function() {
this.$options = {
@ -317,5 +317,5 @@ Search.SELECTION = 2;
}).call(Search.prototype);
return Search;
exports.Search = Search;
});

View file

@ -37,10 +37,10 @@
define(function(require, exports, module) {
var oop = require("./lib/oop");
var lang = require("./lib/lang");
var MEventEmitter = require("./event_emitter");
var Range = require("./range");
var oop = require("pilot/oop").oop;
var lang = require("pilot/lang").lang;
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var Range = require("ace/range").Range;
var Selection = function(doc) {
this.doc = doc;
@ -54,7 +54,7 @@ var Selection = function(doc) {
(function() {
oop.implement(this, MEventEmitter);
oop.implement(this, EventEmitter);
this.isEmpty = function() {
return (!this.selectionAnchor ||
@ -79,11 +79,11 @@ var Selection = function(doc) {
if (!this.selectionAnchor) {
this.selectionAnchor = anchor;
this.$dispatchEvent("changeSelection", {});
this._dispatchEvent("changeSelection", {});
}
else if (this.selectionAnchor.row !== anchor.row || this.selectionAnchor.column !== anchor.column) {
this.selectionAnchor = anchor;
this.$dispatchEvent("changeSelection", {});
this._dispatchEvent("changeSelection", {});
}
};
@ -142,7 +142,7 @@ var Selection = function(doc) {
this.clearSelection = function() {
if (this.selectionAnchor) {
this.selectionAnchor = null;
this.$dispatchEvent("changeSelection", {});
this._dispatchEvent("changeSelection", {});
}
};
@ -181,7 +181,7 @@ var Selection = function(doc) {
}
if (changed)
this.$dispatchEvent("changeSelection", {});
this._dispatchEvent("changeSelection", {});
};
this.selectTo = function(row, column) {
@ -381,7 +381,7 @@ var Selection = function(doc) {
// only dispatch change if the cursor actually changed
if (cursor.row !== this.selectionLead.row || cursor.column !== this.selectionLead.column) {
this.selectionLead = cursor;
this.$dispatchEvent("changeCursor", { data: this.getCursor() });
this._dispatchEvent("changeCursor", { data: this.getCursor() });
}
};
@ -417,5 +417,5 @@ var Selection = function(doc) {
}).call(Selection.prototype);
return Selection;
exports.Selection = Selection;
});

View file

@ -1,3 +1,40 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require({
paths: {
"ace": "../src/ace"

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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) {

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
@ -30,11 +59,11 @@ var Test = {
this.doc2 = new Document(["ghi", "jkl"].join("\n"));
this.editor = new Editor(new MockRenderer());
},
"test: change document" : function() {
this.editor.setDocument(this.doc1);
assert.equal(this.editor.getDocument(), this.doc1);
this.editor.setDocument(this.doc2);
assert.equal(this.editor.getDocument(), this.doc2);
},
@ -134,4 +163,4 @@ var Test = {
module.exports = require("async/test").testcase(Test);
if (module === require.main)
module.exports.exec()
module.exports.exec()

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");

View file

@ -1,21 +1,49 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
var oop = require("../lib/oop");
MEventEmitter = require("../event_emitter"),
assert = require("./assertions");
var EventEmitter = function() {};
oop.implement(EventEmitter.prototype, MEventEmitter);
oop.implement(EventEmitter.prototype, EventEmitter);
var Test = {
"test: dispatch event with no data" : function() {
@ -35,4 +63,4 @@ var Test = {
module.exports = require("async/test").testcase(Test)
if (module === require.main)
module.exports.exec()
module.exports.exec()

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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) {

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/Document",
@ -13,10 +42,11 @@ require.def([
], function(
Document,
Range,
CssMode
cssMod
) {
var CssTest = new TestCase("mode.CssTest", {
var CssMode = cssMod.Css;
var CssTest = new TestCase("mode.CssTest", {
setUp : function() {
this.mode = new CssMode();

View file

@ -1,17 +1,47 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/mode/Css"
], function(
CssMode
cssMod
) {
var CssMode = cssMod.Css;
var CssTest = new TestCase("mode.CssTest", {
setUp : function() {

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/Document",
@ -13,9 +42,10 @@ require.def([
], function(
Document,
Range,
HtmlMode
htmlMod
) {
var HtmlMode = htmlMod.Html;
var HtmlTest = new TestCase("mode.HtmlTest", {
setUp : function() {

View file

@ -1,17 +1,47 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/mode/Html"
], function(
HtmlMode
htmlMod
) {
var HtmlMode = htmlMod.Html;
var HtmlTest = new TestCase("mode.HtmlTest", {
setUp : function() {

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/Document",
@ -15,9 +44,10 @@ require.def([
Document,
Range,
Tokenizer,
JavaScriptMode
jsMod
) {
var JavaScriptMode = jsMod.JavaScript;
var JavaScriptTest = new TestCase("mode.JavaScriptTest", {
setUp : function() {

View file

@ -1,17 +1,47 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/mode/JavaScript"
], function(
JavaScriptMode
jsMod
) {
var JavaScriptMode = jsMod.JavaScript;
var JavaScriptTokenizerTest = new TestCase("mode.JavaScriptTokenizerTest", {
setUp : function() {

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/Document",
@ -13,9 +42,10 @@ require.def([
], function(
Document,
Range,
TextMode
textMod
) {
var TextMode = textMod.Text;
var TextTest = new TestCase("mode.TextTest", {
setUp : function() {

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/Document",
@ -15,9 +44,10 @@ require.def([
Document,
Range,
Tokenizer,
XmlMode
xmlMod
) {
var XmlMode = xmlMod.Xml;
var XmlTest = new TestCase("mode.XmlTest", {
setUp : function() {

View file

@ -1,17 +1,47 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require.def([
"ace/mode/Xml"
], function(
XmlMode
xmlMod
) {
var XmlMode = xmlMod.Xml;
var XmlTest = new TestCase("mode.XmlTest", {
setUp : function() {

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
@ -132,4 +161,4 @@ var Test = {
module.exports = require("async/test").testcase(Test)
if (module === require.main)
module.exports.exec()
module.exports.exec()

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
@ -121,4 +150,4 @@ var Test = {
module.exports = require("async/test").testcase(Test);
if (module === require.main)
module.exports.exec()
module.exports.exec()

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
@ -318,4 +347,4 @@ var Test = {
module.exports = require("async/test").testcase(Test)
if (module === require.main)
module.exports.exec();
module.exports.exec();

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
@ -264,4 +293,4 @@ var Test = {
module.exports = require("async/test").testcase(Test);
if (module === require.main)
module.exports.exec()
module.exports.exec()

View file

@ -1,10 +1,39 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
@ -18,11 +47,11 @@ global.navigator = browser.navigator;
global.location = browser.location;
var Document = require("../document"),
Editor = require("../editor"),
JavaScriptMode = require("../mode/javascript"),
Editor = require("../editor"),
JavaScriptMode = require("../mode/javascript").JavaScript,
MockRenderer = require("./mockrenderer"),
assert = require("./assertions");
var Test = {
"test: delete line from the middle" : function() {
var doc = new Document(["a", "b", "c", "d"].join("\n"));
@ -317,4 +346,4 @@ var Test = {
module.exports = require("async/test").testcase(Test);
if (module === require.main)
module.exports.exec()
module.exports.exec()

View file

@ -1,13 +1,42 @@
/**
* 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 <http://www.gnu.org/licenses/lgpl-3.0.txt>
* @author Fabian Jakobs <fabian AT ajax DOT org>
*/
* 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 <fabian AT ajax DOT org>
*
* 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 ***** */
require("../../../support/paths");
var Document = "../document",
VirtualRenderer = "../virtual_renderer",
assert = "../assertions";
@ -45,4 +74,4 @@ var Test = {
module.exports = require("async/test").testcase(Test);
if (module === require.main)
module.exports.exec()
module.exports.exec()

View file

@ -37,7 +37,7 @@
define(function(require, exports, module) {
var event = require("./lib/event");
var event = require("pilot/event").event;
var TextInput = function(parentNode, host) {
@ -146,5 +146,5 @@ var TextInput = function(parentNode, host) {
};
};
return TextInput;
});
exports.TextInput = TextInput;
});

View file

@ -1,6 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-clouds .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -150,11 +187,9 @@ var dom = require("../lib/dom");
.ace-clouds .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-clouds"
};
})
exports.cssClass = "ace-clouds";
});

View file

@ -1,6 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-clouds-midnight .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -151,11 +188,9 @@ background-color:#E92E2E;\
.ace-clouds-midnight .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-clouds-midnight"
};
})
exports.cssClass = "ace-clouds-midnight";
});

View file

@ -1,7 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-cobalt .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -153,11 +189,9 @@ color:#0088FF;\
.ace-cobalt .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-cobalt"
};
})
exports.cssClass = "ace-cobalt";
});

View file

@ -1,6 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-dawn .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -156,11 +193,9 @@ color:#5A525F;\
.ace-dawn .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-dawn"
};
})
exports.cssClass = "ace-dawn";
});

View file

@ -1,12 +1,47 @@
define(["require", "exports", "module", "text!ace/theme/eclipse.css", "../lib/dom"],
function(require, exports, module, cssText) {
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = require("text!ace/theme/eclipse.css");
var dom = require("../lib/dom");
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-eclipse"
};
})
exports.cssClass = "ace-eclipse";
});

View file

@ -1,7 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-idle-fingers .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -153,11 +189,9 @@ color:#BC9458;\
.ace-idle-fingers .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-idle-fingers"
};
})
exports.cssClass = "ace-idle-fingers";
});

View file

@ -1,7 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-kr-theme .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -153,11 +189,9 @@ color:#706D5B;\
.ace-kr-theme .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-kr-theme"
};
})
exports.cssClass = "ace-kr-theme";
});

View file

@ -1,7 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-mono-industrial .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -153,11 +189,9 @@ background-color:#151C19;\
.ace-mono-industrial .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-mono-industrial"
};
})
exports.cssClass = "ace-mono-industrial";
});

View file

@ -1,7 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-monokai .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -153,11 +189,9 @@ background-color:#AE81FF;\
.ace-monokai .ace_xml_pe {\
\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-monokai"
};
})
exports.cssClass = "ace-monokai";
});

View file

@ -1,12 +1,47 @@
define(["require", "exports", "module", "text!ace/theme/tm.css", "../lib/dom"],
function(require, exports, module, cssText) {
/* ***** 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 <fabian AT ajax DOT org>
*
* 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 ***** */
var dom = require("../lib/dom");
define(function(require, exports, module) {
var dom = require("pilot/dom").dom;
var cssText = require("text!ace/theme/tm.css");
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-tm"
};
})
exports.cssClass = "ace-tm";
});

View file

@ -1,6 +1,43 @@
/* ***** 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 <fabian AT ajax DOT org>
*
* 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("pilot/dom").dom;
var cssText = ".ace-twilight .ace_editor {\
border: 2px solid rgb(159, 159, 159);\
@ -154,11 +191,9 @@ color:#5F5A60;\
.ace-twilight .ace_xml_pe {\
color:#494949;\
}";
// import CSS once
dom.importCssString(cssText);
return {
cssClass: "ace-twilight"
};
})
exports.cssClass = "ace-twilight";
});

View file

@ -128,5 +128,5 @@ var Tokenizer = function(rules) {
}).call(Tokenizer.prototype);
return Tokenizer;
});
exports.Tokenizer = Tokenizer;
});

View file

@ -73,5 +73,5 @@ var UndoManager = function() {
}).call(UndoManager.prototype);
return UndoManager;
});
exports.UndoManager = UndoManager;
});

View file

@ -35,22 +35,20 @@
*
* ***** END LICENSE BLOCK ***** */
define(["require", "exports", "module", "text!ace/css/editor.css", "./lib/oop", "./lib/oop",
"./lib/event", "./layer/gutter", "./layer/marker", "./layer/text",
"./layer/cursor", "./scrollbar", "./renderloop", "./event_emitter"],
function(require, exports, module, editorCss) {
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 GutterLayer = require("./layer/gutter");
var MarkerLayer = require("./layer/marker");
var TextLayer = require("./layer/text");
var CursorLayer = require("./layer/cursor");
var ScrollBar = require("./scrollbar");
var RenderLoop = require("./renderloop");
var MEventEmitter = require("./event_emitter");
var oop = require("pilot/oop").oop;
var lang = require("pilot/lang").lang;
var dom = require("pilot/dom").dom;
var event = require("pilot/event").event;
var GutterLayer = require("ace/layer/gutter").Gutter;
var MarkerLayer = require("ace/layer/marker").Marker;
var TextLayer = require("ace/layer/text").Text;
var CursorLayer = require("ace/layer/cursor").Cursor;
var ScrollBar = require("ace/scrollbar").ScrollBar;
var RenderLoop = require("ace/renderloop").RenderLoop;
var EventEmitter = require("pilot/event_emitter").EventEmitter;
var editorCss = require("text!ace/css/editor.css");
// import CSS once
dom.importCssString(editorCss);
@ -115,7 +113,7 @@ var VirtualRenderer = function(container, theme) {
this.$loop = new RenderLoop(lang.bind(this.$renderChanges, this));
this.$loop.schedule(this.CHANGE_FULL);
this.$updatePrintMargin();
this.setPadding(4);
};
@ -133,7 +131,7 @@ var VirtualRenderer = function(container, theme) {
this.CHANGE_SIZE = 64;
this.CHANGE_FULL = 128;
oop.implement(this, MEventEmitter);
oop.implement(this, EventEmitter);
this.setDocument = function(doc) {
this.lines = doc.lines;
@ -225,7 +223,7 @@ var VirtualRenderer = function(container, theme) {
var pageX = event.getDocumentX(e);
var pageY = event.getDocumentY(e);
this.$dispatchEvent("gutter" + e.type, {
this._dispatchEvent("gutter" + e.type, {
row: this.screenToTextCoordinates(pageX, pageY).row,
htmlEvent: e
});
@ -262,7 +260,7 @@ var VirtualRenderer = function(container, theme) {
this.getPrintMarginColumn = function() {
return this.$printMarginColumn;
};
this.setShowGutter = function(show){
this.$gutter.style.display = show ? "block" : "none";
this.showGutter = show;
@ -295,18 +293,18 @@ var VirtualRenderer = function(container, theme) {
this.getFirstVisibleRow = function() {
return (this.layerConfig || {}).firstRow || 0;
};
this.getFirstFullyVisibleRow = function(){
if (!this.layerConfig)
return 0;
return this.layerConfig.firstRow + (this.layerConfig.offset == 0 ? 0 : 1);
}
this.getLastFullyVisibleRow = function() {
if (!this.layerConfig)
return 0;
var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight);
return this.layerConfig.firstRow - 1 + flint;
}
@ -374,7 +372,7 @@ var VirtualRenderer = function(container, theme) {
}
else if (changes & this.CHANGE_LINES) {
this.$updateLines();
this.$updateScrollBar();
this.$updateScrollBar();
} if (changes & this.CHANGE_GUTTER) {
this.showGutter && this.$gutterLayer.update(this.layerConfig);
}
@ -470,17 +468,17 @@ var VirtualRenderer = function(container, theme) {
this.$markerLayer.removeMarker(markerId);
this.$loop.schedule(this.CHANGE_MARKER);
};
this.addGutterDecoration = function(row, className){
this.$gutterLayer.addGutterDecoration(row, className);
this.$loop.schedule(this.CHANGE_GUTTER);
}
this.removeGutterDecoration = function(row, className){
this.$gutterLayer.removeGutterDecoration(row, className);
this.$loop.schedule(this.CHANGE_GUTTER);
}
this.setBreakpoints = function(rows) {
this.$gutterLayer.setBreakpoints(rows);
this.$loop.schedule(this.CHANGE_GUTTER);
@ -528,7 +526,7 @@ var VirtualRenderer = function(container, theme) {
this.getScrollTop = function() {
return this.scrollTop;
};
this.getScrollLeft = function() {
return this.scroller.scrollLeft;
};
@ -550,7 +548,7 @@ var VirtualRenderer = function(container, theme) {
this.$loop.schedule(this.CHANGE_SCROLL);
}
};
this.scrollToX = function(scrollLeft) {
if (scrollLeft <= this.$padding)
scrollLeft = 0;
@ -579,10 +577,10 @@ var VirtualRenderer = function(container, theme) {
this.textToScreenCoordinates = function(row, column) {
var canvasPos = this.scroller.getBoundingClientRect();
var x = this.padding + Math.round(this.doc.documentToScreenColumn(row, column) * this.characterWidth);
var y = row * this.lineHeight;
return {
pageX: canvasPos.left + x - this.getScrollLeft(),
pageY: canvasPos.top + y - this.getScrollTop()
@ -637,5 +635,5 @@ var VirtualRenderer = function(container, theme) {
}).call(VirtualRenderer.prototype);
return VirtualRenderer;
});
exports.VirtualRenderer = VirtualRenderer;
});