Save changes

This commit is contained in:
Garen Torikian 2012-11-02 15:34:25 -07:00 committed by nightwing
commit eb955fa90d
18 changed files with 15484 additions and 1283 deletions

View file

@ -39,22 +39,13 @@ var Editor = require("./editor").Editor;
var Renderer = require("./virtual_renderer").VirtualRenderer;
var EditSession = require("./edit_session").EditSession;
/** internal, hide
* class Split
/**
* @class Split
*
*
*
**/
/** internal, hide
* new Split(container, theme, splits)
* - container (Document): The document to associate with the split
* - theme (String): The name of the initial theme
* - splits (Number): The number of initial splits
*
*
*
**/
var Split = function(container, theme, splits) {
this.BELOW = 1;
@ -96,13 +87,6 @@ var Split = function(container, theme, splits) {
return editor;
};
/** internal, hide
* Split.setSplits(splits) -> Void
* - splits (Number): The new number of splits
*
*
*
**/
this.setSplits = function(splits) {
var editor;
if (splits < 1) {
@ -133,18 +117,16 @@ var Split = function(container, theme, splits) {
};
/**
* Split.getSplits() -> Number
*
*
* Returns the number of splits.
*
* @returns {Number}
**/
this.getSplits = function() {
return this.$splits;
};
/**
* Split.getEditor(idx) -> Editor
* -idx (Number): The index of the editor you want
* @param {Number} idx The index of the editor you want
*
* Returns the editor identified by the index `idx`.
*
@ -154,40 +136,36 @@ var Split = function(container, theme, splits) {
};
/**
* Split.getCurrentEditor() -> Editor
*
*
* Returns the current editor.
*
* @returns {Editor}
**/
this.getCurrentEditor = function() {
return this.$cEditor;
};
/** related to: Editor.focus
* Split.focus() -> Void
*
/**
* Focuses the current editor.
*
* @related Editor.focus
**/
this.focus = function() {
this.$cEditor.focus();
};
/** related to: Editor.blur
* Split.blur() -> Void
*
/**
* Blurs the current editor.
*
* @related Editor.blur
**/
this.blur = function() {
this.$cEditor.blur();
};
/** related to: Editor.setTheme
* Split.setTheme(theme) -> Void
* - theme (String): The name of the theme to set
/**
*
* @param {String} theme The name of the theme to set
*
* Sets a theme for each of the available editors.
* @related Editor.setTheme
**/
this.setTheme = function(theme) {
this.$editors.forEach(function(editor) {
@ -195,11 +173,12 @@ var Split = function(container, theme, splits) {
});
};
/** internal, hide
* Split.setKeyboardHandler(keybinding) -> Void
* - keybinding (String):
/**
*
*
* @param {String} keybinding
*
* Sets the keyboard handler for the editor.
* @related editor.setKeyboardHandler
**/
this.setKeyboardHandler = function(keybinding) {
this.$editors.forEach(function(editor) {
@ -207,10 +186,10 @@ var Split = function(container, theme, splits) {
});
};
/** internal, hide
* Split.forEach(callback, scope) -> Void
* - callback (Function): A callback function to execute
* - scope (String):
/**
*
* @param {Function} callback A callback function to execute
* @param {String} scope The default scope for the callback
*
* Executes `callback` on all of the available editors.
*
@ -219,14 +198,14 @@ var Split = function(container, theme, splits) {
this.$editors.forEach(callback, scope);
};
/** related to: Editor.setFontSize
* Split.setFontSize(size) -> Void
* - size (Number): The new font size
this.$fontSize = "";
/**
* @param {Number} size The new font size
*
* Sets the font size, in pixels, for all the available editors.
*
**/
this.$fontSize = "";
this.setFontSize = function(size) {
this.$fontSize = size;
this.forEach(function(editor) {
@ -261,13 +240,13 @@ var Split = function(container, theme, splits) {
return s;
};
/** related to: Editor.setSession
* Split.setSession(session, idx) -> Void
* - session (EditSession): The new edit session
* - idx (Number): The editor's index you're interested in
/**
*
* @param {EditSession} session The new edit session
* @param {Number} idx The editor's index you're interested in
*
* Sets a new [[EditSession `EditSession`]] for the indicated editor.
*
* @related Editor.setSession
**/
this.setSession = function(session, idx) {
var editor;
@ -295,19 +274,18 @@ var Split = function(container, theme, splits) {
return session;
};
/** internal, hide
* Split.getOrientation() -> Number
/**
*
* Returns the orientation.
*
* @returns Number
**/
this.getOrientation = function() {
return this.$orientation;
};
/** internal, hide
* Split.setOrientation(oriantation) -> Void
* - oriantation (Number):
/**
*
* @param {Number} orientation The new orientation value
*
* Sets the orientation.
*
@ -320,11 +298,11 @@ var Split = function(container, theme, splits) {
this.resize();
};
/** internal
/**
* Split.resize() -> Void
*
*
*
* Resizes the editor.
**/
this.resize = function() {
var width = this.$container.clientWidth;
@ -356,12 +334,7 @@ var Split = function(container, theme, splits) {
}).call(Split.prototype);
/** internal
* Split.UndoManagerProxy() -> Void
*
*
*
**/
function UndoManagerProxy(undoManager, session) {
this.$u = undoManager;
this.$doc = session;