Editor

Editors. Editor

Editor represents a fragment editor

Methods

deleteText(pos, val)

Description:
  • Inserts text into this editor
Source:
Parameters:
Name Type Description
pos number The position to delete from
val string The value to delete

focus()

Description:
  • Focuses the editor
Source:

getValue() → {string}

Description:
  • Get the current string value of this editor
Source:
Returns:
Type
string

insertAtSelection(text)

Description:
  • Inserts the given text at the current selection, if no selection just insert at the cursor position, else replace the current selection.
Source:
Parameters:
Name Type Description
text string The text to insert

insertText(pos, val)

Description:
  • Inserts text into this editor
Source:
Parameters:
Name Type Description
pos number The position to insert at
val string The value to insert

setForeignSelection(remoteClient, cursorSelection)

Description:
  • Sets a forign client selection marker in this editor
Source:
Parameters:
Name Type Description
remoteClient String Webstrate clientId of the remote client that has a selection in the fragment this editor is editing
cursorSelection Editors.Editor~cursorSelection The selection

setLine()

Description:
  • Sets the currently active line
Source:

setValue(value)

Description:
  • Sets the current string value of this editor
Source:
Parameters:
Name Type Description
value string

unload()

Description:
  • Unloads this editor
Source:

Type Definitions

cursorSelection

Source:
Properties:
Name Type Description
startLine number
startColumn number
endLine number
endColumn number
positionLine number
positionColumn number
Type:
  • object

Events

EventSystem:"Codestrates.Editor.Blur"

Description:
  • Triggers when an editor looses focus
Source:
Properties:
Name Type Description
editor Editors.Editor The editor that triggered the event
Type:
  • Event

EventSystem:"Codestrates.Editor.Closed"

Description:
  • Triggers when an editor is closed
Source:
Properties:
Name Type Description
editor Editors.Editor The editor that triggered the event
Type:
  • Event

EventSystem:"Codestrates.Editor.Focus"

Description:
  • Triggers when an editor gains focus
Source:
Properties:
Name Type Description
editor Editors.Editor The editor that triggered the event
Type:
  • Event

EventSystem:"Codestrates.Editor.Opened"

Description:
  • Triggers when an editor is opened
Source:
Properties:
Name Type Description
editor Editors.Editor The editor that triggered the event
Type:
  • Event

EventSystem:"Codestrates.Editor.Selection"

Description:
  • Triggers when a selection changes inside an editor
Source:
Properties:
Name Type Description
editor Editors.Editor The editor that triggered the event
selection Editors.Editor~cursorSelection The selection
Type:
  • Event