update packaged ace
|
|
@ -1,5 +1,5 @@
|
|||
define(function(f) {
|
||||
var i = f("./lib/oop"), j = f("./event_emitter");
|
||||
define(function(f, i) {
|
||||
var j = f("pilot/oop"), k = f("pilot/event_emitter").EventEmitter;
|
||||
f = function(a, c) {
|
||||
this.running = false;
|
||||
this.textLines = [];
|
||||
|
|
@ -9,13 +9,13 @@ define(function(f) {
|
|||
var b = this;
|
||||
this.$worker = function() {
|
||||
if(b.running) {
|
||||
for(var e = new Date, g = b.currentLine, d = b.textLines, h = 0, k = c.getLastVisibleRow();b.currentLine < d.length;) {
|
||||
for(var e = new Date, g = b.currentLine, d = b.textLines, h = 0, l = c.getLastVisibleRow();b.currentLine < d.length;) {
|
||||
b.lines[b.currentLine] = b.$tokenizeRows(b.currentLine, b.currentLine)[0];
|
||||
b.currentLine++;
|
||||
h += 1;
|
||||
if(h % 5 == 0 && new Date - e > 20) {
|
||||
b.fireUpdateEvent(g, b.currentLine - 1);
|
||||
b.running = setTimeout(b.$worker, b.currentLine < k ? 20 : 100);
|
||||
b.running = setTimeout(b.$worker, b.currentLine < l ? 20 : 100);
|
||||
return
|
||||
}
|
||||
}b.running = false;
|
||||
|
|
@ -24,7 +24,7 @@ define(function(f) {
|
|||
}
|
||||
};
|
||||
(function() {
|
||||
i.implement(this, j);
|
||||
j.implement(this, k);
|
||||
this.setTokenizer = function(a) {
|
||||
this.tokenizer = a;
|
||||
this.lines = [];
|
||||
|
|
@ -36,7 +36,7 @@ define(function(f) {
|
|||
this.stop()
|
||||
};
|
||||
this.fireUpdateEvent = function(a, c) {
|
||||
this.$dispatchEvent("update", {data:{first:a, last:c}})
|
||||
this._dispatchEvent("update", {data:{first:a, last:c}})
|
||||
};
|
||||
this.start = function(a) {
|
||||
this.currentLine = Math.min(a || 0, this.currentLine, this.textLines.length);
|
||||
|
|
@ -75,5 +75,5 @@ define(function(f) {
|
|||
}return b
|
||||
}
|
||||
}).call(f.prototype);
|
||||
return f
|
||||
i.BackgroundTokenizer = f
|
||||
});
|
||||
|
|
@ -1,152 +1,152 @@
|
|||
define(function(b) {
|
||||
b = b("../plugin_manager");
|
||||
b.registerCommand("selectall", function(a, c) {
|
||||
c.selectAll()
|
||||
});
|
||||
b.registerCommand("removeline", function(a) {
|
||||
a.removeLines()
|
||||
});
|
||||
b.registerCommand("gotoline", function(a) {
|
||||
b = b("pilot/canon");
|
||||
b.addCommand({name:"selectall", exec:function(a) {
|
||||
a.editor.getSelection().selectAll()
|
||||
}});
|
||||
b.addCommand({name:"removeline", exec:function(a) {
|
||||
a.editor.removeLines()
|
||||
}});
|
||||
b.addCommand({name:"gotoline", exec:function(a) {
|
||||
var c = parseInt(prompt("Enter line number:"));
|
||||
isNaN(c) || a.gotoLine(c)
|
||||
});
|
||||
b.registerCommand("togglecomment", function(a) {
|
||||
a.toggleCommentLines()
|
||||
});
|
||||
b.registerCommand("findnext", function(a) {
|
||||
a.findNext()
|
||||
});
|
||||
b.registerCommand("findprevious", function(a) {
|
||||
a.findPrevious()
|
||||
});
|
||||
b.registerCommand("find", function(a) {
|
||||
isNaN(c) || a.editor.gotoLine(c)
|
||||
}});
|
||||
b.addCommand({name:"togglecomment", exec:function(a) {
|
||||
a.editor.toggleCommentLines()
|
||||
}});
|
||||
b.addCommand({name:"findnext", exec:function(a) {
|
||||
a.editor.findNext()
|
||||
}});
|
||||
b.addCommand({name:"findprevious", exec:function(a) {
|
||||
a.editor.findPrevious()
|
||||
}});
|
||||
b.addCommand({name:"find", exec:function(a) {
|
||||
var c = prompt("Find:");
|
||||
a.find(c)
|
||||
});
|
||||
b.registerCommand("undo", function(a) {
|
||||
a.undo()
|
||||
});
|
||||
b.registerCommand("redo", function(a) {
|
||||
a.redo()
|
||||
});
|
||||
b.registerCommand("redo", function(a) {
|
||||
a.redo()
|
||||
});
|
||||
b.registerCommand("overwrite", function(a) {
|
||||
a.toggleOverwrite()
|
||||
});
|
||||
b.registerCommand("copylinesup", function(a) {
|
||||
a.copyLinesUp()
|
||||
});
|
||||
b.registerCommand("movelinesup", function(a) {
|
||||
a.moveLinesUp()
|
||||
});
|
||||
b.registerCommand("selecttostart", function(a, c) {
|
||||
c.selectFileStart()
|
||||
});
|
||||
b.registerCommand("gotostart", function(a) {
|
||||
a.navigateFileStart()
|
||||
});
|
||||
b.registerCommand("selectup", function(a, c) {
|
||||
c.selectUp()
|
||||
});
|
||||
b.registerCommand("golineup", function(a) {
|
||||
a.navigateUp()
|
||||
});
|
||||
b.registerCommand("copylinesdown", function(a) {
|
||||
a.copyLinesDown()
|
||||
});
|
||||
b.registerCommand("movelinesdown", function(a) {
|
||||
a.moveLinesDown()
|
||||
});
|
||||
b.registerCommand("selecttoend", function(a, c) {
|
||||
c.selectFileEnd()
|
||||
});
|
||||
b.registerCommand("gotoend", function(a) {
|
||||
a.navigateFileEnd()
|
||||
});
|
||||
b.registerCommand("selectdown", function(a, c) {
|
||||
c.selectDown()
|
||||
});
|
||||
b.registerCommand("godown", function(a) {
|
||||
a.navigateDown()
|
||||
});
|
||||
b.registerCommand("selectwordleft", function(a, c) {
|
||||
c.selectWordLeft()
|
||||
});
|
||||
b.registerCommand("gotowordleft", function(a) {
|
||||
a.navigateWordLeft()
|
||||
});
|
||||
b.registerCommand("selecttolinestart", function(a, c) {
|
||||
c.selectLineStart()
|
||||
});
|
||||
b.registerCommand("gotolinestart", function(a) {
|
||||
a.navigateLineStart()
|
||||
});
|
||||
b.registerCommand("selectleft", function(a, c) {
|
||||
c.selectLeft()
|
||||
});
|
||||
b.registerCommand("gotoleft", function(a) {
|
||||
a.navigateLeft()
|
||||
});
|
||||
b.registerCommand("selectwordright", function(a, c) {
|
||||
c.selectWordRight()
|
||||
});
|
||||
b.registerCommand("gotowordright", function(a) {
|
||||
a.navigateWordRight()
|
||||
});
|
||||
b.registerCommand("selecttolineend", function(a, c) {
|
||||
c.selectLineEnd()
|
||||
});
|
||||
b.registerCommand("gotolineend", function(a) {
|
||||
a.navigateLineEnd()
|
||||
});
|
||||
b.registerCommand("selectright", function(a, c) {
|
||||
c.selectRight()
|
||||
});
|
||||
b.registerCommand("gotoright", function(a) {
|
||||
a.navigateRight()
|
||||
});
|
||||
b.registerCommand("selectpagedown", function(a) {
|
||||
a.selectPageDown()
|
||||
});
|
||||
b.registerCommand("pagedown", function(a) {
|
||||
a.scrollPageDown()
|
||||
});
|
||||
b.registerCommand("gotopagedown", function(a) {
|
||||
a.gotoPageDown()
|
||||
});
|
||||
b.registerCommand("selectpageup", function(a) {
|
||||
a.selectPageUp()
|
||||
});
|
||||
b.registerCommand("pageup", function(a) {
|
||||
a.scrollPageUp()
|
||||
});
|
||||
b.registerCommand("gotopageup", function(a) {
|
||||
a.gotoPageUp()
|
||||
});
|
||||
b.registerCommand("selectlinestart", function(a, c) {
|
||||
c.selectLineStart()
|
||||
});
|
||||
b.registerCommand("gotolinestart", function(a) {
|
||||
a.navigateLineStart()
|
||||
});
|
||||
b.registerCommand("selectlineend", function(a, c) {
|
||||
c.selectLineEnd()
|
||||
});
|
||||
b.registerCommand("gotolineend", function(a) {
|
||||
a.navigateLineEnd()
|
||||
});
|
||||
b.registerCommand("del", function(a) {
|
||||
a.removeRight()
|
||||
});
|
||||
b.registerCommand("backspace", function(a) {
|
||||
a.removeLeft()
|
||||
});
|
||||
b.registerCommand("outdent", function(a) {
|
||||
a.blockOutdent()
|
||||
});
|
||||
b.registerCommand("indent", function(a) {
|
||||
a.indent()
|
||||
})
|
||||
a.editor.find(c)
|
||||
}});
|
||||
b.addCommand({name:"undo", exec:function(a) {
|
||||
a.editor.undo()
|
||||
}});
|
||||
b.addCommand({name:"redo", exec:function(a) {
|
||||
a.editor.redo()
|
||||
}});
|
||||
b.addCommand({name:"redo", exec:function(a) {
|
||||
a.editor.redo()
|
||||
}});
|
||||
b.addCommand({name:"overwrite", exec:function(a) {
|
||||
a.editor.toggleOverwrite()
|
||||
}});
|
||||
b.addCommand({name:"copylinesup", exec:function(a) {
|
||||
a.editor.copyLinesUp()
|
||||
}});
|
||||
b.addCommand({name:"movelinesup", exec:function(a) {
|
||||
a.editor.moveLinesUp()
|
||||
}});
|
||||
b.addCommand({name:"selecttostart", exec:function(a) {
|
||||
a.editor.getSelection().selectFileStart()
|
||||
}});
|
||||
b.addCommand({name:"gotostart", exec:function(a) {
|
||||
a.editor.navigateFileStart()
|
||||
}});
|
||||
b.addCommand({name:"selectup", exec:function(a) {
|
||||
a.editor.getSelection().selectUp()
|
||||
}});
|
||||
b.addCommand({name:"golineup", exec:function(a) {
|
||||
a.editor.navigateUp()
|
||||
}});
|
||||
b.addCommand({name:"copylinesdown", exec:function(a) {
|
||||
a.editor.copyLinesDown()
|
||||
}});
|
||||
b.addCommand({name:"movelinesdown", exec:function(a) {
|
||||
a.editor.moveLinesDown()
|
||||
}});
|
||||
b.addCommand({name:"selecttoend", exec:function(a) {
|
||||
a.editor.getSelection().selectFileEnd()
|
||||
}});
|
||||
b.addCommand({name:"gotoend", exec:function(a) {
|
||||
a.editor.navigateFileEnd()
|
||||
}});
|
||||
b.addCommand({name:"selectdown", exec:function(a) {
|
||||
a.editor.getSelection().selectDown()
|
||||
}});
|
||||
b.addCommand({name:"godown", exec:function(a) {
|
||||
a.editor.navigateDown()
|
||||
}});
|
||||
b.addCommand({name:"selectwordleft", exec:function(a) {
|
||||
a.editor.getSelection().selectWordLeft()
|
||||
}});
|
||||
b.addCommand({name:"gotowordleft", exec:function(a) {
|
||||
a.editor.navigateWordLeft()
|
||||
}});
|
||||
b.addCommand({name:"selecttolinestart", exec:function(a) {
|
||||
a.editor.getSelection().selectLineStart()
|
||||
}});
|
||||
b.addCommand({name:"gotolinestart", exec:function(a) {
|
||||
a.editor.navigateLineStart()
|
||||
}});
|
||||
b.addCommand({name:"selectleft", exec:function(a) {
|
||||
a.editor.getSelection().selectLeft()
|
||||
}});
|
||||
b.addCommand({name:"gotoleft", exec:function(a) {
|
||||
a.editor.navigateLeft()
|
||||
}});
|
||||
b.addCommand({name:"selectwordright", exec:function(a) {
|
||||
a.editor.getSelection().selectWordRight()
|
||||
}});
|
||||
b.addCommand({name:"gotowordright", exec:function(a) {
|
||||
a.editor.navigateWordRight()
|
||||
}});
|
||||
b.addCommand({name:"selecttolineend", exec:function(a) {
|
||||
a.editor.getSelection().selectLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"gotolineend", exec:function(a) {
|
||||
a.editor.navigateLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"selectright", exec:function(a) {
|
||||
a.editor.getSelection().selectRight()
|
||||
}});
|
||||
b.addCommand({name:"gotoright", exec:function(a) {
|
||||
a.editor.navigateRight()
|
||||
}});
|
||||
b.addCommand({name:"selectpagedown", exec:function(a) {
|
||||
a.editor.selectPageDown()
|
||||
}});
|
||||
b.addCommand({name:"pagedown", exec:function(a) {
|
||||
a.editor.scrollPageDown()
|
||||
}});
|
||||
b.addCommand({name:"gotopagedown", exec:function(a) {
|
||||
a.editor.gotoPageDown()
|
||||
}});
|
||||
b.addCommand({name:"selectpageup", exec:function(a) {
|
||||
a.editor.selectPageUp()
|
||||
}});
|
||||
b.addCommand({name:"pageup", exec:function(a) {
|
||||
a.editor.scrollPageUp()
|
||||
}});
|
||||
b.addCommand({name:"gotopageup", exec:function(a) {
|
||||
a.editor.gotoPageUp()
|
||||
}});
|
||||
b.addCommand({name:"selectlinestart", exec:function(a) {
|
||||
a.editor.getSelection().selectLineStart()
|
||||
}});
|
||||
b.addCommand({name:"gotolinestart", exec:function(a) {
|
||||
a.editor.navigateLineStart()
|
||||
}});
|
||||
b.addCommand({name:"selectlineend", exec:function(a) {
|
||||
a.editor.getSelection().selectLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"gotolineend", exec:function(a) {
|
||||
a.editor.navigateLineEnd()
|
||||
}});
|
||||
b.addCommand({name:"del", exec:function(a) {
|
||||
a.editor.removeRight()
|
||||
}});
|
||||
b.addCommand({name:"backspace", exec:function(a) {
|
||||
a.editor.removeLeft()
|
||||
}});
|
||||
b.addCommand({name:"outdent", exec:function(a) {
|
||||
a.editor.blockOutdent()
|
||||
}});
|
||||
b.addCommand({name:"indent", exec:function(a) {
|
||||
a.editor.indent()
|
||||
}})
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function() {
|
||||
return{selectall:"Command-A", removeline:"Command-D", gotoline:"Command-L", togglecomment:"Command-7", findnext:"Command-K", findprevious:"Command-Shift-K", find:"Command-F", replace:"Command-R", undo:"Command-Z", redo:"Command-Shift-Z|Command-Y", overwrite:"Insert", copylinesup:"Command-Option-Up", movelinesup:"Option-Up", selecttostart:"Command-Shift-Up", gotostart:"Command-Home|Command-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Command-Option-Down", movelinesdown:"Option-Down",
|
||||
define(function(b, a) {
|
||||
a.bindings = {selectall:"Command-A", removeline:"Command-D", gotoline:"Command-L", togglecomment:"Command-7", findnext:"Command-K", findprevious:"Command-Shift-K", find:"Command-F", replace:"Command-R", undo:"Command-Z", redo:"Command-Shift-Z|Command-Y", overwrite:"Insert", copylinesup:"Command-Option-Up", movelinesup:"Option-Up", selecttostart:"Command-Shift-Up", gotostart:"Command-Home|Command-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Command-Option-Down", movelinesdown:"Option-Down",
|
||||
selecttoend:"Command-Shift-Down", gotoend:"Command-End|Command-Down", selectdown:"Shift-Down", godown:"Down", selectwordleft:"Option-Shift-Left", gotowordleft:"Option-Left", selecttolinestart:"Command-Shift-Left", gotolinestart:"Command-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Option-Shift-Right", gotowordright:"Option-Right", selecttolineend:"Command-Shift-Right", gotolineend:"Command-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown",
|
||||
pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home", selectlineend:"Shift-End", del:"Delete", backspace:"Ctrl-Backspace|Command-Backspace|Option-Backspace|Backspace", outdent:"Shift-Tab", indent:"Tab"}
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function() {
|
||||
return{selectall:"Ctrl-A", removeline:"Ctrl-D", gotoline:"Ctrl-L", togglecomment:"Ctrl-7", findnext:"Ctrl-K", findprevious:"Ctrl-Shift-K", find:"Ctrl-F", replace:"Ctrl-R", undo:"Ctrl-Z", redo:"Ctrl-Shift-Z|Ctrl-Y", overwrite:"Insert", copylinesup:"Ctrl-Alt-Up", movelinesup:"Alt-Up", selecttostart:"Alt-Shift-Up", gotostart:"Ctrl-Home|Ctrl-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Ctrl-Alt-Down", movelinesdown:"Alt-Down", selecttoend:"Alt-Shift-Down", gotoend:"Ctrl-End|Ctrl-Down", selectdown:"Shift-Down",
|
||||
godown:"Down", selectwordleft:"Ctrl-Shift-Left", gotowordleft:"Ctrl-Left", selecttolinestart:"Alt-Shift-Left", gotolinestart:"Alt-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Ctrl-Shift-Right", gotowordright:"Ctrl-Right", selecttolineend:"Alt-Shift-Right", gotolineend:"Alt-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown", pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home", selectlineend:"Shift-End",
|
||||
del:"Delete", backspace:"Backspace", outdent:"Shift-Tab", indent:"Tab"}
|
||||
define(function(b, a) {
|
||||
a.bindings = {selectall:"Ctrl-A", removeline:"Ctrl-D", gotoline:"Ctrl-L", togglecomment:"Ctrl-7", findnext:"Ctrl-K", findprevious:"Ctrl-Shift-K", find:"Ctrl-F", replace:"Ctrl-R", undo:"Ctrl-Z", redo:"Ctrl-Shift-Z|Ctrl-Y", overwrite:"Insert", copylinesup:"Ctrl-Alt-Up", movelinesup:"Alt-Up", selecttostart:"Alt-Shift-Up", gotostart:"Ctrl-Home|Ctrl-Up", selectup:"Shift-Up", golineup:"Up", copylinesdown:"Ctrl-Alt-Down", movelinesdown:"Alt-Down", selecttoend:"Alt-Shift-Down", gotoend:"Ctrl-End|Ctrl-Down",
|
||||
selectdown:"Shift-Down", godown:"Down", selectwordleft:"Ctrl-Shift-Left", gotowordleft:"Ctrl-Left", selecttolinestart:"Alt-Shift-Left", gotolinestart:"Alt-Left|Home", selectleft:"Shift-Left", gotoleft:"Left", selectwordright:"Ctrl-Shift-Right", gotowordright:"Ctrl-Right", selecttolineend:"Alt-Shift-Right", gotolineend:"Alt-Right|End", selectright:"Shift-Right", gotoright:"Right", selectpagedown:"Shift-PageDown", pagedown:"PageDown", selectpageup:"Shift-PageUp", pageup:"PageUp", selectlinestart:"Shift-Home",
|
||||
selectlineend:"Shift-End", del:"Delete", backspace:"Backspace", outdent:"Shift-Tab", indent:"Tab"}
|
||||
});
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
define(function(g) {
|
||||
var l = g("./lib/oop"), j = g("./lib/lang"), m = g("./event_emitter"), n = g("./selection"), o = g("./mode/text"), h = g("./range");
|
||||
g = function(a, b) {
|
||||
define(function(i, l) {
|
||||
var m = i("pilot/oop"), k = i("pilot/lang"), n = i("pilot/event_emitter").EventEmitter, o = i("ace/selection").Selection, p = i("ace/mode/text").Mode, j = i("ace/range").Range;
|
||||
i = function(a, b) {
|
||||
this.modified = true;
|
||||
this.lines = [];
|
||||
this.selection = new n(this);
|
||||
this.selection = new o(this);
|
||||
this.$breakpoints = [];
|
||||
this.listeners = [];
|
||||
b && this.setMode(b);
|
||||
j.isArray(a) ? this.$insertLines(0, a) : this.$insert({row:0, column:0}, a)
|
||||
Array.isArray(a) ? this.$insertLines(0, a) : this.$insert({row:0, column:0}, a)
|
||||
};
|
||||
(function() {
|
||||
l.implement(this, m);
|
||||
m.implement(this, n);
|
||||
this.$undoManager = null;
|
||||
this.$split = function(a) {
|
||||
return a.split(/\r\n|\r|\n/)
|
||||
|
|
@ -29,7 +29,7 @@ define(function(g) {
|
|||
return this.selection
|
||||
};
|
||||
this.fireChangeEvent = function(a, b) {
|
||||
this.$dispatchEvent("change", {data:{firstRow:a, lastRow:b}})
|
||||
this._dispatchEvent("change", {data:{firstRow:a, lastRow:b}})
|
||||
};
|
||||
this.setUndoManager = function(a) {
|
||||
this.$undoManager = a;
|
||||
|
|
@ -37,7 +37,7 @@ define(function(g) {
|
|||
this.$informUndoManager && this.$informUndoManager.cancel();
|
||||
if(a) {
|
||||
var b = this;
|
||||
this.$informUndoManager = j.deferredCall(function() {
|
||||
this.$informUndoManager = k.deferredCall(function() {
|
||||
b.$deltas.length > 0 && a.execute({action:"aceupdate", args:[b.$deltas, b]});
|
||||
b.$deltas = []
|
||||
})
|
||||
|
|
@ -50,7 +50,7 @@ define(function(g) {
|
|||
return this.$undoManager || this.$defaultUndoManager
|
||||
};
|
||||
this.getTabString = function() {
|
||||
return this.getUseSoftTabs() ? j.stringRepeat(" ", this.getTabSize()) : "\t"
|
||||
return this.getUseSoftTabs() ? k.stringRepeat(" ", this.getTabSize()) : "\t"
|
||||
};
|
||||
this.$useSoftTabs = true;
|
||||
this.setUseSoftTabs = function(a) {
|
||||
|
|
@ -66,12 +66,15 @@ define(function(g) {
|
|||
if(!(isNaN(a) || this.$tabSize === a)) {
|
||||
this.modified = true;
|
||||
this.$tabSize = a;
|
||||
this.$dispatchEvent("changeTabSize")
|
||||
this._dispatchEvent("changeTabSize")
|
||||
}
|
||||
};
|
||||
this.getTabSize = function() {
|
||||
return this.$tabSize
|
||||
};
|
||||
this.isTabStop = function(a) {
|
||||
return this.$useSoftTabs && a.column % this.$tabSize == 0
|
||||
};
|
||||
this.getBreakpoints = function() {
|
||||
return this.$breakpoints
|
||||
};
|
||||
|
|
@ -79,19 +82,19 @@ define(function(g) {
|
|||
this.$breakpoints = [];
|
||||
for(var b = 0;b < a.length;b++) {
|
||||
this.$breakpoints[a[b]] = true
|
||||
}this.$dispatchEvent("changeBreakpoint", {})
|
||||
}this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.clearBreakpoints = function() {
|
||||
this.$breakpoints = [];
|
||||
this.$dispatchEvent("changeBreakpoint", {})
|
||||
this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.setBreakpoint = function(a) {
|
||||
this.$breakpoints[a] = true;
|
||||
this.$dispatchEvent("changeBreakpoint", {})
|
||||
this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.clearBreakpoint = function(a) {
|
||||
delete this.$breakpoints[a];
|
||||
this.$dispatchEvent("changeBreakpoint", {})
|
||||
this._dispatchEvent("changeBreakpoint", {})
|
||||
};
|
||||
this.$detectNewLine = function(a) {
|
||||
this.$autoNewLine = (a = a.match(/^.*?(\r?\n)/m)) ? a[1] : "\n"
|
||||
|
|
@ -112,7 +115,7 @@ define(function(g) {
|
|||
e++
|
||||
}for(b = b;b < c.length && c.charAt(b).match(d);) {
|
||||
b++
|
||||
}return new h(a, e, a, b)
|
||||
}return new j(a, e, a, b)
|
||||
};
|
||||
this.$getNewLineCharacter = function() {
|
||||
switch(this.$newLineMode) {
|
||||
|
|
@ -138,19 +141,19 @@ define(function(g) {
|
|||
this.setMode = function(a) {
|
||||
if(this.$mode !== a) {
|
||||
this.$mode = a;
|
||||
this.$dispatchEvent("changeMode")
|
||||
this._dispatchEvent("changeMode")
|
||||
}
|
||||
};
|
||||
this.getMode = function() {
|
||||
if(!this.$mode) {
|
||||
this.$mode = new o
|
||||
this.$mode = new p
|
||||
}return this.$mode
|
||||
};
|
||||
this.$scrollTop = 0;
|
||||
this.setScrollTopRow = function(a) {
|
||||
if(this.$scrollTop !== a) {
|
||||
this.$scrollTop = a;
|
||||
this.$dispatchEvent("changeScrollTop")
|
||||
this._dispatchEvent("changeScrollTop")
|
||||
}
|
||||
};
|
||||
this.getScrollTopRow = function() {
|
||||
|
|
@ -162,7 +165,7 @@ define(function(g) {
|
|||
};
|
||||
this.getScreenWidth = function() {
|
||||
this.$computeWidth();
|
||||
return this.screenWith
|
||||
return this.screenWidth
|
||||
};
|
||||
this.$computeWidth = function() {
|
||||
if(this.modified) {
|
||||
|
|
@ -170,13 +173,13 @@ define(function(g) {
|
|||
for(var a = this.lines, b = 0, c = 0, d = this.getTabSize(), e = 0;e < a.length;e++) {
|
||||
var f = a[e].length;
|
||||
b = Math.max(b, f);
|
||||
a[e].replace("\t", function(i) {
|
||||
a[e].replace("\t", function(g) {
|
||||
f += d - 1;
|
||||
return i
|
||||
return g
|
||||
});
|
||||
c = Math.max(c, f)
|
||||
}this.width = b;
|
||||
this.screenWith = c
|
||||
this.screenWidth = c
|
||||
}
|
||||
};
|
||||
this.getLine = function(a) {
|
||||
|
|
@ -220,14 +223,14 @@ define(function(g) {
|
|||
b = b.row;
|
||||
for(var e = 1, f = this.getLine(b);;) {
|
||||
for(;d >= 0;) {
|
||||
var i = f.charAt(d);
|
||||
if(i == c) {
|
||||
var g = f.charAt(d);
|
||||
if(g == c) {
|
||||
e -= 1;
|
||||
if(e == 0) {
|
||||
return{row:b, column:d}
|
||||
}
|
||||
}else {
|
||||
if(i == a) {
|
||||
if(g == a) {
|
||||
e += 1
|
||||
}
|
||||
}d -= 1
|
||||
|
|
@ -241,21 +244,21 @@ define(function(g) {
|
|||
this.$findClosingBracket = function(a, b) {
|
||||
var c = this.$brackets[a], d = b.column;
|
||||
b = b.row;
|
||||
for(var e = 1, f = this.getLine(b), i = this.getLength();;) {
|
||||
for(var e = 1, f = this.getLine(b), g = this.getLength();;) {
|
||||
for(;d < f.length;) {
|
||||
var k = f.charAt(d);
|
||||
if(k == c) {
|
||||
var h = f.charAt(d);
|
||||
if(h == c) {
|
||||
e -= 1;
|
||||
if(e == 0) {
|
||||
return{row:b, column:d}
|
||||
}
|
||||
}else {
|
||||
if(k == a) {
|
||||
if(h == a) {
|
||||
e += 1
|
||||
}
|
||||
}d += 1
|
||||
}b += 1;
|
||||
if(b >= i) {
|
||||
if(b >= g) {
|
||||
break
|
||||
}f = this.getLine(b);
|
||||
d = 0
|
||||
|
|
@ -266,6 +269,26 @@ define(function(g) {
|
|||
this.fireChangeEvent(a.row, a.row == b.row ? a.row : undefined);
|
||||
return b
|
||||
};
|
||||
this.multiRowInsert = function(a, b, c) {
|
||||
for(var d = this.lines, e = a.length - 1;e >= 0;e--) {
|
||||
var f = a[e];
|
||||
if(!(f >= d.length)) {
|
||||
var g = b - d[f].length;
|
||||
if(g > 0) {
|
||||
var h = k.stringRepeat(" ", g) + c;
|
||||
g = -g
|
||||
}else {
|
||||
h = c;
|
||||
g = 0
|
||||
}h = this.$insert({row:f, column:b + g}, h, false)
|
||||
}
|
||||
}if(h) {
|
||||
this.fireChangeEvent(a[0], a[a.length - 1] + h.row - a[0]);
|
||||
return{rows:h.row - a[0], columns:h.column - b}
|
||||
}else {
|
||||
return{rows:0, columns:0}
|
||||
}
|
||||
};
|
||||
this.$insertLines = function(a, b, c) {
|
||||
if(b.length != 0) {
|
||||
var d = [a, 0];
|
||||
|
|
@ -273,7 +296,7 @@ define(function(g) {
|
|||
this.lines.splice.apply(this.lines, d);
|
||||
if(!c && this.$undoManager) {
|
||||
c = this.$getNewLineCharacter();
|
||||
this.$deltas.push({action:"insertText", range:new h(a, 0, a + b.length, 0), text:b.join(c) + c});
|
||||
this.$deltas.push({action:"insertText", range:new j(a, 0, a + b.length, 0), text:b.join(c) + c});
|
||||
this.$informUndoManager.schedule()
|
||||
}
|
||||
}
|
||||
|
|
@ -304,7 +327,7 @@ define(function(g) {
|
|||
d = {row:a.row + d.length - 1, column:d[d.length - 1].length}
|
||||
}
|
||||
}if(!c && this.$undoManager) {
|
||||
this.$deltas.push({action:"insertText", range:h.fromPoints(a, d), text:b});
|
||||
this.$deltas.push({action:"insertText", range:j.fromPoints(a, d), text:b});
|
||||
this.$informUndoManager.schedule()
|
||||
}return d
|
||||
};
|
||||
|
|
@ -318,6 +341,18 @@ define(function(g) {
|
|||
this.fireChangeEvent(a.start.row, a.isMultiLine() ? undefined : a.start.row);
|
||||
return a.start
|
||||
};
|
||||
this.multiRowRemove = function(a, b) {
|
||||
if(b.start.row !== a[0]) {
|
||||
throw new TypeError("range must start in the first row!");
|
||||
}for(var c = b.end.row - a[0], d = a.length - 1;d >= 0;d--) {
|
||||
var e = a[d];
|
||||
if(!(e >= this.lines.length)) {
|
||||
var f = this.$remove(new j(e, b.start.column, e + c, b.end.column), false)
|
||||
}
|
||||
}if(f) {
|
||||
c < 0 ? this.fireChangeEvent(a[0] + c, undefined) : this.fireChangeEvent(a[0], c == 0 ? a[a.length - 1] : undefined)
|
||||
}
|
||||
};
|
||||
this.$remove = function(a, b) {
|
||||
if(!a.isEmpty()) {
|
||||
if(!b && this.$undoManager) {
|
||||
|
|
@ -364,33 +399,33 @@ define(function(g) {
|
|||
this.fireChangeEvent(a.start.row, c == b.row ? c : undefined);
|
||||
return b
|
||||
};
|
||||
this.indentRows = function(a, b) {
|
||||
b.replace("\t", this.getTabString());
|
||||
for(var c = a.start.row;c <= a.end.row;c++) {
|
||||
this.$insert({row:c, column:0}, b)
|
||||
}this.fireChangeEvent(a.start.row, a.end.row);
|
||||
return b.length
|
||||
this.indentRows = function(a, b, c) {
|
||||
c = c.replace("\t", this.getTabString());
|
||||
for(var d = a;d <= b;d++) {
|
||||
this.$insert({row:d, column:0}, c)
|
||||
}this.fireChangeEvent(a, b);
|
||||
return c.length
|
||||
};
|
||||
this.outdentRows = function(a) {
|
||||
for(var b = new h(0, 0, 0, 0), c = this.getTabSize(), d = a.start.row;d <= a.end.row;++d) {
|
||||
var e = this.getLine(d);
|
||||
b.start.row = d;
|
||||
b.end.row = d;
|
||||
for(var f = 0;f < c;++f) {
|
||||
if(e.charAt(f) != " ") {
|
||||
for(var b = a.collapseRows(), c = new j(0, 0, 0, 0), d = this.getTabSize(), e = b.start.row;e <= b.end.row;++e) {
|
||||
var f = this.getLine(e);
|
||||
c.start.row = e;
|
||||
c.end.row = e;
|
||||
for(var g = 0;g < d;++g) {
|
||||
if(f.charAt(g) != " ") {
|
||||
break
|
||||
}
|
||||
}if(f < c && e.charAt(f) == "\t") {
|
||||
b.start.column = f;
|
||||
b.end.column = f + 1
|
||||
}if(g < d && f.charAt(g) == "\t") {
|
||||
c.start.column = g;
|
||||
c.end.column = g + 1
|
||||
}else {
|
||||
b.start.column = 0;
|
||||
b.end.column = f
|
||||
}if(d == a.start.row) {
|
||||
a.start.column -= b.end.column - b.start.column
|
||||
}if(d == a.end.row) {
|
||||
a.end.column -= b.end.column - b.start.column
|
||||
}this.$remove(b)
|
||||
c.start.column = 0;
|
||||
c.end.column = g
|
||||
}if(e == a.start.row) {
|
||||
a.start.column -= c.end.column - c.start.column
|
||||
}if(e == a.end.row) {
|
||||
a.end.column -= c.end.column - c.start.column
|
||||
}this.$remove(c)
|
||||
}this.fireChangeEvent(a.start.row, a.end.row);
|
||||
return a
|
||||
};
|
||||
|
|
@ -398,7 +433,7 @@ define(function(g) {
|
|||
if(a <= 0) {
|
||||
return 0
|
||||
}var c = this.lines.slice(a, b + 1);
|
||||
this.$remove(new h(a, 0, b + 1, 0));
|
||||
this.$remove(new j(a - 1, this.lines[a - 1].length, b, this.lines[b].length));
|
||||
this.$insertLines(a - 1, c);
|
||||
this.fireChangeEvent(a - 1, b);
|
||||
return-1
|
||||
|
|
@ -407,7 +442,7 @@ define(function(g) {
|
|||
if(b >= this.lines.length - 1) {
|
||||
return 0
|
||||
}var c = this.lines.slice(a, b + 1);
|
||||
this.$remove(new h(a, 0, b + 1, 0));
|
||||
this.$remove(new j(a, 0, b + 1, 0));
|
||||
this.$insertLines(a + 1, c);
|
||||
this.fireChangeEvent(a, b + 1);
|
||||
return 1
|
||||
|
|
@ -454,6 +489,6 @@ define(function(g) {
|
|||
}
|
||||
}return d
|
||||
}
|
||||
}).call(g.prototype);
|
||||
return g
|
||||
}).call(i.prototype);
|
||||
l.Document = i
|
||||
});
|
||||
3972
build/ace/editor.js
|
|
@ -1,29 +0,0 @@
|
|||
define(function(d) {
|
||||
var e = d("./lib/lang");
|
||||
d = {};
|
||||
d.$dispatchEvent = function(a, b) {
|
||||
this.$eventRegistry = this.$eventRegistry || {};
|
||||
var c = this.$eventRegistry[a];
|
||||
if(c && c.length) {
|
||||
b = b || {};
|
||||
b.type = a;
|
||||
for(a = 0;a < c.length;a++) {
|
||||
c[a](b)
|
||||
}
|
||||
}
|
||||
};
|
||||
d.on = d.addEventListener = function(a, b) {
|
||||
this.$eventRegistry = this.$eventRegistry || {};
|
||||
var c = this.$eventRegistry[a];
|
||||
c || (c = this.$eventRegistry[a] = []);
|
||||
e.arrayIndexOf(c, b) == -1 && c.push(b)
|
||||
};
|
||||
d.removeEventListener = function(a, b) {
|
||||
this.$eventRegistry = this.$eventRegistry || {};
|
||||
if(a = this.$eventRegistry[a]) {
|
||||
b = e.arrayIndexOf(a, b);
|
||||
b !== -1 && a.splice(b, 1)
|
||||
}
|
||||
};
|
||||
return d
|
||||
});
|
||||
|
|
@ -1,56 +1,55 @@
|
|||
define(function(e) {
|
||||
var m = e("./lib/core"), l = e("./lib/event"), n = e("./conf/keybindings/default_mac"), o = e("./conf/keybindings/default_win"), p = e("./plugin_manager");
|
||||
e("./commands/default_commands");
|
||||
e = function(j, h, k) {
|
||||
this.setConfig(k);
|
||||
var a = this;
|
||||
l.addKeyListener(j, function(b) {
|
||||
var c = (a.config.reverse[0 | (b.ctrlKey ? 1 : 0) | (b.altKey ? 2 : 0) | (b.shiftKey ? 4 : 0) | (b.metaKey ? 8 : 0)] || {})[(a.keyNames[b.keyCode] || String.fromCharCode(b.keyCode)).toLowerCase()];
|
||||
if(c = p.commands[c]) {
|
||||
c(h, h.getSelection());
|
||||
return l.stopEvent(b)
|
||||
define(function(e, n) {
|
||||
var j = e("pilot/useragent"), m = e("pilot/event"), o = e("ace/conf/keybindings/default_mac").bindings, p = e("ace/conf/keybindings/default_win").bindings, q = e("pilot/canon");
|
||||
e("ace/commands/default_commands");
|
||||
e = function(k, i, l) {
|
||||
this.setConfig(l);
|
||||
var b = this;
|
||||
m.addKeyListener(k, function(a) {
|
||||
var d = (b.config.reverse[j.isOpera && j.isMac ? 0 | (a.metaKey ? 1 : 0) | (a.altKey ? 2 : 0) | (a.shiftKey ? 4 : 0) | (a.ctrlKey ? 8 : 0) : 0 | (a.ctrlKey ? 1 : 0) | (a.altKey ? 2 : 0) | (a.shiftKey ? 4 : 0) | (a.metaKey ? 8 : 0)] || {})[(b.keyNames[a.keyCode] || String.fromCharCode(a.keyCode)).toLowerCase()];
|
||||
if(q.exec(d, {editor:i})) {
|
||||
return m.stopEvent(a)
|
||||
}
|
||||
})
|
||||
};
|
||||
(function() {
|
||||
function j(a, b, c, f) {
|
||||
return(f && a.toLowerCase() || a).replace(/(?:^\s+|\n|\s+$)/g, "").split(new RegExp("[\\s ]*" + b + "[\\s ]*", "g"), c || 999)
|
||||
function k(b, a, d, f) {
|
||||
return(f && b.toLowerCase() || b).replace(/(?:^\s+|\n|\s+$)/g, "").split(new RegExp("[\\s ]*" + a + "[\\s ]*", "g"), d || 999)
|
||||
}
|
||||
function h(a, b, c) {
|
||||
function i(b, a, d) {
|
||||
var f, g = 0;
|
||||
a = j(a, "\\-", null, true);
|
||||
for(var d = 0, i = a.length;d < i;++d) {
|
||||
if(this.keyMods[a[d]]) {
|
||||
g |= this.keyMods[a[d]]
|
||||
b = k(b, "\\-", null, true);
|
||||
for(var c = 0, h = b.length;c < h;++c) {
|
||||
if(this.keyMods[b[c]]) {
|
||||
g |= this.keyMods[b[c]]
|
||||
}else {
|
||||
f = a[d] || "-"
|
||||
f = b[c] || "-"
|
||||
}
|
||||
}(c[g] || (c[g] = {}))[f] = b;
|
||||
return c
|
||||
}(d[g] || (d[g] = {}))[f] = a;
|
||||
return d
|
||||
}
|
||||
function k(a, b) {
|
||||
var c, f, g, d, i = {};
|
||||
for(c in a) {
|
||||
d = a[c];
|
||||
if(b && typeof d == "string") {
|
||||
d = d.split(b);
|
||||
function l(b, a) {
|
||||
var d, f, g, c, h = {};
|
||||
for(d in b) {
|
||||
c = b[d];
|
||||
if(a && typeof c == "string") {
|
||||
c = c.split(a);
|
||||
f = 0;
|
||||
for(g = d.length;f < g;++f) {
|
||||
h.call(this, d[f], c, i)
|
||||
for(g = c.length;f < g;++f) {
|
||||
i.call(this, c[f], d, h)
|
||||
}
|
||||
}else {
|
||||
h.call(this, d, c, i)
|
||||
i.call(this, c, d, h)
|
||||
}
|
||||
}return i
|
||||
}return h
|
||||
}
|
||||
this.keyMods = {ctrl:1, alt:2, option:2, shift:4, meta:8, command:8};
|
||||
this.keyNames = {"8":"Backspace", "9":"Tab", "13":"Enter", "27":"Esc", "32":"Space", "33":"PageUp", "34":"PageDown", "35":"End", "36":"Home", "37":"Left", "38":"Up", "39":"Right", "40":"Down", "45":"Insert", "46":"Delete", "107":"+", "112":"F1", "113":"F2", "114":"F3", "115":"F4", "116":"F5", "117":"F6", "118":"F7", "119":"F8", "120":"F9", "121":"F10", "122":"F11", "123":"F12"};
|
||||
this.setConfig = function(a) {
|
||||
this.config = a || (m.isMac ? n : o);
|
||||
this.setConfig = function(b) {
|
||||
this.config = b || (j.isMac ? o : p);
|
||||
if(typeof this.config.reverse == "undefined") {
|
||||
this.config.reverse = k.call(this, this.config, "|")
|
||||
this.config.reverse = l.call(this, this.config, "|")
|
||||
}
|
||||
}
|
||||
}).call(e.prototype);
|
||||
return e
|
||||
n.KeyBinding = e
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function(b) {
|
||||
var d = b("../lib/dom");
|
||||
define(function(b, f) {
|
||||
var d = b("pilot/dom");
|
||||
b = function(a) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_cursor-layer";
|
||||
|
|
@ -59,5 +59,5 @@ define(function(b) {
|
|||
}
|
||||
}
|
||||
}).call(b.prototype);
|
||||
return b
|
||||
f.Cursor = b
|
||||
});
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
define(function() {
|
||||
var d = function(a) {
|
||||
define(function(d, e) {
|
||||
var f = d("pilot/dom");
|
||||
d = function(a) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_gutter-layer";
|
||||
a.appendChild(this.element);
|
||||
|
|
@ -22,9 +23,9 @@ define(function() {
|
|||
for(var b = [], c = a.firstRow;c <= a.lastRow;c++) {
|
||||
b.push("<div class='ace_gutter-cell", this.$decorations[c] || "", this.$breakpoints[c] ? " ace_breakpoint" : "", "' style='height:", a.lineHeight, "px;'>", c + 1, "</div>");
|
||||
b.push("</div>")
|
||||
}this.element.innerHTML = b.join("");
|
||||
}this.element = f.setInnerHtml(this.element, b.join(""));
|
||||
this.element.style.height = a.minHeight + "px"
|
||||
}
|
||||
}).call(d.prototype);
|
||||
return d
|
||||
e.Gutter = d
|
||||
});
|
||||
|
|
@ -1,72 +1,74 @@
|
|||
define(function(h) {
|
||||
var i = h("../range");
|
||||
h = function(c) {
|
||||
define(function(h, j) {
|
||||
var i = h("ace/range").Range, k = h("pilot/dom");
|
||||
h = function(d) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_marker-layer";
|
||||
c.appendChild(this.element);
|
||||
d.appendChild(this.element);
|
||||
this.markers = {};
|
||||
this.$markerId = 1
|
||||
};
|
||||
(function() {
|
||||
this.setDocument = function(c) {
|
||||
this.doc = c
|
||||
this.setDocument = function(d) {
|
||||
this.doc = d
|
||||
};
|
||||
this.addMarker = function(c, a, e) {
|
||||
this.addMarker = function(d, a, e) {
|
||||
var b = this.$markerId++;
|
||||
this.markers[b] = {range:c, type:e || "line", clazz:a};
|
||||
this.markers[b] = {range:d, type:e || "line", clazz:a};
|
||||
return b
|
||||
};
|
||||
this.removeMarker = function(c) {
|
||||
this.markers[c] && delete this.markers[c]
|
||||
this.removeMarker = function(d) {
|
||||
this.markers[d] && delete this.markers[d]
|
||||
};
|
||||
this.update = function(c) {
|
||||
if(c = c || this.config) {
|
||||
this.config = c;
|
||||
this.update = function(d) {
|
||||
if(d = d || this.config) {
|
||||
this.config = d;
|
||||
var a = [];
|
||||
for(var e in this.markers) {
|
||||
var b = this.markers[e], d = b.range.clipRows(c.firstRow, c.lastRow);
|
||||
if(!d.isEmpty()) {
|
||||
if(d.isMultiLine()) {
|
||||
b.type == "text" ? this.drawTextMarker(a, d, b.clazz, c) : this.drawMultiLineMarker(a, d, b.clazz, c)
|
||||
var b = this.markers[e], c = b.range.clipRows(d.firstRow, d.lastRow);
|
||||
if(!c.isEmpty()) {
|
||||
if(c.isMultiLine()) {
|
||||
b.type == "text" ? this.drawTextMarker(a, c, b.clazz, d) : this.drawMultiLineMarker(a, c, b.clazz, d)
|
||||
}else {
|
||||
this.drawSingleLineMarker(a, d, b.clazz, c)
|
||||
this.drawSingleLineMarker(a, c, b.clazz, d)
|
||||
}
|
||||
}
|
||||
}this.element.innerHTML = a.join("")
|
||||
}this.element = k.setInnerHtml(this.element, a.join(""))
|
||||
}
|
||||
};
|
||||
this.drawTextMarker = function(c, a, e, b) {
|
||||
var d = a.start.row, f = new i(d, a.start.column, d, this.doc.getLine(d).length);
|
||||
this.drawSingleLineMarker(c, f, e, b);
|
||||
d = a.end.row;
|
||||
f = new i(d, 0, d, a.end.column);
|
||||
this.drawSingleLineMarker(c, f, e, b);
|
||||
for(d = a.start.row + 1;d < a.end.row;d++) {
|
||||
f.start.row = d;
|
||||
f.end.row = d;
|
||||
f.end.column = this.doc.getLine(d).length;
|
||||
this.drawSingleLineMarker(c, f, e, b)
|
||||
this.drawTextMarker = function(d, a, e, b) {
|
||||
var c = a.start.row, f = new i(c, a.start.column, c, this.doc.getLine(c).length);
|
||||
this.drawSingleLineMarker(d, f, e, b, 1);
|
||||
c = a.end.row;
|
||||
f = new i(c, 0, c, a.end.column);
|
||||
this.drawSingleLineMarker(d, f, e, b);
|
||||
for(c = a.start.row + 1;c < a.end.row;c++) {
|
||||
f.start.row = c;
|
||||
f.end.row = c;
|
||||
f.end.column = this.doc.getLine(c).length;
|
||||
this.drawSingleLineMarker(d, f, e, b, 1)
|
||||
}
|
||||
};
|
||||
this.drawMultiLineMarker = function(c, a, e, b) {
|
||||
this.drawMultiLineMarker = function(d, a, e, b) {
|
||||
a = a.toScreenRange(this.doc);
|
||||
var d = b.lineHeight, f = Math.round(b.width - a.start.column * b.characterWidth), g = (a.start.row - b.firstRow) * b.lineHeight, j = Math.round(a.start.column * b.characterWidth);
|
||||
c.push("<div class='", e, "' style='", "height:", d, "px;", "width:", f, "px;", "top:", g, "px;", "left:", j, "px;'></div>");
|
||||
var c = b.lineHeight, f = Math.round(b.width - a.start.column * b.characterWidth), g = (a.start.row - b.firstRow) * b.lineHeight, l = Math.round(a.start.column * b.characterWidth);
|
||||
d.push("<div class='", e, "' style='", "height:", c, "px;", "width:", f, "px;", "top:", g, "px;", "left:", l, "px;'></div>");
|
||||
g = (a.end.row - b.firstRow) * b.lineHeight;
|
||||
f = Math.round(a.end.column * b.characterWidth);
|
||||
c.push("<div class='", e, "' style='", "height:", d, "px;", "top:", g, "px;", "width:", f, "px;'></div>");
|
||||
d = (a.end.row - a.start.row - 1) * b.lineHeight;
|
||||
if(!(d < 0)) {
|
||||
d.push("<div class='", e, "' style='", "height:", c, "px;", "top:", g, "px;", "width:", f, "px;'></div>");
|
||||
c = (a.end.row - a.start.row - 1) * b.lineHeight;
|
||||
if(!(c < 0)) {
|
||||
g = (a.start.row + 1 - b.firstRow) * b.lineHeight;
|
||||
c.push("<div class='", e, "' style='", "height:", d, "px;", "width:", b.width, "px;", "top:", g, "px;'></div>")
|
||||
d.push("<div class='", e, "' style='", "height:", c, "px;", "width:", b.width, "px;", "top:", g, "px;'></div>")
|
||||
}
|
||||
};
|
||||
this.drawSingleLineMarker = function(c, a, e, b) {
|
||||
this.drawSingleLineMarker = function(d, a, e, b, c) {
|
||||
a = a.toScreenRange(this.doc);
|
||||
var d = b.lineHeight, f = Math.round((a.end.column - a.start.column) * b.characterWidth), g = (a.start.row - b.firstRow) * b.lineHeight;
|
||||
var f = b.lineHeight;
|
||||
c = Math.round((a.end.column + (c || 0) - a.start.column) * b.characterWidth);
|
||||
var g = (a.start.row - b.firstRow) * b.lineHeight;
|
||||
a = Math.round(a.start.column * b.characterWidth);
|
||||
c.push("<div class='", e, "' style='", "height:", d, "px;", "width:", f, "px;", "top:", g, "px;", "left:", a, "px;'></div>")
|
||||
d.push("<div class='", e, "' style='", "height:", f, "px;", "width:", c, "px;", "top:", g, "px;", "left:", a, "px;'></div>")
|
||||
}
|
||||
}).call(h.prototype);
|
||||
return h
|
||||
j.Marker = h
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function(k) {
|
||||
var m = k("../lib/oop"), n = k("../lib/dom"), o = k("../event_emitter");
|
||||
define(function(k, n) {
|
||||
var o = k("pilot/oop"), l = k("pilot/dom"), p = k("pilot/lang"), q = k("pilot/event_emitter").EventEmitter;
|
||||
k = function(a) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_layer ace_text-layer";
|
||||
|
|
@ -8,7 +8,7 @@ define(function(k) {
|
|||
this.$pollSizeChanges()
|
||||
};
|
||||
(function() {
|
||||
m.implement(this, o);
|
||||
o.implement(this, q);
|
||||
this.EOF_CHAR = "¶";
|
||||
this.EOL_CHAR = "¬";
|
||||
this.TAB_CHAR = "→";
|
||||
|
|
@ -28,37 +28,41 @@ define(function(k) {
|
|||
var b = a.$measureSizes();
|
||||
if(a.$characterSize.width !== b.width || a.$characterSize.height !== b.height) {
|
||||
a.$characterSize = b;
|
||||
a.$dispatchEvent("changeCharaterSize", {data:b})
|
||||
a._dispatchEvent("changeCharaterSize", {data:b})
|
||||
}
|
||||
}, 500)
|
||||
};
|
||||
this.$fontStyles = {fontFamily:1, fontSize:1, fontWeight:1, fontStyle:1, lineHeight:1};
|
||||
this.$measureSizes = function() {
|
||||
var a = document.createElement("div"), b = a.style;
|
||||
b.width = b.height = "auto";
|
||||
b.left = b.top = "-1000px";
|
||||
b.visibility = "hidden";
|
||||
b.position = "absolute";
|
||||
b.overflow = "visible";
|
||||
if(!this.$measureNode) {
|
||||
var a = this.$measureNode = document.createElement("div"), b = a.style;
|
||||
b.width = b.height = "auto";
|
||||
b.left = b.top = "-1000px";
|
||||
b.visibility = "hidden";
|
||||
b.position = "absolute";
|
||||
b.overflow = "visible";
|
||||
b.whiteSpace = "nowrap";
|
||||
a.innerHTML = p.stringRepeat("Xy", 1E3);
|
||||
document.body.insertBefore(a, document.body.firstChild)
|
||||
}b = this.$measureNode.style;
|
||||
for(var e in this.$fontStyles) {
|
||||
var f = n.computedStyle(this.element, e);
|
||||
b[e] = f
|
||||
}a.innerHTML = (new Array(1E3)).join("Xy");
|
||||
document.body.insertBefore(a, document.body.firstChild);
|
||||
b = {height:a.offsetHeight, width:a.offsetWidth / 2E3};
|
||||
document.body.removeChild(a);
|
||||
return b
|
||||
a = l.computedStyle(this.element, e);
|
||||
b[e] = a
|
||||
}return{height:this.$measureNode.offsetHeight, width:this.$measureNode.offsetWidth / 2E3}
|
||||
};
|
||||
this.setDocument = function(a) {
|
||||
this.doc = a
|
||||
};
|
||||
this.$showInvisibles = false;
|
||||
this.showInvisibles = false;
|
||||
this.setShowInvisibles = function(a) {
|
||||
this.$showInvisibles = a
|
||||
if(this.showInvisibles == a) {
|
||||
return false
|
||||
}this.showInvisibles = a;
|
||||
return true
|
||||
};
|
||||
this.$computeTabString = function() {
|
||||
var a = this.doc.getTabSize();
|
||||
if(this.$showInvisibles) {
|
||||
if(this.showInvisibles) {
|
||||
a = a / 2;
|
||||
this.$tabString = "<span class='ace_invisible'>" + (new Array(Math.floor(a))).join(" ") + this.TAB_CHAR + (new Array(Math.ceil(a) + 1)).join(" ") + "</span>"
|
||||
}else {
|
||||
|
|
@ -68,31 +72,31 @@ define(function(k) {
|
|||
this.updateLines = function(a, b, e) {
|
||||
this.$computeTabString();
|
||||
this.config = a;
|
||||
var f = Math.max(b, a.firstRow), c = Math.min(e, a.lastRow), d = this.element.childNodes, h = this;
|
||||
this.tokenizer.getTokens(f, c, function(i) {
|
||||
for(var g = f;g <= c;g++) {
|
||||
var j = d[g - a.firstRow];
|
||||
var g = Math.max(b, a.firstRow), c = Math.min(e, a.lastRow), d = this.element.childNodes, h = this;
|
||||
this.tokenizer.getTokens(g, c, function(i) {
|
||||
for(var f = g;f <= c;f++) {
|
||||
var j = d[f - a.firstRow];
|
||||
if(j) {
|
||||
var l = [];
|
||||
h.$renderLine(l, g, i[g - f].tokens);
|
||||
j.innerHTML = l.join("")
|
||||
var m = [];
|
||||
h.$renderLine(m, f, i[f - g].tokens);
|
||||
l.setInnerHtml(j, m.join)
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
this.scrollLines = function(a) {
|
||||
function b(i) {
|
||||
a.firstRow < c.firstRow ? f.$renderLinesFragment(a, a.firstRow, c.firstRow - 1, function(g) {
|
||||
d.firstChild ? d.insertBefore(g, d.firstChild) : d.appendChild(g);
|
||||
a.firstRow < c.firstRow ? g.$renderLinesFragment(a, a.firstRow, c.firstRow - 1, function(f) {
|
||||
d.firstChild ? d.insertBefore(f, d.firstChild) : d.appendChild(f);
|
||||
i()
|
||||
}) : i()
|
||||
}
|
||||
function e() {
|
||||
a.lastRow > c.lastRow && f.$renderLinesFragment(a, c.lastRow + 1, a.lastRow, function(i) {
|
||||
a.lastRow > c.lastRow && g.$renderLinesFragment(a, c.lastRow + 1, a.lastRow, function(i) {
|
||||
d.appendChild(i)
|
||||
})
|
||||
}
|
||||
var f = this;
|
||||
var g = this;
|
||||
this.$computeTabString();
|
||||
var c = this.config;
|
||||
this.config = a;
|
||||
|
|
@ -111,48 +115,48 @@ define(function(k) {
|
|||
}
|
||||
}b(e)
|
||||
};
|
||||
this.$renderLinesFragment = function(a, b, e, f) {
|
||||
this.$renderLinesFragment = function(a, b, e, g) {
|
||||
var c = document.createDocumentFragment(), d = this;
|
||||
this.tokenizer.getTokens(b, e, function(h) {
|
||||
for(var i = b;i <= e;i++) {
|
||||
var g = document.createElement("div");
|
||||
g.className = "ace_line";
|
||||
var j = g.style;
|
||||
var f = document.createElement("div");
|
||||
f.className = "ace_line";
|
||||
var j = f.style;
|
||||
j.height = d.$characterSize.height + "px";
|
||||
j.width = a.width + "px";
|
||||
j = [];
|
||||
d.$renderLine(j, i, h[i - b].tokens);
|
||||
g.innerHTML = j.join("");
|
||||
c.appendChild(g)
|
||||
}f(c)
|
||||
f.innerHTML = j.join("");
|
||||
c.appendChild(f)
|
||||
}g(c)
|
||||
})
|
||||
};
|
||||
this.update = function(a) {
|
||||
this.$computeTabString();
|
||||
this.config = a;
|
||||
var b = [], e = this;
|
||||
this.tokenizer.getTokens(a.firstRow, a.lastRow, function(f) {
|
||||
this.tokenizer.getTokens(a.firstRow, a.lastRow, function(g) {
|
||||
for(var c = a.firstRow;c <= a.lastRow;c++) {
|
||||
b.push("<div class='ace_line' style='height:" + e.$characterSize.height + "px;", "width:", a.width, "px'>");
|
||||
e.$renderLine(b, c, f[c - a.firstRow].tokens);
|
||||
e.$renderLine(b, c, g[c - a.firstRow].tokens);
|
||||
b.push("</div>")
|
||||
}e.element.innerHTML = b.join("")
|
||||
}e.element = l.setInnerHtml(e.element, b.join(""))
|
||||
})
|
||||
};
|
||||
this.$textToken = {text:true, rparen:true, lparen:true};
|
||||
this.$renderLine = function(a, b, e) {
|
||||
for(var f = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g, c = 0;c < e.length;c++) {
|
||||
var d = e[c], h = d.value.replace(/&/g, "&").replace(/</g, "<").replace(f, " ").replace(/\t/g, this.$tabString);
|
||||
for(var g = /[\v\f \u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]/g, c = 0;c < e.length;c++) {
|
||||
var d = e[c], h = d.value.replace(/&/g, "&").replace(/</g, "<").replace(g, " ").replace(/\t/g, this.$tabString);
|
||||
if(this.$textToken[d.type]) {
|
||||
a.push(h)
|
||||
}else {
|
||||
d = "ace_" + d.type.replace(/\./g, " ace_");
|
||||
a.push("<span class='", d, "'>", h, "</span>")
|
||||
}
|
||||
}if(this.$showInvisibles) {
|
||||
}if(this.showInvisibles) {
|
||||
b !== this.doc.getLength() - 1 ? a.push("<span class='ace_invisible'>" + this.EOL_CHAR + "</span>") : a.push("<span class='ace_invisible'>" + this.EOF_CHAR + "</span>")
|
||||
}
|
||||
}
|
||||
}).call(k.prototype);
|
||||
return k
|
||||
n.Text = k
|
||||
});
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
define(function() {
|
||||
var a = {}, d = (navigator.platform.match(/mac|win|linux/i) || ["other"])[0].toLowerCase();
|
||||
a.isWin = d == "win";
|
||||
a.isMac = d == "mac";
|
||||
a.isLinux = d == "linux";
|
||||
a.isIE = !+"\u000b1";
|
||||
a.isGecko = window.controllers && window.navigator.product === "Gecko";
|
||||
a.provide = function(b) {
|
||||
b = b.split(".");
|
||||
for(var c = window, e = 0;e < b.length;e++) {
|
||||
var f = b[e];
|
||||
c[f] || (c[f] = {});
|
||||
c = c[f]
|
||||
}
|
||||
};
|
||||
return a
|
||||
});
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
define(function() {
|
||||
var c = {};
|
||||
c.inherits = function(a, b) {
|
||||
var d = function() {
|
||||
};
|
||||
d.prototype = b.prototype;
|
||||
a.super_ = b.prototype;
|
||||
a.prototype = new d;
|
||||
a.prototype.constructor = a
|
||||
};
|
||||
c.mixin = function(a, b) {
|
||||
for(var d in b) {
|
||||
a[d] = b[d]
|
||||
}
|
||||
};
|
||||
c.implement = function(a, b) {
|
||||
c.mixin(a, b)
|
||||
};
|
||||
return c
|
||||
});
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
define("ace/mode/css_highlight_rules", ["require", "exports", "module", "../lib/oop", "../lib/lang", "./text_highlight_rules"], function(b) {
|
||||
var j = b("../lib/oop"), c = b("../lib/lang");
|
||||
b = b("./text_highlight_rules");
|
||||
define("ace/mode/css_highlight_rules", ["require", "exports", "module", "pilot/oop", "pilot/lang", "ace/mode/text_highlight_rules"], function(b, j) {
|
||||
var k = b("pilot/oop"), c = b("pilot/lang");
|
||||
b = b("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var e = function() {
|
||||
function a(d) {
|
||||
var l = [];
|
||||
var m = [];
|
||||
d = d.split("");
|
||||
for(var k = 0;k < d.length;k++) {
|
||||
l.push("[", d[k].toLowerCase(), d[k].toUpperCase(), "]")
|
||||
}return l.join("")
|
||||
for(var l = 0;l < d.length;l++) {
|
||||
m.push("[", d[l].toLowerCase(), d[l].toUpperCase(), "]")
|
||||
}return m.join("")
|
||||
}
|
||||
var f = c.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")),
|
||||
g = c.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")), h = c.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")),
|
||||
|
|
@ -19,11 +19,11 @@ define("ace/mode/css_highlight_rules", ["require", "exports", "module", "../lib/
|
|||
return f[d.toLowerCase()] ? "support.type" : g[d.toLowerCase()] ? "support.function" : h[d.toLowerCase()] ? "support.constant" : i[d.toLowerCase()] ? "support.constant.color" : "text"
|
||||
}, regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
j.inherits(e, b);
|
||||
return e
|
||||
k.inherits(e, b);
|
||||
j.CssHighlightRules = e
|
||||
});
|
||||
define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../range"], function(b) {
|
||||
var j = b("../range");
|
||||
define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(b, j) {
|
||||
var k = b("ace/range").Range;
|
||||
b = function() {
|
||||
};
|
||||
(function() {
|
||||
|
|
@ -41,7 +41,7 @@ define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../r
|
|||
if(!f || f.row == e) {
|
||||
return 0
|
||||
}f = this.$getIndent(c.getLine(f.row));
|
||||
c.replace(new j(e, 0, e, a - 1), f);
|
||||
c.replace(new k(e, 0, e, a - 1), f);
|
||||
return f.length - (a - 1)
|
||||
};
|
||||
this.$getIndent = function(c) {
|
||||
|
|
@ -50,15 +50,15 @@ define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../r
|
|||
}return""
|
||||
}
|
||||
}).call(b.prototype);
|
||||
return b
|
||||
j.MatchingBraceOutdent = b
|
||||
});
|
||||
define("ace/mode/css", ["require", "exports", "module", "../lib/oop", "./text", "../tokenizer", "./css_highlight_rules", "./matching_brace_outdent"], function(b) {
|
||||
var j = b("../lib/oop"), c = b("./text"), e = b("../tokenizer"), a = b("./css_highlight_rules"), f = b("./matching_brace_outdent");
|
||||
define("ace/mode/css", ["require", "exports", "module", "pilot/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/css_highlight_rules", "ace/mode/matching_brace_outdent"], function(b, j) {
|
||||
var k = b("pilot/oop"), c = b("ace/mode/text").Mode, e = b("ace/tokenizer").Tokenizer, a = b("ace/mode/css_highlight_rules").CssHighlightRules, f = b("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
|
||||
b = function() {
|
||||
this.$tokenizer = new e((new a).getRules());
|
||||
this.$outdent = new f
|
||||
};
|
||||
j.inherits(b, c);
|
||||
k.inherits(b, c);
|
||||
(function() {
|
||||
this.getNextLineIndent = function(g, h, i) {
|
||||
var d = this.$getIndent(h);
|
||||
|
|
@ -76,5 +76,5 @@ define("ace/mode/css", ["require", "exports", "module", "../lib/oop", "./text",
|
|||
return this.$outdent.autoOutdent(h, i)
|
||||
}
|
||||
}).call(b.prototype);
|
||||
return b
|
||||
j.Mode = b
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
define(function(c) {
|
||||
var h = c("../lib/oop"), d = c("../lib/lang");
|
||||
c = c("./text_highlight_rules");
|
||||
define(function(c, h) {
|
||||
var i = c("pilot/oop"), d = c("pilot/lang");
|
||||
c = c("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var g = function() {
|
||||
function a(b) {
|
||||
var f = [];
|
||||
|
|
@ -9,16 +9,16 @@ define(function(c) {
|
|||
f.push("[", b[e].toLowerCase(), b[e].toUpperCase(), "]")
|
||||
}return f.join("")
|
||||
}
|
||||
var i = d.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")),
|
||||
j = d.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")), k = d.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")),
|
||||
l = d.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|"));
|
||||
var j = d.arrayToMap("azimuth|background-attachment|background-color|background-image|background-position|background-repeat|background|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|-moz-border-radius|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|position|quotes|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|stress|table-layout|text-align|text-decoration|text-indent|text-shadow|text-transform|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-spacing|z-index".split("|")),
|
||||
k = d.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")), l = d.arrayToMap("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|super|sw-resize|table-footer-group|table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|zero".split("|")),
|
||||
m = d.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("em")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ex")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("px")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" +
|
||||
a("cm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("mm")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("in")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pt")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("pc")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("deg")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" +
|
||||
a("rad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("grad")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("ms")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("s")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("hz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))" + a("khz")}, {token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))%"},
|
||||
{token:"constant.numeric", regex:"\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{6}"}, {token:"constant.numeric", regex:"#[a-fA-F0-9]{3}"}, {token:"lparen", regex:"{"}, {token:"rparen", regex:"}"}, {token:function(b) {
|
||||
return i[b.toLowerCase()] ? "support.type" : j[b.toLowerCase()] ? "support.function" : k[b.toLowerCase()] ? "support.constant" : l[b.toLowerCase()] ? "support.constant.color" : "text"
|
||||
return j[b.toLowerCase()] ? "support.type" : k[b.toLowerCase()] ? "support.function" : l[b.toLowerCase()] ? "support.constant" : m[b.toLowerCase()] ? "support.constant.color" : "text"
|
||||
}, regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
h.inherits(g, c);
|
||||
return g
|
||||
i.inherits(g, c);
|
||||
h.CssHighlightRules = g
|
||||
});
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
define(function(a) {
|
||||
var c = a("../lib/oop");
|
||||
a = a("./text_highlight_rules");
|
||||
define(function(a, c) {
|
||||
var d = a("pilot/oop");
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"comment.doc", regex:"\\*\\/", next:"start"}, {token:"comment.doc.tag", regex:"@[\\w\\d_]+"}, {token:"comment.doc", regex:"s+"}, {token:"comment.doc", regex:"[^@\\*]+"}, {token:"comment.doc", regex:"."}]}
|
||||
this.$rules = {start:[{token:"comment.doc", regex:"\\*\\/", next:"start"}, {token:"comment.doc.tag", regex:"@[\\w\\d_]+"}, {token:"comment.doc", regex:"s+"}, {token:"comment.doc", regex:"TODO"}, {token:"comment.doc", regex:"[^@\\*]+"}, {token:"comment.doc", regex:"."}]}
|
||||
};
|
||||
c.inherits(b, a);
|
||||
d.inherits(b, a);
|
||||
(function() {
|
||||
this.getStartRule = function(d) {
|
||||
return{token:"comment.doc", regex:"\\/\\*(?=\\*)", next:d}
|
||||
this.getStartRule = function(e) {
|
||||
return{token:"comment.doc", regex:"\\/\\*(?=\\*)", next:e}
|
||||
}
|
||||
}).call(b.prototype);
|
||||
return b
|
||||
c.DocCommentHighlightRules = b
|
||||
});
|
||||
|
|
@ -1,33 +1,33 @@
|
|||
define("ace/mode/html_highlight_rules", ["require", "exports", "module", "../lib/oop", "./css_highlight_rules", "./javascript_highlight_rules", "./text_highlight_rules"], function(a) {
|
||||
var f = a("../lib/oop"), g = a("./css_highlight_rules"), h = a("./javascript_highlight_rules");
|
||||
a = a("./text_highlight_rules");
|
||||
define("ace/mode/html_highlight_rules", ["require", "exports", "module", "pilot/oop", "ace/mode/css_highlight_rules", "ace/mode/javascript_highlight_rules", "ace/mode/text_highlight_rules"], function(a, f) {
|
||||
var g = a("pilot/oop"), h = a("ace/mode/css_highlight_rules").CssHighlightRules, i = a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var d = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<(?=s*script)", next:"script"}, {token:"text", regex:"<(?=s*style)", next:"css"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], script:[{token:"text", regex:">", next:"js-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"},
|
||||
{token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], css:[{token:"text", regex:">", next:"css-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", next:"start"},
|
||||
{token:"text", regex:"\\s+"}, {token:"text", regex:".+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]};
|
||||
this.addRules((new h).getRules(), "js-");
|
||||
this.addRules((new i).getRules(), "js-");
|
||||
this.$rules["js-start"].unshift({token:"comment", regex:"\\/\\/.*(?=<\\/script>)", next:"tag"}, {token:"text", regex:"<\\/(?=script)", next:"tag"});
|
||||
this.addRules((new g).getRules(), "css-");
|
||||
this.addRules((new h).getRules(), "css-");
|
||||
this.$rules["css-start"].unshift({token:"text", regex:"<\\/(?=style)", next:"tag"})
|
||||
};
|
||||
f.inherits(d, a);
|
||||
return d
|
||||
g.inherits(d, a);
|
||||
f.HtmlHighlightRules = d
|
||||
});
|
||||
define("ace/mode/html", ["require", "exports", "module", "../lib/oop", "./text", "./javascript", "./css", "../tokenizer", "./html_highlight_rules"], function(a) {
|
||||
var f = a("../lib/oop"), g = a("./text"), h = a("./javascript"), d = a("./css"), k = a("../tokenizer"), l = a("./html_highlight_rules");
|
||||
define("ace/mode/html", ["require", "exports", "module", "pilot/oop", "ace/mode/text", "ace/mode/javascript", "ace/mode/css", "ace/tokenizer", "ace/mode/html_highlight_rules"], function(a, f) {
|
||||
var g = a("pilot/oop"), h = a("ace/mode/text").Mode, i = a("ace/mode/javascript").Mode, d = a("ace/mode/css").Mode, l = a("ace/tokenizer").Tokenizer, m = a("ace/mode/html_highlight_rules").HtmlHighlightRules;
|
||||
a = function() {
|
||||
this.$tokenizer = new k((new l).getRules());
|
||||
this.$js = new h;
|
||||
this.$tokenizer = new l((new m).getRules());
|
||||
this.$js = new i;
|
||||
this.$css = new d
|
||||
};
|
||||
f.inherits(a, g);
|
||||
g.inherits(a, h);
|
||||
(function() {
|
||||
this.toggleCommentLines = function() {
|
||||
return this.$delegate("toggleCommentLines", arguments, function() {
|
||||
return 0
|
||||
})
|
||||
};
|
||||
this.getNextLineIndent = function(i, b) {
|
||||
this.getNextLineIndent = function(j, b) {
|
||||
var e = this;
|
||||
return this.$delegate("getNextLineIndent", arguments, function() {
|
||||
return e.$getIndent(b)
|
||||
|
|
@ -41,17 +41,17 @@ define("ace/mode/html", ["require", "exports", "module", "../lib/oop", "./text",
|
|||
this.autoOutdent = function() {
|
||||
return this.$delegate("autoOutdent", arguments)
|
||||
};
|
||||
this.$delegate = function(i, b, e) {
|
||||
var j = b[0], c = j.split("js-");
|
||||
this.$delegate = function(j, b, e) {
|
||||
var k = b[0], c = k.split("js-");
|
||||
if(!c[0] && c[1]) {
|
||||
b[0] = c[1];
|
||||
return this.$js[i].apply(this.$js, b)
|
||||
}c = j.split("css-");
|
||||
return this.$js[j].apply(this.$js, b)
|
||||
}c = k.split("css-");
|
||||
if(!c[0] && c[1]) {
|
||||
b[0] = c[1];
|
||||
return this.$css[i].apply(this.$css, b)
|
||||
return this.$css[j].apply(this.$css, b)
|
||||
}return e ? e() : undefined
|
||||
}
|
||||
}).call(a.prototype);
|
||||
return a
|
||||
f.Mode = a
|
||||
});
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
define(function(a) {
|
||||
var c = a("../lib/oop"), d = a("./css_highlight_rules"), e = a("./javascript_highlight_rules");
|
||||
a = a("./text_highlight_rules");
|
||||
define(function(a, c) {
|
||||
var d = a("pilot/oop"), e = a("ace/mode/css_highlight_rules").CssHighlightRules, f = a("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<(?=s*script)", next:"script"}, {token:"text", regex:"<(?=s*style)", next:"css"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], script:[{token:"text", regex:">", next:"js-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"},
|
||||
{token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], css:[{token:"text", regex:">", next:"css-start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>", next:"start"},
|
||||
{token:"text", regex:"\\s+"}, {token:"text", regex:".+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]};
|
||||
this.addRules((new e).getRules(), "js-");
|
||||
this.addRules((new f).getRules(), "js-");
|
||||
this.$rules["js-start"].unshift({token:"comment", regex:"\\/\\/.*(?=<\\/script>)", next:"tag"}, {token:"text", regex:"<\\/(?=script)", next:"tag"});
|
||||
this.addRules((new d).getRules(), "css-");
|
||||
this.addRules((new e).getRules(), "css-");
|
||||
this.$rules["css-start"].unshift({token:"text", regex:"<\\/(?=style)", next:"tag"})
|
||||
};
|
||||
c.inherits(b, a);
|
||||
return b
|
||||
d.inherits(b, a);
|
||||
c.HtmlHighlightRules = b
|
||||
});
|
||||
|
|
@ -1,61 +1,59 @@
|
|||
define(function(f) {
|
||||
var h = f("../lib/oop"), i = f("./text"), j = f("../tokenizer"), k = f("./javascript_highlight_rules"), l = f("./matching_brace_outdent"), m = f("../range");
|
||||
define(function(f, h) {
|
||||
var i = f("pilot/oop"), j = f("ace/mode/text").Mode, k = f("ace/tokenizer").Tokenizer, l = f("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules, m = f("ace/mode/matching_brace_outdent").MatchingBraceOutdent, n = f("ace/range").Range;
|
||||
f = function() {
|
||||
this.$tokenizer = new j((new k).getRules());
|
||||
this.$outdent = new l
|
||||
this.$tokenizer = new k((new l).getRules());
|
||||
this.$outdent = new m
|
||||
};
|
||||
h.inherits(f, i);
|
||||
i.inherits(f, j);
|
||||
(function() {
|
||||
this.toggleCommentLines = function(c, d, e) {
|
||||
var a = true;
|
||||
this.toggleCommentLines = function(c, a, d, g) {
|
||||
var e = true;
|
||||
c = /^(\s*)\/\//;
|
||||
for(var b = e.start.row;b <= e.end.row;b++) {
|
||||
if(!c.test(d.getLine(b))) {
|
||||
a = false;
|
||||
for(var b = d;b <= g;b++) {
|
||||
if(!c.test(a.getLine(b))) {
|
||||
e = false;
|
||||
break
|
||||
}
|
||||
}if(a) {
|
||||
a = new m(0, 0, 0, 0);
|
||||
for(b = e.start.row;b <= e.end.row;b++) {
|
||||
var g = d.getLine(b).replace(c, "$1");
|
||||
a.start.row = b;
|
||||
a.end.row = b;
|
||||
a.end.column = g.length + 2;
|
||||
d.replace(a, g)
|
||||
}if(e) {
|
||||
e = new n(0, 0, 0, 0);
|
||||
for(b = d;b <= g;b++) {
|
||||
d = a.getLine(b).replace(c, "$1");
|
||||
e.start.row = b;
|
||||
e.end.row = b;
|
||||
e.end.column = d.length + 2;
|
||||
a.replace(e, d)
|
||||
}return-2
|
||||
}else {
|
||||
return d.indentRows(e, "//")
|
||||
return a.indentRows(d, g, "//")
|
||||
}
|
||||
};
|
||||
this.getNextLineIndent = function(c, d, e) {
|
||||
var a = this.$getIndent(d), b = this.$tokenizer.getLineTokens(d, c), g = b.tokens;
|
||||
b = b.state;
|
||||
if(g.length && g[g.length - 1].type == "comment") {
|
||||
return a
|
||||
this.getNextLineIndent = function(c, a, d) {
|
||||
var g = this.$getIndent(a), e = this.$tokenizer.getLineTokens(a, c), b = e.tokens;
|
||||
e = e.state;
|
||||
if(b.length && b[b.length - 1].type == "comment") {
|
||||
return g
|
||||
}if(c == "start") {
|
||||
if(c = d.match(/^.*[\{\(\[]\s*$/)) {
|
||||
a += e
|
||||
if(c = a.match(/^.*[\{\(\[]\s*$/)) {
|
||||
g += d
|
||||
}
|
||||
}else {
|
||||
if(c == "doc-start") {
|
||||
if(b == "start") {
|
||||
if(e == "start") {
|
||||
return""
|
||||
}if(c = d.match(/^\s*(\/?)\*/)) {
|
||||
}if(c = a.match(/^\s*(\/?)\*/)) {
|
||||
if(c[1]) {
|
||||
a += " "
|
||||
}a += "* "
|
||||
}if(c[1]) {
|
||||
a += " "
|
||||
}a += "* "
|
||||
g += " "
|
||||
}g += "* "
|
||||
}
|
||||
}
|
||||
}return a
|
||||
}return g
|
||||
};
|
||||
this.checkOutdent = function(c, d, e) {
|
||||
return this.$outdent.checkOutdent(d, e)
|
||||
this.checkOutdent = function(c, a, d) {
|
||||
return this.$outdent.checkOutdent(a, d)
|
||||
};
|
||||
this.autoOutdent = function(c, d, e) {
|
||||
return this.$outdent.autoOutdent(d, e)
|
||||
this.autoOutdent = function(c, a, d) {
|
||||
return this.$outdent.autoOutdent(a, d)
|
||||
}
|
||||
}).call(f.prototype);
|
||||
return f
|
||||
h.Mode = f
|
||||
});
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
define(function(a) {
|
||||
var e = a("../lib/oop"), c = a("../lib/lang"), f = a("./doc_comment_highlight_rules");
|
||||
a = a("./text_highlight_rules");
|
||||
define(function(a, e) {
|
||||
var f = a("pilot/oop"), c = a("pilot/lang"), g = a("ace/mode/doc_comment_highlight_rules").DocCommentHighlightRules;
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
JavaScriptHighlightRules = function() {
|
||||
var d = new f, g = c.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")), h = c.arrayToMap("true|false|null|undefined|Infinity|NaN|undefined".split("|")), i = c.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));
|
||||
var d = new g, h = c.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|var|while|with".split("|")), i = c.arrayToMap("null|Infinity|NaN|undefined".split("|")), j = c.arrayToMap("class|enum|extends|super|const|export|import|implements|let|private|public|yield|interface|package|protected|static".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"\\/\\/.*$"}, d.getStartRule("doc-start"), {token:"comment", regex:"\\/\\*", next:"comment"}, {token:"string.regexp", regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).,;]|$)"}, {token:"string", regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'}, {token:"string", regex:'["].*\\\\$', next:"qqstring"}, {token:"string", regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"}, {token:"string", regex:"['].*\\\\$", next:"qstring"}, {token:"constant.numeric",
|
||||
regex:"0[xX][0-9a-fA-F]+\\b"}, {token:"constant.numeric", regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, {token:function(b) {
|
||||
return b == "this" ? "variable.language" : g[b] ? "keyword" : h[b] ? "constant.language" : i[b] ? "invalid.illegal" : b == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
}, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(in|instanceof|new|delete|typeof|void)"}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}], qqstring:[{token:"string", regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
||||
regex:"0[xX][0-9a-fA-F]+\\b"}, {token:"constant.numeric", regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, {token:"constant.language.boolean", regex:"(?:true|false)\\b"}, {token:function(b) {
|
||||
return b == "this" ? "variable.language" : h[b] ? "keyword" : i[b] ? "constant.language" : j[b] ? "invalid.illegal" : b == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
}, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"}, {token:"lparen", regex:"[[({]"}, {token:"rparen", regex:"[\\])}]"}, {token:"text", regex:"\\s+"}], comment:[{token:"comment", regex:".*?\\*\\/", next:"start"}, {token:"comment", regex:".+"}], qqstring:[{token:"string", regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
|
||||
next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next:"start"}, {token:"string", regex:".+"}]};
|
||||
this.addRules(d.getRules(), "doc-");
|
||||
this.$rules["doc-start"][0].next = "start"
|
||||
};
|
||||
e.inherits(JavaScriptHighlightRules, a);
|
||||
return JavaScriptHighlightRules
|
||||
f.inherits(JavaScriptHighlightRules, a);
|
||||
e.JavaScriptHighlightRules = JavaScriptHighlightRules
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function(e) {
|
||||
var f = e("../range");
|
||||
define(function(e, f) {
|
||||
var g = e("ace/range").Range;
|
||||
e = function() {
|
||||
};
|
||||
(function() {
|
||||
|
|
@ -17,7 +17,7 @@ define(function(e) {
|
|||
if(!d || d.row == b) {
|
||||
return 0
|
||||
}d = this.$getIndent(a.getLine(d.row));
|
||||
a.replace(new f(b, 0, b, c - 1), d);
|
||||
a.replace(new g(b, 0, b, c - 1), d);
|
||||
return d.length - (c - 1)
|
||||
};
|
||||
this.$getIndent = function(a) {
|
||||
|
|
@ -26,5 +26,5 @@ define(function(e) {
|
|||
}return""
|
||||
}
|
||||
}).call(e.prototype);
|
||||
return e
|
||||
f.MatchingBraceOutdent = e
|
||||
});
|
||||
48
build/ace/mode/php.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
define(function(d, h) {
|
||||
var i = d("pilot/oop"), j = d("./text").Mode, k = d("../tokenizer").Tokenizer, l = d("./php_highlight_rules").PhpHighlightRules, m = d("./matching_brace_outdent").MatchingBraceOutdent, n = d("../range").Range;
|
||||
d = function() {
|
||||
this.$tokenizer = new k((new l).getRules());
|
||||
this.$outdent = new m
|
||||
};
|
||||
i.inherits(d, j);
|
||||
(function() {
|
||||
this.toggleCommentLines = function(f, a, b, g) {
|
||||
var c = true;
|
||||
f = /^(\s*)#/;
|
||||
for(var e = b;e <= g;e++) {
|
||||
if(!f.test(a.getLine(e))) {
|
||||
c = false;
|
||||
break
|
||||
}
|
||||
}if(c) {
|
||||
c = new n(0, 0, 0, 0);
|
||||
for(e = b;e <= g;e++) {
|
||||
b = a.getLine(e).replace(f, "$1");
|
||||
c.start.row = e;
|
||||
c.end.row = e;
|
||||
c.end.column = b.length + 2;
|
||||
a.replace(c, b)
|
||||
}return-2
|
||||
}else {
|
||||
return a.indentRows(b, g, "#")
|
||||
}
|
||||
};
|
||||
this.getNextLineIndent = function(f, a, b) {
|
||||
var g = this.$getIndent(a), c = this.$tokenizer.getLineTokens(a, f).tokens;
|
||||
if(c.length && c[c.length - 1].type == "comment") {
|
||||
return g
|
||||
}if(f == "start") {
|
||||
if(a.match(/^.*[\{\(\[\:]\s*$/)) {
|
||||
g += b
|
||||
}
|
||||
}return g
|
||||
};
|
||||
this.checkOutdent = function(f, a, b) {
|
||||
return this.$outdent.checkOutdent(a, b)
|
||||
};
|
||||
this.autoOutdent = function(f, a, b) {
|
||||
return this.$outdent.autoOutdent(a, b)
|
||||
}
|
||||
}).call(d.prototype);
|
||||
h.Mode = d
|
||||
});
|
||||
46
build/ace/mode/php_highlight_rules.js
Normal file
|
|
@ -1,20 +1,20 @@
|
|||
define("ace/mode/python_highlight_rules", ["require", "exports", "module", "../lib/oop", "../lib/lang", "./text_highlight_rules"], function(a) {
|
||||
var k = a("../lib/oop"), b = a("../lib/lang");
|
||||
a = a("./text_highlight_rules");
|
||||
define("ace/mode/python_highlight_rules", ["require", "exports", "module", "pilot/oop", "pilot/lang", "./text_highlight_rules"], function(a, l) {
|
||||
var m = a("pilot/oop"), b = a("pilot/lang");
|
||||
a = a("./text_highlight_rules").TextHighlightRules;
|
||||
PythonHighlightRules = function() {
|
||||
var f = b.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), i = b.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), j = b.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),
|
||||
l = b.arrayToMap("".split("|"));
|
||||
var f = b.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), h = b.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), i = b.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),
|
||||
n = b.arrayToMap("".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"#.*$"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}(?:(?:.)|(?:^"{3}))*?"{3}'}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}.*$', next:"qqstring"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}(?:(?:.)|(?:^'{3}))*?'{3}"}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}.*$", next:"qstring"}, {token:"string",
|
||||
regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"}, {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"},
|
||||
{token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"}, {token:function(c) {
|
||||
return f[c] ? "keyword" : i[c] ? "constant.language" : l[c] ? "invalid.illegal" : j[c] ? "support.function" : c == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
return f[c] ? "keyword" : h[c] ? "constant.language" : n[c] ? "invalid.illegal" : i[c] ? "support.function" : c == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
}, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], qqstring:[{token:"string", regex:'(?:^"{3})*?"{3}', next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:^'{3})*?'{3}", next:"start"}, {token:"string", regex:".+"}]}
|
||||
};
|
||||
k.inherits(PythonHighlightRules, a);
|
||||
return PythonHighlightRules
|
||||
m.inherits(PythonHighlightRules, a);
|
||||
l.PythonHighlightRules = PythonHighlightRules
|
||||
});
|
||||
define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../range"], function(a) {
|
||||
var k = a("../range");
|
||||
define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(a, l) {
|
||||
var m = a("ace/range").Range;
|
||||
a = function() {
|
||||
};
|
||||
(function() {
|
||||
|
|
@ -24,16 +24,16 @@ define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../r
|
|||
}return/^\s*\}/.test(f)
|
||||
};
|
||||
this.autoOutdent = function(b, f) {
|
||||
var i = b.getLine(f).match(/^(\s*\})/);
|
||||
if(!i) {
|
||||
var h = b.getLine(f).match(/^(\s*\})/);
|
||||
if(!h) {
|
||||
return 0
|
||||
}i = i[1].length;
|
||||
var j = b.findMatchingBracket({row:f, column:i});
|
||||
if(!j || j.row == f) {
|
||||
}h = h[1].length;
|
||||
var i = b.findMatchingBracket({row:f, column:h});
|
||||
if(!i || i.row == f) {
|
||||
return 0
|
||||
}j = this.$getIndent(b.getLine(j.row));
|
||||
b.replace(new k(f, 0, f, i - 1), j);
|
||||
return j.length - (i - 1)
|
||||
}i = this.$getIndent(b.getLine(i.row));
|
||||
b.replace(new m(f, 0, f, h - 1), i);
|
||||
return i.length - (h - 1)
|
||||
};
|
||||
this.$getIndent = function(b) {
|
||||
if(b = b.match(/^(\s+)/)) {
|
||||
|
|
@ -41,53 +41,53 @@ define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "../r
|
|||
}return""
|
||||
}
|
||||
}).call(a.prototype);
|
||||
return a
|
||||
l.MatchingBraceOutdent = a
|
||||
});
|
||||
define("ace/mode/python", ["require", "exports", "module", "../lib/oop", "./text", "../tokenizer", "./python_highlight_rules", "./matching_brace_outdent", "../range"], function(a) {
|
||||
var k = a("../lib/oop"), b = a("./text"), f = a("../tokenizer"), i = a("./python_highlight_rules"), j = a("./matching_brace_outdent"), l = a("../range");
|
||||
define("ace/mode/python", ["require", "exports", "module", "pilot/oop", "./text", "../tokenizer", "./python_highlight_rules", "./matching_brace_outdent", "../range"], function(a, l) {
|
||||
var m = a("pilot/oop"), b = a("./text").Mode, f = a("../tokenizer").Tokenizer, h = a("./python_highlight_rules").PythonHighlightRules, i = a("./matching_brace_outdent").MatchingBraceOutdent, n = a("../range").Range;
|
||||
a = function() {
|
||||
this.$tokenizer = new f((new i).getRules());
|
||||
this.$outdent = new j
|
||||
this.$tokenizer = new f((new h).getRules());
|
||||
this.$outdent = new i
|
||||
};
|
||||
k.inherits(a, b);
|
||||
m.inherits(a, b);
|
||||
(function() {
|
||||
this.toggleCommentLines = function(c, e, g) {
|
||||
var h = true;
|
||||
this.toggleCommentLines = function(c, d, e, k) {
|
||||
var g = true;
|
||||
c = /^(\s*)#/;
|
||||
for(var d = g.start.row;d <= g.end.row;d++) {
|
||||
if(!c.test(e.getLine(d))) {
|
||||
h = false;
|
||||
for(var j = e;j <= k;j++) {
|
||||
if(!c.test(d.getLine(j))) {
|
||||
g = false;
|
||||
break
|
||||
}
|
||||
}if(h) {
|
||||
h = new l(0, 0, 0, 0);
|
||||
for(d = g.start.row;d <= g.end.row;d++) {
|
||||
var m = e.getLine(d).replace(c, "$1");
|
||||
h.start.row = d;
|
||||
h.end.row = d;
|
||||
h.end.column = m.length + 2;
|
||||
e.replace(h, m)
|
||||
}if(g) {
|
||||
g = new n(0, 0, 0, 0);
|
||||
for(j = e;j <= k;j++) {
|
||||
e = d.getLine(j).replace(c, "$1");
|
||||
g.start.row = j;
|
||||
g.end.row = j;
|
||||
g.end.column = e.length + 2;
|
||||
d.replace(g, e)
|
||||
}return-2
|
||||
}else {
|
||||
return e.indentRows(g, "#")
|
||||
return d.indentRows(e, k, "#")
|
||||
}
|
||||
};
|
||||
this.getNextLineIndent = function(c, e, g) {
|
||||
var h = this.$getIndent(e), d = this.$tokenizer.getLineTokens(e, c).tokens;
|
||||
if(d.length && d[d.length - 1].type == "comment") {
|
||||
return h
|
||||
this.getNextLineIndent = function(c, d, e) {
|
||||
var k = this.$getIndent(d), g = this.$tokenizer.getLineTokens(d, c).tokens;
|
||||
if(g.length && g[g.length - 1].type == "comment") {
|
||||
return k
|
||||
}if(c == "start") {
|
||||
if(e.match(/^.*[\{\(\[\:]\s*$/)) {
|
||||
h += g
|
||||
if(d.match(/^.*[\{\(\[\:]\s*$/)) {
|
||||
k += e
|
||||
}
|
||||
}return h
|
||||
}return k
|
||||
};
|
||||
this.checkOutdent = function(c, e, g) {
|
||||
return this.$outdent.checkOutdent(e, g)
|
||||
this.checkOutdent = function(c, d, e) {
|
||||
return this.$outdent.checkOutdent(d, e)
|
||||
};
|
||||
this.autoOutdent = function(c, e, g) {
|
||||
return this.$outdent.autoOutdent(e, g)
|
||||
this.autoOutdent = function(c, d, e) {
|
||||
return this.$outdent.autoOutdent(d, e)
|
||||
}
|
||||
}).call(a.prototype);
|
||||
return a
|
||||
l.Mode = a
|
||||
});
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
define(function(a) {
|
||||
var d = a("../lib/oop"), c = a("../lib/lang");
|
||||
a = a("./text_highlight_rules");
|
||||
define(function(a, d) {
|
||||
var e = a("pilot/oop"), c = a("pilot/lang");
|
||||
a = a("./text_highlight_rules").TextHighlightRules;
|
||||
PythonHighlightRules = function() {
|
||||
var e = c.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), f = c.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), g = c.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),
|
||||
h = c.arrayToMap("".split("|"));
|
||||
var f = c.arrayToMap("and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield".split("|")), g = c.arrayToMap("True|False|None|NotImplemented|Ellipsis|__debug__".split("|")), h = c.arrayToMap("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern".split("|")),
|
||||
i = c.arrayToMap("".split("|"));
|
||||
this.$rules = {start:[{token:"comment", regex:"#.*$"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}(?:(?:.)|(?:^"{3}))*?"{3}'}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"{3}.*$', next:"qqstring"}, {token:"string", regex:'(?:(?:[rubRUB])|(?:[ubUB][rR]))?"(?:(?:\\\\.)|(?:[^"\\\\]))*?"'}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}(?:(?:.)|(?:^'{3}))*?'{3}"}, {token:"string", regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'{3}.*$", next:"qstring"}, {token:"string",
|
||||
regex:"(?:(?:[rubRUB])|(?:[ubUB][rR]))?'(?:(?:\\\\.)|(?:[^'\\\\]))*?'"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))|\\d+)[jJ]\\b"}, {token:"constant.numeric", regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"}, {token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))[lL]\\b"},
|
||||
{token:"constant.numeric", regex:"(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"}, {token:function(b) {
|
||||
return e[b] ? "keyword" : f[b] ? "constant.language" : h[b] ? "invalid.illegal" : g[b] ? "support.function" : b == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
return f[b] ? "keyword" : g[b] ? "constant.language" : i[b] ? "invalid.illegal" : h[b] ? "support.function" : b == "debugger" ? "invalid.deprecated" : "identifier"
|
||||
}, regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}, {token:"keyword.operator", regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="}, {token:"lparen", regex:"[\\[\\(\\{]"}, {token:"rparen", regex:"[\\]\\)\\}]"}, {token:"text", regex:"\\s+"}], qqstring:[{token:"string", regex:'(?:^"{3})*?"{3}', next:"start"}, {token:"string", regex:".+"}], qstring:[{token:"string", regex:"(?:^'{3})*?'{3}", next:"start"}, {token:"string", regex:".+"}]}
|
||||
};
|
||||
d.inherits(PythonHighlightRules, a);
|
||||
return PythonHighlightRules
|
||||
e.inherits(PythonHighlightRules, a);
|
||||
d.PythonHighlightRules = PythonHighlightRules
|
||||
});
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
define(function(a) {
|
||||
var c = a("../tokenizer"), d = a("./text_highlight_rules");
|
||||
define(function(a, c) {
|
||||
var d = a("ace/tokenizer").Tokenizer, e = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
a = function() {
|
||||
this.$tokenizer = new c((new d).getRules())
|
||||
this.$tokenizer = new d((new e).getRules())
|
||||
};
|
||||
(function() {
|
||||
this.getTokenizer = function() {
|
||||
|
|
@ -24,5 +24,5 @@ define(function(a) {
|
|||
}return""
|
||||
}
|
||||
}).call(a.prototype);
|
||||
return a
|
||||
c.Mode = a
|
||||
});
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
define(function() {
|
||||
var f = function() {
|
||||
define(function(a, h) {
|
||||
a = function() {
|
||||
this.$rules = {start:[{token:"text", regex:".+"}]}
|
||||
};
|
||||
(function() {
|
||||
this.addRules = function(g, a) {
|
||||
for(var b in g) {
|
||||
for(var c = g[b], d = 0;d < c.length;d++) {
|
||||
var e = c[d];
|
||||
e.next = e.next ? a + e.next : a + b
|
||||
}this.$rules[a + b] = c
|
||||
this.addRules = function(g, b) {
|
||||
for(var c in g) {
|
||||
for(var d = g[c], e = 0;e < d.length;e++) {
|
||||
var f = d[e];
|
||||
f.next = f.next ? b + f.next : b + c
|
||||
}this.$rules[b + c] = d
|
||||
}
|
||||
};
|
||||
this.getRules = function() {
|
||||
return this.$rules
|
||||
}
|
||||
}).call(f.prototype);
|
||||
return f
|
||||
}).call(a.prototype);
|
||||
h.TextHighlightRules = a
|
||||
});
|
||||
|
|
@ -1,23 +1,23 @@
|
|||
define("ace/mode/xml_highlight_rules", ["require", "exports", "module", "../lib/oop", "./text_highlight_rules"], function(a) {
|
||||
var c = a("../lib/oop");
|
||||
a = a("./text_highlight_rules");
|
||||
define("ace/mode/xml_highlight_rules", ["require", "exports", "module", "pilot/oop", "ace/mode/text_highlight_rules"], function(a, c) {
|
||||
var d = a("pilot/oop");
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>",
|
||||
next:"start"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"(?:[^\\]]|\\](?!\\]>))+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
c.inherits(b, a);
|
||||
return b
|
||||
d.inherits(b, a);
|
||||
c.XmlHighlightRules = b
|
||||
});
|
||||
define("ace/mode/xml", ["require", "exports", "module", "../lib/oop", "./text", "../tokenizer", "./xml_highlight_rules"], function(a) {
|
||||
var c = a("../lib/oop"), b = a("./text"), d = a("../tokenizer"), e = a("./xml_highlight_rules");
|
||||
define("ace/mode/xml", ["require", "exports", "module", "pilot/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/xml_highlight_rules"], function(a, c) {
|
||||
var d = a("pilot/oop"), b = a("ace/mode/text").Mode, e = a("ace/tokenizer").Tokenizer, f = a("ace/mode/xml_highlight_rules").XmlHighlightRules;
|
||||
a = function() {
|
||||
this.$tokenizer = new d((new e).getRules())
|
||||
this.$tokenizer = new e((new f).getRules())
|
||||
};
|
||||
c.inherits(a, b);
|
||||
d.inherits(a, b);
|
||||
(function() {
|
||||
this.getNextLineIndent = function(g, f) {
|
||||
return this.$getIndent(f)
|
||||
this.getNextLineIndent = function(h, g) {
|
||||
return this.$getIndent(g)
|
||||
}
|
||||
}).call(a.prototype);
|
||||
return a
|
||||
c.Mode = a
|
||||
});
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
define(function(a) {
|
||||
var c = a("../lib/oop");
|
||||
a = a("./text_highlight_rules");
|
||||
define(function(a, c) {
|
||||
var d = a("pilot/oop");
|
||||
a = a("ace/mode/text_highlight_rules").TextHighlightRules;
|
||||
var b = function() {
|
||||
this.$rules = {start:[{token:"text", regex:"<\\!\\[CDATA\\[", next:"cdata"}, {token:"xml_pe", regex:"<\\?.*?\\?>"}, {token:"comment", regex:"<\\!--", next:"comment"}, {token:"text", regex:"<\\/?", next:"tag"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"[^<]+"}], tag:[{token:"text", regex:">", next:"start"}, {token:"keyword", regex:"[-_a-zA-Z0-9:]+"}, {token:"text", regex:"\\s+"}, {token:"string", regex:'".*?"'}, {token:"string", regex:"'.*?'"}], cdata:[{token:"text", regex:"\\]\\]>",
|
||||
next:"start"}, {token:"text", regex:"\\s+"}, {token:"text", regex:"(?:[^\\]]|\\](?!\\]>))+"}], comment:[{token:"comment", regex:".*?--\>", next:"start"}, {token:"comment", regex:".+"}]}
|
||||
};
|
||||
c.inherits(b, a);
|
||||
return b
|
||||
d.inherits(b, a);
|
||||
c.XmlHighlightRules = b
|
||||
});
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
define(function() {
|
||||
return{commands:{}, registerCommand:function(a, b) {
|
||||
this.commands[a] = b
|
||||
}}
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function() {
|
||||
define(function(h, f) {
|
||||
var c = function(a, b, d, e) {
|
||||
this.start = {row:a, column:b};
|
||||
this.end = {row:d, column:e}
|
||||
|
|
@ -44,9 +44,9 @@ define(function() {
|
|||
if(d == -1) {
|
||||
var e = {row:a, column:b}
|
||||
}else {
|
||||
var f = {row:a, column:b}
|
||||
var g = {row:a, column:b}
|
||||
}
|
||||
}return c.fromPoints(e || this.start, f || this.end)
|
||||
}return c.fromPoints(e || this.start, g || this.end)
|
||||
};
|
||||
this.isEmpty = function() {
|
||||
return this.start.row == this.end.row && this.start.column == this.end.column
|
||||
|
|
@ -57,6 +57,9 @@ define(function() {
|
|||
this.clone = function() {
|
||||
return c.fromPoints(this.start, this.end)
|
||||
};
|
||||
this.collapseRows = function() {
|
||||
return this.end.column == 0 ? new c(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new c(this.start.row, 0, this.end.row, 0)
|
||||
};
|
||||
this.toScreenRange = function(a) {
|
||||
return new c(this.start.row, a.documentToScreenColumn(this.start.row, this.start.column), this.end.row, a.documentToScreenColumn(this.end.row, this.end.column))
|
||||
}
|
||||
|
|
@ -64,5 +67,5 @@ define(function() {
|
|||
c.fromPoints = function(a, b) {
|
||||
return new c(a.row, a.column, b.row, b.column)
|
||||
};
|
||||
return c
|
||||
f.Range = c
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function(d) {
|
||||
var e = d("./lib/event");
|
||||
define(function(d, f) {
|
||||
var e = d("pilot/event");
|
||||
d = function(b) {
|
||||
this.onRender = b;
|
||||
this.pending = false;
|
||||
|
|
@ -7,6 +7,7 @@ define(function(d) {
|
|||
};
|
||||
(function() {
|
||||
this.schedule = function(b) {
|
||||
b = 128;
|
||||
this.changes |= b;
|
||||
if(!this.pending) {
|
||||
this.pending = true;
|
||||
|
|
@ -15,7 +16,11 @@ define(function(d) {
|
|||
a.pending = false;
|
||||
var c = a.changes;
|
||||
a.changes = 0;
|
||||
a.onRender(c)
|
||||
var g = new Date;
|
||||
a.onRender(c);
|
||||
a.setTimeoutZero(function() {
|
||||
console.log(new Date - g)
|
||||
})
|
||||
})
|
||||
}
|
||||
};
|
||||
|
|
@ -40,5 +45,5 @@ define(function(d) {
|
|||
}
|
||||
}
|
||||
}).call(d.prototype);
|
||||
return d
|
||||
f.RenderLoop = d
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function(a) {
|
||||
var c = a("./lib/oop"), d = a("./lib/lang"), e = a("./lib/dom"), f = a("./lib/event"), g = a("./event_emitter");
|
||||
define(function(a, c) {
|
||||
var d = a("pilot/oop"), e = a("pilot/dom"), f = a("pilot/event"), g = a("pilot/event_emitter").EventEmitter;
|
||||
a = function(b) {
|
||||
this.element = document.createElement("div");
|
||||
this.element.className = "ace_sb";
|
||||
|
|
@ -8,12 +8,12 @@ define(function(a) {
|
|||
b.appendChild(this.element);
|
||||
this.width = e.scrollbarWidth();
|
||||
this.element.style.width = this.width;
|
||||
f.addListener(this.element, "scroll", d.bind(this.onScroll, this))
|
||||
f.addListener(this.element, "scroll", this.onScroll.bind(this))
|
||||
};
|
||||
(function() {
|
||||
c.implement(this, g);
|
||||
d.implement(this, g);
|
||||
this.onScroll = function() {
|
||||
this.$dispatchEvent("scroll", {data:this.element.scrollTop})
|
||||
this._dispatchEvent("scroll", {data:this.element.scrollTop})
|
||||
};
|
||||
this.getWidth = function() {
|
||||
return this.width
|
||||
|
|
@ -28,5 +28,5 @@ define(function(a) {
|
|||
this.element.scrollTop = b
|
||||
}
|
||||
}).call(a.prototype);
|
||||
return a
|
||||
c.ScrollBar = a
|
||||
});
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
define(function(o) {
|
||||
var p = o("./lib/lang"), r = o("./lib/oop"), s = o("./range"), l = function() {
|
||||
define(function(o, r) {
|
||||
var p = o("pilot/lang"), s = o("pilot/oop"), t = o("ace/range").Range, l = function() {
|
||||
this.$options = {needle:"", backwards:false, wrap:false, caseSensitive:false, wholeWord:false, scope:l.ALL, regExp:false}
|
||||
};
|
||||
l.ALL = 1;
|
||||
l.SELECTION = 2;
|
||||
(function() {
|
||||
this.set = function(a) {
|
||||
r.mixin(this.$options, a);
|
||||
s.mixin(this.$options, a);
|
||||
return this
|
||||
};
|
||||
this.getOptions = function() {
|
||||
|
|
@ -78,7 +78,7 @@ define(function(o) {
|
|||
}}
|
||||
};
|
||||
this.$rangeFromMatch = function(a, b, c) {
|
||||
return new s(a, b, a, b + c)
|
||||
return new t(a, b, a, b + c)
|
||||
};
|
||||
this.$assembleRegExp = function() {
|
||||
var a = this.$options.regExp ? this.$options.needle : p.escapeRegExp(this.$options.needle);
|
||||
|
|
@ -145,5 +145,5 @@ define(function(o) {
|
|||
}}
|
||||
}
|
||||
}).call(l.prototype);
|
||||
return l
|
||||
r.Search = l
|
||||
});
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
define(function(d) {
|
||||
var g = d("./lib/oop"), h = d("./lib/lang"), i = d("./event_emitter"), f = d("./range");
|
||||
define(function(d, g) {
|
||||
var h = d("pilot/oop"), i = d("pilot/lang"), j = d("pilot/event_emitter").EventEmitter, f = d("ace/range").Range;
|
||||
d = function(a) {
|
||||
this.doc = a;
|
||||
this.clearSelection();
|
||||
this.selectionLead = {row:0, column:0}
|
||||
};
|
||||
(function() {
|
||||
g.implement(this, i);
|
||||
h.implement(this, j);
|
||||
this.isEmpty = function() {
|
||||
return!this.selectionAnchor || this.selectionAnchor.row == this.selectionLead.row && this.selectionAnchor.column == this.selectionLead.column
|
||||
};
|
||||
|
|
@ -23,11 +23,11 @@ define(function(d) {
|
|||
if(this.selectionAnchor) {
|
||||
if(this.selectionAnchor.row !== a.row || this.selectionAnchor.column !== a.column) {
|
||||
this.selectionAnchor = a;
|
||||
this.$dispatchEvent("changeSelection", {})
|
||||
this._dispatchEvent("changeSelection", {})
|
||||
}
|
||||
}else {
|
||||
this.selectionAnchor = a;
|
||||
this.$dispatchEvent("changeSelection", {})
|
||||
this._dispatchEvent("changeSelection", {})
|
||||
}
|
||||
};
|
||||
this.getSelectionAnchor = function() {
|
||||
|
|
@ -61,15 +61,19 @@ define(function(d) {
|
|||
this.clearSelection = function() {
|
||||
if(this.selectionAnchor) {
|
||||
this.selectionAnchor = null;
|
||||
this.$dispatchEvent("changeSelection", {})
|
||||
this._dispatchEvent("changeSelection", {})
|
||||
}
|
||||
};
|
||||
this.selectAll = function() {
|
||||
var a = this.doc.getLength() - 1;
|
||||
this.setSelectionAnchor(a, this.doc.getLine(a).length);
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorTo(0, 0)
|
||||
})
|
||||
if(!this.selectionAnchor) {
|
||||
this.selectionAnchor = this.$clone(this.selectionLead)
|
||||
}a = {row:0, column:0};
|
||||
if(a.row !== this.selectionLead.row || a.column !== this.selectionLead.column) {
|
||||
this.selectionLead = a;
|
||||
this._dispatchEvent("changeSelection", {blockScrolling:true})
|
||||
}
|
||||
};
|
||||
this.setSelectionRange = function(a, b) {
|
||||
if(b) {
|
||||
|
|
@ -89,7 +93,7 @@ define(function(d) {
|
|||
a.call(this);
|
||||
if(c.row !== this.selectionLead.row || c.column !== this.selectionLead.column) {
|
||||
b = true
|
||||
}b && this.$dispatchEvent("changeSelection", {})
|
||||
}b && this._dispatchEvent("changeSelection", {})
|
||||
};
|
||||
this.selectTo = function(a, b) {
|
||||
this.$moveSelection(function() {
|
||||
|
|
@ -151,14 +155,16 @@ define(function(d) {
|
|||
if(this.selectionLead.column == 0) {
|
||||
this.selectionLead.row > 0 && this.moveCursorTo(this.selectionLead.row - 1, this.doc.getLine(this.selectionLead.row - 1).length)
|
||||
}else {
|
||||
this.moveCursorBy(0, -1)
|
||||
var a = this.doc, b = a.getTabSize(), c = this.selectionLead;
|
||||
a.isTabStop(c) && a.getLine(c.row).slice(c.column - b, c.column).split(" ").length - 1 == b ? this.moveCursorBy(0, -b) : this.moveCursorBy(0, -1)
|
||||
}
|
||||
};
|
||||
this.moveCursorRight = function() {
|
||||
if(this.selectionLead.column == this.doc.getLine(this.selectionLead.row).length) {
|
||||
this.selectionLead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.selectionLead.row + 1, 0)
|
||||
}else {
|
||||
this.moveCursorBy(0, 1)
|
||||
var a = this.doc, b = a.getTabSize(), c = this.selectionLead;
|
||||
a.isTabStop(c) && a.getLine(c.row).slice(c.column, c.column + b).split(" ").length - 1 == b ? this.moveCursorBy(0, b) : this.moveCursorBy(0, 1)
|
||||
}
|
||||
};
|
||||
this.moveCursorLineStart = function() {
|
||||
|
|
@ -199,7 +205,7 @@ define(function(d) {
|
|||
};
|
||||
this.moveCursorWordLeft = function() {
|
||||
var a = this.selectionLead.row, b = this.selectionLead.column, c = this.doc.getLine(a);
|
||||
c = h.stringReverse(c.substring(0, b));
|
||||
c = i.stringReverse(c.substring(0, b));
|
||||
this.doc.nonTokenRe.lastIndex = 0;
|
||||
this.doc.tokenRe.lastIndex = 0;
|
||||
if(b == 0) {
|
||||
|
|
@ -226,7 +232,7 @@ define(function(d) {
|
|||
a = this.$clipPositionToDocument(a, b);
|
||||
if(a.row !== this.selectionLead.row || a.column !== this.selectionLead.column) {
|
||||
this.selectionLead = a;
|
||||
this.$dispatchEvent("changeCursor", {data:this.getCursor()})
|
||||
this._dispatchEvent("changeCursor", {data:this.getCursor()})
|
||||
}
|
||||
};
|
||||
this.moveCursorUp = function() {
|
||||
|
|
@ -251,5 +257,5 @@ define(function(d) {
|
|||
return{row:a.row, column:a.column}
|
||||
}
|
||||
}).call(d.prototype);
|
||||
return d
|
||||
g.Selection = d
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
require({paths:{ace:"../src/ace"}}, ["ace/test/assertions", "ace/test/ChangeDocumentTest"], function(a) {
|
||||
console.log(a);
|
||||
alert("a " + a)
|
||||
});
|
||||
require("../../../support/paths");
|
||||
var async = require("async");
|
||||
async.concat(require("./change_document_test"), require("./document_test"), require("./event_emitter_test"), require("./navigation_test"), require("./range_test"), require("./search_test"), require("./selection_test"), require("./text_edit_test"), require("./mode/css_test"), require("./mode/css_tokenizer_test"), require("./mode/html_test"), require("./mode/html_tokenizer_test"), require("./mode/javascript_test"), require("./mode/javascript_tokenizer_test"), require("./mode/text_test"), require("./mode/xml_test"),
|
||||
require("./mode/xml_tokenizer_test")).exec();
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
define(function(e, f, g) {
|
||||
var a = e("assert");
|
||||
a.position = function(b, c, d) {
|
||||
a.equal(b.row, c);
|
||||
a.equal(b.column, d)
|
||||
};
|
||||
a.range = function(b, c, d, h, i) {
|
||||
a.position(b.start, c, d);
|
||||
a.position(b.end, h, i)
|
||||
};
|
||||
a.notOk = function(b) {
|
||||
a.equal(b, false)
|
||||
};
|
||||
f.jsonEquals = function(b, c) {
|
||||
a.equal(JSON.stringify(b), JSON.stringify(c))
|
||||
};
|
||||
g.exports = a
|
||||
});
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
define(function(c, d, f) {
|
||||
c("./mockdom");
|
||||
var e = c("../document").Document, g = c("../editor").Editor, h = c("../mode/text").Mode, i = c("../mode/javascript").Mode, j = c("./mockrenderer"), a = c("./assertions");
|
||||
d = {setUp:function() {
|
||||
this.doc1 = new e("abc\ndef");
|
||||
this.doc2 = new e("ghi\njkl");
|
||||
this.editor = new g(new j)
|
||||
}, "test: change document":function() {
|
||||
this.editor.setDocument(this.doc1);
|
||||
a.equal(this.editor.getDocument(), this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.equal(this.editor.getDocument(), this.doc2)
|
||||
}, "test: only changes to the new document should have effect":function() {
|
||||
var b = false;
|
||||
this.editor.onDocumentChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
this.doc1.duplicateLines(0, 0);
|
||||
a.notOk(b);
|
||||
this.doc2.duplicateLines(0, 0);
|
||||
a.notOk(b)
|
||||
}, "test: should use cursor of new document":function() {
|
||||
this.doc1.getSelection().moveCursorTo(0, 1);
|
||||
this.doc2.getSelection().moveCursorTo(1, 0);
|
||||
this.editor.setDocument(this.doc1);
|
||||
a.position(this.editor.getCursorPosition(), 0, 1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getCursorPosition(), 1, 0)
|
||||
}, "test: only changing the cursor of the new doc should not have an effect":function() {
|
||||
this.editor.onCursorChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getCursorPosition(), 0, 0);
|
||||
var b = false;
|
||||
this.doc1.getSelection().moveCursorTo(0, 1);
|
||||
a.position(this.editor.getCursorPosition(), 0, 0);
|
||||
a.notOk(b);
|
||||
this.doc2.getSelection().moveCursorTo(1, 1);
|
||||
a.position(this.editor.getCursorPosition(), 1, 1);
|
||||
a.ok(b)
|
||||
}, "test: should use selection of new document":function() {
|
||||
this.doc1.getSelection().selectTo(0, 1);
|
||||
this.doc2.getSelection().selectTo(1, 0);
|
||||
this.editor.setDocument(this.doc1);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 0, 1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 1, 0)
|
||||
}, "test: only changing the selection of the new doc should not have an effect":function() {
|
||||
this.editor.onSelectionChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 0, 0);
|
||||
var b = false;
|
||||
this.doc1.getSelection().selectTo(0, 1);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 0, 0);
|
||||
a.notOk(b);
|
||||
this.doc2.getSelection().selectTo(1, 1);
|
||||
a.position(this.editor.getSelection().getSelectionLead(), 1, 1);
|
||||
a.ok(b)
|
||||
}, "test: should use mode of new document":function() {
|
||||
this.editor.onDocumentModeChange = function() {
|
||||
b = true
|
||||
};
|
||||
this.editor.setDocument(this.doc1);
|
||||
this.editor.setDocument(this.doc2);
|
||||
var b = false;
|
||||
this.doc1.setMode(new h);
|
||||
a.notOk(b);
|
||||
this.doc2.setMode(new i);
|
||||
a.ok(b)
|
||||
}};
|
||||
f.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,153 +1,163 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require("../../../support/paths");
|
||||
var Document = require("../document"), UndoManager = require("../undomanager"), MockRenderer = require("./mockrenderer"), Range = require("../range"), assert = require("./assertions"), async = require("async"), Test = {"test: find matching opening bracket":function() {
|
||||
var a = new Document(["(()(", "())))"]);
|
||||
assert.position(a.findMatchingBracket({row:0, column:3}), 0, 1);
|
||||
assert.position(a.findMatchingBracket({row:1, column:2}), 1, 0);
|
||||
assert.position(a.findMatchingBracket({row:1, column:3}), 0, 3);
|
||||
assert.position(a.findMatchingBracket({row:1, column:4}), 0, 0);
|
||||
assert.equal(a.findMatchingBracket({row:1, column:5}), null)
|
||||
}, "test: find matching closing bracket":function() {
|
||||
var a = new Document(["(()(", "())))"]);
|
||||
assert.position(a.findMatchingBracket({row:1, column:1}), 1, 1);
|
||||
assert.position(a.findMatchingBracket({row:1, column:1}), 1, 1);
|
||||
assert.position(a.findMatchingBracket({row:0, column:4}), 1, 2);
|
||||
assert.position(a.findMatchingBracket({row:0, column:2}), 0, 2);
|
||||
assert.position(a.findMatchingBracket({row:0, column:1}), 1, 3);
|
||||
assert.equal(a.findMatchingBracket({row:0, column:0}), null)
|
||||
}, "test: match different bracket types":function() {
|
||||
var a = new Document(["({[", ")]}"]);
|
||||
assert.position(a.findMatchingBracket({row:0, column:1}), 1, 0);
|
||||
assert.position(a.findMatchingBracket({row:0, column:2}), 1, 2);
|
||||
assert.position(a.findMatchingBracket({row:0, column:3}), 1, 1);
|
||||
assert.position(a.findMatchingBracket({row:1, column:1}), 0, 0);
|
||||
assert.position(a.findMatchingBracket({row:1, column:2}), 0, 2);
|
||||
assert.position(a.findMatchingBracket({row:1, column:3}), 0, 1)
|
||||
}, "test: move lines down":function() {
|
||||
var a = new Document(["1", "2", "3", "4"]);
|
||||
console.log(a.toString().replace(/\n/g, "\\n"));
|
||||
a.moveLinesDown(0, 1);
|
||||
console.log(a.toString().replace(/\n/g, "\\n"));
|
||||
assert.equal(a.toString(), "3\n1\n2\n4");
|
||||
a.moveLinesDown(1, 2);
|
||||
assert.equal(a.toString(), "3\n4\n1\n2");
|
||||
a.moveLinesDown(2, 3);
|
||||
assert.equal(a.toString(), "3\n4\n1\n2");
|
||||
a.moveLinesDown(2, 2);
|
||||
assert.equal(a.toString(), "3\n4\n2\n1")
|
||||
}, "__test: move lines up":function() {
|
||||
var a = new Document(["1", "2", "3", "4"]);
|
||||
console.log(a.toString().replace(/\n/g, "\\n"));
|
||||
a.moveLinesUp(2, 3);
|
||||
console.log(a.toString().replace(/\n/g, "\\n"));
|
||||
assert.equal(a.toString(), "1\n3\n4\n2");
|
||||
a.moveLinesUp(1, 2);
|
||||
assert.equal(a.toString(), "3\n4\n1\n2");
|
||||
a.moveLinesUp(0, 1);
|
||||
assert.equal(a.toString(), "3\n4\n1\n2");
|
||||
a.moveLinesUp(2, 2);
|
||||
assert.equal(a.toString(), "3\n1\n4\n2")
|
||||
}, "test: duplicate lines":function() {
|
||||
var a = new Document(["1", "2", "3", "4"]);
|
||||
a.duplicateLines(1, 2);
|
||||
assert.equal(a.toString(), "1\n2\n3\n2\n3\n4")
|
||||
}, "test: duplicate last line":function() {
|
||||
var a = new Document(["1", "2", "3"]);
|
||||
a.duplicateLines(2, 2);
|
||||
assert.equal(a.toString(), "1\n2\n3\n3")
|
||||
}, "test: duplicate first line":function() {
|
||||
var a = new Document(["1", "2", "3"]);
|
||||
a.duplicateLines(0, 0);
|
||||
assert.equal(a.toString(), "1\n1\n2\n3")
|
||||
}, "test: should handle unix style new lines":function() {
|
||||
var a = new Document(["1", "2", "3"]);
|
||||
assert.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: should handle windows style new lines":function() {
|
||||
var a = new Document("1\r\n2\r\n3");
|
||||
a.setNewLineMode("unix");
|
||||
assert.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: set new line mode to 'windows' should use '\r\n' as new lines":function() {
|
||||
var a = new Document("1\n2\n3");
|
||||
a.setNewLineMode("windows");
|
||||
assert.equal(a.toString(), "1\r\n2\r\n3")
|
||||
}, "test: set new line mode to 'unix' should use '\n' as new lines":function() {
|
||||
var a = new Document("1\r\n2\r\n3");
|
||||
a.setNewLineMode("unix");
|
||||
assert.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: set new line mode to 'auto' should detect the incoming nl type":function() {
|
||||
var a = new Document("1\n2\n3");
|
||||
a.setNewLineMode("auto");
|
||||
assert.equal(a.toString(), "1\n2\n3");
|
||||
a = new Document("1\r\n2\r\n3");
|
||||
a.setNewLineMode("auto");
|
||||
assert.equal(a.toString(), "1\r\n2\r\n3");
|
||||
a.replace(new Range(0, 0, 2, 1), "4\n5\n6");
|
||||
assert.equal("4\n5\n6", a.toString())
|
||||
}, "__test: undo/redo for delete line":function() {
|
||||
var a = new Document(["111", "222", "333"]), b = new UndoManager;
|
||||
a.setUndoManager(b);
|
||||
var d = a.toString(), c = new Editor(new MockRenderer, a);
|
||||
c.removeLines();
|
||||
var e = a.toString();
|
||||
assert.equal(e, "222\n333");
|
||||
a.$informUndoManager.call();
|
||||
c.removeLines();
|
||||
var f = a.toString();
|
||||
assert.equal(f, "333");
|
||||
a.$informUndoManager.call();
|
||||
c.removeLines();
|
||||
c = a.toString();
|
||||
assert.equal(c, "");
|
||||
a.$informUndoManager.call();
|
||||
b.undo();
|
||||
a.$informUndoManager.call();
|
||||
assert.equal(a.toString(), f);
|
||||
b.undo();
|
||||
a.$informUndoManager.call();
|
||||
assert.equal(a.toString(), e);
|
||||
b.undo();
|
||||
a.$informUndoManager.call();
|
||||
assert.equal(a.toString(), d);
|
||||
b.undo();
|
||||
a.$informUndoManager.call();
|
||||
assert.equal(a.toString(), d)
|
||||
}, "test: convert document to screen coordinates":function() {
|
||||
var a = new Document("01234\t567890\t1234");
|
||||
a.setTabSize(4);
|
||||
assert.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
assert.equal(a.documentToScreenColumn(0, 4), 4);
|
||||
assert.equal(a.documentToScreenColumn(0, 5), 5);
|
||||
assert.equal(a.documentToScreenColumn(0, 6), 9);
|
||||
assert.equal(a.documentToScreenColumn(0, 12), 15);
|
||||
assert.equal(a.documentToScreenColumn(0, 13), 19);
|
||||
a.setTabSize(2);
|
||||
assert.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
assert.equal(a.documentToScreenColumn(0, 4), 4);
|
||||
assert.equal(a.documentToScreenColumn(0, 5), 5);
|
||||
assert.equal(a.documentToScreenColumn(0, 6), 7);
|
||||
assert.equal(a.documentToScreenColumn(0, 12), 13);
|
||||
assert.equal(a.documentToScreenColumn(0, 13), 15)
|
||||
}, "test: convert document to scrren coordinates with leading tabs":function() {
|
||||
var a = new Document("\t\t123");
|
||||
a.setTabSize(4);
|
||||
assert.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
assert.equal(a.documentToScreenColumn(0, 1), 4);
|
||||
assert.equal(a.documentToScreenColumn(0, 2), 8);
|
||||
assert.equal(a.documentToScreenColumn(0, 3), 9)
|
||||
}, "test: convert screen to document coordinates":function() {
|
||||
var a = new Document("01234\t567890\t1234");
|
||||
a.setTabSize(4);
|
||||
assert.equal(a.screenToDocumentColumn(0, 0), 0);
|
||||
assert.equal(a.screenToDocumentColumn(0, 4), 4);
|
||||
assert.equal(a.screenToDocumentColumn(0, 5), 5);
|
||||
assert.equal(a.screenToDocumentColumn(0, 6), 5);
|
||||
assert.equal(a.screenToDocumentColumn(0, 7), 5);
|
||||
assert.equal(a.screenToDocumentColumn(0, 8), 5);
|
||||
assert.equal(a.screenToDocumentColumn(0, 9), 6);
|
||||
assert.equal(a.screenToDocumentColumn(0, 15), 12);
|
||||
assert.equal(a.screenToDocumentColumn(0, 19), 13)
|
||||
}};
|
||||
module.exports = require("async/test").testcase(Test);
|
||||
module === require.main && module.exports.exec();
|
||||
define(function(e, g, i) {
|
||||
var c = e("../document").Document, h = e("../undomanager").UndoManager;
|
||||
e("./mockrenderer");
|
||||
var f = e("../range").Range, b = e("./assertions");
|
||||
e("async");
|
||||
g = {"test: find matching opening bracket":function() {
|
||||
var a = new c(["(()(", "())))"]);
|
||||
b.position(a.findMatchingBracket({row:0, column:3}), 0, 1);
|
||||
b.position(a.findMatchingBracket({row:1, column:2}), 1, 0);
|
||||
b.position(a.findMatchingBracket({row:1, column:3}), 0, 3);
|
||||
b.position(a.findMatchingBracket({row:1, column:4}), 0, 0);
|
||||
b.equal(a.findMatchingBracket({row:1, column:5}), null)
|
||||
}, "test: find matching closing bracket":function() {
|
||||
var a = new c(["(()(", "())))"]);
|
||||
b.position(a.findMatchingBracket({row:1, column:1}), 1, 1);
|
||||
b.position(a.findMatchingBracket({row:1, column:1}), 1, 1);
|
||||
b.position(a.findMatchingBracket({row:0, column:4}), 1, 2);
|
||||
b.position(a.findMatchingBracket({row:0, column:2}), 0, 2);
|
||||
b.position(a.findMatchingBracket({row:0, column:1}), 1, 3);
|
||||
b.equal(a.findMatchingBracket({row:0, column:0}), null)
|
||||
}, "test: match different bracket types":function() {
|
||||
var a = new c(["({[", ")]}"]);
|
||||
b.position(a.findMatchingBracket({row:0, column:1}), 1, 0);
|
||||
b.position(a.findMatchingBracket({row:0, column:2}), 1, 2);
|
||||
b.position(a.findMatchingBracket({row:0, column:3}), 1, 1);
|
||||
b.position(a.findMatchingBracket({row:1, column:1}), 0, 0);
|
||||
b.position(a.findMatchingBracket({row:1, column:2}), 0, 2);
|
||||
b.position(a.findMatchingBracket({row:1, column:3}), 0, 1)
|
||||
}, "test: move lines down":function() {
|
||||
var a = new c(["a1", "a2", "a3", "a4"]);
|
||||
a.moveLinesDown(0, 1);
|
||||
b.equal(a.toString(), "a3\na1\na2\na4");
|
||||
a.moveLinesDown(1, 2);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesDown(2, 3);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesDown(2, 2);
|
||||
b.equal(a.toString(), "a3\na4\na2\na1")
|
||||
}, "test: move lines up":function() {
|
||||
var a = new c(["a1", "a2", "a3", "a4"]);
|
||||
a.moveLinesUp(2, 3);
|
||||
b.equal(a.toString(), "a1\na3\na4\na2");
|
||||
a.moveLinesUp(1, 2);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesUp(0, 1);
|
||||
b.equal(a.toString(), "a3\na4\na1\na2");
|
||||
a.moveLinesUp(2, 2);
|
||||
b.equal(a.toString(), "a3\na1\na4\na2")
|
||||
}, "test: duplicate lines":function() {
|
||||
var a = new c(["1", "2", "3", "4"]);
|
||||
a.duplicateLines(1, 2);
|
||||
b.equal(a.toString(), "1\n2\n3\n2\n3\n4")
|
||||
}, "test: duplicate last line":function() {
|
||||
var a = new c(["1", "2", "3"]);
|
||||
a.duplicateLines(2, 2);
|
||||
b.equal(a.toString(), "1\n2\n3\n3")
|
||||
}, "test: duplicate first line":function() {
|
||||
var a = new c(["1", "2", "3"]);
|
||||
a.duplicateLines(0, 0);
|
||||
b.equal(a.toString(), "1\n1\n2\n3")
|
||||
}, "test: should handle unix style new lines":function() {
|
||||
var a = new c(["1", "2", "3"]);
|
||||
b.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: should handle windows style new lines":function() {
|
||||
var a = new c("1\r\n2\r\n3");
|
||||
a.setNewLineMode("unix");
|
||||
b.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: set new line mode to 'windows' should use '\r\n' as new lines":function() {
|
||||
var a = new c("1\n2\n3");
|
||||
a.setNewLineMode("windows");
|
||||
b.equal(a.toString(), "1\r\n2\r\n3")
|
||||
}, "test: set new line mode to 'unix' should use '\n' as new lines":function() {
|
||||
var a = new c("1\r\n2\r\n3");
|
||||
a.setNewLineMode("unix");
|
||||
b.equal(a.toString(), "1\n2\n3")
|
||||
}, "test: set new line mode to 'auto' should detect the incoming nl type":function() {
|
||||
var a = new c("1\n2\n3");
|
||||
a.setNewLineMode("auto");
|
||||
b.equal(a.toString(), "1\n2\n3");
|
||||
a = new c("1\r\n2\r\n3");
|
||||
a.setNewLineMode("auto");
|
||||
b.equal(a.toString(), "1\r\n2\r\n3");
|
||||
a.replace(new f(0, 0, 2, 1), "4\n5\n6");
|
||||
b.equal("4\n5\n6", a.toString())
|
||||
}, "test: convert document to screen coordinates":function() {
|
||||
var a = new c("01234\t567890\t1234");
|
||||
a.setTabSize(4);
|
||||
b.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
b.equal(a.documentToScreenColumn(0, 4), 4);
|
||||
b.equal(a.documentToScreenColumn(0, 5), 5);
|
||||
b.equal(a.documentToScreenColumn(0, 6), 9);
|
||||
b.equal(a.documentToScreenColumn(0, 12), 15);
|
||||
b.equal(a.documentToScreenColumn(0, 13), 19);
|
||||
a.setTabSize(2);
|
||||
b.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
b.equal(a.documentToScreenColumn(0, 4), 4);
|
||||
b.equal(a.documentToScreenColumn(0, 5), 5);
|
||||
b.equal(a.documentToScreenColumn(0, 6), 7);
|
||||
b.equal(a.documentToScreenColumn(0, 12), 13);
|
||||
b.equal(a.documentToScreenColumn(0, 13), 15)
|
||||
}, "test: convert document to scrren coordinates with leading tabs":function() {
|
||||
var a = new c("\t\t123");
|
||||
a.setTabSize(4);
|
||||
b.equal(a.documentToScreenColumn(0, 0), 0);
|
||||
b.equal(a.documentToScreenColumn(0, 1), 4);
|
||||
b.equal(a.documentToScreenColumn(0, 2), 8);
|
||||
b.equal(a.documentToScreenColumn(0, 3), 9)
|
||||
}, "test: convert screen to document coordinates":function() {
|
||||
var a = new c("01234\t567890\t1234");
|
||||
a.setTabSize(4);
|
||||
b.equal(a.screenToDocumentColumn(0, 0), 0);
|
||||
b.equal(a.screenToDocumentColumn(0, 4), 4);
|
||||
b.equal(a.screenToDocumentColumn(0, 5), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 6), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 7), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 8), 5);
|
||||
b.equal(a.screenToDocumentColumn(0, 9), 6);
|
||||
b.equal(a.screenToDocumentColumn(0, 15), 12);
|
||||
b.equal(a.screenToDocumentColumn(0, 19), 13)
|
||||
}, "test: insert text in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = a.multiRowInsert([0, 1, 2], 2, "juhu 1");
|
||||
b.equal(d.rows, 0);
|
||||
b.equal(d.columns, 6);
|
||||
b.equal(a.toString(), "12juhu 1\n juhu 1\nabjuhu 1cd")
|
||||
}, "test: undo insert text in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = new h;
|
||||
a.setUndoManager(d);
|
||||
a.multiRowInsert([0, 1, 2], 2, "juhu 1");
|
||||
a.$informUndoManager.call();
|
||||
b.equal(a.toString(), "12juhu 1\n juhu 1\nabjuhu 1cd");
|
||||
d.undo();
|
||||
b.equal(a.toString(), "12\n\nabcd");
|
||||
d.redo();
|
||||
b.equal(a.toString(), "12juhu 1\n juhu 1\nabjuhu 1cd")
|
||||
}, "test: insert new line in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = a.multiRowInsert([0, 1, 2], 2, "\n");
|
||||
b.equal(d.rows, 1);
|
||||
b.equal(a.toString(), "12\n\n \n\nab\ncd")
|
||||
}, "test: insert multi line text in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = a.multiRowInsert([0, 1, 2], 2, "juhu\n12");
|
||||
b.equal(d.rows, 1);
|
||||
b.equal(a.toString(), "12juhu\n12\n juhu\n12\nabjuhu\n12cd")
|
||||
}, "test: remove right in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]);
|
||||
a.multiRowRemove([0, 1, 2], new f(0, 2, 0, 3));
|
||||
b.equal(a.toString(), "12\n\nabd")
|
||||
}, "test: undo remove right in multiple rows":function() {
|
||||
var a = new c(["12", "", "abcd"]), d = new h;
|
||||
a.setUndoManager(d);
|
||||
a.multiRowRemove([0, 1, 2], new f(0, 1, 0, 3));
|
||||
a.$informUndoManager.call();
|
||||
b.equal(a.toString(), "1\n\nad");
|
||||
d.undo();
|
||||
b.equal(a.toString(), "12\n\nabcd");
|
||||
d.redo();
|
||||
b.equal(a.toString(), "1\n\nad")
|
||||
}};
|
||||
i.exports = e("async/test").testcase(g)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
require("../../../support/paths");
|
||||
var oop = require("pilot/oop");
|
||||
EventEmitter = require("pilot/event_emitter").EventEmitter;
|
||||
assert = require("./assertions");
|
||||
var Emitter = function() {
|
||||
};
|
||||
oop.implement(Emitter.prototype, EventEmitter);
|
||||
var Test = {"test: dispatch event with no data":function() {
|
||||
var a = new Emitter, b = false;
|
||||
a.addEventListener("juhu", function(c) {
|
||||
b = true;
|
||||
assert.equal(c.type, "juhu")
|
||||
});
|
||||
a._dispatchEvent("juhu");
|
||||
assert.ok(b)
|
||||
}};
|
||||
module.exports = require("async/test").testcase(Test);
|
||||
module === require.main && module.exports.exec();
|
||||
6
build/ace/test/mockdom.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
var dom = require("jsdom/level2/html").dom.level2.html, browser = require("jsdom/browser/index").windowAugmentation(dom);
|
||||
global.document = browser.document;
|
||||
global.window = browser.window;
|
||||
global.self = browser.self;
|
||||
global.navigator = browser.navigator;
|
||||
global.location = browser.location;
|
||||
|
|
@ -1,6 +1,3 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
define(function() {
|
||||
MockRenderer = function(a) {
|
||||
this.container = document.createElement("div");
|
||||
|
|
@ -54,6 +51,8 @@ define(function() {
|
|||
};
|
||||
MockRenderer.prototype.updateFull = function() {
|
||||
};
|
||||
MockRenderer.prototype.updateText = function() {
|
||||
};
|
||||
MockRenderer.prototype.showCursor = function() {
|
||||
};
|
||||
MockRenderer.prototype.visualizeFocus = function() {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,24 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/Document", "ace/Range", "ace/mode/Css"], function(b, c, d) {
|
||||
new TestCase("mode.CssTest", {setUp:function() {
|
||||
this.mode = new d
|
||||
define(function(b, c, e) {
|
||||
var f = b("ace/document").Document, g = b("ace/mode/css").Mode, a = b("../assertions");
|
||||
c = {setUp:function() {
|
||||
this.mode = new g
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var a = new b(" abc\ncde\nfg"), e = new c(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", a, e);
|
||||
assertEquals(" abc\ncde\nfg", a.toString())
|
||||
var d = new f(" abc\ncde\nfg");
|
||||
this.mode.toggleCommentLines("start", d, 0, 1);
|
||||
a.equal(" abc\ncde\nfg", d.toString())
|
||||
}, "test: lines should keep indentation":function() {
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " abc", " "));
|
||||
assertEquals("\t", this.mode.getNextLineIndent("start", "\tabc", " "))
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " abc", " "));
|
||||
a.equal("\t", this.mode.getNextLineIndent("start", "\tabc", " "))
|
||||
}, "test: new line after { should increase indent":function() {
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " abc{", " "));
|
||||
assertEquals("\t ", this.mode.getNextLineIndent("start", "\tabc { ", " "))
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " abc{", " "));
|
||||
a.equal("\t ", this.mode.getNextLineIndent("start", "\tabc { ", " "))
|
||||
}, "test: no indent increase after { in a comment":function() {
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " /*{", " "));
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " /*{ ", " "))
|
||||
}})
|
||||
});
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " /*{", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " /*{ ", " "))
|
||||
}};
|
||||
e.exports = b("async/test").testcase(c)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,26 +1,33 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/mode/Css"], function(b) {
|
||||
new TestCase("mode.CssTest", {setUp:function() {
|
||||
this.tokenizer = (new b).getTokenizer()
|
||||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/css").Mode, b = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize pixel number":function() {
|
||||
var a = this.tokenizer.getLineTokens("-12px", "start").tokens;
|
||||
assertEquals(1, a.length);
|
||||
assertEquals("number", a[0].type)
|
||||
b.equal(1, a.length);
|
||||
b.equal("constant.numeric", a[0].type)
|
||||
}, "test: tokenize hex3 color":function() {
|
||||
var a = this.tokenizer.getLineTokens("#abc", "start").tokens;
|
||||
assertEquals(1, a.length);
|
||||
assertEquals("number", a[0].type)
|
||||
b.equal(1, a.length);
|
||||
b.equal("constant.numeric", a[0].type)
|
||||
}, "test: tokenize hex6 color":function() {
|
||||
var a = this.tokenizer.getLineTokens("#abc012", "start").tokens;
|
||||
assertEquals(1, a.length);
|
||||
assertEquals("number", a[0].type)
|
||||
b.equal(1, a.length);
|
||||
b.equal("constant.numeric", a[0].type)
|
||||
}, "test: tokenize parens":function() {
|
||||
var a = this.tokenizer.getLineTokens("{()}", "start").tokens;
|
||||
assertEquals(3, a.length);
|
||||
assertEquals("lparen", a[0].type);
|
||||
assertEquals("text", a[1].type);
|
||||
assertEquals("rparen", a[2].type)
|
||||
}})
|
||||
});
|
||||
b.equal(3, a.length);
|
||||
b.equal("lparen", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("rparen", a[2].type)
|
||||
}, "test for last rule in ruleset to catch capturing group bugs":function() {
|
||||
var a = this.tokenizer.getLineTokens("top", "start").tokens;
|
||||
b.equal(1, a.length);
|
||||
b.equal("support.type", a[0].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d, "css tokenizer")
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,16 +1,20 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/Document", "ace/Range", "ace/mode/Html"], function(b, c, d) {
|
||||
new TestCase("mode.HtmlTest", {setUp:function() {
|
||||
this.mode = new d
|
||||
define(function(a, c, e) {
|
||||
var f = a("ace/document").Document, g = a("ace/range").Range, h = a("ace/mode/html").Mode, b = a("../assertions");
|
||||
c = {setUp:function() {
|
||||
this.mode = new h
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var a = new b([" abc", "cde", "fg"]), e = new c(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", a, e);
|
||||
assertEquals(" abc\ncde\nfg", a.toString())
|
||||
var d = new f([" abc", "cde", "fg"]);
|
||||
new g(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", d, 0, 1);
|
||||
b.equal(" abc\ncde\nfg", d.toString())
|
||||
}, "test: next line indent should be the same as the current line indent":function() {
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " abc"));
|
||||
assertEquals("", this.mode.getNextLineIndent("start", "abc"));
|
||||
assertEquals("\t", this.mode.getNextLineIndent("start", "\tabc"))
|
||||
}})
|
||||
});
|
||||
b.equal(" ", this.mode.getNextLineIndent("start", " abc"));
|
||||
b.equal("", this.mode.getNextLineIndent("start", "abc"));
|
||||
b.equal("\t", this.mode.getNextLineIndent("start", "\tabc"))
|
||||
}};
|
||||
e.exports = a("async/test").testcase(c)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,21 +1,24 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/mode/Html"], function(b) {
|
||||
new TestCase("mode.HtmlTest", {setUp:function() {
|
||||
this.tokenizer = (new b).getTokenizer()
|
||||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/html").Mode, a = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize embedded script":function() {
|
||||
var a = this.tokenizer.getLineTokens("<script a='a'>var<\/script>'123'", "start").tokens;
|
||||
assertEquals("text", a[0].type);
|
||||
assertEquals("keyword", a[1].type);
|
||||
assertEquals("text", a[2].type);
|
||||
assertEquals("keyword", a[3].type);
|
||||
assertEquals("text", a[4].type);
|
||||
assertEquals("string", a[5].type);
|
||||
assertEquals("text", a[6].type);
|
||||
assertEquals("keyword", a[7].type);
|
||||
assertEquals("text", a[8].type);
|
||||
assertEquals("keyword", a[9].type);
|
||||
assertEquals("text", a[10].type)
|
||||
}})
|
||||
});
|
||||
var b = this.tokenizer.getLineTokens("<script a='a'>var<\/script>'123'", "start").tokens;
|
||||
a.equal("text", b[0].type);
|
||||
a.equal("keyword", b[1].type);
|
||||
a.equal("text", b[2].type);
|
||||
a.equal("keyword", b[3].type);
|
||||
a.equal("text", b[4].type);
|
||||
a.equal("string", b[5].type);
|
||||
a.equal("text", b[6].type);
|
||||
a.equal("keyword", b[7].type);
|
||||
a.equal("text", b[8].type);
|
||||
a.equal("keyword", b[9].type);
|
||||
a.equal("text", b[10].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,62 +1,70 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/Document", "ace/Range", "ace/Tokenizer", "ace/mode/JavaScript"], function(c, d, e, f) {
|
||||
new TestCase("mode.JavaScriptTest", {setUp:function() {
|
||||
this.mode = new f
|
||||
define(function(d, e, f) {
|
||||
var c = d("ace/document").Document, g = d("ace/tokenizer").Tokenizer, h = d("ace/mode/javascript").Mode, a = d("../assertions");
|
||||
e = {setUp:function() {
|
||||
this.mode = new h
|
||||
}, "test: getTokenizer() (smoke test)":function() {
|
||||
var a = this.mode.getTokenizer();
|
||||
assertTrue(a instanceof e);
|
||||
a = a.getLineTokens("'juhu'", "start").tokens;
|
||||
assertEquals("string", a[0].type)
|
||||
var b = this.mode.getTokenizer();
|
||||
a.ok(b instanceof g);
|
||||
b = b.getLineTokens("'juhu'", "start").tokens;
|
||||
a.equal("string", b[0].type)
|
||||
}, "test: toggle comment lines should prepend '//' to each line":function() {
|
||||
var a = new c([" abc", "cde", "fg"]), b = new d(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", a, b);
|
||||
assertEquals("// abc\n//cde\nfg", a.toString())
|
||||
var b = new c([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 1);
|
||||
a.equal("// abc\n//cde\nfg", b.toString())
|
||||
}, "test: toggle comment on commented lines should remove leading '//' chars":function() {
|
||||
var a = new c(["// abc", "//cde", "fg"]), b = new d(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", a, b);
|
||||
assertEquals(" abc\ncde\nfg", a.toString())
|
||||
var b = new c(["// abc", "//cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 1);
|
||||
a.equal(" abc\ncde\nfg", b.toString())
|
||||
}, "test: toggle comment lines twice should return the original text":function() {
|
||||
var b = new c([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 2);
|
||||
this.mode.toggleCommentLines("start", b, 0, 2);
|
||||
a.equal(" abc\ncde\nfg", b.toString())
|
||||
}, "test: toggle comment on multiple lines with one commented line prepend '//' to each line":function() {
|
||||
var a = new c(["// abc", "//cde", "fg"]), b = new d(0, 3, 2, 1);
|
||||
this.mode.toggleCommentLines("start", a, b);
|
||||
assertEquals("//// abc\n////cde\n//fg", a.toString())
|
||||
var b = new c(["// abc", "//cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 2);
|
||||
a.equal("//// abc\n////cde\n//fg", b.toString())
|
||||
}, "test: toggle comment on a comment line with leading white space":function() {
|
||||
var a = new c(["//cde", " //fg"]), b = new d(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", a, b);
|
||||
assertEquals("cde\n fg", a.toString())
|
||||
var b = new c(["//cde", " //fg"]);
|
||||
this.mode.toggleCommentLines("start", b, 0, 1);
|
||||
a.equal("cde\n fg", b.toString())
|
||||
}, "test: auto indent after opening brace":function() {
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", "if () {", " "))
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", "if () {", " "))
|
||||
}, "test: no auto indent after opening brace in multi line comment":function() {
|
||||
assertEquals("", this.mode.getNextLineIndent("start", "/*if () {", " "));
|
||||
assertEquals(" ", this.mode.getNextLineIndent("comment", " abcd", " "))
|
||||
a.equal("", this.mode.getNextLineIndent("start", "/*if () {", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("comment", " abcd", " "))
|
||||
}, "test: no auto indent after opening brace in single line comment":function() {
|
||||
assertEquals("", this.mode.getNextLineIndent("start", "//if () {", " "));
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " //if () {", " "))
|
||||
a.equal("", this.mode.getNextLineIndent("start", "//if () {", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " //if () {", " "))
|
||||
}, "test: no auto indent should add to existing indent":function() {
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " if () {", " "));
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " cde", " "))
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " if () {", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("start", " cde", " "))
|
||||
}, "test: special indent in doc comments":function() {
|
||||
assertEquals(" * ", this.mode.getNextLineIndent("doc-start", "/**", " "));
|
||||
assertEquals(" * ", this.mode.getNextLineIndent("doc-start", " /**", " "));
|
||||
assertEquals(" * ", this.mode.getNextLineIndent("doc-start", " *", " "));
|
||||
assertEquals(" * ", this.mode.getNextLineIndent("doc-start", " *", " "));
|
||||
assertEquals(" ", this.mode.getNextLineIndent("doc-start", " abc", " "))
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", "/**", " "));
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", " /**", " "));
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", " *", " "));
|
||||
a.equal(" * ", this.mode.getNextLineIndent("doc-start", " *", " "));
|
||||
a.equal(" ", this.mode.getNextLineIndent("doc-start", " abc", " "))
|
||||
}, "test: no indent after doc comments":function() {
|
||||
assertEquals("", this.mode.getNextLineIndent("doc-start", " */", " "))
|
||||
a.equal("", this.mode.getNextLineIndent("doc-start", " */", " "))
|
||||
}, "test: trigger outdent if line is space and new text starts with closing brace":function() {
|
||||
assertTrue(this.mode.checkOutdent("start", " ", " }"));
|
||||
assertFalse(this.mode.checkOutdent("start", " a ", " }"));
|
||||
assertFalse(this.mode.checkOutdent("start", "", "}"));
|
||||
assertFalse(this.mode.checkOutdent("start", " ", "a }"));
|
||||
assertFalse(this.mode.checkOutdent("start", " }", "}"))
|
||||
a.ok(this.mode.checkOutdent("start", " ", " }"));
|
||||
a.ok(!this.mode.checkOutdent("start", " a ", " }"));
|
||||
a.ok(!this.mode.checkOutdent("start", "", "}"));
|
||||
a.ok(!this.mode.checkOutdent("start", " ", "a }"));
|
||||
a.ok(!this.mode.checkOutdent("start", " }", "}"))
|
||||
}, "test: auto outdent should indent the line with the same indent as the line with the matching opening brace":function() {
|
||||
var a = new c([" function foo() {", " bla", " }"]);
|
||||
this.mode.autoOutdent("start", a, 2);
|
||||
assertEquals(" }", a.getLine(2))
|
||||
var b = new c([" function foo() {", " bla", " }"]);
|
||||
this.mode.autoOutdent("start", b, 2);
|
||||
a.equal(" }", b.getLine(2))
|
||||
}, "test: no auto outdent if no matching brace is found":function() {
|
||||
var a = new c([" function foo()", " bla", " }"]);
|
||||
this.mode.autoOutdent("start", a, 2);
|
||||
assertEquals(" }", a.getLine(2))
|
||||
}})
|
||||
});
|
||||
var b = new c([" function foo()", " bla", " }"]);
|
||||
this.mode.autoOutdent("start", b, 2);
|
||||
a.equal(" }", b.getLine(2))
|
||||
}};
|
||||
f.exports = d("async/test").testcase(e)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,34 +1,43 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/mode/JavaScript"], function(b) {
|
||||
new TestCase("mode.JavaScriptTokenizerTest", {setUp:function() {
|
||||
this.tokenizer = (new b).getTokenizer()
|
||||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/javascript").Mode, b = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize1":function() {
|
||||
var a = this.tokenizer.getLineTokens("foo = function", "start").tokens;
|
||||
assertEquals(3, a.length);
|
||||
assertEquals("identifier", a[0].type);
|
||||
assertEquals("text", a[1].type);
|
||||
assertEquals("keyword", a[2].type)
|
||||
b.equal(5, a.length);
|
||||
b.equal("identifier", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("keyword.operator", a[2].type);
|
||||
b.equal("text", a[3].type);
|
||||
b.equal("keyword", a[4].type)
|
||||
}, "test: tokenize doc comment":function() {
|
||||
var a = this.tokenizer.getLineTokens("abc /** de */ fg", "start").tokens;
|
||||
assertEquals(5, a.length);
|
||||
assertEquals("identifier", a[0].type);
|
||||
assertEquals("text", a[1].type);
|
||||
assertEquals("doc-comment", a[2].type);
|
||||
assertEquals("text", a[3].type);
|
||||
assertEquals("identifier", a[4].type)
|
||||
b.equal(5, a.length);
|
||||
b.equal("identifier", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("comment.doc", a[2].type);
|
||||
b.equal("text", a[3].type);
|
||||
b.equal("identifier", a[4].type)
|
||||
}, "test: tokenize doc comment with tag":function() {
|
||||
var a = this.tokenizer.getLineTokens("/** @param {} */", "start").tokens;
|
||||
assertEquals(3, a.length);
|
||||
assertEquals("doc-comment", a[0].type);
|
||||
assertEquals("doc-comment-tag", a[1].type);
|
||||
assertEquals("doc-comment", a[2].type)
|
||||
b.equal(3, a.length);
|
||||
b.equal("comment.doc", a[0].type);
|
||||
b.equal("comment.doc.tag", a[1].type);
|
||||
b.equal("comment.doc", a[2].type)
|
||||
}, "test: tokenize parens":function() {
|
||||
var a = this.tokenizer.getLineTokens("[{( )}]", "start").tokens;
|
||||
assertEquals(3, a.length);
|
||||
assertEquals("lparen", a[0].type);
|
||||
assertEquals("text", a[1].type);
|
||||
assertEquals("rparen", a[2].type)
|
||||
}})
|
||||
});
|
||||
b.equal(3, a.length);
|
||||
b.equal("lparen", a[0].type);
|
||||
b.equal("text", a[1].type);
|
||||
b.equal("rparen", a[2].type)
|
||||
}, "test for last rule in ruleset to catch capturing group bugs":function() {
|
||||
var a = this.tokenizer.getLineTokens("}", "start").tokens;
|
||||
b.equal(1, a.length);
|
||||
b.equal("rparen", a[0].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,14 +1,17 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/Document", "ace/Range", "ace/mode/Text"], function(b, c, d) {
|
||||
new TestCase("mode.TextTest", {setUp:function() {
|
||||
this.mode = new d
|
||||
define(function(a, b, e) {
|
||||
var f = a("ace/document").Document, g = a("ace/mode/text").Mode, c = a("../assertions");
|
||||
b = {setUp:function() {
|
||||
this.mode = new g
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var a = new b([" abc", "cde", "fg"]), e = new c(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", a, e);
|
||||
assertEquals(" abc\ncde\nfg", a.toString())
|
||||
var d = new f([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", d, 0, 1);
|
||||
c.equal(" abc\ncde\nfg", d.toString())
|
||||
}, "text: lines should not be indented":function() {
|
||||
assertEquals("", this.mode.getNextLineIndent("start", " abc", " "))
|
||||
}})
|
||||
});
|
||||
c.equal("", this.mode.getNextLineIndent("start", " abc", " "))
|
||||
}};
|
||||
e.exports = a("async/test").testcase(b)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,21 +1,24 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/Document", "ace/Range", "ace/Tokenizer", "ace/mode/Xml"], function(b, c, d, e) {
|
||||
new TestCase("mode.XmlTest", {setUp:function() {
|
||||
this.mode = new e
|
||||
define(function(c, d, e) {
|
||||
var f = c("ace/document").Document, g = c("ace/tokenizer").Tokenizer, h = c("ace/mode/xml").Mode, b = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.mode = new h
|
||||
}, "test: getTokenizer() (smoke test)":function() {
|
||||
var a = this.mode.getTokenizer();
|
||||
assertTrue(a instanceof d);
|
||||
b.ok(a instanceof g);
|
||||
a = a.getLineTokens("<juhu>", "start").tokens;
|
||||
assertEquals("keyword", a[1].type)
|
||||
b.equal("keyword", a[1].type)
|
||||
}, "test: toggle comment lines should not do anything":function() {
|
||||
var a = new b([" abc", "cde", "fg"]), f = new c(0, 3, 1, 1);
|
||||
this.mode.toggleCommentLines("start", a, f);
|
||||
assertEquals(" abc\ncde\nfg", a.toString())
|
||||
var a = new f([" abc", "cde", "fg"]);
|
||||
this.mode.toggleCommentLines("start", a, 0, 1);
|
||||
b.equal(" abc\ncde\nfg", a.toString())
|
||||
}, "test: next line indent should be the same as the current line indent":function() {
|
||||
assertEquals(" ", this.mode.getNextLineIndent("start", " abc"));
|
||||
assertEquals("", this.mode.getNextLineIndent("start", "abc"));
|
||||
assertEquals("\t", this.mode.getNextLineIndent("start", "\tabc"))
|
||||
}})
|
||||
});
|
||||
b.equal(" ", this.mode.getNextLineIndent("start", " abc"));
|
||||
b.equal("", this.mode.getNextLineIndent("start", "abc"));
|
||||
b.equal("\t", this.mode.getNextLineIndent("start", "\tabc"))
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,16 +1,19 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require.def(["ace/mode/Xml"], function(b) {
|
||||
new TestCase("mode.XmlTest", {setUp:function() {
|
||||
this.tokenizer = (new b).getTokenizer()
|
||||
define(function(c, d, e) {
|
||||
var f = c("ace/mode/xml").Mode, a = c("../assertions");
|
||||
d = {setUp:function() {
|
||||
this.tokenizer = (new f).getTokenizer()
|
||||
}, "test: tokenize1":function() {
|
||||
var a = this.tokenizer.getLineTokens("<Juhu>//Juhu Kinners</Kinners>", "start").tokens;
|
||||
assertEquals(5, a.length);
|
||||
assertEquals("text", a[0].type);
|
||||
assertEquals("keyword", a[1].type);
|
||||
assertEquals("text", a[2].type);
|
||||
assertEquals("keyword", a[3].type);
|
||||
assertEquals("text", a[4].type)
|
||||
}})
|
||||
});
|
||||
var b = this.tokenizer.getLineTokens("<Juhu>//Juhu Kinners</Kinners>", "start").tokens;
|
||||
a.equal(5, b.length);
|
||||
a.equal("text", b[0].type);
|
||||
a.equal("keyword", b[1].type);
|
||||
a.equal("text", b[2].type);
|
||||
a.equal("keyword", b[3].type);
|
||||
a.equal("text", b[4].type)
|
||||
}};
|
||||
e.exports = c("async/test").testcase(d)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
define(function(d, h, i) {
|
||||
d("./mockdom");
|
||||
var g = d("../Document").Document, e = d("../Editor").Editor, f = d("./mockrenderer"), b = d("./assertions");
|
||||
h = {createTextDocument:function(a, c) {
|
||||
c = (new Array(c + 1)).join("a");
|
||||
a = (new Array(a)).join(c + "\n") + c;
|
||||
return new g(a)
|
||||
}, "test: navigate to end of file should scroll the last line into view":function() {
|
||||
var a = this.createTextDocument(200, 10);
|
||||
a = new e(new f, a);
|
||||
a.navigateFileEnd();
|
||||
var c = a.getCursorPosition();
|
||||
b.ok(a.getFirstVisibleRow() <= c.row);
|
||||
b.ok(a.getLastVisibleRow() >= c.row)
|
||||
}, "test: navigate to start of file should scroll the first row into view":function() {
|
||||
var a = this.createTextDocument(200, 10);
|
||||
a = new e(new f, a);
|
||||
a.moveCursorTo(a.getLastVisibleRow() + 20);
|
||||
a.navigateFileStart();
|
||||
b.equal(a.getFirstVisibleRow(), 0)
|
||||
}, "test: goto hidden line should scroll the line into the middle of the viewport":function() {
|
||||
var a = new e(new f, this.createTextDocument(200, 5));
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(101);
|
||||
b.position(a.getCursorPosition(), 100, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 90);
|
||||
a.navigateTo(100, 0);
|
||||
a.gotoLine(11);
|
||||
b.position(a.getCursorPosition(), 10, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(100, 0);
|
||||
a.gotoLine(6);
|
||||
b.position(a.getCursorPosition(), 5, 0);
|
||||
b.equal(0, a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(100, 0);
|
||||
a.gotoLine(1);
|
||||
b.position(a.getCursorPosition(), 0, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(191);
|
||||
b.position(a.getCursorPosition(), 190, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 180);
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(196);
|
||||
b.position(a.getCursorPosition(), 195, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 180)
|
||||
}, "test: goto visible line should only move the cursor and not scroll":function() {
|
||||
var a = new e(new f, this.createTextDocument(200, 5));
|
||||
a.navigateTo(0, 0);
|
||||
a.gotoLine(12);
|
||||
b.position(a.getCursorPosition(), 11, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 0);
|
||||
a.navigateTo(30, 0);
|
||||
a.gotoLine(33);
|
||||
b.position(a.getCursorPosition(), 32, 0);
|
||||
b.equal(a.getFirstVisibleRow(), 30)
|
||||
}, "test: navigate from the end of a long line down to a short line and back should maintain the curser column":function() {
|
||||
var a = new e(new f, new g(["123456", "1"]));
|
||||
a.navigateTo(0, 6);
|
||||
b.position(a.getCursorPosition(), 0, 6);
|
||||
a.navigateDown();
|
||||
b.position(a.getCursorPosition(), 1, 1);
|
||||
a.navigateUp();
|
||||
b.position(a.getCursorPosition(), 0, 6)
|
||||
}, "test: reset desired column on navigate left or right":function() {
|
||||
var a = new e(new f, new g(["123456", "12"]));
|
||||
a.navigateTo(0, 6);
|
||||
b.position(a.getCursorPosition(), 0, 6);
|
||||
a.navigateDown();
|
||||
b.position(a.getCursorPosition(), 1, 2);
|
||||
a.navigateLeft();
|
||||
b.position(a.getCursorPosition(), 1, 1);
|
||||
a.navigateUp();
|
||||
b.position(a.getCursorPosition(), 0, 1)
|
||||
}};
|
||||
i.exports = d("async/test").testcase(h)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
define(function(e, f, g) {
|
||||
var c = e("../range").Range, b = e("./assertions");
|
||||
f = {"test: create range":function() {
|
||||
var a = new c(1, 2, 3, 4);
|
||||
b.equal(a.start.row, 1);
|
||||
b.equal(a.start.column, 2);
|
||||
b.equal(a.end.row, 3);
|
||||
b.equal(a.end.column, 4)
|
||||
}, "test: create from points":function() {
|
||||
var a = c.fromPoints({row:1, column:2}, {row:3, column:4});
|
||||
b.equal(a.start.row, 1);
|
||||
b.equal(a.start.column, 2);
|
||||
b.equal(a.end.row, 3);
|
||||
b.equal(a.end.column, 4)
|
||||
}, "test: clip to rows":function() {
|
||||
b.range((new c(0, 20, 100, 30)).clipRows(10, 30), 10, 0, 31, 0);
|
||||
b.range((new c(0, 20, 30, 10)).clipRows(10, 30), 10, 0, 30, 10);
|
||||
var a = new c(0, 20, 3, 10);
|
||||
a = a.clipRows(10, 30);
|
||||
b.ok(a.isEmpty());
|
||||
b.range(a, 10, 0, 10, 0)
|
||||
}, "test: isEmpty":function() {
|
||||
var a = new c(1, 2, 1, 2);
|
||||
b.ok(a.isEmpty());
|
||||
a = new c(1, 2, 1, 6);
|
||||
b.notOk(a.isEmpty())
|
||||
}, "test: is multi line":function() {
|
||||
var a = new c(1, 2, 1, 6);
|
||||
b.notOk(a.isMultiLine());
|
||||
a = new c(1, 2, 2, 6);
|
||||
b.ok(a.isMultiLine())
|
||||
}, "test: clone":function() {
|
||||
var a = new c(1, 2, 3, 4), d = a.clone();
|
||||
b.position(d.start, 1, 2);
|
||||
b.position(d.end, 3, 4);
|
||||
d.start.column = 20;
|
||||
b.position(a.start, 1, 2);
|
||||
d.end.column = 20;
|
||||
b.position(a.end, 3, 4)
|
||||
}, "test: contains for multi line ranges":function() {
|
||||
var a = new c(1, 10, 5, 20);
|
||||
b.ok(a.contains(1, 10));
|
||||
b.ok(a.contains(2, 0));
|
||||
b.ok(a.contains(3, 100));
|
||||
b.ok(a.contains(5, 19));
|
||||
b.ok(a.contains(5, 20));
|
||||
b.notOk(a.contains(1, 9));
|
||||
b.notOk(a.contains(0, 0));
|
||||
b.notOk(a.contains(5, 21))
|
||||
}, "test: contains for single line ranges":function() {
|
||||
var a = new c(1, 10, 1, 20);
|
||||
b.ok(a.contains(1, 10));
|
||||
b.ok(a.contains(1, 15));
|
||||
b.ok(a.contains(1, 20));
|
||||
b.notOk(a.contains(0, 9));
|
||||
b.notOk(a.contains(2, 9));
|
||||
b.notOk(a.contains(1, 9));
|
||||
b.notOk(a.contains(1, 21))
|
||||
}, "test: extend range":function() {
|
||||
var a = new c(2, 10, 2, 30);
|
||||
a = a.extend(2, 5);
|
||||
b.range(a, 2, 5, 2, 30);
|
||||
a = a.extend(2, 35);
|
||||
b.range(a, 2, 5, 2, 35);
|
||||
a = a.extend(2, 15);
|
||||
b.range(a, 2, 5, 2, 35);
|
||||
a = a.extend(1, 4);
|
||||
b.range(a, 1, 4, 2, 35);
|
||||
a = a.extend(6, 10);
|
||||
b.range(a, 1, 4, 6, 10)
|
||||
}, "test: collapse rows":function() {
|
||||
var a = new c(0, 2, 1, 2);
|
||||
b.range(a.collapseRows(), 0, 0, 1, 0);
|
||||
a = new c(2, 2, 3, 1);
|
||||
b.range(a.collapseRows(), 2, 0, 3, 0);
|
||||
a = new c(2, 2, 3, 0);
|
||||
b.range(a.collapseRows(), 2, 0, 2, 0);
|
||||
a = new c(2, 0, 2, 0);
|
||||
b.range(a.collapseRows(), 2, 0, 2, 0)
|
||||
}};
|
||||
g.exports = e("async/test").testcase(f)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,135 +1,137 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require("../../../support/paths");
|
||||
var Document = require("../document"), Search = require("../search"), assert = require("./assertions"), Test = {"test: configure the search object":function() {
|
||||
(new Search).set({needle:"juhu", scope:Search.ALL})
|
||||
}, "test: find simple text in document":function() {
|
||||
var a = new Document(["juhu kinners 123", "456"]);
|
||||
a = (new Search).set({needle:"kinners"}).find(a);
|
||||
assert.position(a.start, 0, 5);
|
||||
assert.position(a.end, 0, 12)
|
||||
}, "test: find simple text in next line":function() {
|
||||
var a = new Document(["abc", "juhu kinners 123", "456"]);
|
||||
a = (new Search).set({needle:"kinners"}).find(a);
|
||||
assert.position(a.start, 1, 5);
|
||||
assert.position(a.end, 1, 12)
|
||||
}, "test: find text starting at cursor position":function() {
|
||||
var a = new Document(["juhu kinners", "juhu kinners 123"]);
|
||||
a.getSelection().moveCursorTo(0, 6);
|
||||
a = (new Search).set({needle:"kinners"}).find(a);
|
||||
assert.position(a.start, 1, 5);
|
||||
assert.position(a.end, 1, 12)
|
||||
}, "test: wrap search is off by default":function() {
|
||||
var a = new Document(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
var b = (new Search).set({needle:"kinners"});
|
||||
assert.equal(b.find(a), null)
|
||||
}, "test: wrap search should wrap at file end":function() {
|
||||
var a = new Document(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
a = (new Search).set({needle:"kinners", wrap:true}).find(a);
|
||||
assert.position(a.start, 1, 5);
|
||||
assert.position(a.end, 1, 12)
|
||||
}, "test: wrap search with no match should return 'null'":function() {
|
||||
var a = new Document(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
var b = (new Search).set({needle:"xyz", wrap:true});
|
||||
assert.equal(b.find(a), null)
|
||||
}, "test: case sensitive is by default off":function() {
|
||||
var a = new Document(["abc", "juhu kinners 123", "456"]), b = (new Search).set({needle:"JUHU"});
|
||||
assert.range(b.find(a), 1, 0, 1, 4)
|
||||
}, "test: case sensitive search":function() {
|
||||
var a = new Document(["abc", "juhu kinners 123", "456"]);
|
||||
a = (new Search).set({needle:"KINNERS", caseSensitive:true}).find(a);
|
||||
assert.equal(a, null)
|
||||
}, "test: whole word search should not match inside of words":function() {
|
||||
var a = new Document(["juhukinners", "juhu kinners 123", "456"]);
|
||||
a = (new Search).set({needle:"kinners", wholeWord:true}).find(a);
|
||||
assert.position(a.start, 1, 5);
|
||||
assert.position(a.end, 1, 12)
|
||||
}, "test: find backwards":function() {
|
||||
var a = new Document(["juhu juhu juhu juhu"]);
|
||||
a.getSelection().moveCursorTo(0, 10);
|
||||
a = (new Search).set({needle:"juhu", backwards:true}).find(a);
|
||||
assert.position(a.start, 0, 5);
|
||||
assert.position(a.end, 0, 9)
|
||||
}, "test: find in selection":function() {
|
||||
var a = new Document(["juhu", "juhu", "juhu", "juhu"]);
|
||||
a.getSelection().setSelectionAnchor(1, 0);
|
||||
a.getSelection().selectTo(3, 5);
|
||||
var b = (new Search).set({needle:"juhu", wrap:true, scope:Search.SELECTION}), c = b.find(a);
|
||||
assert.position(c.start, 1, 0);
|
||||
assert.position(c.end, 1, 4);
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
c = b.find(a);
|
||||
assert.position(c.start, 1, 0);
|
||||
assert.position(c.end, 1, 4)
|
||||
}, "test: find backwards in selection":function() {
|
||||
var a = new Document(["juhu", "juhu", "juhu", "juhu"]), b = (new Search).set({needle:"juhu", wrap:true, backwards:true, scope:Search.SELECTION});
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
var c = b.find(a);
|
||||
assert.position(c.start, 2, 0);
|
||||
assert.position(c.end, 2, 4);
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(1, 2);
|
||||
assert.equal(b.find(a), null)
|
||||
}, "test: edge case - match directly before the cursor":function() {
|
||||
var a = new Document(["123", "123", "juhu"]), b = (new Search).set({needle:"juhu", wrap:true});
|
||||
a.getSelection().moveCursorTo(2, 5);
|
||||
a = b.find(a);
|
||||
assert.position(a.start, 2, 0);
|
||||
assert.position(a.end, 2, 4)
|
||||
}, "test: edge case - match backwards directly after the cursor":function() {
|
||||
var a = new Document(["123", "123", "juhu"]), b = (new Search).set({needle:"juhu", wrap:true, backwards:true});
|
||||
a.getSelection().moveCursorTo(2, 0);
|
||||
a = b.find(a);
|
||||
assert.position(a.start, 2, 0);
|
||||
assert.position(a.end, 2, 4)
|
||||
}, "test: find using a regular expression":function() {
|
||||
var a = new Document(["abc123 123 cd", "abc"]);
|
||||
a = (new Search).set({needle:"\\d+", regExp:true}).find(a);
|
||||
assert.position(a.start, 0, 3);
|
||||
assert.position(a.end, 0, 6)
|
||||
}, "test: find using a regular expression and whole word":function() {
|
||||
var a = new Document(["abc123 123 cd", "abc"]);
|
||||
a = (new Search).set({needle:"\\d+\\b", regExp:true, wholeWord:true}).find(a);
|
||||
assert.position(a.start, 0, 7);
|
||||
assert.position(a.end, 0, 10)
|
||||
}, "test: use regular expressions with capture groups":function() {
|
||||
var a = new Document([" ab: 12px", " <h1 abc"]);
|
||||
a = (new Search).set({needle:"(\\d+)", regExp:true}).find(a);
|
||||
assert.position(a.start, 0, 6);
|
||||
assert.position(a.end, 0, 8)
|
||||
}, "test: find all matches in selection":function() {
|
||||
var a = new Document(["juhu", "juhu", "juhu", "juhu"]), b = (new Search).set({needle:"uh", wrap:true, scope:Search.SELECTION});
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
a = b.findAll(a);
|
||||
assert.equal(a.length, 2);
|
||||
assert.position(a[0].start, 1, 1);
|
||||
assert.position(a[0].end, 1, 3);
|
||||
assert.position(a[1].start, 2, 1);
|
||||
assert.position(a[1].end, 2, 3)
|
||||
}, "test: replace() should return the replacement if the input matches the needle":function() {
|
||||
var a = (new Search).set({needle:"juhu"});
|
||||
assert.equal(a.replace("juhu", "kinners"), "kinners");
|
||||
assert.equal(a.replace("", "kinners"), null);
|
||||
assert.equal(a.replace(" juhu", "kinners"), null)
|
||||
}, "test: replace with a RegExp search":function() {
|
||||
var a = (new Search).set({needle:"\\d+", regExp:true});
|
||||
assert.equal(a.replace("123", "kinners"), "kinners");
|
||||
assert.equal(a.replace("01234", "kinners"), "kinners");
|
||||
assert.equal(a.replace("", "kinners"), null);
|
||||
assert.equal(a.replace("a12", "kinners"), null);
|
||||
assert.equal(a.replace("12a", "kinners"), null)
|
||||
}, "test: replace with RegExp match and capture groups":function() {
|
||||
var a = (new Search).set({needle:"ab(\\d\\d)", regExp:true});
|
||||
assert.equal(a.replace("ab12", "cd$1"), "cd12");
|
||||
assert.equal(a.replace("ab12", "-$&-"), "-ab12-");
|
||||
assert.equal(a.replace("ab12", "$$"), "$")
|
||||
}};
|
||||
module.exports = require("async/test").testcase(Test);
|
||||
module === require.main && module.exports.exec();
|
||||
define(function(g, h, i) {
|
||||
var d = g("../document").Document, c = g("../search").Search, b = g("./assertions");
|
||||
h = {"test: configure the search object":function() {
|
||||
(new c).set({needle:"juhu", scope:c.ALL})
|
||||
}, "test: find simple text in document":function() {
|
||||
var a = new d(["juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"kinners"}).find(a);
|
||||
b.position(a.start, 0, 5);
|
||||
b.position(a.end, 0, 12)
|
||||
}, "test: find simple text in next line":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"kinners"}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: find text starting at cursor position":function() {
|
||||
var a = new d(["juhu kinners", "juhu kinners 123"]);
|
||||
a.getSelection().moveCursorTo(0, 6);
|
||||
a = (new c).set({needle:"kinners"}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: wrap search is off by default":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
var e = (new c).set({needle:"kinners"});
|
||||
b.equal(e.find(a), null)
|
||||
}, "test: wrap search should wrap at file end":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
a = (new c).set({needle:"kinners", wrap:true}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: wrap search with no match should return 'null'":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a.getSelection().moveCursorTo(2, 1);
|
||||
var e = (new c).set({needle:"xyz", wrap:true});
|
||||
b.equal(e.find(a), null)
|
||||
}, "test: case sensitive is by default off":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]), e = (new c).set({needle:"JUHU"});
|
||||
b.range(e.find(a), 1, 0, 1, 4)
|
||||
}, "test: case sensitive search":function() {
|
||||
var a = new d(["abc", "juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"KINNERS", caseSensitive:true}).find(a);
|
||||
b.equal(a, null)
|
||||
}, "test: whole word search should not match inside of words":function() {
|
||||
var a = new d(["juhukinners", "juhu kinners 123", "456"]);
|
||||
a = (new c).set({needle:"kinners", wholeWord:true}).find(a);
|
||||
b.position(a.start, 1, 5);
|
||||
b.position(a.end, 1, 12)
|
||||
}, "test: find backwards":function() {
|
||||
var a = new d(["juhu juhu juhu juhu"]);
|
||||
a.getSelection().moveCursorTo(0, 10);
|
||||
a = (new c).set({needle:"juhu", backwards:true}).find(a);
|
||||
b.position(a.start, 0, 5);
|
||||
b.position(a.end, 0, 9)
|
||||
}, "test: find in selection":function() {
|
||||
var a = new d(["juhu", "juhu", "juhu", "juhu"]);
|
||||
a.getSelection().setSelectionAnchor(1, 0);
|
||||
a.getSelection().selectTo(3, 5);
|
||||
var e = (new c).set({needle:"juhu", wrap:true, scope:c.SELECTION}), f = e.find(a);
|
||||
b.position(f.start, 1, 0);
|
||||
b.position(f.end, 1, 4);
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
f = e.find(a);
|
||||
b.position(f.start, 1, 0);
|
||||
b.position(f.end, 1, 4)
|
||||
}, "test: find backwards in selection":function() {
|
||||
var a = new d(["juhu", "juhu", "juhu", "juhu"]), e = (new c).set({needle:"juhu", wrap:true, backwards:true, scope:c.SELECTION});
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
var f = e.find(a);
|
||||
b.position(f.start, 2, 0);
|
||||
b.position(f.end, 2, 4);
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(1, 2);
|
||||
b.equal(e.find(a), null)
|
||||
}, "test: edge case - match directly before the cursor":function() {
|
||||
var a = new d(["123", "123", "juhu"]), e = (new c).set({needle:"juhu", wrap:true});
|
||||
a.getSelection().moveCursorTo(2, 5);
|
||||
a = e.find(a);
|
||||
b.position(a.start, 2, 0);
|
||||
b.position(a.end, 2, 4)
|
||||
}, "test: edge case - match backwards directly after the cursor":function() {
|
||||
var a = new d(["123", "123", "juhu"]), e = (new c).set({needle:"juhu", wrap:true, backwards:true});
|
||||
a.getSelection().moveCursorTo(2, 0);
|
||||
a = e.find(a);
|
||||
b.position(a.start, 2, 0);
|
||||
b.position(a.end, 2, 4)
|
||||
}, "test: find using a regular expression":function() {
|
||||
var a = new d(["abc123 123 cd", "abc"]);
|
||||
a = (new c).set({needle:"\\d+", regExp:true}).find(a);
|
||||
b.position(a.start, 0, 3);
|
||||
b.position(a.end, 0, 6)
|
||||
}, "test: find using a regular expression and whole word":function() {
|
||||
var a = new d(["abc123 123 cd", "abc"]);
|
||||
a = (new c).set({needle:"\\d+\\b", regExp:true, wholeWord:true}).find(a);
|
||||
b.position(a.start, 0, 7);
|
||||
b.position(a.end, 0, 10)
|
||||
}, "test: use regular expressions with capture groups":function() {
|
||||
var a = new d([" ab: 12px", " <h1 abc"]);
|
||||
a = (new c).set({needle:"(\\d+)", regExp:true}).find(a);
|
||||
b.position(a.start, 0, 6);
|
||||
b.position(a.end, 0, 8)
|
||||
}, "test: find all matches in selection":function() {
|
||||
var a = new d(["juhu", "juhu", "juhu", "juhu"]), e = (new c).set({needle:"uh", wrap:true, scope:c.SELECTION});
|
||||
a.getSelection().setSelectionAnchor(0, 2);
|
||||
a.getSelection().selectTo(3, 2);
|
||||
a = e.findAll(a);
|
||||
b.equal(a.length, 2);
|
||||
b.position(a[0].start, 1, 1);
|
||||
b.position(a[0].end, 1, 3);
|
||||
b.position(a[1].start, 2, 1);
|
||||
b.position(a[1].end, 2, 3)
|
||||
}, "test: replace() should return the replacement if the input matches the needle":function() {
|
||||
var a = (new c).set({needle:"juhu"});
|
||||
b.equal(a.replace("juhu", "kinners"), "kinners");
|
||||
b.equal(a.replace("", "kinners"), null);
|
||||
b.equal(a.replace(" juhu", "kinners"), null)
|
||||
}, "test: replace with a RegExp search":function() {
|
||||
var a = (new c).set({needle:"\\d+", regExp:true});
|
||||
b.equal(a.replace("123", "kinners"), "kinners");
|
||||
b.equal(a.replace("01234", "kinners"), "kinners");
|
||||
b.equal(a.replace("", "kinners"), null);
|
||||
b.equal(a.replace("a12", "kinners"), null);
|
||||
b.equal(a.replace("12a", "kinners"), null)
|
||||
}, "test: replace with RegExp match and capture groups":function() {
|
||||
var a = (new c).set({needle:"ab(\\d\\d)", regExp:true});
|
||||
b.equal(a.replace("ab12", "cd$1"), "cd12");
|
||||
b.equal(a.replace("ab12", "-$&-"), "-ab12-");
|
||||
b.equal(a.replace("ab12", "$$"), "$")
|
||||
}};
|
||||
i.exports = g("async/test").testcase(h)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
define(function(e, f, g) {
|
||||
var d = e("../document").Document, b = e("./assertions");
|
||||
f = {createTextDocument:function(a, c) {
|
||||
c = (new Array(c + 1)).join("a");
|
||||
a = (new Array(a)).join(c + "\n") + c;
|
||||
return new d(a)
|
||||
}, "test: move cursor to end of file should place the cursor on last row and column":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorFileEnd();
|
||||
b.position(a.getCursor(), 199, 10)
|
||||
}, "test: moveCursor to start of file should place the cursor on the first row and column":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorFileStart();
|
||||
b.position(a.getCursor(), 0, 0)
|
||||
}, "test: move selection lead to end of file":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorTo(100, 5);
|
||||
a.selectFileEnd();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 100, 5);
|
||||
b.position(a.end, 199, 10)
|
||||
}, "test: move selection lead to start of file":function() {
|
||||
var a = this.createTextDocument(200, 10).getSelection();
|
||||
a.moveCursorTo(100, 5);
|
||||
a.selectFileStart();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 0);
|
||||
b.position(a.end, 100, 5)
|
||||
}, "test: move cursor word right":function() {
|
||||
var a = (new d("ab\n Juhu Kinners (abc, 12)\n cde")).getSelection();
|
||||
a.moveCursorDown();
|
||||
b.position(a.getCursor(), 1, 0);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 1);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 5);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 6);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 13);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 15);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 18);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 20);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 22);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 1, 23);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 2, 0)
|
||||
}, "test: select word right if cursor in word":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 2);
|
||||
a.moveCursorWordRight();
|
||||
b.position(a.getCursor(), 0, 4)
|
||||
}, "test: moveCursor word left":function() {
|
||||
var a = (new d("ab\n Juhu Kinners (abc, 12)\n cde")).getSelection();
|
||||
a.moveCursorDown();
|
||||
a.moveCursorLineEnd();
|
||||
b.position(a.getCursor(), 1, 23);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 22);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 20);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 18);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 15);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 13);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 6);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 5);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 1);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 1, 0);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 0, 2)
|
||||
}, "test: select word left if cursor in word":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 8);
|
||||
a.moveCursorWordLeft();
|
||||
b.position(a.getCursor(), 0, 5)
|
||||
}, "test: select word right and select":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 0);
|
||||
a.selectWordRight();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 0);
|
||||
b.position(a.end, 0, 4)
|
||||
}, "test: select word left and select":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 3);
|
||||
a.selectWordLeft();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 0);
|
||||
b.position(a.end, 0, 3)
|
||||
}, "test: select word with cursor in word should select the word":function() {
|
||||
var a = (new d("Juhu Kinners 123")).getSelection();
|
||||
a.moveCursorTo(0, 8);
|
||||
a.selectWord();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 5);
|
||||
b.position(a.end, 0, 12)
|
||||
}, "test: select word with cursor betwen white space and word should select the word":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 4);
|
||||
a.selectWord();
|
||||
var c = a.getRange();
|
||||
b.position(c.start, 0, 0);
|
||||
b.position(c.end, 0, 4);
|
||||
a.moveCursorTo(0, 5);
|
||||
a.selectWord();
|
||||
c = a.getRange();
|
||||
b.position(c.start, 0, 5);
|
||||
b.position(c.end, 0, 12)
|
||||
}, "test: select word with cursor in white space should select white space":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 5);
|
||||
a.selectWord();
|
||||
a = a.getRange();
|
||||
b.position(a.start, 0, 4);
|
||||
b.position(a.end, 0, 6)
|
||||
}, "test: moving cursor should fire a 'changeCursor' event":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 5);
|
||||
var c = false;
|
||||
a.addEventListener("changeCursor", function() {
|
||||
c = true
|
||||
});
|
||||
a.moveCursorTo(0, 6);
|
||||
b.ok(c)
|
||||
}, "test: calling setCursor with the same position should not fire an event":function() {
|
||||
var a = (new d("Juhu Kinners")).getSelection();
|
||||
a.moveCursorTo(0, 5);
|
||||
var c = false;
|
||||
a.addEventListener("changeCursor", function() {
|
||||
c = true
|
||||
});
|
||||
a.moveCursorTo(0, 5);
|
||||
b.notOk(c)
|
||||
}};
|
||||
g.exports = e("async/test").testcase(f)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,185 +1,247 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require("../../../support/paths");
|
||||
var dom = require("jsdom/level2/html").dom.level2.html, browser = require("jsdom/browser/index").windowAugmentation(dom);
|
||||
global.document = browser.document;
|
||||
global.window = browser.window;
|
||||
global.self = browser.self;
|
||||
global.navigator = browser.navigator;
|
||||
global.location = browser.location;
|
||||
var Document = require("../document"), Editor = require("../editor"), JavaScriptMode = require("../mode/javascript"), MockRenderer = require("./mockrenderer"), assert = require("./assertions"), Test = {"test: delete line from the middle":function() {
|
||||
var b = new Document("a\nb\nc\nd"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.removeLines();
|
||||
assert.equal(b.toString(), "a\nc\nd");
|
||||
assert.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
assert.equal(b.toString(), "a\nd");
|
||||
assert.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
assert.equal(b.toString(), "a\n");
|
||||
assert.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
assert.equal(b.toString(), "a\n");
|
||||
assert.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: delete multiple selected lines":function() {
|
||||
var b = new Document("a\nb\nc\nd"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.removeLines();
|
||||
assert.equal(b.toString(), "a\nd");
|
||||
assert.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: delete first line":function() {
|
||||
var b = new Document("a\nb\nc"), a = new Editor(new MockRenderer, b);
|
||||
a.removeLines();
|
||||
assert.equal(b.toString(), "b\nc");
|
||||
assert.position(a.getCursorPosition(), 0, 0)
|
||||
}, "test: delete last":function() {
|
||||
var b = new Document("a\nb\nc"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(2, 1);
|
||||
a.removeLines();
|
||||
assert.equal(b.toString(), "a\nb\n");
|
||||
assert.position(a.getCursorPosition(), 2, 0)
|
||||
}, "__test: indent block":function() {
|
||||
var b = new Document("a12345\nb12345\nc12345"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(1, 3);
|
||||
a.getSelection().selectDown();
|
||||
a.blockIndent(" ");
|
||||
assert.equal("a12345\n b12345\n c12345", b.toString());
|
||||
assert.position(a.getCursorPosition(), 2, 7);
|
||||
b = a.getSelectionRange();
|
||||
assert.position(b.start, 1, 7);
|
||||
assert.position(b.end, 2, 7)
|
||||
}, "__test: outdent block":function() {
|
||||
var b = new Document(" a12345\n b12345\n c12345"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(0, 3);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectDown();
|
||||
a.blockOutdent(" ");
|
||||
assert.equal(b.toString(), " a12345\nb12345\n c12345");
|
||||
assert.position(a.getCursorPosition(), 2, 0);
|
||||
var c = a.getSelectionRange();
|
||||
assert.position(c.start, 0, 1);
|
||||
assert.position(c.end, 2, 1);
|
||||
a.blockOutdent(" ");
|
||||
assert.equal(b.toString(), "a12345\nb12345\nc12345");
|
||||
c = a.getSelectionRange();
|
||||
assert.position(c.start, 0, 1);
|
||||
assert.position(c.end, 2, 1)
|
||||
}, "test: outent without a selection should update cursor":function() {
|
||||
var b = new Document(" 12"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(0, 3);
|
||||
a.blockOutdent(" ");
|
||||
assert.equal(b.toString(), " 12");
|
||||
assert.position(a.getCursorPosition(), 0, 0)
|
||||
}, "test: comment lines should perserve selection":function() {
|
||||
var b = new Document(" abc\ncde", new JavaScriptMode), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(0, 2);
|
||||
a.getSelection().selectDown();
|
||||
a.toggleCommentLines();
|
||||
assert.equal("// abc\n//cde", b.toString());
|
||||
b = a.getSelectionRange();
|
||||
assert.position(b.start, 0, 4);
|
||||
assert.position(b.end, 1, 4)
|
||||
}, "test: uncomment lines should perserve selection":function() {
|
||||
var b = new Document("// abc\n//cde", new JavaScriptMode), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(0, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectRight();
|
||||
a.getSelection().selectRight();
|
||||
a.toggleCommentLines();
|
||||
assert.equal(" abc\ncde", b.toString());
|
||||
assert.range(a.getSelectionRange(), 0, 0, 1, 1)
|
||||
}, "test: comment lines - if the selection end is at the line start it should stay there":function() {
|
||||
var b = new Document("abc\ncde", new JavaScriptMode);
|
||||
b = new Editor(new MockRenderer, b);
|
||||
b.moveCursorTo(0, 0);
|
||||
b.getSelection().selectDown();
|
||||
b.toggleCommentLines();
|
||||
assert.range(b.getSelectionRange(), 0, 2, 1, 0);
|
||||
b = new Document("abc\ncde", new JavaScriptMode);
|
||||
b = new Editor(new MockRenderer, b);
|
||||
b.moveCursorTo(1, 0);
|
||||
b.getSelection().selectUp();
|
||||
b.toggleCommentLines();
|
||||
assert.range(b.getSelectionRange(), 0, 2, 1, 0)
|
||||
}, "test: move lines down should select moved lines":function() {
|
||||
var b = new Document("11\n22\n33\n44"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(0, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.moveLinesDown();
|
||||
assert.equal("33\n11\n22\n44", b.toString());
|
||||
assert.position(a.getCursorPosition(), 1, 0);
|
||||
assert.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
assert.position(a.getSelection().getSelectionLead(), 1, 0);
|
||||
a.moveLinesDown();
|
||||
assert.equal("33\n44\n11\n22", b.toString());
|
||||
assert.position(a.getCursorPosition(), 2, 0);
|
||||
assert.position(a.getSelection().getSelectionAnchor(), 3, 2);
|
||||
assert.position(a.getSelection().getSelectionLead(), 2, 0);
|
||||
a.moveLinesDown();
|
||||
assert.equal("33\n44\n11\n22", b.toString());
|
||||
assert.position(a.getCursorPosition(), 2, 0);
|
||||
assert.position(a.getSelection().getSelectionAnchor(), 3, 2);
|
||||
assert.position(a.getSelection().getSelectionLead(), 2, 0)
|
||||
}, "__test: move lines up should select moved lines":function() {
|
||||
var b = new Document("11\n22\n33\n44"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(2, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.moveLinesUp();
|
||||
assert.equal(b.toString(), "11\n33\n44\n22");
|
||||
assert.position(a.getCursorPosition(), 1, 0);
|
||||
assert.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
assert.position(a.getSelection().getSelectionLead(), 1, 0);
|
||||
a.moveLinesUp();
|
||||
assert.equal(b.toString(), "33\n44\n11\n22");
|
||||
assert.position(a.getCursorPosition(), 0, 0);
|
||||
assert.position(a.getSelection().getSelectionAnchor(), 2, 0);
|
||||
assert.position(a.getSelection().getSelectionLead(), 0, 0)
|
||||
}, "test: move line without active selection should move cursor to start of the moved line":function() {
|
||||
var b = new Document("11\n22\n33\n44"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.clearSelection();
|
||||
a.moveLinesDown();
|
||||
assert.equal("11\n33\n22\n44", b.toString());
|
||||
assert.position(a.getCursorPosition(), 2, 0);
|
||||
a.clearSelection();
|
||||
a.moveLinesUp();
|
||||
assert.equal("11\n22\n33\n44", b.toString());
|
||||
assert.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: copy lines down should select lines and place cursor at the selection start":function() {
|
||||
var b = new Document("11\n22\n33\n44"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.copyLinesDown();
|
||||
assert.equal("11\n22\n33\n22\n33\n44", b.toString());
|
||||
assert.position(a.getCursorPosition(), 3, 0);
|
||||
assert.position(a.getSelection().getSelectionAnchor(), 5, 0);
|
||||
assert.position(a.getSelection().getSelectionLead(), 3, 0)
|
||||
}, "test: copy lines up should select lines and place cursor at the selection start":function() {
|
||||
var b = new Document("11\n22\n33\n44"), a = new Editor(new MockRenderer, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.copyLinesUp();
|
||||
assert.equal("11\n22\n33\n22\n33\n44", b.toString());
|
||||
assert.position(a.getCursorPosition(), 1, 0);
|
||||
assert.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
assert.position(a.getSelection().getSelectionLead(), 1, 0)
|
||||
}, "test: input a tab with soft tab should convert it to spaces":function() {
|
||||
var b = new Document(""), a = new Editor(new MockRenderer, b);
|
||||
b.setTabSize(2);
|
||||
b.setUseSoftTabs(true);
|
||||
a.onTextInput("\t");
|
||||
assert.equal(b.toString(), " ");
|
||||
b.setTabSize(5);
|
||||
a.onTextInput("\t");
|
||||
assert.equal(b.toString(), " ")
|
||||
}, "test: input tab without soft tabs should keep the tab character":function() {
|
||||
var b = new Document(""), a = new Editor(new MockRenderer, b);
|
||||
b.setUseSoftTabs(false);
|
||||
a.onTextInput("\t");
|
||||
assert.equal(b.toString(), "\t")
|
||||
}};
|
||||
module.exports = require("async/test").testcase(Test);
|
||||
module === require.main && module.exports.exec();
|
||||
define(function(g, k, n) {
|
||||
g("./mockdom");
|
||||
var d = g("../document").Document, e = g("../editor").Editor, i = g("../mode/javascript").Mode, o = g("../undomanager").UndoManager, f = g("./mockrenderer"), c = g("./assertions");
|
||||
k = {"test: delete line from the middle":function() {
|
||||
var b = new d("a\nb\nc\nd"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nc\nd");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nd");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\n");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\n");
|
||||
c.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: delete multiple selected lines":function() {
|
||||
var b = new d("a\nb\nc\nd"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nd");
|
||||
c.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: delete first line":function() {
|
||||
var b = new d("a\nb\nc"), a = new e(new f, b);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "b\nc");
|
||||
c.position(a.getCursorPosition(), 0, 0)
|
||||
}, "test: delete last":function() {
|
||||
var b = new d("a\nb\nc"), a = new e(new f, b);
|
||||
a.moveCursorTo(2, 1);
|
||||
a.removeLines();
|
||||
c.equal(b.toString(), "a\nb\n");
|
||||
c.position(a.getCursorPosition(), 2, 0)
|
||||
}, "test: indent block":function() {
|
||||
var b = new d("a12345\nb12345\nc12345"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 3);
|
||||
a.getSelection().selectDown();
|
||||
a.indent();
|
||||
c.equal("a12345\n b12345\n c12345", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 7);
|
||||
b = a.getSelectionRange();
|
||||
c.position(b.start, 1, 7);
|
||||
c.position(b.end, 2, 7)
|
||||
}, "test: indent selected lines":function() {
|
||||
var b = new d("a12345\nb12345\nc12345"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 0);
|
||||
a.getSelection().selectDown();
|
||||
a.indent();
|
||||
c.equal("a12345\n b12345\nc12345", b.toString())
|
||||
}, "test: no auto indent if cursor is before the {":function() {
|
||||
var b = new d("{", new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 0);
|
||||
a.onTextInput("\n");
|
||||
c.equal("\n{", b.toString())
|
||||
}, "test: outdent block":function() {
|
||||
var b = new d(" a12345\n b12345\n c12345"), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 5);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectDown();
|
||||
a.blockOutdent();
|
||||
c.equal(b.toString(), " a12345\nb12345\n c12345");
|
||||
c.position(a.getCursorPosition(), 2, 1);
|
||||
var h = a.getSelectionRange();
|
||||
c.position(h.start, 0, 1);
|
||||
c.position(h.end, 2, 1);
|
||||
a.blockOutdent();
|
||||
c.equal(b.toString(), "a12345\nb12345\nc12345");
|
||||
h = a.getSelectionRange();
|
||||
c.position(h.start, 0, 0);
|
||||
c.position(h.end, 2, 0)
|
||||
}, "test: outent without a selection should update cursor":function() {
|
||||
var b = new d(" 12"), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 3);
|
||||
a.blockOutdent(" ");
|
||||
c.equal(b.toString(), " 12");
|
||||
c.position(a.getCursorPosition(), 0, 0)
|
||||
}, "test: comment lines should perserve selection":function() {
|
||||
var b = new d(" abc\ncde", new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 2);
|
||||
a.getSelection().selectDown();
|
||||
a.toggleCommentLines();
|
||||
c.equal("// abc\n//cde", b.toString());
|
||||
b = a.getSelectionRange();
|
||||
c.position(b.start, 0, 4);
|
||||
c.position(b.end, 1, 4)
|
||||
}, "test: uncomment lines should perserve selection":function() {
|
||||
var b = new d("// abc\n//cde", new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectRight();
|
||||
a.getSelection().selectRight();
|
||||
a.toggleCommentLines();
|
||||
c.equal(" abc\ncde", b.toString());
|
||||
c.range(a.getSelectionRange(), 0, 0, 1, 1)
|
||||
}, "test: toggle comment lines twice should return the original text":function() {
|
||||
var b = new d([" abc", "cde", "fg"], new i), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 0);
|
||||
a.getSelection().selectDown();
|
||||
a.getSelection().selectDown();
|
||||
a.toggleCommentLines();
|
||||
a.toggleCommentLines();
|
||||
c.equal(" abc\ncde\nfg", b.toString())
|
||||
}, "test: comment lines - if the selection end is at the line start it should stay there":function() {
|
||||
var b = new d("abc\ncde", new i);
|
||||
b = new e(new f, b);
|
||||
b.moveCursorTo(0, 0);
|
||||
b.getSelection().selectDown();
|
||||
b.toggleCommentLines();
|
||||
c.range(b.getSelectionRange(), 0, 2, 1, 0);
|
||||
b = new d("abc\ncde", new i);
|
||||
b = new e(new f, b);
|
||||
b.moveCursorTo(1, 0);
|
||||
b.getSelection().selectUp();
|
||||
b.toggleCommentLines();
|
||||
c.range(b.getSelectionRange(), 0, 2, 1, 0)
|
||||
}, "test: move lines down should select moved lines":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(0, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.moveLinesDown();
|
||||
c.equal("33\n11\n22\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 1, 0);
|
||||
a.moveLinesDown();
|
||||
c.equal("33\n44\n11\n22", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 2);
|
||||
c.position(a.getSelection().getSelectionLead(), 2, 0);
|
||||
a.moveLinesDown();
|
||||
c.equal("33\n44\n11\n22", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 2);
|
||||
c.position(a.getSelection().getSelectionLead(), 2, 0)
|
||||
}, "test: move lines up should select moved lines":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(2, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.moveLinesUp();
|
||||
c.equal(b.toString(), "11\n33\n44\n22");
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 1, 0);
|
||||
a.moveLinesUp();
|
||||
c.equal(b.toString(), "33\n44\n11\n22");
|
||||
c.position(a.getCursorPosition(), 0, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 2, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 0, 0)
|
||||
}, "test: move line without active selection should move cursor to start of the moved line":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.clearSelection();
|
||||
a.moveLinesDown();
|
||||
c.equal("11\n33\n22\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 2, 0);
|
||||
a.clearSelection();
|
||||
a.moveLinesUp();
|
||||
c.equal("11\n22\n33\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 1, 0)
|
||||
}, "test: copy lines down should select lines and place cursor at the selection start":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.copyLinesDown();
|
||||
c.equal("11\n22\n33\n22\n33\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 5, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 3, 0)
|
||||
}, "test: copy lines up should select lines and place cursor at the selection start":function() {
|
||||
var b = new d("11\n22\n33\n44"), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.getSelection().selectDown();
|
||||
a.copyLinesUp();
|
||||
c.equal("11\n22\n33\n22\n33\n44", b.toString());
|
||||
c.position(a.getCursorPosition(), 1, 0);
|
||||
c.position(a.getSelection().getSelectionAnchor(), 3, 0);
|
||||
c.position(a.getSelection().getSelectionLead(), 1, 0)
|
||||
}, "test: input a tab with soft tab should convert it to spaces":function() {
|
||||
var b = new d(""), a = new e(new f, b);
|
||||
b.setTabSize(2);
|
||||
b.setUseSoftTabs(true);
|
||||
a.onTextInput("\t");
|
||||
c.equal(b.toString(), " ");
|
||||
b.setTabSize(5);
|
||||
a.onTextInput("\t");
|
||||
c.equal(b.toString(), " ")
|
||||
}, "test: input tab without soft tabs should keep the tab character":function() {
|
||||
var b = new d(""), a = new e(new f, b);
|
||||
b.setUseSoftTabs(false);
|
||||
a.onTextInput("\t");
|
||||
c.equal(b.toString(), "\t")
|
||||
}, "test: undo/redo for delete line":function() {
|
||||
var b = new d(["111", "222", "333"]), a = new o;
|
||||
b.setUndoManager(a);
|
||||
var h = b.toString(), j = new e(new f, b);
|
||||
j.removeLines();
|
||||
var l = b.toString();
|
||||
c.equal(l, "222\n333");
|
||||
b.$informUndoManager.call();
|
||||
j.removeLines();
|
||||
var m = b.toString();
|
||||
c.equal(m, "333");
|
||||
b.$informUndoManager.call();
|
||||
j.removeLines();
|
||||
j = b.toString();
|
||||
c.equal(j, "");
|
||||
b.$informUndoManager.call();
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), m);
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), l);
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), h);
|
||||
a.undo();
|
||||
b.$informUndoManager.call();
|
||||
c.equal(b.toString(), h)
|
||||
}, "test: remove left should remove character left of the cursor":function() {
|
||||
var b = new d(["123", "456"]), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 1);
|
||||
a.removeLeft();
|
||||
c.equal(b.toString(), "123\n56")
|
||||
}, "test: remove left should remove line break if cursor is at line start":function() {
|
||||
var b = new d(["123", "456"]), a = new e(new f, b);
|
||||
a.moveCursorTo(1, 0);
|
||||
a.removeLeft();
|
||||
c.equal(b.toString(), "123456")
|
||||
}, "test: remove left should remove tabsize spaces if cursor is on a tab stop and preceeded by spaces":function() {
|
||||
var b = new d(["123", " 456"]);
|
||||
b.setUseSoftTabs(true);
|
||||
b.setTabSize(4);
|
||||
var a = new e(new f, b);
|
||||
a.moveCursorTo(1, 8);
|
||||
a.removeLeft();
|
||||
c.equal(b.toString(), "123\n 456")
|
||||
}};
|
||||
n.exports = g("async/test").testcase(k)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,28 +1,31 @@
|
|||
/*
|
||||
LGPLv3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
|
||||
*/
|
||||
require("../../../support/paths");
|
||||
var Document = "../document", VirtualRenderer = "../virtual_renderer", assert = "../assertions", Test = {"test: screen2text the column should be rounded to the next character edge":function() {
|
||||
var b = document.createElement("div");
|
||||
b.style.left = "0px";
|
||||
b.style.top = "0px";
|
||||
b.style.width = "100px";
|
||||
b.style.height = "100px";
|
||||
document.body.style.margin = "0px";
|
||||
document.body.style.padding = "0px";
|
||||
document.body.appendChild(b);
|
||||
var a = new VirtualRenderer(b);
|
||||
a.setDocument(new Document("1234"));
|
||||
a.characterWidth = 10;
|
||||
a.lineHeight = 15;
|
||||
assert.position(a.screenToTextCoordinates(0, 0), 0, 0);
|
||||
assert.position(a.screenToTextCoordinates(4, 0), 0, 0);
|
||||
assert.position(a.screenToTextCoordinates(5, 0), 0, 1);
|
||||
assert.position(a.screenToTextCoordinates(9, 0), 0, 1);
|
||||
assert.position(a.screenToTextCoordinates(10, 0), 0, 1);
|
||||
assert.position(a.screenToTextCoordinates(14, 0), 0, 1);
|
||||
assert.position(a.screenToTextCoordinates(15, 0), 0, 2);
|
||||
document.body.removeChild(b)
|
||||
}};
|
||||
module.exports = require("async/test").testcase(Test);
|
||||
module === require.main && module.exports.exec();
|
||||
define(function(d, e, f) {
|
||||
d("./mockdom");
|
||||
var g = d("../document").Document, h = d("../virtual_renderer").VirtualRenderer, b = d("./assertions");
|
||||
e = {"test: screen2text the column should be rounded to the next character edge":function() {
|
||||
var c = document.createElement("div");
|
||||
c.style.left = "0px";
|
||||
c.style.top = "0px";
|
||||
c.style.width = "100px";
|
||||
c.style.height = "100px";
|
||||
document.body.style.margin = "0px";
|
||||
document.body.style.padding = "0px";
|
||||
document.body.appendChild(c);
|
||||
var a = new h(c);
|
||||
a.setDocument(new g("1234"));
|
||||
a.characterWidth = 10;
|
||||
a.lineHeight = 15;
|
||||
b.position(a.screenToTextCoordinates(0, 0), 0, 0);
|
||||
b.position(a.screenToTextCoordinates(4, 0), 0, 0);
|
||||
b.position(a.screenToTextCoordinates(5, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(9, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(10, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(14, 0), 0, 1);
|
||||
b.position(a.screenToTextCoordinates(15, 0), 0, 2);
|
||||
document.body.removeChild(c)
|
||||
}};
|
||||
f.exports = d("async/test").testcase(e)
|
||||
});
|
||||
if(module === require.main) {
|
||||
require("../../../support/paths");
|
||||
exports.exec()
|
||||
};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
define(function(l) {
|
||||
var b = l("./lib/event");
|
||||
return function(m, c) {
|
||||
define(function(l, m) {
|
||||
var b = l("pilot/event");
|
||||
m.TextInput = function(n, c) {
|
||||
function e() {
|
||||
if(!f) {
|
||||
var d = a.value;
|
||||
|
|
@ -19,7 +19,7 @@ define(function(l) {
|
|||
h.position = "absolute";
|
||||
h.left = "-10000px";
|
||||
h.top = "-10000px";
|
||||
m.appendChild(a);
|
||||
n.appendChild(a);
|
||||
var j = String.fromCharCode(0);
|
||||
e();
|
||||
var i = false, f = false, g = function() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-clouds .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-clouds .ace_scroller { background-color: #FFFFFF;}.ace-clouds .ace_text-layer { cursor: text; color: #000000;}.ace-clouds .ace_cursor { border-left: 2px solid #000000;}.ace-clouds .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-clouds .ace_marker-layer .ace_selection { background: #BDD5FC;}.ace-clouds .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds .ace_marker-layer .ace_active_line { background: #FFFBD1;} .ace-clouds .ace_invisible { color: #BFBFBF;}.ace-clouds .ace_keyword { color:#AF956F;}.ace-clouds .ace_keyword.ace_operator { color:#484848;}.ace-clouds .ace_constant { }.ace-clouds .ace_constant.ace_language { color:#39946A;}.ace-clouds .ace_constant.ace_library { }.ace-clouds .ace_constant.ace_numeric { color:#46A609;}.ace-clouds .ace_invalid { background-color:#FF002A;}.ace-clouds .ace_invalid.ace_illegal { }.ace-clouds .ace_invalid.ace_deprecated { }.ace-clouds .ace_support { }.ace-clouds .ace_support.ace_function { color:#C52727;}.ace-clouds .ace_function.ace_buildin { }.ace-clouds .ace_string { color:#5D90CD;}.ace-clouds .ace_string.ace_regexp { }.ace-clouds .ace_comment { color:#BCC8BA;}.ace-clouds .ace_comment.ace_doc { }.ace-clouds .ace_comment.ace_doc.ace_tag { }.ace-clouds .ace_variable { }.ace-clouds .ace_variable.ace_language { }.ace-clouds .ace_xml_pe { }");
|
||||
return{cssClass:"ace-clouds"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-clouds .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-clouds .ace_scroller { background-color: #FFFFFF;}.ace-clouds .ace_text-layer { cursor: text; color: #000000;}.ace-clouds .ace_cursor { border-left: 2px solid #000000;}.ace-clouds .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-clouds .ace_marker-layer .ace_selection { background: #BDD5FC;}.ace-clouds .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds .ace_marker-layer .ace_active_line { background: #FFFBD1;} .ace-clouds .ace_invisible { color: #BFBFBF;}.ace-clouds .ace_keyword { color:#AF956F;}.ace-clouds .ace_keyword.ace_operator { color:#484848;}.ace-clouds .ace_constant { }.ace-clouds .ace_constant.ace_language { color:#39946A;}.ace-clouds .ace_constant.ace_library { }.ace-clouds .ace_constant.ace_numeric { color:#46A609;}.ace-clouds .ace_invalid { background-color:#FF002A;}.ace-clouds .ace_invalid.ace_illegal { }.ace-clouds .ace_invalid.ace_deprecated { }.ace-clouds .ace_support { }.ace-clouds .ace_support.ace_function { color:#C52727;}.ace-clouds .ace_function.ace_buildin { }.ace-clouds .ace_string { color:#5D90CD;}.ace-clouds .ace_string.ace_regexp { }.ace-clouds .ace_comment { color:#BCC8BA;}.ace-clouds .ace_comment.ace_doc { }.ace-clouds .ace_comment.ace_doc.ace_tag { }.ace-clouds .ace_variable { }.ace-clouds .ace_variable.ace_language { }.ace-clouds .ace_xml_pe { }");
|
||||
b.cssClass = "ace-clouds"
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-clouds-midnight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds-midnight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds-midnight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds-midnight .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds-midnight .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-clouds-midnight .ace_scroller { background-color: #191919;}.ace-clouds-midnight .ace_text-layer { cursor: text; color: #929292;}.ace-clouds-midnight .ace_cursor { border-left: 2px solid #7DA5DC;}.ace-clouds-midnight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #7DA5DC;} .ace-clouds-midnight .ace_marker-layer .ace_selection { background: #000000;}.ace-clouds-midnight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds-midnight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds-midnight .ace_marker-layer .ace_active_line { background: rgba(215, 215, 215, 0.031);} .ace-clouds-midnight .ace_invisible { color: #BFBFBF;}.ace-clouds-midnight .ace_keyword { color:#927C5D;}.ace-clouds-midnight .ace_keyword.ace_operator { color:#4B4B4B;}.ace-clouds-midnight .ace_constant { }.ace-clouds-midnight .ace_constant.ace_language { color:#39946A;}.ace-clouds-midnight .ace_constant.ace_library { }.ace-clouds-midnight .ace_constant.ace_numeric { color:#46A609;}.ace-clouds-midnight .ace_invalid { color:#FFFFFF;background-color:#E92E2E;}.ace-clouds-midnight .ace_invalid.ace_illegal { }.ace-clouds-midnight .ace_invalid.ace_deprecated { }.ace-clouds-midnight .ace_support { }.ace-clouds-midnight .ace_support.ace_function { color:#E92E2E;}.ace-clouds-midnight .ace_function.ace_buildin { }.ace-clouds-midnight .ace_string { color:#5D90CD;}.ace-clouds-midnight .ace_string.ace_regexp { }.ace-clouds-midnight .ace_comment { color:#3C403B;}.ace-clouds-midnight .ace_comment.ace_doc { }.ace-clouds-midnight .ace_comment.ace_doc.ace_tag { }.ace-clouds-midnight .ace_variable { }.ace-clouds-midnight .ace_variable.ace_language { }.ace-clouds-midnight .ace_xml_pe { }");
|
||||
return{cssClass:"ace-clouds-midnight"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-clouds-midnight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-clouds-midnight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-clouds-midnight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-clouds-midnight .ace_gutter-layer { width: 100%; text-align: right;}.ace-clouds-midnight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-clouds-midnight .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-clouds-midnight .ace_scroller { background-color: #191919;}.ace-clouds-midnight .ace_text-layer { cursor: text; color: #929292;}.ace-clouds-midnight .ace_cursor { border-left: 2px solid #7DA5DC;}.ace-clouds-midnight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #7DA5DC;} .ace-clouds-midnight .ace_marker-layer .ace_selection { background: #000000;}.ace-clouds-midnight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-clouds-midnight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #BFBFBF;}.ace-clouds-midnight .ace_marker-layer .ace_active_line { background: rgba(215, 215, 215, 0.031);} .ace-clouds-midnight .ace_invisible { color: #BFBFBF;}.ace-clouds-midnight .ace_keyword { color:#927C5D;}.ace-clouds-midnight .ace_keyword.ace_operator { color:#4B4B4B;}.ace-clouds-midnight .ace_constant { }.ace-clouds-midnight .ace_constant.ace_language { color:#39946A;}.ace-clouds-midnight .ace_constant.ace_library { }.ace-clouds-midnight .ace_constant.ace_numeric { color:#46A609;}.ace-clouds-midnight .ace_invalid { color:#FFFFFF;background-color:#E92E2E;}.ace-clouds-midnight .ace_invalid.ace_illegal { }.ace-clouds-midnight .ace_invalid.ace_deprecated { }.ace-clouds-midnight .ace_support { }.ace-clouds-midnight .ace_support.ace_function { color:#E92E2E;}.ace-clouds-midnight .ace_function.ace_buildin { }.ace-clouds-midnight .ace_string { color:#5D90CD;}.ace-clouds-midnight .ace_string.ace_regexp { }.ace-clouds-midnight .ace_comment { color:#3C403B;}.ace-clouds-midnight .ace_comment.ace_doc { }.ace-clouds-midnight .ace_comment.ace_doc.ace_tag { }.ace-clouds-midnight .ace_variable { }.ace-clouds-midnight .ace_variable.ace_language { }.ace-clouds-midnight .ace_xml_pe { }");
|
||||
b.cssClass = "ace-clouds-midnight"
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-cobalt .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-cobalt .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-cobalt .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-cobalt .ace_gutter-layer { width: 100%; text-align: right;}.ace-cobalt .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-cobalt .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-cobalt .ace_scroller { background-color: #002240;}.ace-cobalt .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-cobalt .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-cobalt .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-cobalt .ace_marker-layer .ace_selection { background: rgba(179, 101, 57, 0.75);}.ace-cobalt .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-cobalt .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.35);} .ace-cobalt .ace_invisible { color: rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_keyword { color:#FF9D00;}.ace-cobalt .ace_keyword.ace_operator { }.ace-cobalt .ace_constant { color:#FF628C;}.ace-cobalt .ace_constant.ace_language { }.ace-cobalt .ace_constant.ace_library { }.ace-cobalt .ace_constant.ace_numeric { }.ace-cobalt .ace_invalid { color:#F8F8F8;background-color:#800F00;}.ace-cobalt .ace_invalid.ace_illegal { }.ace-cobalt .ace_invalid.ace_deprecated { }.ace-cobalt .ace_support { color:#80FFBB;}.ace-cobalt .ace_support.ace_function { color:#FFB054;}.ace-cobalt .ace_function.ace_buildin { }.ace-cobalt .ace_string { }.ace-cobalt .ace_string.ace_regexp { color:#80FFC2;}.ace-cobalt .ace_comment { font-style:italic;color:#0088FF;}.ace-cobalt .ace_comment.ace_doc { }.ace-cobalt .ace_comment.ace_doc.ace_tag { }.ace-cobalt .ace_variable { color:#CCCCCC;}.ace-cobalt .ace_variable.ace_language { color:#FF80E1;}.ace-cobalt .ace_xml_pe { }");
|
||||
return{cssClass:"ace-cobalt"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-cobalt .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-cobalt .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-cobalt .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-cobalt .ace_gutter-layer { width: 100%; text-align: right;}.ace-cobalt .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-cobalt .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-cobalt .ace_scroller { background-color: #002240;}.ace-cobalt .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-cobalt .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-cobalt .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-cobalt .ace_marker-layer .ace_selection { background: rgba(179, 101, 57, 0.75);}.ace-cobalt .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-cobalt .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.35);} .ace-cobalt .ace_invisible { color: rgba(255, 255, 255, 0.15);}.ace-cobalt .ace_keyword { color:#FF9D00;}.ace-cobalt .ace_keyword.ace_operator { }.ace-cobalt .ace_constant { color:#FF628C;}.ace-cobalt .ace_constant.ace_language { }.ace-cobalt .ace_constant.ace_library { }.ace-cobalt .ace_constant.ace_numeric { }.ace-cobalt .ace_invalid { color:#F8F8F8;background-color:#800F00;}.ace-cobalt .ace_invalid.ace_illegal { }.ace-cobalt .ace_invalid.ace_deprecated { }.ace-cobalt .ace_support { color:#80FFBB;}.ace-cobalt .ace_support.ace_function { color:#FFB054;}.ace-cobalt .ace_function.ace_buildin { }.ace-cobalt .ace_string { }.ace-cobalt .ace_string.ace_regexp { color:#80FFC2;}.ace-cobalt .ace_comment { font-style:italic;color:#0088FF;}.ace-cobalt .ace_comment.ace_doc { }.ace-cobalt .ace_comment.ace_doc.ace_tag { }.ace-cobalt .ace_variable { color:#CCCCCC;}.ace-cobalt .ace_variable.ace_language { color:#FF80E1;}.ace-cobalt .ace_xml_pe { }");
|
||||
b.cssClass = "ace-cobalt"
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-dawn .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-dawn .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-dawn .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-dawn .ace_gutter-layer { width: 100%; text-align: right;}.ace-dawn .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-dawn .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-dawn .ace_scroller { background-color: #F9F9F9;}.ace-dawn .ace_text-layer { cursor: text; color: #080808;}.ace-dawn .ace_cursor { border-left: 2px solid #000000;}.ace-dawn .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-dawn .ace_marker-layer .ace_selection { background: rgba(39, 95, 255, 0.30);}.ace-dawn .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-dawn .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(75, 75, 126, 0.50);}.ace-dawn .ace_marker-layer .ace_active_line { background: rgba(36, 99, 180, 0.12);} .ace-dawn .ace_invisible { color: rgba(75, 75, 126, 0.50);}.ace-dawn .ace_keyword { color:#794938;}.ace-dawn .ace_keyword.ace_operator { }.ace-dawn .ace_constant { color:#811F24;}.ace-dawn .ace_constant.ace_language { }.ace-dawn .ace_constant.ace_library { }.ace-dawn .ace_constant.ace_numeric { }.ace-dawn .ace_invalid { }.ace-dawn .ace_invalid.ace_illegal { text-decoration:underline;font-style:italic;color:#F8F8F8;background-color:#B52A1D;}.ace-dawn .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#B52A1D;}.ace-dawn .ace_support { color:#691C97;}.ace-dawn .ace_support.ace_function { color:#693A17;}.ace-dawn .ace_function.ace_buildin { }.ace-dawn .ace_string { color:#0B6125;}.ace-dawn .ace_string.ace_regexp { color:#CF5628;}.ace-dawn .ace_comment { font-style:italic;color:#5A525F;}.ace-dawn .ace_comment.ace_doc { }.ace-dawn .ace_comment.ace_doc.ace_tag { }.ace-dawn .ace_variable { color:#234A97;}.ace-dawn .ace_variable.ace_language { }.ace-dawn .ace_xml_pe { }");
|
||||
return{cssClass:"ace-dawn"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-dawn .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-dawn .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-dawn .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-dawn .ace_gutter-layer { width: 100%; text-align: right;}.ace-dawn .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-dawn .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-dawn .ace_scroller { background-color: #F9F9F9;}.ace-dawn .ace_text-layer { cursor: text; color: #080808;}.ace-dawn .ace_cursor { border-left: 2px solid #000000;}.ace-dawn .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #000000;} .ace-dawn .ace_marker-layer .ace_selection { background: rgba(39, 95, 255, 0.30);}.ace-dawn .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-dawn .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(75, 75, 126, 0.50);}.ace-dawn .ace_marker-layer .ace_active_line { background: rgba(36, 99, 180, 0.12);} .ace-dawn .ace_invisible { color: rgba(75, 75, 126, 0.50);}.ace-dawn .ace_keyword { color:#794938;}.ace-dawn .ace_keyword.ace_operator { }.ace-dawn .ace_constant { color:#811F24;}.ace-dawn .ace_constant.ace_language { }.ace-dawn .ace_constant.ace_library { }.ace-dawn .ace_constant.ace_numeric { }.ace-dawn .ace_invalid { }.ace-dawn .ace_invalid.ace_illegal { text-decoration:underline;font-style:italic;color:#F8F8F8;background-color:#B52A1D;}.ace-dawn .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#B52A1D;}.ace-dawn .ace_support { color:#691C97;}.ace-dawn .ace_support.ace_function { color:#693A17;}.ace-dawn .ace_function.ace_buildin { }.ace-dawn .ace_string { color:#0B6125;}.ace-dawn .ace_string.ace_regexp { color:#CF5628;}.ace-dawn .ace_comment { font-style:italic;color:#5A525F;}.ace-dawn .ace_comment.ace_doc { }.ace-dawn .ace_comment.ace_doc.ace_tag { }.ace-dawn .ace_variable { color:#234A97;}.ace-dawn .ace_variable.ace_language { }.ace-dawn .ace_xml_pe { }");
|
||||
b.cssClass = "ace-dawn"
|
||||
});
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
define("ace/theme/eclipse", ["require", "exports", "module", "text!ace/theme/eclipse.css!.ace-eclipse .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-eclipse .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-eclipse .ace_gutter {\n width: 40px;\n background: rgb(227, 227, 227);\n border-right: 1px solid rgb(159, 159, 159);\t \n color: rgb(136, 136, 136);\n}\n\n.ace-eclipse .ace_gutter-layer {\n right: 10px;\n text-align: right;\n}\n\n.ace-eclipse .ace_text-layer {\n cursor: text;\n}\n\n.ace-eclipse .ace_cursor {\n border-left: 1px solid black;\n}\n\n.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {\n color: rgb(127, 0, 85);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-eclipse .ace_line .ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_line .ace_string {\n color: rgb(42, 0, 255);\n}\n\n.ace-eclipse .ace_line .ace_comment {\n color: rgb(63, 127, 95);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc {\n color: rgb(63, 95, 191);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(127, 159, 191);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_numeric {\n}\n\n.ace-eclipse .ace_line .ace_tag {\n\tcolor: rgb(63, 127, 127);\n}\n\n.ace-eclipse .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-eclipse .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-eclipse .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}",
|
||||
"../lib/dom"], function(a, c, d, b) {
|
||||
a("../lib/dom").importCssString(b);
|
||||
return{cssClass:"ace-eclipse"}
|
||||
define("ace/theme/eclipse", ["require", "exports", "module", "pilot/dom", "text!ace/theme/eclipse.css!.ace-eclipse .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-eclipse .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-eclipse .ace_gutter {\n width: 40px;\n background: rgb(227, 227, 227);\n border-right: 1px solid rgb(159, 159, 159);\t \n color: rgb(136, 136, 136);\n}\n\n.ace-eclipse .ace_gutter-layer {\n right: 10px;\n text-align: right;\n}\n\n.ace-eclipse .ace_text-layer {\n cursor: text;\n}\n\n.ace-eclipse .ace_cursor {\n border-left: 1px solid black;\n}\n\n.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {\n color: rgb(127, 0, 85);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-eclipse .ace_line .ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_line .ace_string {\n color: rgb(42, 0, 255);\n}\n\n.ace-eclipse .ace_line .ace_comment {\n color: rgb(63, 127, 95);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc {\n color: rgb(63, 95, 191);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(127, 159, 191);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_numeric {\n}\n\n.ace-eclipse .ace_line .ace_tag {\n\tcolor: rgb(63, 127, 127);\n}\n\n.ace-eclipse .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-eclipse .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-eclipse .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}"],
|
||||
function(a, b) {
|
||||
var c = a("pilot/dom");
|
||||
a = a("text!ace/theme/eclipse.css!.ace-eclipse .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-eclipse .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-eclipse .ace_gutter {\n width: 40px;\n background: rgb(227, 227, 227);\n border-right: 1px solid rgb(159, 159, 159);\t \n color: rgb(136, 136, 136);\n}\n\n.ace-eclipse .ace_gutter-layer {\n right: 10px;\n text-align: right;\n}\n\n.ace-eclipse .ace_text-layer {\n cursor: text;\n}\n\n.ace-eclipse .ace_cursor {\n border-left: 1px solid black;\n}\n\n.ace-eclipse .ace_line .ace_keyword, .ace-eclipse .ace_line .ace_variable {\n color: rgb(127, 0, 85);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-eclipse .ace_line .ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-eclipse .ace_line .ace_string {\n color: rgb(42, 0, 255);\n}\n\n.ace-eclipse .ace_line .ace_comment {\n color: rgb(63, 127, 95);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc {\n color: rgb(63, 95, 191);\n}\n\n.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(127, 159, 191);\n}\n\n.ace-eclipse .ace_line .ace_constant.ace_numeric {\n}\n\n.ace-eclipse .ace_line .ace_tag {\n\tcolor: rgb(63, 127, 127);\n}\n\n.ace-eclipse .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-eclipse .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-eclipse .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-eclipse .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}");
|
||||
c.importCssString(a);
|
||||
b.cssClass = "ace-eclipse"
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-idle-fingers .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-idle-fingers .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-idle-fingers .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-idle-fingers .ace_gutter-layer { width: 100%; text-align: right;}.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-idle-fingers .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-idle-fingers .ace_scroller { background-color: #323232;}.ace-idle-fingers .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-idle-fingers .ace_cursor { border-left: 2px solid #91FF00;}.ace-idle-fingers .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #91FF00;} .ace-idle-fingers .ace_marker-layer .ace_selection { background: rgba(90, 100, 126, 0.88);}.ace-idle-fingers .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-idle-fingers .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #404040;}.ace-idle-fingers .ace_marker-layer .ace_active_line { background: #353637;} .ace-idle-fingers .ace_invisible { color: #404040;}.ace-idle-fingers .ace_keyword { color:#CC7833;}.ace-idle-fingers .ace_keyword.ace_operator { }.ace-idle-fingers .ace_constant { color:#6C99BB;}.ace-idle-fingers .ace_constant.ace_language { }.ace-idle-fingers .ace_constant.ace_library { }.ace-idle-fingers .ace_constant.ace_numeric { }.ace-idle-fingers .ace_invalid { color:#FFFFFF;background-color:#FF0000;}.ace-idle-fingers .ace_invalid.ace_illegal { }.ace-idle-fingers .ace_invalid.ace_deprecated { }.ace-idle-fingers .ace_support { }.ace-idle-fingers .ace_support.ace_function { color:#B83426;}.ace-idle-fingers .ace_function.ace_buildin { }.ace-idle-fingers .ace_string { color:#A5C261;}.ace-idle-fingers .ace_string.ace_regexp { color:#CCCC33;}.ace-idle-fingers .ace_comment { font-style:italic;color:#BC9458;}.ace-idle-fingers .ace_comment.ace_doc { }.ace-idle-fingers .ace_comment.ace_doc.ace_tag { }.ace-idle-fingers .ace_variable { }.ace-idle-fingers .ace_variable.ace_language { }.ace-idle-fingers .ace_xml_pe { }");
|
||||
return{cssClass:"ace-idle-fingers"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-idle-fingers .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-idle-fingers .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-idle-fingers .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-idle-fingers .ace_gutter-layer { width: 100%; text-align: right;}.ace-idle-fingers .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-idle-fingers .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-idle-fingers .ace_scroller { background-color: #323232;}.ace-idle-fingers .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-idle-fingers .ace_cursor { border-left: 2px solid #91FF00;}.ace-idle-fingers .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #91FF00;} .ace-idle-fingers .ace_marker-layer .ace_selection { background: rgba(90, 100, 126, 0.88);}.ace-idle-fingers .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-idle-fingers .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #404040;}.ace-idle-fingers .ace_marker-layer .ace_active_line { background: #353637;} .ace-idle-fingers .ace_invisible { color: #404040;}.ace-idle-fingers .ace_keyword { color:#CC7833;}.ace-idle-fingers .ace_keyword.ace_operator { }.ace-idle-fingers .ace_constant { color:#6C99BB;}.ace-idle-fingers .ace_constant.ace_language { }.ace-idle-fingers .ace_constant.ace_library { }.ace-idle-fingers .ace_constant.ace_numeric { }.ace-idle-fingers .ace_invalid { color:#FFFFFF;background-color:#FF0000;}.ace-idle-fingers .ace_invalid.ace_illegal { }.ace-idle-fingers .ace_invalid.ace_deprecated { }.ace-idle-fingers .ace_support { color:#bc9458;}.ace-idle-fingers .ace_support.ace_function { color:#B83426;}.ace-idle-fingers .ace_function.ace_buildin { }.ace-idle-fingers .ace_string { color:#A5C261;}.ace-idle-fingers .ace_string.ace_regexp { color:#CCCC33;}.ace-idle-fingers .ace_comment { font-style:italic; color:#BC9458;}.ace-idle-fingers .ace_comment.ace_doc { }.ace-idle-fingers .ace_comment.ace_doc.ace_tag { }.ace-idle-fingers .ace_variable { color:#b7dff8;}.ace-idle-fingers .ace_variable.ace_language { color:#b7dff8;}.ace-idle-fingers .ace_xml_pe { }");
|
||||
b.cssClass = "ace-idle-fingers"
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-kr-theme .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-kr-theme .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-kr-theme .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-kr-theme .ace_gutter-layer { width: 100%; text-align: right;}.ace-kr-theme .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-kr-theme .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-kr-theme .ace_scroller { background-color: #0B0A09;}.ace-kr-theme .ace_text-layer { cursor: text; color: #FCFFE0;}.ace-kr-theme .ace_cursor { border-left: 2px solid #FF9900;}.ace-kr-theme .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FF9900;} .ace-kr-theme .ace_marker-layer .ace_selection { background: rgba(170, 0, 255, 0.45);}.ace-kr-theme .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-kr-theme .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_marker-layer .ace_active_line { background: #38403D;} .ace-kr-theme .ace_invisible { color: rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_keyword { color:#949C8B;}.ace-kr-theme .ace_keyword.ace_operator { }.ace-kr-theme .ace_constant { color:rgba(210, 117, 24, 0.76);}.ace-kr-theme .ace_constant.ace_language { }.ace-kr-theme .ace_constant.ace_library { }.ace-kr-theme .ace_constant.ace_numeric { }.ace-kr-theme .ace_invalid { color:#F8F8F8;background-color:#A41300;}.ace-kr-theme .ace_invalid.ace_illegal { }.ace-kr-theme .ace_invalid.ace_deprecated { }.ace-kr-theme .ace_support { color:#9FC28A;}.ace-kr-theme .ace_support.ace_function { color:#85873A;}.ace-kr-theme .ace_function.ace_buildin { }.ace-kr-theme .ace_string { }.ace-kr-theme .ace_string.ace_regexp { color:rgba(125, 255, 192, 0.65);}.ace-kr-theme .ace_comment { font-style:italic;color:#706D5B;}.ace-kr-theme .ace_comment.ace_doc { }.ace-kr-theme .ace_comment.ace_doc.ace_tag { }.ace-kr-theme .ace_variable { color:#D1A796;}.ace-kr-theme .ace_variable.ace_language { color:#FF80E1;}.ace-kr-theme .ace_xml_pe { }");
|
||||
return{cssClass:"ace-kr-theme"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-kr-theme .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-kr-theme .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-kr-theme .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-kr-theme .ace_gutter-layer { width: 100%; text-align: right;}.ace-kr-theme .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-kr-theme .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-kr-theme .ace_scroller { background-color: #0B0A09;}.ace-kr-theme .ace_text-layer { cursor: text; color: #FCFFE0;}.ace-kr-theme .ace_cursor { border-left: 2px solid #FF9900;}.ace-kr-theme .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FF9900;} .ace-kr-theme .ace_marker-layer .ace_selection { background: rgba(170, 0, 255, 0.45);}.ace-kr-theme .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-kr-theme .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_marker-layer .ace_active_line { background: #38403D;} .ace-kr-theme .ace_invisible { color: rgba(255, 177, 111, 0.32);}.ace-kr-theme .ace_keyword { color:#949C8B;}.ace-kr-theme .ace_keyword.ace_operator { }.ace-kr-theme .ace_constant { color:rgba(210, 117, 24, 0.76);}.ace-kr-theme .ace_constant.ace_language { }.ace-kr-theme .ace_constant.ace_library { }.ace-kr-theme .ace_constant.ace_numeric { }.ace-kr-theme .ace_invalid { color:#F8F8F8;background-color:#A41300;}.ace-kr-theme .ace_invalid.ace_illegal { }.ace-kr-theme .ace_invalid.ace_deprecated { }.ace-kr-theme .ace_support { color:#9FC28A;}.ace-kr-theme .ace_support.ace_function { color:#85873A;}.ace-kr-theme .ace_function.ace_buildin { }.ace-kr-theme .ace_string { }.ace-kr-theme .ace_string.ace_regexp { color:rgba(125, 255, 192, 0.65);}.ace-kr-theme .ace_comment { font-style:italic;color:#706D5B;}.ace-kr-theme .ace_comment.ace_doc { }.ace-kr-theme .ace_comment.ace_doc.ace_tag { }.ace-kr-theme .ace_variable { color:#D1A796;}.ace-kr-theme .ace_variable.ace_language { color:#FF80E1;}.ace-kr-theme .ace_xml_pe { }");
|
||||
b.cssClass = "ace-kr-theme"
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-mono-industrial .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-mono-industrial .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-mono-industrial .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-mono-industrial .ace_gutter-layer { width: 100%; text-align: right;}.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-mono-industrial .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-mono-industrial .ace_scroller { background-color: #222C28;}.ace-mono-industrial .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-mono-industrial .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-mono-industrial .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-mono-industrial .ace_marker-layer .ace_selection { background: rgba(145, 153, 148, 0.40);}.ace-mono-industrial .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-mono-industrial .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_marker-layer .ace_active_line { background: rgba(12, 13, 12, 0.25);} .ace-mono-industrial .ace_invisible { color: rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_keyword { color:#A39E64;}.ace-mono-industrial .ace_keyword.ace_operator { color:#A8B3AB;}.ace-mono-industrial .ace_constant { color:#E98800;}.ace-mono-industrial .ace_constant.ace_language { }.ace-mono-industrial .ace_constant.ace_library { }.ace-mono-industrial .ace_constant.ace_numeric { color:#E98800;}.ace-mono-industrial .ace_invalid { color:#FFFFFF;background-color:rgba(153, 0, 0, 0.68);}.ace-mono-industrial .ace_invalid.ace_illegal { }.ace-mono-industrial .ace_invalid.ace_deprecated { }.ace-mono-industrial .ace_support { }.ace-mono-industrial .ace_support.ace_function { color:#588E60;}.ace-mono-industrial .ace_function.ace_buildin { }.ace-mono-industrial .ace_string { }.ace-mono-industrial .ace_string.ace_regexp { }.ace-mono-industrial .ace_comment { color:#666C68;background-color:#151C19;}.ace-mono-industrial .ace_comment.ace_doc { }.ace-mono-industrial .ace_comment.ace_doc.ace_tag { }.ace-mono-industrial .ace_variable { }.ace-mono-industrial .ace_variable.ace_language { color:#648BD2;}.ace-mono-industrial .ace_xml_pe { }");
|
||||
return{cssClass:"ace-mono-industrial"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-mono-industrial .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-mono-industrial .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-mono-industrial .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-mono-industrial .ace_gutter-layer { width: 100%; text-align: right;}.ace-mono-industrial .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-mono-industrial .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-mono-industrial .ace_scroller { background-color: #222C28;}.ace-mono-industrial .ace_text-layer { cursor: text; color: #FFFFFF;}.ace-mono-industrial .ace_cursor { border-left: 2px solid #FFFFFF;}.ace-mono-industrial .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #FFFFFF;} .ace-mono-industrial .ace_marker-layer .ace_selection { background: rgba(145, 153, 148, 0.40);}.ace-mono-industrial .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-mono-industrial .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_marker-layer .ace_active_line { background: rgba(12, 13, 12, 0.25);} .ace-mono-industrial .ace_invisible { color: rgba(102, 108, 104, 0.50);}.ace-mono-industrial .ace_keyword { color:#A39E64;}.ace-mono-industrial .ace_keyword.ace_operator { color:#A8B3AB;}.ace-mono-industrial .ace_constant { color:#E98800;}.ace-mono-industrial .ace_constant.ace_language { }.ace-mono-industrial .ace_constant.ace_library { }.ace-mono-industrial .ace_constant.ace_numeric { color:#E98800;}.ace-mono-industrial .ace_invalid { color:#FFFFFF;background-color:rgba(153, 0, 0, 0.68);}.ace-mono-industrial .ace_invalid.ace_illegal { }.ace-mono-industrial .ace_invalid.ace_deprecated { }.ace-mono-industrial .ace_support { }.ace-mono-industrial .ace_support.ace_function { color:#588E60;}.ace-mono-industrial .ace_function.ace_buildin { }.ace-mono-industrial .ace_string { }.ace-mono-industrial .ace_string.ace_regexp { }.ace-mono-industrial .ace_comment { color:#666C68;background-color:#151C19;}.ace-mono-industrial .ace_comment.ace_doc { }.ace-mono-industrial .ace_comment.ace_doc.ace_tag { }.ace-mono-industrial .ace_variable { }.ace-mono-industrial .ace_variable.ace_language { color:#648BD2;}.ace-mono-industrial .ace_xml_pe { }");
|
||||
b.cssClass = "ace-mono-industrial"
|
||||
});
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-monokai .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-monokai .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-monokai .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-monokai .ace_gutter-layer { width: 100%; text-align: right;}.ace-monokai .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-monokai .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-monokai .ace_scroller { background-color: #272822;}.ace-monokai .ace_text-layer { cursor: text; color: #F8F8F2;}.ace-monokai .ace_cursor { border-left: 2px solid #F8F8F0;}.ace-monokai .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #F8F8F0;} .ace-monokai .ace_marker-layer .ace_selection { background: #49483E;}.ace-monokai .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-monokai .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #49483E;}.ace-monokai .ace_marker-layer .ace_active_line { background: #49483E;} .ace-monokai .ace_invisible { color: #49483E;}.ace-monokai .ace_keyword { color:#F92672;}.ace-monokai .ace_keyword.ace_operator { }.ace-monokai .ace_constant { }.ace-monokai .ace_constant.ace_language { color:#AE81FF;}.ace-monokai .ace_constant.ace_library { }.ace-monokai .ace_constant.ace_numeric { color:#AE81FF;}.ace-monokai .ace_invalid { color:#F8F8F0;background-color:#F92672;}.ace-monokai .ace_invalid.ace_illegal { }.ace-monokai .ace_invalid.ace_deprecated { color:#F8F8F0;background-color:#AE81FF;}.ace-monokai .ace_support { }.ace-monokai .ace_support.ace_function { color:#66D9EF;}.ace-monokai .ace_function.ace_buildin { }.ace-monokai .ace_string { color:#E6DB74;}.ace-monokai .ace_string.ace_regexp { }.ace-monokai .ace_comment { color:#75715E;}.ace-monokai .ace_comment.ace_doc { }.ace-monokai .ace_comment.ace_doc.ace_tag { }.ace-monokai .ace_variable { }.ace-monokai .ace_variable.ace_language { }.ace-monokai .ace_xml_pe { }");
|
||||
return{cssClass:"ace-monokai"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-monokai .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-monokai .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-monokai .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-monokai .ace_gutter-layer { width: 100%; text-align: right;}.ace-monokai .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-monokai .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-monokai .ace_scroller { background-color: #272822;}.ace-monokai .ace_text-layer { cursor: text; color: #F8F8F2;}.ace-monokai .ace_cursor { border-left: 2px solid #F8F8F0;}.ace-monokai .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #F8F8F0;} .ace-monokai .ace_marker-layer .ace_selection { background: #49483E;}.ace-monokai .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-monokai .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #49483E;}.ace-monokai .ace_marker-layer .ace_active_line { background: #49483E;} .ace-monokai .ace_invisible { color: #49483E;}.ace-monokai .ace_keyword { color:#F92672;}.ace-monokai .ace_keyword.ace_operator { }.ace-monokai .ace_constant { }.ace-monokai .ace_constant.ace_language { color:#AE81FF;}.ace-monokai .ace_constant.ace_library { }.ace-monokai .ace_constant.ace_numeric { color:#AE81FF;}.ace-monokai .ace_invalid { color:#F8F8F0;background-color:#F92672;}.ace-monokai .ace_invalid.ace_illegal { }.ace-monokai .ace_invalid.ace_deprecated { color:#F8F8F0;background-color:#AE81FF;}.ace-monokai .ace_support { }.ace-monokai .ace_support.ace_function { color:#66D9EF;}.ace-monokai .ace_function.ace_buildin { }.ace-monokai .ace_string { color:#E6DB74;}.ace-monokai .ace_string.ace_regexp { }.ace-monokai .ace_comment { color:#75715E;}.ace-monokai .ace_comment.ace_doc { }.ace-monokai .ace_comment.ace_doc.ace_tag { }.ace-monokai .ace_variable { }.ace-monokai .ace_variable.ace_language { }.ace-monokai .ace_xml_pe { }");
|
||||
b.cssClass = "ace-monokai"
|
||||
});
|
||||
4
build/ace/theme/pastel_on_dark.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-pastel-on-dark .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-pastel-on-dark .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-pastel-on-dark .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-pastel-on-dark .ace_gutter-layer { width: 100%; text-align: right;}.ace-pastel-on-dark .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-pastel-on-dark .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-pastel-on-dark .ace_scroller { background-color: #2c2828;}.ace-pastel-on-dark .ace_text-layer { cursor: text; color: #8f938f;}.ace-pastel-on-dark .ace_cursor { border-left: 2px solid #A7A7A7;}.ace-pastel-on-dark .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;} .ace-pastel-on-dark .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-pastel-on-dark .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-pastel-on-dark .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-pastel-on-dark .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);} .ace-pastel-on-dark .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-pastel-on-dark .ace_keyword { color:#757ad8;}.ace-pastel-on-dark .ace_keyword.ace_operator { color:#797878;}.ace-pastel-on-dark .ace_constant { color:#4fb7c5;}.ace-pastel-on-dark .ace_constant.ace_language { }.ace-pastel-on-dark .ace_constant.ace_library { }.ace-pastel-on-dark .ace_constant.ace_numeric { }.ace-pastel-on-dark .ace_invalid { }.ace-pastel-on-dark .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-pastel-on-dark .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-pastel-on-dark .ace_support { color:#9a9a9a;}.ace-pastel-on-dark .ace_support.ace_function { color:#aeb2f8;}.ace-pastel-on-dark .ace_function.ace_buildin { }.ace-pastel-on-dark .ace_string { color:#66a968;}.ace-pastel-on-dark .ace_string.ace_regexp { color:#E9C062;}.ace-pastel-on-dark .ace_comment { color:#656865;}.ace-pastel-on-dark .ace_comment.ace_doc { color:A6C6FF;}.ace-pastel-on-dark .ace_comment.ace_doc.ace_tag { color:A6C6FF;}.ace-pastel-on-dark .ace_variable { color:#bebf55;}.ace-pastel-on-dark .ace_variable.ace_language { color:#bebf55;}.ace-pastel-on-dark .ace_xml_pe { color:#494949;}");
|
||||
b.cssClass = "ace-pastel-on-dark"
|
||||
});
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
define(["require", "exports", "module", "text!ace/theme/tm.css!.ace-tm .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-tm .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-tm .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-tm .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-tm .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-tm .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_text-layer {\n cursor: text;\n}\n\n.ace-tm .ace_cursor {\n border-left: 2px solid black;\n}\n\n.ace-tm .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid black;\n}\n \n.ace-tm .ace_line .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_line .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_invalid {\n background-color: rgb(153, 0, 0);\n color: white;\n}\n\n.ace-tm .ace_line .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_line .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_line .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_line .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_line .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_line .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0) \n}",
|
||||
"../lib/dom"], function(a, c, d, b) {
|
||||
a("../lib/dom").importCssString(b);
|
||||
return{cssClass:"ace-tm"}
|
||||
define(function(a, b) {
|
||||
var c = a("pilot/dom");
|
||||
a = a("text!ace/theme/tm.css!.ace-tm .ace_editor {\n border: 2px solid rgb(159, 159, 159);\n}\n\n.ace-tm .ace_editor.ace_focus {\n border: 2px solid #327fbd;\n}\n\n.ace-tm .ace_gutter {\n width: 50px;\n background: #e8e8e8;\n color: #333;\n overflow : hidden;\n}\n\n.ace-tm .ace_gutter-layer {\n width: 100%;\n text-align: right;\n}\n\n.ace-tm .ace_gutter-layer .ace_gutter-cell {\n padding-right: 6px;\n}\n\n.ace-tm .ace_editor .ace_printMargin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_text-layer {\n cursor: text;\n}\n\n.ace-tm .ace_cursor {\n border-left: 2px solid black;\n}\n\n.ace-tm .ace_cursor.ace_overwrite {\n border-left: 0px;\n border-bottom: 1px solid black;\n}\n \n.ace-tm .ace_line .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_line .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_line .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_line .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_invalid {\n background-color: rgb(153, 0, 0);\n color: white;\n}\n\n.ace-tm .ace_line .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_line .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_line .ace_support.ace_type,\n.ace-tm .ace_line .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_line .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_line .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_line .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_line .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_line .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_line .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_line .ace_xml_pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active_line {\n background: rgb(232, 242, 254);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0) \n}");
|
||||
c.importCssString(a);
|
||||
b.cssClass = "ace-tm"
|
||||
});
|
||||
|
|
@ -41,6 +41,9 @@
|
|||
.ace-tm .ace_line .ace_constant.ace_buildin {
|
||||
color: rgb(88, 72, 246);
|
||||
}
|
||||
.ace-tm .ace_line .ace_constant.ace_language {
|
||||
color: rgb(88, 92, 246);
|
||||
}
|
||||
.ace-tm .ace_line .ace_constant.ace_library {
|
||||
color: rgb(6, 150, 14);
|
||||
}
|
||||
|
|
@ -51,6 +54,13 @@
|
|||
.ace-tm .ace_line .ace_support.ace_function {
|
||||
color: rgb(60, 76, 114);
|
||||
}
|
||||
.ace-tm .ace_line .ace_support.ace_constant {
|
||||
color: rgb(6, 150, 14);
|
||||
}
|
||||
.ace-tm .ace_line .ace_support.ace_type,
|
||||
.ace-tm .ace_line .ace_support.ace_class {
|
||||
color: rgb(109, 121, 222);
|
||||
}
|
||||
.ace-tm .ace_line .ace_keyword.ace_operator {
|
||||
color: rgb(104, 118, 135);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
define(function(a) {
|
||||
a("../lib/dom").importCssString(".ace-twilight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-twilight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-twilight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-twilight .ace_gutter-layer { width: 100%; text-align: right;}.ace-twilight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-twilight .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-twilight .ace_scroller { background-color: #141414;}.ace-twilight .ace_text-layer { cursor: text; color: #F8F8F8;}.ace-twilight .ace_cursor { border-left: 2px solid #A7A7A7;}.ace-twilight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;} .ace-twilight .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-twilight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-twilight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-twilight .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);} .ace-twilight .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-twilight .ace_keyword { color:#CDA869;}.ace-twilight .ace_keyword.ace_operator { }.ace-twilight .ace_constant { color:#CF6A4C;}.ace-twilight .ace_constant.ace_language { }.ace-twilight .ace_constant.ace_library { }.ace-twilight .ace_constant.ace_numeric { }.ace-twilight .ace_invalid { }.ace-twilight .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-twilight .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-twilight .ace_support { color:#9B859D;}.ace-twilight .ace_support.ace_function { color:#DAD085;}.ace-twilight .ace_function.ace_buildin { }.ace-twilight .ace_string { color:#8F9D6A;}.ace-twilight .ace_string.ace_regexp { color:#E9C062;}.ace-twilight .ace_comment { font-style:italic;color:#5F5A60;}.ace-twilight .ace_comment.ace_doc { }.ace-twilight .ace_comment.ace_doc.ace_tag { }.ace-twilight .ace_variable { color:#7587A6;}.ace-twilight .ace_variable.ace_language { }.ace-twilight .ace_xml_pe { color:#494949;}");
|
||||
return{cssClass:"ace-twilight"}
|
||||
define(function(a, b) {
|
||||
a("pilot/dom").importCssString(".ace-twilight .ace_editor { border: 2px solid rgb(159, 159, 159);}.ace-twilight .ace_editor.ace_focus { border: 2px solid #327fbd;}.ace-twilight .ace_gutter { width: 50px; background: #e8e8e8; color: #333; overflow : hidden;}.ace-twilight .ace_gutter-layer { width: 100%; text-align: right;}.ace-twilight .ace_gutter-layer .ace_gutter-cell { padding-right: 6px;}.ace-twilight .ace_editor .ace_printMargin { width: 1px; background: #e8e8e8;}.ace-twilight .ace_scroller { background-color: #141414;}.ace-twilight .ace_text-layer { cursor: text; color: #F8F8F8;}.ace-twilight .ace_cursor { border-left: 2px solid #A7A7A7;}.ace-twilight .ace_cursor.ace_overwrite { border-left: 0px; border-bottom: 1px solid #A7A7A7;} .ace-twilight .ace_marker-layer .ace_selection { background: rgba(221, 240, 255, 0.20);}.ace-twilight .ace_marker-layer .ace_step { background: rgb(198, 219, 174);}.ace-twilight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid rgba(255, 255, 255, 0.25);}.ace-twilight .ace_marker-layer .ace_active_line { background: rgba(255, 255, 255, 0.031);} .ace-twilight .ace_invisible { color: rgba(255, 255, 255, 0.25);}.ace-twilight .ace_keyword { color:#CDA869;}.ace-twilight .ace_keyword.ace_operator { }.ace-twilight .ace_constant { color:#CF6A4C;}.ace-twilight .ace_constant.ace_language { }.ace-twilight .ace_constant.ace_library { }.ace-twilight .ace_constant.ace_numeric { }.ace-twilight .ace_invalid { }.ace-twilight .ace_invalid.ace_illegal { color:#F8F8F8;background-color:rgba(86, 45, 86, 0.75);}.ace-twilight .ace_invalid.ace_deprecated { text-decoration:underline;font-style:italic;color:#D2A8A1;}.ace-twilight .ace_support { color:#9B859D;}.ace-twilight .ace_support.ace_function { color:#DAD085;}.ace-twilight .ace_function.ace_buildin { }.ace-twilight .ace_string { color:#8F9D6A;}.ace-twilight .ace_string.ace_regexp { color:#E9C062;}.ace-twilight .ace_comment { font-style:italic;color:#5F5A60;}.ace-twilight .ace_comment.ace_doc { }.ace-twilight .ace_comment.ace_doc.ace_tag { }.ace-twilight .ace_variable { color:#7587A6;}.ace-twilight .ace_variable.ace_language { }.ace-twilight .ace_xml_pe { color:#494949;}");
|
||||
b.cssClass = "ace-twilight"
|
||||
});
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
define(function() {
|
||||
var k = function(f) {
|
||||
define(function(i, m) {
|
||||
i = function(f) {
|
||||
this.rules = f;
|
||||
this.regExps = {};
|
||||
for(var a in this.rules) {
|
||||
|
|
@ -14,33 +14,31 @@ define(function() {
|
|||
a = a;
|
||||
var b = this.rules[a], c = this.regExps[a];
|
||||
c.lastIndex = 0;
|
||||
for(var g, h = [], i = 0, e = {type:null, value:""};g = c.exec(f);) {
|
||||
var j = "text", l = g[0];
|
||||
if(c.lastIndex == i) {
|
||||
for(var g, j = [], h = 0, e = {type:null, value:""};g = c.exec(f);) {
|
||||
var k = "text", l = g[0];
|
||||
if(c.lastIndex == h) {
|
||||
throw new Error("tokenizer error");
|
||||
}i = c.lastIndex;
|
||||
window.LOG && console.log(a, g);
|
||||
}h = c.lastIndex;
|
||||
for(var d = 0;d < b.length;d++) {
|
||||
if(g[d + 1]) {
|
||||
j = typeof b[d].token == "function" ? b[d].token(g[0]) : b[d].token;
|
||||
k = typeof b[d].token == "function" ? b[d].token(g[0]) : b[d].token;
|
||||
if(b[d].next && b[d].next !== a) {
|
||||
a = b[d].next;
|
||||
b = this.rules[a];
|
||||
i = c.lastIndex;
|
||||
h = c.lastIndex;
|
||||
c = this.regExps[a];
|
||||
c.lastIndex = i
|
||||
c.lastIndex = h
|
||||
}break
|
||||
}
|
||||
}if(e.type !== j) {
|
||||
e.type && h.push(e);
|
||||
e = {type:j, value:l}
|
||||
}if(e.type !== k) {
|
||||
e.type && j.push(e);
|
||||
e = {type:k, value:l}
|
||||
}else {
|
||||
e.value += l
|
||||
}
|
||||
}e.type && h.push(e);
|
||||
window.LOG && console.log(h, a);
|
||||
return{tokens:h, state:a}
|
||||
}e.type && j.push(e);
|
||||
return{tokens:j, state:a}
|
||||
}
|
||||
}).call(k.prototype);
|
||||
return k
|
||||
}).call(i.prototype);
|
||||
m.Tokenizer = i
|
||||
});
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
define(function() {
|
||||
var b = function() {
|
||||
define(function(b, c) {
|
||||
b = function() {
|
||||
this.$undoStack = [];
|
||||
this.$redoStack = []
|
||||
};
|
||||
(function() {
|
||||
this.execute = function(a) {
|
||||
var c = a.args[0];
|
||||
var d = a.args[0];
|
||||
this.$doc = a.args[1];
|
||||
this.$undoStack.push(c)
|
||||
this.$undoStack.push(d)
|
||||
};
|
||||
this.undo = function() {
|
||||
var a = this.$undoStack.pop();
|
||||
|
|
@ -24,5 +24,5 @@ define(function() {
|
|||
}
|
||||
}
|
||||
}).call(b.prototype);
|
||||
return b
|
||||
c.UndoManager = b
|
||||
});
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n position: absolute;\n overflow: hidden;\n\n font-family: "Menlo", "Monaco", "Courier New", monospace;\n font-size: 12px; \n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden; \n}\n\n.ace_gutter {\n position: absolute;\n overflow-x: hidden;\n overflow-y: hidden;\n height: 100%;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0px;\n}\n\n.ace_editor .ace_printMargin {\n position: absolute;\n height: 100%;\n}\n\n.ace_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden; \n white-space: nowrap;\n height: 100%;\n}\n\n.ace_text-layer {\n font-family: Monaco, "Courier New", monospace;\n color: black;\n}\n\n.ace_cursor-layer {\n cursor: text;\n}\n\n.ace_cursor {\n z-index: 3;\n position: absolute;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer {\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 4;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 1;\n}',
|
||||
"./lib/oop", "./lib/oop", "./lib/event", "./layer/gutter", "./layer/marker", "./layer/text", "./layer/cursor", "./scrollbar", "./renderloop", "./event_emitter"], function(d, k, u, l) {
|
||||
var m = d("./lib/oop"), i = d("./lib/lang"), f = d("./lib/dom"), j = d("./lib/event"), n = d("./layer/gutter"), o = d("./layer/marker"), p = d("./layer/text"), q = d("./layer/cursor"), r = d("./scrollbar"), s = d("./renderloop"), t = d("./event_emitter");
|
||||
f.importCssString(l);
|
||||
k = function(a, b) {
|
||||
define(function(d, k) {
|
||||
var l = d("pilot/oop"), f = d("pilot/dom"), i = d("pilot/event"), m = d("ace/layer/gutter").Gutter, n = d("ace/layer/marker").Marker, o = d("ace/layer/text").Text, p = d("ace/layer/cursor").Cursor, q = d("ace/scrollbar").ScrollBar, r = d("ace/renderloop").RenderLoop, s = d("pilot/event_emitter").EventEmitter, j = d('text!ace/css/editor.css!.ace_editor {\n position: absolute;\n overflow: hidden;\n\n font-family: "Menlo", "Monaco", "Courier New", monospace;\n font-size: 12px; \n}\n\n.ace_scroller {\n position: absolute;\n overflow-x: scroll;\n overflow-y: hidden; \n}\n\n.ace_gutter {\n position: absolute;\n overflow-x: hidden;\n overflow-y: hidden;\n height: 100%;\n}\n\n.ace_editor .ace_sb {\n position: absolute;\n overflow-x: hidden;\n overflow-y: scroll;\n right: 0;\n}\n\n.ace_editor .ace_sb div {\n position: absolute;\n width: 1px;\n left: 0px;\n}\n\n.ace_editor .ace_printMargin {\n position: absolute;\n height: 100%;\n}\n\n.ace_layer {\n z-index: 0;\n position: absolute;\n overflow: hidden; \n white-space: nowrap;\n height: 100%;\n}\n\n.ace_text-layer {\n font-family: Monaco, "Courier New", monospace;\n color: black;\n}\n\n.ace_cursor-layer {\n cursor: text;\n}\n\n.ace_cursor {\n z-index: 3;\n position: absolute;\n}\n\n.ace_line {\n white-space: nowrap;\n}\n\n.ace_marker-layer {\n}\n\n.ace_marker-layer .ace_step {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 4;\n}\n\n.ace_marker-layer .ace_active_line {\n position: absolute;\n z-index: 1;\n}');
|
||||
f.importCssString(j);
|
||||
j = function(a, b) {
|
||||
this.container = a;
|
||||
f.addCssClass(this.container, "ace_editor");
|
||||
this.setTheme(b);
|
||||
|
|
@ -15,16 +14,16 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
this.content = document.createElement("div");
|
||||
this.content.style.position = "absolute";
|
||||
this.scroller.appendChild(this.content);
|
||||
this.$gutterLayer = new n(this.$gutter);
|
||||
this.$markerLayer = new o(this.content);
|
||||
var c = this.$textLayer = new p(this.content);
|
||||
this.$gutterLayer = new m(this.$gutter);
|
||||
this.$markerLayer = new n(this.content);
|
||||
var c = this.$textLayer = new o(this.content);
|
||||
this.canvas = c.element;
|
||||
this.characterWidth = c.getCharacterWidth();
|
||||
this.lineHeight = c.getLineHeight();
|
||||
this.$cursorLayer = new q(this.content);
|
||||
this.$cursorLayer = new p(this.content);
|
||||
this.layers = [this.$markerLayer, c, this.$cursorLayer];
|
||||
this.scrollBar = new r(a);
|
||||
this.scrollBar.addEventListener("scroll", i.bind(this.onScroll, this));
|
||||
this.scrollBar = new q(a);
|
||||
this.scrollBar.addEventListener("scroll", this.onScroll.bind(this));
|
||||
this.scrollTop = 0;
|
||||
this.cursorPos = {row:0, column:0};
|
||||
var e = this;
|
||||
|
|
@ -33,10 +32,10 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
e.lineHeight = c.getLineHeight();
|
||||
e.$loop.schedule(e.CHANGE_FULL)
|
||||
});
|
||||
j.addListener(this.$gutter, "click", i.bind(this.$onGutterClick, this));
|
||||
j.addListener(this.$gutter, "dblclick", i.bind(this.$onGutterClick, this));
|
||||
i.addListener(this.$gutter, "click", this.$onGutterClick.bind(this));
|
||||
i.addListener(this.$gutter, "dblclick", this.$onGutterClick.bind(this));
|
||||
this.$size = {width:0, height:0, scrollerHeight:0, scrollerWidth:0};
|
||||
this.$loop = new s(i.bind(this.$renderChanges, this));
|
||||
this.$loop = new r(this.$renderChanges.bind(this));
|
||||
this.$loop.schedule(this.CHANGE_FULL);
|
||||
this.$updatePrintMargin();
|
||||
this.setPadding(4)
|
||||
|
|
@ -51,7 +50,7 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
this.CHANGE_TEXT = 32;
|
||||
this.CHANGE_SIZE = 64;
|
||||
this.CHANGE_FULL = 128;
|
||||
m.implement(this, t);
|
||||
l.implement(this, s);
|
||||
this.setDocument = function(a) {
|
||||
this.lines = a.lines;
|
||||
this.doc = a;
|
||||
|
|
@ -80,24 +79,24 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
this.$loop.schedule(this.CHANGE_FULL)
|
||||
};
|
||||
this.onResize = function() {
|
||||
this.$loop.schedule(this.CHANGE_SIZE);
|
||||
var a = f.getInnerHeight(this.container);
|
||||
if(this.$size.height != a) {
|
||||
this.$size.height = a;
|
||||
this.scroller.style.height = a + "px";
|
||||
this.scrollBar.setHeight(a);
|
||||
var a = this.CHANGE_SIZE, b = f.getInnerHeight(this.container);
|
||||
if(this.$size.height != b) {
|
||||
this.$size.height = b;
|
||||
this.scroller.style.height = b + "px";
|
||||
this.scrollBar.setHeight(b);
|
||||
if(this.doc) {
|
||||
this.scrollToY(this.getScrollTop());
|
||||
this.$loop.schedule(this.CHANGE_FULL)
|
||||
a |= this.CHANGE_FULL
|
||||
}
|
||||
}a = f.getInnerWidth(this.container);
|
||||
if(this.$size.width != a) {
|
||||
this.$size.width = a;
|
||||
var b = this.showGutter ? this.$gutter.offsetWidth : 0;
|
||||
this.scroller.style.left = b + "px";
|
||||
this.scroller.style.width = Math.max(0, a - b - this.scrollBar.getWidth()) + "px"
|
||||
}b = f.getInnerWidth(this.container);
|
||||
if(this.$size.width != b) {
|
||||
this.$size.width = b;
|
||||
var c = this.showGutter ? this.$gutter.offsetWidth : 0;
|
||||
this.scroller.style.left = c + "px";
|
||||
this.scroller.style.width = Math.max(0, b - c - this.scrollBar.getWidth()) + "px"
|
||||
}this.$size.scrollerWidth = this.scroller.clientWidth;
|
||||
this.$size.scrollerHeight = this.scroller.clientHeight
|
||||
this.$size.scrollerHeight = this.scroller.clientHeight;
|
||||
this.$loop.schedule(a)
|
||||
};
|
||||
this.setTokenizer = function(a) {
|
||||
this.$tokenizer = a;
|
||||
|
|
@ -105,17 +104,14 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
this.$loop.schedule(this.CHANGE_TEXT)
|
||||
};
|
||||
this.$onGutterClick = function(a) {
|
||||
var b = j.getDocumentX(a), c = j.getDocumentY(a);
|
||||
this.$dispatchEvent("gutter" + a.type, {row:this.screenToTextCoordinates(b, c).row, htmlEvent:a})
|
||||
var b = i.getDocumentX(a), c = i.getDocumentY(a);
|
||||
this._dispatchEvent("gutter" + a.type, {row:this.screenToTextCoordinates(b, c).row, htmlEvent:a})
|
||||
};
|
||||
this.$showInvisibles = true;
|
||||
this.setShowInvisibles = function(a) {
|
||||
this.$showInvisibles = a;
|
||||
this.$textLayer.setShowInvisibles(a);
|
||||
this.$loop.schedule(this.CHANGE_TEXT)
|
||||
this.$textLayer.setShowInvisibles(a) && this.$loop.schedule(this.CHANGE_TEXT)
|
||||
};
|
||||
this.getShowInvisibles = function() {
|
||||
return this.$showInvisibles
|
||||
return this.$textLayer.showInvisibles
|
||||
};
|
||||
this.$showPrintMargin = true;
|
||||
this.setShowPrintMargin = function(a) {
|
||||
|
|
@ -208,10 +204,12 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
}else {
|
||||
if(a & this.CHANGE_LINES) {
|
||||
this.$updateLines();
|
||||
this.$updateScrollBar()
|
||||
this.$updateScrollBar();
|
||||
this.showGutter && this.$gutterLayer.update(this.layerConfig)
|
||||
}else {
|
||||
a & this.CHANGE_GUTTER && this.showGutter && this.$gutterLayer.update(this.layerConfig)
|
||||
}
|
||||
}a & this.CHANGE_GUTTER && this.showGutter && this.$gutterLayer.update(this.layerConfig);
|
||||
a & this.CHANGE_CURSOR && this.$cursorLayer.update(this.layerConfig);
|
||||
}a & this.CHANGE_CURSOR && this.$cursorLayer.update(this.layerConfig);
|
||||
a & this.CHANGE_MARKER && this.$markerLayer.update(this.layerConfig);
|
||||
a & this.CHANGE_SIZE && this.$updateScrollBar()
|
||||
}
|
||||
|
|
@ -220,7 +218,7 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
};
|
||||
this.$computeLayerConfig = function() {
|
||||
var a = this.scrollTop % this.lineHeight, b = this.$size.scrollerHeight + this.lineHeight, c = this.$getLongestLine(), e = !this.layerConfig ? true : this.layerConfig.width != c, h = Math.ceil(b / this.lineHeight), g = Math.max(0, Math.round((this.scrollTop - a) / this.lineHeight));
|
||||
h = Math.min(this.lines.length, g + h) - 1;
|
||||
h = Math.max(0, Math.min(this.lines.length, g + h) - 1);
|
||||
this.layerConfig = {width:c, padding:this.$padding, firstRow:g, lastRow:h, lineHeight:this.lineHeight, characterWidth:this.characterWidth, minHeight:b, offset:a, height:this.$size.scrollerHeight};
|
||||
for(g = 0;g < this.layers.length;g++) {
|
||||
h = this.layers[g];
|
||||
|
|
@ -251,7 +249,7 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
};
|
||||
this.$getLongestLine = function() {
|
||||
var a = this.doc.getScreenWidth();
|
||||
if(this.$showInvisibles) {
|
||||
if(this.$textLayer.showInvisibles) {
|
||||
a += 1
|
||||
}return Math.max(this.$size.scrollerWidth - this.$padding * 2, Math.round(a * this.characterWidth))
|
||||
};
|
||||
|
|
@ -330,7 +328,7 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
};
|
||||
this.textToScreenCoordinates = function(a, b) {
|
||||
var c = this.scroller.getBoundingClientRect();
|
||||
b = this.padding + Math.round(this.doc.documentToScreenColumn(a, b) * this.characterWidth);
|
||||
b = this.$padding + Math.round(this.doc.documentToScreenColumn(a, b) * this.characterWidth);
|
||||
a = a * this.lineHeight;
|
||||
return{pageX:c.left + b - this.getScrollLeft(), pageY:c.top + a - this.getScrollTop()}
|
||||
};
|
||||
|
|
@ -366,6 +364,6 @@ define(["require", "exports", "module", 'text!ace/css/editor.css!.ace_editor {\n
|
|||
b(a)
|
||||
}c = this
|
||||
}
|
||||
}).call(k.prototype);
|
||||
return k
|
||||
}).call(j.prototype);
|
||||
k.VirtualRenderer = j
|
||||
});
|
||||
|
|
@ -1,17 +1,74 @@
|
|||
|
||||
ace/editor.js
|
||||
demo/startup.js
|
||||
----------------
|
||||
ace/lib/oop.js
|
||||
ace/lib/core.js
|
||||
ace/lib/event.js
|
||||
ace/lib/lang.js
|
||||
pilot/useragent.js
|
||||
pilot/event.js
|
||||
pilot/oop.js
|
||||
pilot/lang.js
|
||||
ace/textinput.js
|
||||
ace/conf/keybindings/default_mac.js
|
||||
ace/conf/keybindings/default_win.js
|
||||
ace/plugin_manager.js
|
||||
pilot/console.js
|
||||
pilot/stacktrace.js
|
||||
pilot/event_emitter.js
|
||||
pilot/catalog.js
|
||||
pilot/types.js
|
||||
pilot/canon.js
|
||||
ace/commands/default_commands.js
|
||||
ace/keybinding.js
|
||||
ace/range.js
|
||||
ace/selection.js
|
||||
ace/tokenizer.js
|
||||
ace/mode/text_highlight_rules.js
|
||||
ace/mode/text.js
|
||||
ace/document.js
|
||||
ace/search.js
|
||||
ace/background_tokenizer.js
|
||||
ace/editor.js
|
||||
pilot/dom.js
|
||||
ace/layer/gutter.js
|
||||
ace/layer/marker.js
|
||||
ace/layer/text.js
|
||||
ace/layer/cursor.js
|
||||
ace/scrollbar.js
|
||||
ace/renderloop.js
|
||||
ace/virtual_renderer.js
|
||||
ace/theme/textmate.js
|
||||
ace/mode/doc_comment_highlight_rules.js
|
||||
ace/mode/javascript_highlight_rules.js
|
||||
ace/mode/matching_brace_outdent.js
|
||||
ace/mode/javascript.js
|
||||
ace/mode/css_highlight_rules.js
|
||||
ace/mode/css.js
|
||||
ace/mode/html_highlight_rules.js
|
||||
ace/mode/html.js
|
||||
ace/mode/xml_highlight_rules.js
|
||||
ace/mode/xml.js
|
||||
ace/mode/python_highlight_rules.js
|
||||
ace/mode/python.js
|
||||
ace/mode/php_highlight_rules.js
|
||||
ace/mode/php.js
|
||||
ace/undomanager.js
|
||||
demo/startup.js
|
||||
pilot/fixoldbrowsers.js
|
||||
|
||||
ace/editor.js
|
||||
----------------
|
||||
pilot/oop.js
|
||||
pilot/useragent.js
|
||||
pilot/event.js
|
||||
pilot/lang.js
|
||||
ace/textinput.js
|
||||
ace/conf/keybindings/default_mac.js
|
||||
ace/conf/keybindings/default_win.js
|
||||
pilot/console.js
|
||||
pilot/stacktrace.js
|
||||
pilot/event_emitter.js
|
||||
pilot/catalog.js
|
||||
pilot/types.js
|
||||
pilot/canon.js
|
||||
ace/commands/default_commands.js
|
||||
ace/keybinding.js
|
||||
ace/event_emitter.js
|
||||
ace/range.js
|
||||
ace/selection.js
|
||||
ace/tokenizer.js
|
||||
|
|
@ -22,9 +79,9 @@ ace/search.js
|
|||
ace/background_tokenizer.js
|
||||
ace/editor.js
|
||||
ace/undomanager.js
|
||||
pilot/dom.js
|
||||
ace/layer/gutter.js
|
||||
ace/layer/marker.js
|
||||
ace/lib/dom.js
|
||||
ace/layer/text.js
|
||||
ace/layer/cursor.js
|
||||
ace/scrollbar.js
|
||||
|
|
|
|||
427
build/cockpit/cli.js
Normal file
|
|
@ -0,0 +1,427 @@
|
|||
define(function(l, o) {
|
||||
function j(b, a, c, d, e) {
|
||||
this.status = b;
|
||||
this.message = a;
|
||||
if(typeof c === "number") {
|
||||
this.start = c;
|
||||
this.end = d;
|
||||
this.predictions = e
|
||||
}else {
|
||||
this.start = c.start;
|
||||
this.end = c.end;
|
||||
this.predictions = c.predictions
|
||||
}
|
||||
}
|
||||
function u(b, a) {
|
||||
this.status = b.status;
|
||||
this.message = b.message;
|
||||
if(a) {
|
||||
this.start = a.start;
|
||||
this.end = a.end
|
||||
}else {
|
||||
this.end = this.start = 0
|
||||
}this.predictions = b.predictions
|
||||
}
|
||||
function h(b, a, c, d, e) {
|
||||
this.emitter = b;
|
||||
this.setText(a);
|
||||
this.start = c;
|
||||
this.end = d;
|
||||
this.priorSpace = e
|
||||
}
|
||||
function q(b, a) {
|
||||
this.param = b;
|
||||
this.requisition = a;
|
||||
this.setValue(b.defaultValue)
|
||||
}
|
||||
function p(b) {
|
||||
this.env = b;
|
||||
this.commandAssignment = new q(s, this)
|
||||
}
|
||||
function i(b, a) {
|
||||
p.call(this, b);
|
||||
if(a && a.flags) {
|
||||
this.flags = a.flags
|
||||
}
|
||||
}
|
||||
l("pilot/console");
|
||||
var v = l("pilot/lang"), r = l("pilot/oop"), w = l("pilot/event_emitter").EventEmitter;
|
||||
l("pilot/types");
|
||||
var k = l("pilot/types").Status;
|
||||
l("pilot/types");
|
||||
var t = l("pilot/canon");
|
||||
o.startup = function() {
|
||||
t.upgradeType("command", s)
|
||||
};
|
||||
j.prototype = {};
|
||||
j.sort = function(b, a) {
|
||||
a !== undefined && b.forEach(function(c) {
|
||||
c.distance = c.start === h.AT_CURSOR ? 0 : a < c.start ? c.start - a : a > c.end ? a - c.end : 0
|
||||
}, this);
|
||||
b.sort(function(c, d) {
|
||||
if(a !== undefined) {
|
||||
var e = c.distance - d.distance;
|
||||
if(e != 0) {
|
||||
return e
|
||||
}
|
||||
}return d.status - c.status
|
||||
});
|
||||
a !== undefined && b.forEach(function(c) {
|
||||
delete c.distance
|
||||
}, this);
|
||||
return b
|
||||
};
|
||||
o.Hint = j;
|
||||
r.inherits(u, j);
|
||||
h.prototype = {merge:function(b) {
|
||||
if(b.emitter != this.emitter) {
|
||||
throw new Error("Can't merge Arguments from different EventEmitters");
|
||||
}return new h(this.emitter, this.text + b.priorSpace + b.text, this.start, b.end, this.priorSpace)
|
||||
}, setText:function(b) {
|
||||
if(b == null) {
|
||||
throw new Error("Illegal text for Argument: " + b);
|
||||
}var a = {argument:this, oldText:this.text, text:b};
|
||||
this.text = b;
|
||||
this.emitter._dispatchEvent("argumentChange", a)
|
||||
}, toString:function() {
|
||||
return this.priorSpace + this.text
|
||||
}};
|
||||
h.merge = function(b, a, c) {
|
||||
a = a === undefined ? 0 : a;
|
||||
c = c === undefined ? b.length : c;
|
||||
var d;
|
||||
for(a = a;a < c;a++) {
|
||||
var e = b[a];
|
||||
d = d ? d.merge(e) : e
|
||||
}return d
|
||||
};
|
||||
h.AT_CURSOR = -1;
|
||||
q.prototype = {param:undefined, conversion:undefined, value:undefined, arg:undefined, value:undefined, setValue:function(b) {
|
||||
if(this.value !== b) {
|
||||
if(b === undefined) {
|
||||
b = this.param.defaultValue;
|
||||
this.arg = undefined
|
||||
}this.value = b;
|
||||
b = b == null ? "" : this.param.type.stringify(b);
|
||||
this.arg && this.arg.setText(b);
|
||||
this.conversion = undefined;
|
||||
this.requisition._assignmentChanged(this)
|
||||
}
|
||||
}, arg:undefined, setArgument:function(b) {
|
||||
if(this.arg !== b) {
|
||||
this.arg = b;
|
||||
this.conversion = this.param.type.parse(b.text);
|
||||
this.conversion.arg = b;
|
||||
this.value = this.conversion.value;
|
||||
this.requisition._assignmentChanged(this)
|
||||
}
|
||||
}, getHint:function() {
|
||||
if(this.param.getCustomHint && this.value && this.arg) {
|
||||
var b = this.param.getCustomHint(this.value, this.arg);
|
||||
if(b) {
|
||||
return b
|
||||
}
|
||||
}b = "<strong>" + this.param.name + "</strong>: ";
|
||||
if(this.param.description) {
|
||||
b += this.param.description.trim();
|
||||
if(b.charAt(b.length - 1) !== ".") {
|
||||
b += "."
|
||||
}if(b.charAt(b.length - 1) !== " ") {
|
||||
b += " "
|
||||
}
|
||||
}var a = k.VALID, c = this.arg ? this.arg.start : h.AT_CURSOR, d = this.arg ? this.arg.end : h.AT_CURSOR, e;
|
||||
if(this.conversion) {
|
||||
a = this.conversion.status;
|
||||
if(this.conversion.message) {
|
||||
b += this.conversion.message
|
||||
}e = this.conversion.predictions
|
||||
}var f = this.arg && this.arg.text !== "";
|
||||
f = this.value !== undefined || f;
|
||||
if(this.param.defaultValue === undefined && !f) {
|
||||
a = k.INVALID;
|
||||
b += "<strong>Required<strong>"
|
||||
}return new j(a, b, c, d, e)
|
||||
}, complete:function() {
|
||||
this.conversion && this.conversion.predictions && this.conversion.predictions.length > 0 && this.setValue(this.conversion.predictions[0])
|
||||
}, decrement:function() {
|
||||
var b = this.param.type.decrement(this.value);
|
||||
b != null && this.setValue(b)
|
||||
}, increment:function() {
|
||||
var b = this.param.type.increment(this.value);
|
||||
b != null && this.setValue(b)
|
||||
}, toString:function() {
|
||||
return this.arg ? this.arg.toString() : ""
|
||||
}};
|
||||
o.Assignment = q;
|
||||
var s = {name:"command", type:"command", description:"The command to execute", getCustomHint:function(b, a) {
|
||||
var c = [];
|
||||
c.push("<strong><tt> > ");
|
||||
c.push(b.name);
|
||||
b.params && b.params.length > 0 && b.params.forEach(function(d) {
|
||||
d.defaultValue === undefined ? c.push(" [" + d.name + "]") : c.push(" <em>[" + d.name + "]</em>")
|
||||
}, this);
|
||||
c.push("</tt></strong><br/>");
|
||||
c.push(b.description ? b.description : "(No description)");
|
||||
c.push("<br/>");
|
||||
if(b.params && b.params.length > 0) {
|
||||
c.push("<ul>");
|
||||
b.params.forEach(function(d) {
|
||||
c.push("<li>");
|
||||
c.push("<strong><tt>" + d.name + "</tt></strong>: ");
|
||||
c.push(d.description ? d.description : "(No description)");
|
||||
if(d.defaultValue === undefined) {
|
||||
c.push(" <em>[Required]</em>")
|
||||
}else {
|
||||
d.defaultValue === null ? c.push(" <em>[Optional]</em>") : c.push(" <em>[Default: " + d.defaultValue + "]</em>")
|
||||
}c.push("</li>")
|
||||
}, this);
|
||||
c.push("</ul>")
|
||||
}return new j(k.VALID, c.join(""), a)
|
||||
}};
|
||||
p.prototype = {commandAssignment:undefined, assignmentCount:undefined, _assignments:undefined, _hints:undefined, _assignmentChanged:function(b) {
|
||||
if(b.param.name === "command") {
|
||||
this._assignments = {};
|
||||
b.value && b.value.params.forEach(function(a) {
|
||||
this._assignments[a.name] = new q(a, this)
|
||||
}, this);
|
||||
this.assignmentCount = Object.keys(this._assignments).length;
|
||||
this._dispatchEvent("commandChange", {command:b.value})
|
||||
}
|
||||
}, getAssignment:function(b) {
|
||||
return this._assignments[typeof b === "string" ? b : Object.keys(this._assignments)[b]]
|
||||
}, getParameterNames:function() {
|
||||
return Object.keys(this._assignments)
|
||||
}, cloneAssignments:function() {
|
||||
return Object.keys(this._assignments).map(function(b) {
|
||||
return this._assignments[b]
|
||||
}, this)
|
||||
}, _updateHints:function() {
|
||||
this._hints.push(this.commandAssignment.getHint());
|
||||
Object.keys(this._assignments).map(function(b) {
|
||||
b = this._assignments[b];
|
||||
b.arg && this._hints.push(b.getHint())
|
||||
}, this);
|
||||
j.sort(this._hints)
|
||||
}, getWorstHint:function() {
|
||||
return this._hints[0]
|
||||
}, getArgs:function() {
|
||||
var b = {};
|
||||
Object.keys(this._assignments).forEach(function(a) {
|
||||
b[a] = this.getAssignment(a).value
|
||||
}, this);
|
||||
return b
|
||||
}, setDefaultValues:function() {
|
||||
Object.keys(this._assignments).forEach(function(b) {
|
||||
this._assignments[b].setValue(undefined)
|
||||
}, this)
|
||||
}, exec:function() {
|
||||
t.exec(this.commandAssignment.value, this.env, this.getArgs(), this.toCanonicalString())
|
||||
}, toCanonicalString:function() {
|
||||
var b = [];
|
||||
b.push(this.commandAssignment.value.name);
|
||||
Object.keys(this._assignments).forEach(function(a) {
|
||||
a = this._assignments[a];
|
||||
var c = a.param.type;
|
||||
if(a.value !== a.param.defaultValue) {
|
||||
b.push(" ");
|
||||
b.push(c.stringify(a.value))
|
||||
}
|
||||
}, this);
|
||||
return b.join("")
|
||||
}};
|
||||
r.implement(p.prototype, w);
|
||||
o.Requisition = p;
|
||||
r.inherits(i, p);
|
||||
(function() {
|
||||
i.prototype.update = function(a) {
|
||||
this.input = a;
|
||||
this._hints = [];
|
||||
a = this._tokenize(a.typed);
|
||||
this._split(a);
|
||||
this.commandAssignment.value && this._assign(a);
|
||||
this._updateHints()
|
||||
};
|
||||
i.prototype.getInputStatusMarkup = function() {
|
||||
var a = this.toString().split("").map(function() {
|
||||
return k.VALID
|
||||
});
|
||||
this._hints.forEach(function(c) {
|
||||
for(var d = c.start;d <= c.end;d++) {
|
||||
if(c.status > a[d]) {
|
||||
a[d] = c.status
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
return a
|
||||
};
|
||||
i.prototype.toString = function() {
|
||||
var a = Object.keys(this._assignments).map(function(c) {
|
||||
return this._assignments[c].toString()
|
||||
}, this);
|
||||
a.unshift(this.commandAssignment.toString());
|
||||
return a.join("")
|
||||
};
|
||||
var b = i.prototype._updateHints;
|
||||
i.prototype._updateHints = function() {
|
||||
b.call(this);
|
||||
var a = this.input.cursor;
|
||||
this._hints.forEach(function(c) {
|
||||
var d = a.end >= c.start && a.end <= c.end;
|
||||
if(!(a.start >= c.start && a.start <= c.end || d) && c.status === k.INCOMPLETE) {
|
||||
c.status = k.INVALID
|
||||
}
|
||||
}, this);
|
||||
j.sort(this._hints)
|
||||
};
|
||||
i.prototype.getHints = function() {
|
||||
return this._hints
|
||||
};
|
||||
i.prototype.getAssignmentAt = function(a) {
|
||||
var c = this.commandAssignment.arg;
|
||||
if(c && a <= c.end) {
|
||||
return this.commandAssignment
|
||||
}c = Object.keys(this._assignments);
|
||||
for(var d = 0;d < c.length;d++) {
|
||||
var e = this._assignments[c[d]];
|
||||
if(e.arg && a <= e.arg.end) {
|
||||
return e
|
||||
}
|
||||
}throw new Error("position (" + a + ") is off end of requisition (" + this.toString() + ")");
|
||||
};
|
||||
i.prototype._tokenize = function(a) {
|
||||
function c(x) {
|
||||
return x.replace(/\uF000/g, " ").replace(/\uF001/g, "'").replace(/\uF002/g, '"')
|
||||
}
|
||||
if(a == null || a.length === 0) {
|
||||
return[new h(this, "", 0, 0, "")]
|
||||
}var d = 1;
|
||||
a = a.replace(/\\\\/g, "\\").replace(/\\b/g, "\u0008").replace(/\\f/g, "\u000c").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\v/g, "\u000b").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\ /g, "\uf000").replace(/\\'/g, "\uf001").replace(/\\"/g, "\uf002");
|
||||
for(var e = 0, f = 0, g = "", m = [];;) {
|
||||
if(e >= a.length) {
|
||||
if(d !== 1) {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g))
|
||||
}else {
|
||||
if(e !== f) {
|
||||
g = a.substring(f, e);
|
||||
m.push(new h(this, "", e, e, g))
|
||||
}
|
||||
}break
|
||||
}var n = a[e];
|
||||
switch(d) {
|
||||
case 1:
|
||||
if(n === "'") {
|
||||
g = a.substring(f, e);
|
||||
d = 3;
|
||||
f = e + 1
|
||||
}else {
|
||||
if(n === '"') {
|
||||
g = a.substring(f, e);
|
||||
d = 4;
|
||||
f = e + 1
|
||||
}else {
|
||||
if(!/ /.test(n)) {
|
||||
g = a.substring(f, e);
|
||||
d = 2;
|
||||
f = e
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case 2:
|
||||
if(n === " ") {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g));
|
||||
d = 1;
|
||||
f = e;
|
||||
g = ""
|
||||
}break;
|
||||
case 3:
|
||||
if(n === "'") {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g));
|
||||
d = 1;
|
||||
f = e + 1;
|
||||
g = ""
|
||||
}break;
|
||||
case 4:
|
||||
if(n === '"') {
|
||||
d = c(a.substring(f, e));
|
||||
m.push(new h(this, d, f, e, g));
|
||||
d = 1;
|
||||
f = e + 1;
|
||||
g = ""
|
||||
}break
|
||||
}
|
||||
e++
|
||||
}return m
|
||||
};
|
||||
i.prototype._split = function(a) {
|
||||
for(var c = 1, d;c <= a.length;) {
|
||||
d = h.merge(a, 0, c);
|
||||
this.commandAssignment.setArgument(d);
|
||||
if(!this.commandAssignment.value) {
|
||||
break
|
||||
}if(this.commandAssignment.value.exec) {
|
||||
for(d = 0;d < c;d++) {
|
||||
a.shift()
|
||||
}break
|
||||
}c++
|
||||
}
|
||||
};
|
||||
i.prototype._assign = function(a) {
|
||||
if(a.length === 0) {
|
||||
this.setDefaultValues()
|
||||
}else {
|
||||
if(this.assignmentCount === 0) {
|
||||
this._hints.push(new j(k.INVALID, this.commandAssignment.value.name + " does not take any parameters", h.merge(a)))
|
||||
}else {
|
||||
if(this.assignmentCount === 1) {
|
||||
var c = this.getAssignment(0);
|
||||
if(c.param.type.name === "text") {
|
||||
c.setArgument(h.merge(a));
|
||||
return
|
||||
}
|
||||
}c = this.cloneAssignments();
|
||||
var d = this.getParameterNames();
|
||||
c.forEach(function(e) {
|
||||
for(var f = "--" + e.name, g = 0;;) {
|
||||
if(f !== a[g].text) {
|
||||
g++;
|
||||
if(g >= a.length) {
|
||||
break
|
||||
}
|
||||
}else {
|
||||
if(e.param.type.name === "boolean") {
|
||||
e.setValue(true)
|
||||
}else {
|
||||
if(g + 1 < a.length) {
|
||||
this._hints.push(new j(k.INCOMPLETE, "Missing value for: " + f, a[g]))
|
||||
}else {
|
||||
a.splice(g + 1, 1);
|
||||
e.setArgument(a[g + 1])
|
||||
}
|
||||
}v.arrayRemove(d, e.name);
|
||||
a.splice(g, 1)
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
d.forEach(function(e) {
|
||||
e = this.getAssignment(e);
|
||||
if(a.length === 0) {
|
||||
e.setValue(undefined)
|
||||
}else {
|
||||
var f = a[0];
|
||||
a.splice(0, 1);
|
||||
e.setArgument(f)
|
||||
}
|
||||
}, this);
|
||||
if(a.length > 0) {
|
||||
c = h.merge(a);
|
||||
this._hints.push(new j(k.INVALID, "Input '" + c.text + "' makes no sense.", c))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
o.CliRequisition = i
|
||||
});
|
||||
9
build/cockpit/index.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
define(function(a, d) {
|
||||
d.startup = function(b, c) {
|
||||
a("pilot/index");
|
||||
a("cockpit/cli").startup(b, c);
|
||||
window.testCli = a("cockpit/test/testCli");
|
||||
a("cockpit/ui/settings").startup(b, c);
|
||||
a("cockpit/ui/cliView").startup(b, c)
|
||||
}
|
||||
});
|
||||
132
build/cockpit/test/assert.js
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
define(function(i, h) {
|
||||
var c = {success:function(a) {
|
||||
console.log(a)
|
||||
}, fail:function() {
|
||||
c._recordThrow("fail", arguments)
|
||||
}, assertTrue:function(a) {
|
||||
a || c._recordThrow("assertTrue", arguments)
|
||||
}, verifyTrue:function(a) {
|
||||
a || c._recordTrace("verifyTrue", arguments)
|
||||
}, assertFalse:function(a) {
|
||||
a && c._recordThrow("assertFalse", arguments)
|
||||
}, verifyFalse:function(a) {
|
||||
a && c._recordTrace("verifyFalse", arguments)
|
||||
}, assertNull:function(a) {
|
||||
a !== null && c._recordThrow("assertNull", arguments)
|
||||
}, verifyNull:function(a) {
|
||||
a !== null && c._recordTrace("verifyNull", arguments)
|
||||
}, assertNotNull:function(a) {
|
||||
a === null && c._recordThrow("assertNotNull", arguments)
|
||||
}, verifyNotNull:function(a) {
|
||||
a === null && c._recordTrace("verifyNotNull", arguments)
|
||||
}, assertUndefined:function(a) {
|
||||
a !== undefined && c._recordThrow("assertUndefined", arguments)
|
||||
}, verifyUndefined:function(a) {
|
||||
a !== undefined && c._recordTrace("verifyUndefined", arguments)
|
||||
}, assertNotUndefined:function(a) {
|
||||
a === undefined && c._recordThrow("assertNotUndefined", arguments)
|
||||
}, verifyNotUndefined:function(a) {
|
||||
a === undefined && c._recordTrace("verifyNotUndefined", arguments)
|
||||
}, assertNaN:function(a) {
|
||||
isNaN(a) || c._recordThrow("assertNaN", arguments)
|
||||
}, verifyNaN:function(a) {
|
||||
isNaN(a) || c._recordTrace("verifyNaN", arguments)
|
||||
}, assertNotNaN:function(a) {
|
||||
isNaN(a) && c._recordThrow("assertNotNaN", arguments)
|
||||
}, verifyNotNaN:function(a) {
|
||||
isNaN(a) && c._recordTrace("verifyNotNaN", arguments)
|
||||
}, assertEqual:function(a, b) {
|
||||
c._isEqual(a, b) || c._recordThrow("assertEqual", arguments)
|
||||
}, verifyEqual:function(a, b) {
|
||||
c._isEqual(a, b) || c._recordTrace("verifyEqual", arguments)
|
||||
}, assertNotEqual:function(a, b) {
|
||||
c._isEqual(a, b) && c._recordThrow("assertNotEqual", arguments)
|
||||
}, verifyNotEqual:function(a, b) {
|
||||
c._isEqual(a, b) && c._recordTrace("verifyNotEqual", arguments)
|
||||
}, assertSame:function(a, b) {
|
||||
a !== b && c._recordThrow("assertSame", arguments)
|
||||
}, verifySame:function(a, b) {
|
||||
a !== b && c._recordTrace("verifySame", arguments)
|
||||
}, assertNotSame:function(a, b) {
|
||||
a !== b && c._recordThrow("assertNotSame", arguments)
|
||||
}, verifyNotSame:function(a, b) {
|
||||
a !== b && c._recordTrace("verifyNotSame", arguments)
|
||||
}, _recordTrace:function() {
|
||||
c._record.apply(this, arguments);
|
||||
console.trace()
|
||||
}, _recordThrow:function() {
|
||||
c._record.apply(this, arguments);
|
||||
throw new Error;
|
||||
}, _record:function() {
|
||||
console.error(arguments);
|
||||
var a = arguments[0] + "(", b = arguments[1];
|
||||
if(typeof b == "string") {
|
||||
a += b
|
||||
}else {
|
||||
for(var d = 0;d < b.length;d++) {
|
||||
if(d != 0) {
|
||||
a += ", "
|
||||
}a += b[d]
|
||||
}
|
||||
}a += ")";
|
||||
console.log(a)
|
||||
}, _isEqual:function(a, b, d) {
|
||||
d || (d = 0);
|
||||
if(d > 10) {
|
||||
return true
|
||||
}if(a == null) {
|
||||
if(b != null) {
|
||||
console.log("expected: null, actual non-null: ", b);
|
||||
return false
|
||||
}return true
|
||||
}if(typeof a == "number" && isNaN(a)) {
|
||||
if(!(typeof b == "number" && isNaN(b))) {
|
||||
console.log("expected: NaN, actual non-NaN: ", b);
|
||||
return false
|
||||
}return true
|
||||
}if(b == null) {
|
||||
if(a != null) {
|
||||
console.log("actual: null, expected non-null: ", a);
|
||||
return false
|
||||
}return true
|
||||
}if(typeof a == "object") {
|
||||
if(typeof b != "object") {
|
||||
console.log("expected object, actual not an object");
|
||||
return false
|
||||
}var f = 0;
|
||||
for(var e in b) {
|
||||
if(typeof b[e] != "function" || typeof a[e] != "function") {
|
||||
var g = c._isEqual(b[e], a[e], d + 1);
|
||||
if(typeof g != "boolean" || !g) {
|
||||
console.log("element '" + e + "' does not match: " + g);
|
||||
return false
|
||||
}
|
||||
}f++
|
||||
}b = 0;
|
||||
for(e in a) {
|
||||
b++
|
||||
}if(f != b) {
|
||||
console.log("expected object size = " + b + ", actual object size = " + f);
|
||||
return false
|
||||
}return true
|
||||
}if(b != a) {
|
||||
console.log("expected = " + a + " (type=" + typeof a + "), actual = " + b + " (type=" + typeof b + ")");
|
||||
return false
|
||||
}if(a instanceof Array) {
|
||||
if(!(b instanceof Array)) {
|
||||
console.log("expected array, actual not an array");
|
||||
return false
|
||||
}if(b.length != a.length) {
|
||||
console.log("expected array length = " + a.length + ", actual array length = " + b.length);
|
||||
return false
|
||||
}for(f = 0;f < b.length;f++) {
|
||||
e = c._isEqual(b[f], a[f], d + 1);
|
||||
if(typeof e != "boolean" || !e) {
|
||||
console.log("element " + f + " does not match: " + e);
|
||||
return false
|
||||
}
|
||||
}return true
|
||||
}return true
|
||||
}};
|
||||
h.test = c
|
||||
});
|
||||
257
build/cockpit/test/testCli.js
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
define(function(l, j) {
|
||||
var a = l("cockpit/test/assert").test, i = l("pilot/types").Status, r = l("pilot/settings").settings;
|
||||
l("cockpit/cli");
|
||||
l("cockpit/cli");
|
||||
var n = l("cockpit/cli").CliRequisition;
|
||||
j.testAll = function() {
|
||||
j.testTokenize();
|
||||
j.testSplit();
|
||||
j.testCli();
|
||||
return"testAll Completed"
|
||||
};
|
||||
j.testTokenize = function() {
|
||||
var b, e = new n;
|
||||
b = e._tokenize("");
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(0, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
b = e._tokenize("s");
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("s", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(1, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
b = e._tokenize(" ");
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("", b[0].text);
|
||||
a.verifyEqual(1, b[0].start);
|
||||
a.verifyEqual(1, b[0].end);
|
||||
a.verifyEqual(" ", b[0].priorSpace);
|
||||
b = e._tokenize("s s");
|
||||
a.verifyEqual(2, b.length);
|
||||
a.verifyEqual("s", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(1, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
a.verifyEqual("s", b[1].text);
|
||||
a.verifyEqual(2, b[1].start);
|
||||
a.verifyEqual(3, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
b = e._tokenize(" 1234 '12 34'");
|
||||
a.verifyEqual(2, b.length);
|
||||
a.verifyEqual("1234", b[0].text);
|
||||
a.verifyEqual(1, b[0].start);
|
||||
a.verifyEqual(5, b[0].end);
|
||||
a.verifyEqual(" ", b[0].priorSpace);
|
||||
a.verifyEqual("12 34", b[1].text);
|
||||
a.verifyEqual(8, b[1].start);
|
||||
a.verifyEqual(13, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
b = e._tokenize('12\'34 "12 34" \\');
|
||||
a.verifyEqual(3, b.length);
|
||||
a.verifyEqual("12'34", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(5, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
a.verifyEqual("12 34", b[1].text);
|
||||
a.verifyEqual(7, b[1].start);
|
||||
a.verifyEqual(12, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
a.verifyEqual("\\", b[2].text);
|
||||
a.verifyEqual(14, b[2].start);
|
||||
a.verifyEqual(15, b[2].end);
|
||||
a.verifyEqual(" ", b[2].priorSpace);
|
||||
b = e._tokenize("a\\ b \\t\\n\\r \\'x\\\" 'd");
|
||||
a.verifyEqual(4, b.length);
|
||||
a.verifyEqual("a b", b[0].text);
|
||||
a.verifyEqual(0, b[0].start);
|
||||
a.verifyEqual(3, b[0].end);
|
||||
a.verifyEqual("", b[0].priorSpace);
|
||||
a.verifyEqual("\t\n\r", b[1].text);
|
||||
a.verifyEqual(4, b[1].start);
|
||||
a.verifyEqual(7, b[1].end);
|
||||
a.verifyEqual(" ", b[1].priorSpace);
|
||||
a.verifyEqual("'x\"", b[2].text);
|
||||
a.verifyEqual(8, b[2].start);
|
||||
a.verifyEqual(11, b[2].end);
|
||||
a.verifyEqual(" ", b[2].priorSpace);
|
||||
a.verifyEqual("d", b[3].text);
|
||||
a.verifyEqual(13, b[3].start);
|
||||
a.verifyEqual(14, b[3].end);
|
||||
a.verifyEqual(" ", b[3].priorSpace);
|
||||
return"testTokenize Completed"
|
||||
};
|
||||
j.testSplit = function() {
|
||||
var b, e = new n;
|
||||
b = e._tokenize("s");
|
||||
e._split(b);
|
||||
a.verifyEqual(1, b.length);
|
||||
a.verifyEqual("s", b[0].text);
|
||||
a.verifyNull(e.commandAssignment.value);
|
||||
b = e._tokenize("set");
|
||||
e._split(b);
|
||||
a.verifyEqual([], b);
|
||||
a.verifyEqual("set", e.commandAssignment.value.name);
|
||||
b = e._tokenize("set a b");
|
||||
e._split(b);
|
||||
a.verifyEqual("set", e.commandAssignment.value.name);
|
||||
a.verifyEqual(2, b.length);
|
||||
a.verifyEqual("a", b[0].text);
|
||||
a.verifyEqual("b", b[1].text);
|
||||
return"testSplit Completed"
|
||||
};
|
||||
j.testCli = function() {
|
||||
function b(k) {
|
||||
d.update(k);
|
||||
s && console.log('####### TEST: typed="' + k.typed + '" cur=' + k.cursor.start + " cli=", d);
|
||||
f = d.getWorstHint();
|
||||
c = d.getAssignmentAt(k.cursor.start).getHint();
|
||||
h = d.getInputStatusMarkup().map(function(o) {
|
||||
return o.valueOf()
|
||||
}).join("");
|
||||
if(d.commandAssignment.value && d.commandAssignment.value.name === "set") {
|
||||
g = d.getAssignment("setting");
|
||||
m = d.getAssignment("value")
|
||||
}else {
|
||||
m = g = undefined
|
||||
}
|
||||
}
|
||||
function e(k, o) {
|
||||
return o.every(function(q) {
|
||||
return k === q || k === q.name
|
||||
}, this)
|
||||
}
|
||||
var g, m, d = new n, s = true, f, c, h, p = r.getSetting("historyLength");
|
||||
b({typed:"", cursor:{start:0, end:0}});
|
||||
a.verifyEqual("", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(0, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:" ", cursor:{start:1, end:1}});
|
||||
a.verifyEqual("0", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(1, c.start);
|
||||
a.verifyEqual(1, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:" ", cursor:{start:0, end:0}});
|
||||
a.verifyEqual("0", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(1, c.start);
|
||||
a.verifyEqual(1, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:"s", cursor:{start:1, end:1}});
|
||||
a.verifyEqual("1", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(1, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyTrue(c.predictions.length > 0);
|
||||
a.verifyTrue(c.predictions.length < 20);
|
||||
e("set", c.predictions);
|
||||
a.verifyNull(d.commandAssignment.value);
|
||||
b({typed:"set", cursor:{start:3, end:3}});
|
||||
a.verifyEqual("000", h);
|
||||
a.verifyEqual(1, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(3, c.end);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
b({typed:"set ", cursor:{start:4, end:4}});
|
||||
a.verifyEqual("0000", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(4, c.start);
|
||||
a.verifyEqual(4, c.end);
|
||||
a.verifyEqual(c, f);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
b({typed:"set ", cursor:{start:2, end:2}});
|
||||
a.verifyEqual("0000", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(3, c.end);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
b({typed:"set h", cursor:{start:5, end:5}});
|
||||
a.verifyEqual("00001", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(4, c.start);
|
||||
a.verifyEqual(5, c.end);
|
||||
a.verifyTrue(c.predictions.length > 0);
|
||||
e("historyLength", c.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("h", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLengt", cursor:{start:16, end:16}});
|
||||
a.verifyEqual("0000111111111111", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.INCOMPLETE, c.status);
|
||||
a.verifyEqual(4, c.start);
|
||||
a.verifyEqual(16, c.end);
|
||||
a.verifyEqual(1, c.predictions.length);
|
||||
e("historyLength", c.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLengt", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLengt", cursor:{start:1, end:1}});
|
||||
a.verifyEqual("0000222222222222", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(0, c.start);
|
||||
a.verifyEqual(3, c.end);
|
||||
a.verifyEqual(i.INVALID, f.status);
|
||||
a.verifyEqual(4, f.start);
|
||||
a.verifyEqual(16, f.end);
|
||||
a.verifyEqual(1, f.predictions.length);
|
||||
e("historyLength", f.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLengt", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLengt ", cursor:{start:17, end:17}});
|
||||
a.verifyEqual("00002222222222222", h);
|
||||
a.verifyEqual(3, d._hints.length);
|
||||
a.verifyEqual(i.VALID, c.status);
|
||||
a.verifyEqual(17, c.start);
|
||||
a.verifyEqual(17, c.end);
|
||||
a.verifyEqual(i.INVALID, f.status);
|
||||
a.verifyEqual(4, f.start);
|
||||
a.verifyEqual(16, f.end);
|
||||
a.verifyEqual(1, f.predictions.length);
|
||||
e("historyLength", f.predictions);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLengt", g.arg.text);
|
||||
a.verifyEqual(undefined, g.value);
|
||||
b({typed:"set historyLength", cursor:{start:17, end:17}});
|
||||
a.verifyEqual("00000000000000000", h);
|
||||
a.verifyEqual(2, d._hints.length);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLength", g.arg.text);
|
||||
a.verifyEqual(p, g.value);
|
||||
b({typed:"set historyLength ", cursor:{start:18, end:18}});
|
||||
a.verifyEqual("000000000000000000", h);
|
||||
a.verifyEqual(3, d._hints.length);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLength", g.arg.text);
|
||||
a.verifyEqual(p, g.value);
|
||||
b({typed:"set historyLength 6", cursor:{start:19, end:19}});
|
||||
a.verifyEqual("0000000000000000000", h);
|
||||
a.verifyEqual(3, d._hints.length);
|
||||
a.verifyEqual("set", d.commandAssignment.value.name);
|
||||
a.verifyEqual("historyLength", g.arg.text);
|
||||
a.verifyEqual(p, g.value);
|
||||
a.verifyEqual("6", m.arg.text);
|
||||
a.verifyEqual(6, m.value);
|
||||
a.verifyEqual("number", typeof m.value);
|
||||
return"testCli Completed"
|
||||
}
|
||||
});
|
||||
2
build/cockpit/test/testNothing.js
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
define(function() {
|
||||
});
|
||||
29
build/cockpit/ui/cliView.css
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
#cockpitInput { padding-left: 16px; }
|
||||
#cockpitOutput { overflow: auto; }
|
||||
#cockpitOutput.cptFocusPopup { position: absolute; z-index: 999; }
|
||||
.cptFocusPopup { display: none; }
|
||||
#cockpitInput:focus ~ .cptFocusPopup { display: block; }
|
||||
#cockpitInput:focus ~ .cptFocusPopup.cptNoPopup { display: none; }
|
||||
.cptCompletion { padding: 0; position: absolute; z-index: -1000; }
|
||||
.cptCompletion.VALID { background: #FFF; }
|
||||
.cptCompletion.INCOMPLETE { background: #DDD; }
|
||||
.cptCompletion.INVALID { background: #DDD; }
|
||||
.cptCompletion span { color: #FFF; }
|
||||
.cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }
|
||||
.cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }
|
||||
span.cptPrompt { color: #66F; font-weight: bold; }
|
||||
.cptHints {
|
||||
color: #000;
|
||||
position: absolute;
|
||||
border: 1px solid rgba(230, 230, 230, 0.8);
|
||||
background: rgba(250, 250, 250, 0.8);
|
||||
-moz-border-radius-topleft: 10px;
|
||||
-moz-border-radius-topright: 10px;
|
||||
border-top-left-radius: 10px; border-top-right-radius: 10px;
|
||||
z-index: 1000;
|
||||
padding: 8px;
|
||||
display: none;
|
||||
}
|
||||
.cptHints ul { margin: 0; padding: 0 15px; }
|
||||
.cptGt { font-weight: bold; font-size: 120%; }
|
||||
184
build/cockpit/ui/cliView.js
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
define(function(f, m) {
|
||||
function i(a, b) {
|
||||
this.cli = a;
|
||||
this.doc = document;
|
||||
this.win = d.getParentWindow(this.doc);
|
||||
if(this.element = this.doc.getElementById("cockpitInput")) {
|
||||
this.settings = b.settings;
|
||||
this.hintDirection = this.settings.getSetting("hintDirection");
|
||||
this.outputDirection = this.settings.getSetting("outputDirection");
|
||||
this.outputHeight = this.settings.getSetting("outputHeight");
|
||||
this.isUpdating = false;
|
||||
this.createElements();
|
||||
this.update()
|
||||
}else {
|
||||
console.log("No element with an id of cockpit. Bailing on cli")
|
||||
}
|
||||
}
|
||||
var j = f("text!cockpit/ui/cliView.css!\n#cockpitInput { padding-left: 16px; }\n\n#cockpitOutput { overflow: auto; }\n#cockpitOutput.cptFocusPopup { position: absolute; z-index: 999; }\n\n.cptFocusPopup { display: none; }\n#cockpitInput:focus ~ .cptFocusPopup { display: block; }\n#cockpitInput:focus ~ .cptFocusPopup.cptNoPopup { display: none; }\n\n.cptCompletion { padding: 0; position: absolute; z-index: -1000; }\n.cptCompletion.VALID { background: #FFF; }\n.cptCompletion.INCOMPLETE { background: #DDD; }\n.cptCompletion.INVALID { background: #DDD; }\n.cptCompletion span { color: #FFF; }\n.cptCompletion span.INCOMPLETE { color: #DDD; border-bottom: 2px dotted #F80; }\n.cptCompletion span.INVALID { color: #DDD; border-bottom: 2px dotted #F00; }\nspan.cptPrompt { color: #66F; font-weight: bold; }\n\n\n.cptHints {\n color: #000;\n position: absolute;\n border: 1px solid rgba(230, 230, 230, 0.8);\n background: rgba(250, 250, 250, 0.8);\n -moz-border-radius-topleft: 10px;\n -moz-border-radius-topright: 10px;\n border-top-left-radius: 10px; border-top-right-radius: 10px;\n z-index: 1000;\n padding: 8px;\n display: none;\n}\n.cptHints ul { margin: 0; padding: 0 15px; }\n\n.cptGt { font-weight: bold; font-size: 120%; }\n"),
|
||||
k = f("pilot/event"), d = f("pilot/dom");
|
||||
d.importCssString(j);
|
||||
var n = f("pilot/canon"), h = f("pilot/types").Status, g = f("pilot/keyboard/keyutil"), o = f("cockpit/cli").CliRequisition;
|
||||
j = f("cockpit/cli").Hint;
|
||||
var p = f("cockpit/ui/requestView").RequestView;
|
||||
new j(h.VALID, "", 0, 0);
|
||||
m.startup = function(a) {
|
||||
var b = new o(a.env);
|
||||
new i(b, a.env)
|
||||
};
|
||||
i.prototype = {createElements:function() {
|
||||
var a = this.element;
|
||||
this.output = this.doc.getElementById("cockpitOutput");
|
||||
this.popupOutput = this.output == null;
|
||||
if(!this.output) {
|
||||
this.output = this.doc.createElement("div");
|
||||
this.output.id = "cockpitOutput";
|
||||
this.output.className = "cptFocusPopup";
|
||||
a.parentNode.insertBefore(this.output, a.nextSibling);
|
||||
var b = function() {
|
||||
this.output.style.maxHeight = this.outputHeight.get() + "px"
|
||||
}.bind(this);
|
||||
this.outputHeight.addEventListener("change", b);
|
||||
b()
|
||||
}this.completer = this.doc.createElement("div");
|
||||
this.completer.className = "cptCompletion VALID";
|
||||
this.completer.style.color = d.computedStyle(a, "color");
|
||||
this.completer.style.fontSize = d.computedStyle(a, "fontSize");
|
||||
this.completer.style.fontFamily = d.computedStyle(a, "fontFamily");
|
||||
this.completer.style.fontWeight = d.computedStyle(a, "fontWeight");
|
||||
this.completer.style.fontStyle = d.computedStyle(a, "fontStyle");
|
||||
a.parentNode.insertBefore(this.completer, a.nextSibling);
|
||||
this.completer.style.backgroundColor = a.style.backgroundColor;
|
||||
a.style.backgroundColor = "transparent";
|
||||
this.hinter = this.doc.createElement("div");
|
||||
this.hinter.className = "cptHints cptFocusPopup";
|
||||
a.parentNode.insertBefore(this.hinter, a.nextSibling);
|
||||
b = this.resizer.bind(this);
|
||||
k.addListener(this.win, "resize", b);
|
||||
this.hintDirection.addEventListener("change", b);
|
||||
this.outputDirection.addEventListener("change", b);
|
||||
b();
|
||||
n.addEventListener("output", function(c) {
|
||||
new p(c.request, this)
|
||||
}.bind(this));
|
||||
g.addKeyDownListener(a, this.onKeyDown.bind(this));
|
||||
k.addListener(a, "keyup", this.onKeyUp.bind(this));
|
||||
k.addListener(a, "mouseup", function() {
|
||||
this.isUpdating = true;
|
||||
this.update();
|
||||
this.isUpdating = false
|
||||
}.bind(this));
|
||||
this.cli.addEventListener("argumentChange", this.onArgChange.bind(this))
|
||||
}, scrollOutputToBottom:function() {
|
||||
this.output.scrollTop = Math.max(this.output.scrollHeight, this.output.clientHeight) - this.output.clientHeight
|
||||
}, resizer:function() {
|
||||
var a = this.element.getClientRects()[0];
|
||||
this.completer.style.top = a.top + "px";
|
||||
var b = a.bottom - a.top;
|
||||
this.completer.style.height = b + "px";
|
||||
this.completer.style.lineHeight = b + "px";
|
||||
this.completer.style.left = a.left + "px";
|
||||
b = a.right - a.left;
|
||||
this.completer.style.width = b + "px";
|
||||
if(this.hintDirection.get() === "below") {
|
||||
this.hinter.style.top = a.bottom + "px";
|
||||
this.hinter.style.bottom = "auto"
|
||||
}else {
|
||||
this.hinter.style.top = "auto";
|
||||
this.hinter.style.bottom = this.doc.documentElement.clientHeight - a.top + "px"
|
||||
}this.hinter.style.left = a.left + 30 + "px";
|
||||
this.hinter.style.maxWidth = b - 110 + "px";
|
||||
if(this.popupOutput) {
|
||||
if(this.outputDirection.get() === "below") {
|
||||
this.output.style.top = a.bottom + "px";
|
||||
this.output.style.bottom = "auto"
|
||||
}else {
|
||||
this.output.style.top = "auto";
|
||||
this.output.style.bottom = this.doc.documentElement.clientHeight - a.top + "px"
|
||||
}this.output.style.left = a.left + "px";
|
||||
this.output.style.width = b - 80 + "px"
|
||||
}
|
||||
}, onKeyDown:function(a) {
|
||||
if(a.keyCode === g.KeyHelper.KEY.TAB || a.keyCode === g.KeyHelper.KEY.UP || a.keyCode === g.KeyHelper.KEY.DOWN) {
|
||||
return true
|
||||
}
|
||||
}, onKeyUp:function(a) {
|
||||
if(a.keyCode === g.KeyHelper.KEY.RETURN) {
|
||||
var b = this.cli.getWorstHint();
|
||||
if(b.status === h.VALID) {
|
||||
this.cli.exec();
|
||||
this.element.value = ""
|
||||
}else {
|
||||
this.element.selectionStart = b.start;
|
||||
this.element.selectionEnd = b.end
|
||||
}
|
||||
}this.update();
|
||||
if(b = this.cli.getAssignmentAt(this.element.selectionStart)) {
|
||||
if(a.keyCode === g.KeyHelper.KEY.TAB) {
|
||||
b.complete();
|
||||
this.update()
|
||||
}if(a.keyCode === g.KeyHelper.KEY.UP) {
|
||||
b.increment();
|
||||
this.update()
|
||||
}if(a.keyCode === g.KeyHelper.KEY.DOWN) {
|
||||
b.decrement();
|
||||
this.update()
|
||||
}
|
||||
}
|
||||
}, update:function() {
|
||||
this.isUpdating = true;
|
||||
var a = {typed:this.element.value, cursor:{start:this.element.selectionStart, end:this.element.selectionEnd}};
|
||||
this.cli.update(a);
|
||||
a = this.cli.getAssignmentAt(a.cursor.start).getHint();
|
||||
d.removeCssClass(this.completer, h.VALID.toString());
|
||||
d.removeCssClass(this.completer, h.INCOMPLETE.toString());
|
||||
d.removeCssClass(this.completer, h.INVALID.toString());
|
||||
var b = '<span class="cptPrompt">></span> ';
|
||||
if(this.element.value.length > 0) {
|
||||
var c = this.cli.getInputStatusMarkup();
|
||||
b += this.markupStatusScore(c)
|
||||
}if(this.element.value.length > 0 && a.predictions && a.predictions.length > 0) {
|
||||
c = a.predictions[0];
|
||||
b += " ⇥ " + (c.name ? c.name : c)
|
||||
}this.completer.innerHTML = b;
|
||||
d.addCssClass(this.completer, this.cli.getWorstHint().status.toString());
|
||||
var e = "";
|
||||
if(this.element.value.length !== 0) {
|
||||
e += a.message;
|
||||
if(a.predictions && a.predictions.length > 0) {
|
||||
e += ": [ ";
|
||||
a.predictions.forEach(function(l) {
|
||||
e += l.name ? l.name : l;
|
||||
e += " | "
|
||||
}, this);
|
||||
e = e.replace(/\| $/, "]")
|
||||
}
|
||||
}this.hinter.innerHTML = e;
|
||||
e.length === 0 ? d.addCssClass(this.hinter, "cptNoPopup") : d.removeCssClass(this.hinter, "cptNoPopup");
|
||||
this.isUpdating = false
|
||||
}, markupStatusScore:function(a) {
|
||||
for(var b = "", c = 0, e = -1;;) {
|
||||
if(e !== a[c]) {
|
||||
b += "<span class=" + a[c].toString() + ">";
|
||||
e = a[c]
|
||||
}b += this.element.value[c];
|
||||
c++;
|
||||
if(c === this.element.value.length) {
|
||||
b += "</span>";
|
||||
break
|
||||
}if(e !== a[c]) {
|
||||
b += "</span>"
|
||||
}
|
||||
}return b
|
||||
}, onArgChange:function(a) {
|
||||
if(!this.isUpdating) {
|
||||
var b = this.element.value.substring(0, a.argument.start), c = this.element.value.substring(a.argument.end);
|
||||
a = typeof a.text === "string" ? a.text : a.text.name;
|
||||
this.element.value = b + a + c;
|
||||
b = (b + a).length;
|
||||
this.element.selectionStart = b;
|
||||
this.element.selectionEnd = b
|
||||
}
|
||||
}};
|
||||
m.CliView = i
|
||||
});
|
||||
BIN
build/cockpit/ui/images/closer.png
Normal file
|
After Width: | Height: | Size: 669 B |
BIN
build/cockpit/ui/images/dot_clear.gif
Normal file
|
After Width: | Height: | Size: 42 B |
BIN
build/cockpit/ui/images/minus.png
Normal file
|
After Width: | Height: | Size: 604 B |
BIN
build/cockpit/ui/images/pinaction.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
build/cockpit/ui/images/pinin.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
build/cockpit/ui/images/pinout.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
build/cockpit/ui/images/pins.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
build/cockpit/ui/images/plus.png
Normal file
|
After Width: | Height: | Size: 635 B |
BIN
build/cockpit/ui/images/throbber.gif
Normal file
|
After Width: | Height: | Size: 11 KiB |
39
build/cockpit/ui/requestView.css
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
.cptRowIn {
|
||||
display: box; display: -moz-box; display: -webkit-box;
|
||||
box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal;
|
||||
box-align: center; -moz-box-align: center; -webkit-box-align: center;
|
||||
color: #333;
|
||||
background-color: #EEE;
|
||||
width: 100%;
|
||||
font-family: consolas, courier, monospace;
|
||||
}
|
||||
.cptRowIn > * { padding-left: 2px; padding-right: 2px; }
|
||||
.cptRowIn > img { cursor: pointer; }
|
||||
.cptHover { display: none; }
|
||||
.cptRowIn:hover > .cptHover { display: block; }
|
||||
.cptRowIn:hover > .cptHover.cptHidden { display: none; }
|
||||
.cptOutTyped {
|
||||
box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1;
|
||||
font-weight: bold; color: #000; font-size: 120%;
|
||||
}
|
||||
.cptRowOutput { padding-left: 10px; line-height: 1.2em; }
|
||||
.cptRowOutput strong,
|
||||
.cptRowOutput b,
|
||||
.cptRowOutput th,
|
||||
.cptRowOutput h1,
|
||||
.cptRowOutput h2,
|
||||
.cptRowOutput h3 { color: #000; }
|
||||
.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }
|
||||
.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }
|
||||
.cptRowOutput input[type=password],
|
||||
.cptRowOutput input[type=text],
|
||||
.cptRowOutput textarea {
|
||||
color: #000; font-size: 120%;
|
||||
background: transparent; padding: 3px;
|
||||
border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
|
||||
}
|
||||
.cptRowOutput table,
|
||||
.cptRowOutput td,
|
||||
.cptRowOutput th { border: 0; padding: 0 2px; }
|
||||
.cptRowOutput .right { text-align: right; }
|
||||
28
build/cockpit/ui/requestView.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
<div class=cptRow>
|
||||
<!-- The div for the input (i.e. what was typed) -->
|
||||
<div class="cptRowIn" save="${rowin}"
|
||||
onclick="${copyToInput}"
|
||||
ondblclick="${executeRequest}">
|
||||
|
||||
<!-- What the user actually typed -->
|
||||
<div class="cptGt">> </div>
|
||||
<div class="cptOutTyped">${request.typed}</div>
|
||||
|
||||
<!-- The extra details that appear on hover -->
|
||||
<div class=cptHover save="${duration}"></div>
|
||||
<img class=cptHover onclick="${hideOutput}" save="${hide}"
|
||||
alt="Hide command output" _src="${imagePath}/minus.png"/>
|
||||
<img class="cptHover cptHidden" onclick="${showOutput}" save="${show}"
|
||||
alt="Show command output" _src="${imagePath}/plus.png"/>
|
||||
<img class=cptHover onclick="${remove}"
|
||||
alt="Remove this command from the history" _src="${imagePath}/closer.png"/>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- The div for the command output -->
|
||||
<div class="cptRowOut" save="${rowout}">
|
||||
<div class="cptRowOutput" save="${output}"></div>
|
||||
<img _src="${imagePath}/throbber.gif" save="${throb}"/>
|
||||
</div>
|
||||
</div>
|
||||
65
build/cockpit/ui/requestView.js
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
define(function(b, j, c) {
|
||||
function i(a, d) {
|
||||
this.request = a;
|
||||
this.cliView = d;
|
||||
this.imagePath = g;
|
||||
this.throb = this.duration = this.show = this.hide = this.output = this.rowout = this.rowin = null;
|
||||
(new k).processNode(l.cloneNode(true), this);
|
||||
this.cliView.output.appendChild(this.rowin);
|
||||
this.cliView.output.appendChild(this.rowout);
|
||||
this.request.addEventListener("output", this.onRequestChange.bind(this))
|
||||
}
|
||||
var e = b("pilot/dom"), h = b("pilot/event"), f = b('text!cockpit/ui/requestView.html!\n<div class=cptRow>\n <!-- The div for the input (i.e. what was typed) --\>\n <div class="cptRowIn" save="${rowin}"\n onclick="${copyToInput}"\n ondblclick="${executeRequest}">\n \n <!-- What the user actually typed --\>\n <div class="cptGt">> </div>\n <div class="cptOutTyped">${request.typed}</div>\n\n <!-- The extra details that appear on hover --\>\n <div class=cptHover save="${duration}"></div>\n <img class=cptHover onclick="${hideOutput}" save="${hide}"\n alt="Hide command output" _src="${imagePath}/minus.png"/>\n <img class="cptHover cptHidden" onclick="${showOutput}" save="${show}"\n alt="Show command output" _src="${imagePath}/plus.png"/>\n <img class=cptHover onclick="${remove}"\n alt="Remove this command from the history" _src="${imagePath}/closer.png"/>\n \n </div>\n \n <!-- The div for the command output --\>\n <div class="cptRowOut" save="${rowout}">\n <div class="cptRowOutput" save="${output}"></div>\n <img _src="${imagePath}/throbber.gif" save="${throb}"/>\n </div>\n</div>\n'),
|
||||
k = b("pilot/domtemplate").Templater;
|
||||
b = b("text!cockpit/ui/requestView.css!\n.cptRowIn {\n display: box; display: -moz-box; display: -webkit-box;\n box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-orient: horizontal;\n box-align: center; -moz-box-align: center; -webkit-box-align: center;\n color: #333;\n background-color: #EEE;\n width: 100%;\n font-family: consolas, courier, monospace;\n}\n.cptRowIn > * { padding-left: 2px; padding-right: 2px; }\n.cptRowIn > img { cursor: pointer; }\n.cptHover { display: none; }\n.cptRowIn:hover > .cptHover { display: block; }\n.cptRowIn:hover > .cptHover.cptHidden { display: none; }\n.cptOutTyped {\n box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1;\n font-weight: bold; color: #000; font-size: 120%;\n}\n.cptRowOutput { padding-left: 10px; line-height: 1.2em; }\n.cptRowOutput strong,\n.cptRowOutput b,\n.cptRowOutput th,\n.cptRowOutput h1,\n.cptRowOutput h2,\n.cptRowOutput h3 { color: #000; }\n.cptRowOutput a { font-weight: bold; color: #666; text-decoration: none; }\n.cptRowOutput a: hover { text-decoration: underline; cursor: pointer; }\n.cptRowOutput input[type=password],\n.cptRowOutput input[type=text],\n.cptRowOutput textarea {\n color: #000; font-size: 120%;\n background: transparent; padding: 3px;\n border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;\n}\n.cptRowOutput table,\n.cptRowOutput td,\n.cptRowOutput th { border: 0; padding: 0 2px; }\n.cptRowOutput .right { text-align: right; }\n");
|
||||
e.importCssString(b);
|
||||
b = document.createElement("div");
|
||||
b.innerHTML = f;
|
||||
var l = b.querySelector(".cptRow");
|
||||
f = c.id.split("/").pop() + ".js";
|
||||
var g;
|
||||
if(c.uri.substr(-f.length) !== f) {
|
||||
console.error("module.id", c.id);
|
||||
console.error("module.uri", c.uri);
|
||||
console.error("filename", f);
|
||||
console.error("Can't work out path from module.uri/module/id");
|
||||
g = "."
|
||||
}else {
|
||||
g = c.uri.substr(0, c.uri.length - f.length) + "images"
|
||||
}i.prototype = {copyToInput:function() {
|
||||
this.cliView.element.value = this.request.typed
|
||||
}, executeRequest:function() {
|
||||
this.cliView.cli.update({typed:this.request.typed, cursor:{start:0, end:0}});
|
||||
this.cliView.cli.exec()
|
||||
}, hideOutput:function(a) {
|
||||
this.output.style.display = "none";
|
||||
e.addCssClass(this.hide, "cmd_hidden");
|
||||
e.removeCssClass(this.show, "cmd_hidden");
|
||||
h.stopPropagation(a)
|
||||
}, showOutput:function(a) {
|
||||
this.output.style.display = "block";
|
||||
e.removeCssClass(this.hide, "cmd_hidden");
|
||||
e.addCssClass(this.show, "cmd_hidden");
|
||||
h.stopPropagation(a)
|
||||
}, remove:function(a) {
|
||||
this.cliView.output.removeChild(this.rowin);
|
||||
this.cliView.output.removeChild(this.rowout);
|
||||
h.stopPropagation(a)
|
||||
}, onRequestChange:function() {
|
||||
this.duration.innerHTML = this.request.duration ? "completed in " + this.request.duration / 1E3 + " sec " : "";
|
||||
this.output.innerHTML = "";
|
||||
this.request.outputs.forEach(function(a) {
|
||||
var d;
|
||||
if(typeof a == "string") {
|
||||
d = document.createElement("p");
|
||||
d.innerHTML = a
|
||||
}else {
|
||||
d = a
|
||||
}this.output.appendChild(d)
|
||||
}, this);
|
||||
this.cliView.scrollOutputToBottom();
|
||||
e.setCssClass(this.output, "cmd_error", this.request.error);
|
||||
this.throb.style.display = this.request.completed ? "none" : "block"
|
||||
}};
|
||||
j.RequestView = i
|
||||
});
|
||||
15
build/cockpit/ui/settings.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
define(function(b, c) {
|
||||
var d = b("pilot/types"), e = new (b("pilot/types/basic").SelectionType)({name:"direction", data:["above", "below"]}), f = {name:"hintDirection", description:"Are hints shown above or below the command line?", type:"direction", defaultValue:"above"}, g = {name:"outputDirection", description:"Is the output window shown above or below the command line?", type:"direction", defaultValue:"above"}, h = {name:"outputHeight", description:"What height should the output panel be?", type:"number", defaultValue:300};
|
||||
c.startup = function(a) {
|
||||
d.registerType(e);
|
||||
a.env.settings.addSetting(f);
|
||||
a.env.settings.addSetting(g);
|
||||
a.env.settings.addSetting(h)
|
||||
};
|
||||
c.shutdown = function(a) {
|
||||
d.unregisterType(e);
|
||||
a.env.settings.removeSetting(f);
|
||||
a.env.settings.removeSetting(g);
|
||||
a.env.settings.removeSetting(h)
|
||||
}
|
||||
});
|
||||
11
build/demo/boot-build.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
define(function(a) {
|
||||
a("pilot/fixoldbrowsers");
|
||||
var b = a("pilot/plugin_manager").catalog, d = a("pilot/plugin_manager").REASONS.APP_STARTUP;
|
||||
a("pilot/settings");
|
||||
b.registerPlugins(["pilot/index", "cockpit/index"]).then(function() {
|
||||
var c = a("pilot/environment").create();
|
||||
b.startupPlugins({env:c}, d).then(function() {
|
||||
a("demo/startup").launch(c)
|
||||
})
|
||||
})
|
||||
});
|
||||
10
build/demo/boot.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
var config = {packagePaths:{"../support/cockpit/lib":[{name:"cockpit", main:"index", lib:"."}], "../support/cockpit/support/pilot/lib":[{name:"pilot", main:"index", lib:"."}]}, paths:{demo:"../demo", ace:"../lib/ace"}}, deps = ["pilot/fixoldbrowsers", "pilot/plugin_manager", "pilot/settings", "pilot/environment", "demo/startup"];
|
||||
require(config, deps, function() {
|
||||
var a = require("pilot/plugin_manager").catalog;
|
||||
a.registerPlugins(["pilot/index", "cockpit/index"]).then(function() {
|
||||
var b = require("pilot/environment").create();
|
||||
a.startupPlugins({env:b}).then(function() {
|
||||
require("demo/startup").launch(b)
|
||||
})
|
||||
})
|
||||
});
|
||||
BIN
build/demo/logo.png
Normal file
|
After Width: | Height: | Size: 16 KiB |