new Editor(element, settings [, autoNew])
The Editor mixin provides an editable block of text.
Parameters:
Name | Type | Argument | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
JQuery | The element to which the editor should be applied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
settings |
Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
autoNew |
boolean | undefined |
<optional> |
true | Creates a new editor object when missing. |
- Source:
Members
-
Ready :boolean
-
Flag signifying whether or not the editor is ready to use.
Type:
- boolean
- Source:
-
Parent :JQuery
-
Element which has been transformed into an editor.
Type:
- JQuery
- Source:
-
data :Control|Object
-
The data object passed along with events.
Type:
- Control | Object
- Source:
-
NumericOnly :boolean
-
Setting signifying whether or not the editor should block non-numeric values from being entered.
Type:
- boolean
- Source:
-
BlockedKeys :Array.<number>
-
Key codes which should be blocked from input.
Type:
- Array.<number>
- Source:
-
Validator :Validator
-
Validator to use in conjunction with the editor.
Type:
- Source:
-
LastValidValue :string
-
Most recently validated value within the editor.
Type:
- string
- Source:
-
ReadOnly :boolean
-
Whether or not the editor is read-only.
Type:
- boolean
- Default Value:
-
- false
- Source:
-
Selection :Editor#SelectionObject
-
Object storing selection information for the editor.
Type:
- Source:
-
Settings :Editor#SettingsObject
-
Object storing settings for the editor.
Type:
- Source:
Methods
-
Changed()
-
Handles the change logic for the editor and calls the onChange event if appropriate.
- Source:
-
Exec(commandName, value)
-
Executes a document command on the active editor.
See https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand for more information.Parameters:
Name Type Description commandName
string The command to execute on the editor region.
value
string Value parameter to send with command being executed.
- Source:
-
GetRawSelection()
-
Retrieves raw selection data.
- Source:
Returns:
-
PossibleSelection()
-
Triggers a check to determine if the selection has changed and fire off the appropriate event if so.
- Source:
-
Resize()
-
Resizes the editor based on the size constraints applied to it.
- Source:
-
SelectionChanged()
-
Calls the SelectionChanged event for the editor.
- Source:
-
SetClass(className)
-
Sets a CSS class to the editor.
Parameters:
Name Type Description className
string The CSS class to set.
- Source:
-
SetHeight(height)
-
Sets a fixed height to the editor.
Parameters:
Name Type Description height
string The height to set.
- Source:
-
SetHeightElement(element)
-
Sets an object height binding to the editor.
Parameters:
Name Type Description element
string The element to set the editor height off of.
- Source:
-
SetStyle(name, value)
-
Applies a CSS style property to the editor.
Parameters:
Name Type Description name
string The name of the CSS property to set.
value
string Value of CSS property to be set.
- Source:
Type Definitions
-
SelectionObject
-
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description Selection.Raw
string <optional>
"" Selection.Fonts
Array.<string> <optional>
[EditorGlobal.DefaultFont.Font] Selection.Families
Array.<string> <optional>
[EditorGlobal.DefaultFont.Family] Selection.Sizes
Array.<string> <optional>
[EditorGlobal.DefaultFont.Size] -
SettingsObject
-
Type:
- Object
- Source:
Properties:
Name Type Description SettingsObject.BlockedKeys
Array.<number> Key codes which should be blocked from input.
SettingsObject.data
Control | Object The data object passed along with events.
SettingsObject.DefaultFont
EditorGlobal#Font Override of default font settings.
SettingsObject.Height
number Height of editor.
SettingsObject.Height
JQuery Element to sync height to.
SettingsObject.NumericOnly
boolean Blocks non-numeric values from being entered.
SettingsObject.onChange
boolean Event called when editor value is changed.
SettingsObject.onKeyBlock
boolean Event called when editor blocks a key from entry.
SettingsObject.onResize
boolean Event called when editor is resized.
SettingsObject.ReadOnly
boolean Sets whether or not the editor is read-only.
SettingsObject.Validator
Validator Validator to use in conjunction with the editor mixin.
-
RawSelectionObject
-
Type:
- Object
- Source:
Properties:
Name Type Description Selection.Raw
string Selection.Fonts
Array.<string> Selection.Families
Array.<string> Selection.Sizes
Array.<string> Selection.Bold
string Selection.Italic
string Selection.Underline
string Selection.Strikethrough
string Selection.Subscript
string Selection.Superscript
string Selection.Styles
string
Events
-
onChange
-
Event called when editor value is changed.
- Source:
-
onKeyBlock
-
Event called when editor blocks a key from entry.
Parameters:
Name Type Description event
IJQueryEventObject The keydown event object.
- Source:
-
onResize
-
Event called when editor is resized.
- Source: