Update Events documentation
This commit is contained in:
parent
0a14538bbe
commit
039e04c160
28 changed files with 891 additions and 404 deletions
|
|
@ -127,6 +127,12 @@ var Editor = function(renderer, session) {
|
|||
*
|
||||
* Sets a new editsession to use. This method also emits the `'changeSession'` event.
|
||||
**/
|
||||
/**
|
||||
* Editor@changeSession(e)
|
||||
* - e (Object): An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s.
|
||||
*
|
||||
* Emitted whenever the [[EditSession]] changes.
|
||||
**/
|
||||
this.setSession = function(session) {
|
||||
if (this.session == session)
|
||||
return;
|
||||
|
|
@ -462,9 +468,10 @@ var Editor = function(renderer, session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Editor@cursorChange()
|
||||
* Editor@changeSelection()
|
||||
*
|
||||
* Emitted when the selection changes.
|
||||
*
|
||||
* Emitted when the cursor changes.
|
||||
**/
|
||||
this.onCursorChange = function() {
|
||||
this.$cursorChange();
|
||||
|
|
@ -508,12 +515,6 @@ var Editor = function(renderer, session) {
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* Editor@selectionChange(e)
|
||||
* - e (Object): Contains a single property, `data`, which has the delta of changes
|
||||
*
|
||||
* Emitted when a selection has changed.
|
||||
**/
|
||||
this.onSelectionChange = function(e) {
|
||||
var session = this.session;
|
||||
|
||||
|
|
@ -568,74 +569,39 @@ var Editor = function(renderer, session) {
|
|||
return re;
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeFrontMarker()
|
||||
*
|
||||
* Emitted when a front marker changes.
|
||||
**/
|
||||
|
||||
this.onChangeFrontMarker = function() {
|
||||
this.renderer.updateFrontMarkers();
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeBackMarker()
|
||||
*
|
||||
* Emitted when a back marker changes.
|
||||
**/
|
||||
this.onChangeBackMarker = function() {
|
||||
this.renderer.updateBackMarkers();
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeBreakpoint()
|
||||
*
|
||||
* Emitted when a breakpoint changes.
|
||||
**/
|
||||
|
||||
this.onChangeBreakpoint = function() {
|
||||
this.renderer.updateBreakpoints();
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeAnnotation()
|
||||
*
|
||||
* Emitted when an annotation changes.
|
||||
**/
|
||||
this.onChangeAnnotation = function() {
|
||||
this.renderer.setAnnotations(this.session.getAnnotations());
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeMode()
|
||||
*
|
||||
* Emitted when the mode changes.
|
||||
**/
|
||||
|
||||
this.onChangeMode = function() {
|
||||
this.renderer.updateText();
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeWrapLimit()
|
||||
*
|
||||
* Emitted when the wrap limit changes.
|
||||
**/
|
||||
|
||||
this.onChangeWrapLimit = function() {
|
||||
this.renderer.updateFull();
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeWrapMode()
|
||||
*
|
||||
* Emitted when the wrap mode changes.
|
||||
**/
|
||||
this.onChangeWrapMode = function() {
|
||||
this.renderer.onResize(true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor@changeFold()
|
||||
*
|
||||
* Emitted when the code folds change.
|
||||
**/
|
||||
|
||||
this.onChangeFold = function() {
|
||||
// Update the active line marker as due to folding changes the current
|
||||
// line range on the screen might have changed.
|
||||
|
|
@ -649,6 +615,12 @@ var Editor = function(renderer, session) {
|
|||
*
|
||||
* Returns the string of text currently highlighted.
|
||||
**/
|
||||
/**
|
||||
* Editor@copy(text)
|
||||
* - text (String): The copied text
|
||||
*
|
||||
* Emitted when text is copied.
|
||||
**/
|
||||
this.getCopyText = function() {
|
||||
var text = "";
|
||||
if (!this.selection.isEmpty())
|
||||
|
|
@ -677,9 +649,16 @@ var Editor = function(renderer, session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Editor.onPaste()
|
||||
*
|
||||
* called whenever a text "paste" happens.
|
||||
* Editor.onPaste(text)
|
||||
* - text (String): The pasted text
|
||||
*
|
||||
* Called whenever a text "paste" happens.
|
||||
**/
|
||||
/**
|
||||
* Editor@paste(text)
|
||||
* - text (String): The pasted text
|
||||
*
|
||||
* Emitted when text is pasted.
|
||||
**/
|
||||
this.onPaste = function(text) {
|
||||
// todo this should change when paste becomes a command
|
||||
|
|
@ -872,6 +851,13 @@ var Editor = function(renderer, session) {
|
|||
* Indicates how selections should occur. By default, selections are set to "line". This function also emits the `'changeSelectionStyle'` event.
|
||||
*
|
||||
**/
|
||||
/**
|
||||
* Editor@changeSelectionStyle(data)
|
||||
* - data (Object): Contains one property, `data`, which indicates the new selection style
|
||||
*
|
||||
* Emitted when the selection style changes, via [[Editor.setSelectionStyle]].
|
||||
*
|
||||
**/
|
||||
this.setSelectionStyle = function(style) {
|
||||
if (this.$selectionStyle == style) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue