mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
feature(edward) ed -> edward
This commit is contained in:
parent
57624cbe73
commit
ece8637275
1 changed files with 26 additions and 26 deletions
|
|
@ -4,17 +4,17 @@ var join, ace, Util, DOM;
|
|||
'use strict';
|
||||
|
||||
if (typeof module !== 'undefined' && module.exports)
|
||||
module.exports = new edward();
|
||||
module.exports = new Edward();
|
||||
else
|
||||
global.edward = new edward();
|
||||
global.edward = new Edward();
|
||||
|
||||
function edward() {
|
||||
function Edward() {
|
||||
var Element,
|
||||
ElementMsg,
|
||||
Value,
|
||||
Ace,
|
||||
|
||||
ed = function(el, callback) {
|
||||
edward = function(el, callback) {
|
||||
Element = el || document.body;
|
||||
exec.series([
|
||||
loadFiles,
|
||||
|
|
@ -36,16 +36,16 @@ var join, ace, Util, DOM;
|
|||
return msg;
|
||||
}
|
||||
|
||||
ed.addCommand = function(options) {
|
||||
edward.addCommand = function(options) {
|
||||
Ace.commands.addCommand(options);
|
||||
};
|
||||
|
||||
ed.clearSelection = function() {
|
||||
edward.clearSelection = function() {
|
||||
Ace.clearSelection();
|
||||
return ed;
|
||||
return edward;
|
||||
};
|
||||
|
||||
ed.goToLine = function() {
|
||||
edward.goToLine = function() {
|
||||
var msg = 'Enter line number:',
|
||||
cursor = edward.getCursor(),
|
||||
number = cursor.row + 1,
|
||||
|
|
@ -57,34 +57,34 @@ var join, ace, Util, DOM;
|
|||
Ace.gotoLine(number);
|
||||
};
|
||||
|
||||
ed.moveCursorTo = function(row, column) {
|
||||
edward.moveCursorTo = function(row, column) {
|
||||
Ace.moveCursorTo(row, column);
|
||||
return ed;
|
||||
return edward;
|
||||
};
|
||||
|
||||
ed.focus = function() {
|
||||
edward.focus = function() {
|
||||
Ace.focus();
|
||||
return ed;
|
||||
return edward;
|
||||
};
|
||||
|
||||
ed.remove = function(direction) {
|
||||
edward.remove = function(direction) {
|
||||
Ace.remove(direction);
|
||||
};
|
||||
|
||||
ed.getCursor = function() {
|
||||
edward.getCursor = function() {
|
||||
return Ace.selection.getCursor();
|
||||
};
|
||||
|
||||
ed.getValue = function() {
|
||||
edward.getValue = function() {
|
||||
return Ace.getValue();
|
||||
};
|
||||
|
||||
ed.setValue = function(value) {
|
||||
edward.setValue = function(value) {
|
||||
Ace.setValue(value);
|
||||
};
|
||||
|
||||
ed.setValueFirst = function(value) {
|
||||
var session = ed.getSession(),
|
||||
edward.setValueFirst = function(value) {
|
||||
var session = edward.getSession(),
|
||||
UndoManager = ace.require('ace/undomanager').UndoManager;
|
||||
|
||||
Value = value;
|
||||
|
|
@ -94,28 +94,28 @@ var join, ace, Util, DOM;
|
|||
session.setUndoManager(new UndoManager());
|
||||
};
|
||||
|
||||
ed.setOption = function(name, value) {
|
||||
edward.setOption = function(name, value) {
|
||||
Ace.setOption(name, value);
|
||||
};
|
||||
|
||||
ed.setOptions = function(options) {
|
||||
edward.setOptions = function(options) {
|
||||
Ace.setOptions(options);
|
||||
};
|
||||
|
||||
ed.selectAll = function() {
|
||||
edward.selectAll = function() {
|
||||
Ace.selectAll();
|
||||
};
|
||||
|
||||
ed.scrollToLine = function(row) {
|
||||
edward.scrollToLine = function(row) {
|
||||
Ace.scrollToLine(row, true);
|
||||
return ed;
|
||||
return edward;
|
||||
};
|
||||
|
||||
ed.getSession = function() {
|
||||
edward.getSession = function() {
|
||||
return Ace.getSession();
|
||||
};
|
||||
|
||||
ed.showMessage = function(text) {
|
||||
edward.showMessage = function(text) {
|
||||
var HIDE_TIME = 2000;
|
||||
|
||||
/*
|
||||
|
|
@ -156,7 +156,7 @@ var join, ace, Util, DOM;
|
|||
});
|
||||
}
|
||||
|
||||
return ed;
|
||||
return edward;
|
||||
}
|
||||
|
||||
})(this, join, DOM, Util.exec, DOM.load);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue