diff --git a/lib/client/edward.js b/lib/client/edward.js index 8380c38b..3b8bf9b2 100644 --- a/lib/client/edward.js +++ b/lib/client/edward.js @@ -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);