Merge remote branch 'remotes/mozilla/master'
Conflicts: demo/editor-build.html demo/editor.html
This commit is contained in:
commit
f7c217d7a4
108 changed files with 8340 additions and 1335 deletions
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue