ve.WordProcessor

ve.Component. ve.WordProcessor

Refer to ve.Component for methods or fields inherited from this Component's parent such as .options.attributes or .element.

Multiline rich text editor used as a word processor.

  • Functional binding: veWordProcessor().
Constructor:
  • arg0_value: string - The HTML contents of the current text editor.
  • arg1_options: Object
Instance:
  • .v: string - The current HTML contents, same as arg0_value.
Methods:
  • handleEvents() - Initialises event handlers for the present component.
  • getWYSIWYGFromFields(arg0_wysiwyg_el:HTMLElement) | string - Fetches the internal .innerHTML value, resolving conflicts between visual/code views.
  • initWYSIWYG() - Internal helper function. Initialises the component.
  • addParagraphTag(arg0_e:KeyboardEvent)
  • parentTagActive(arg0_el:HTMLElement) | boolean
  • selectionChange(arg0_e:Event, arg1_buttons:Array<HTMLElement>, arg2_editor:HTMLElement) | boolean - Fires an internal selection change event.
  • pasteEvent(arg0_e:ClipboardEvent)
Static Methods:
  • execCodeAction(arg0_button_el:HTMLElement, arg1_editor_el:HTMLElement, arg2_visual_view_el:HTMLElement, arg3_html_view_el:HTMLElement)
  • execDefaultAction(arg0_action:string)
  • execLinkAction(arg0_modal_el:HTMLElement)
  • restoreSelection(arg0_saved_selection:Selection)
  • saveSelection() | Range

Extends

Members

v :string

Returns the innerHTML of the present Component's input value.

  • Accessor of: ve.WordProcessor
Source:
Type:
  • string

v

Sets the HTML value for the present Component as a string.

  • Accessor of: ve.WordProcessor
Source:

from_binding

Internal .from_binding setter for handling .options.from_binding. Accepts a string literal that is then parsed to a variable reference.

.to_binding counterparts are manually handled child-side.

Overrides:
Source:

limit

Tests the current this.limit by calling this.limit_function(this.v, this). Otherwise resolves to true if no .options.limit is set.

Overrides:
Source:

name

Returns the visual name of the present ve.Component,

Overrides:
Source:

Methods

#execCodeAction(arg0_button_el, arg1_editor_el, arg2_visual_view_el, arg3_html_view_el)

Executes a code action and changes the formatting within the ve.WordProcessor component.

  • Static method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_button_el HTMLElement

The button_el that determines the code action to execute.

arg1_editor_el HTMLElement
arg2_visual_view_el HTMLElement
arg3_html_view_el HTMLElement

#execDefaultAction(arg0_action)

Executes a default action given its string via document.execCommand.

  • Static method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_action string

#execLinkAction(arg0_modal_el)

Adds a link to the current ve.WordProcessor editor being mentioned.

  • Static method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_modal_el HTMLElement

#restoreSelection(arg0_saved_selection)

Restores a saved selection for the current ve.WordProcessor component.

  • Static method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_saved_selection Selection

#saveSelection() → {Range}

Saves the current selection for later restoration by ve.WordProcessor.restoreSelection().

  • Static method of: ve.WordProcessor
Source:
Returns:
Type:
Range

addParagraphTag(arg0_e)

Adds a paragraph tag on newline.

  • Method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_e KeyboardEvent

getWYSIWYGFromFields(arg0_wysiwyg_el) → {string}

Fetches the internal .innerHTML value, resolving any conflicts between the visual view and the code view.

  • Method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_wysiwyg_el HTMLElement
Returns:
Type:
string

handleEvents()

Initialises event handlers for the present Component.

  • Method of: ve.WordProcessor
Source:

initWYSIWYG()

Initialises the present WYSIWYG Component.

  • Method of: ve.WordProcessor
Source:

parentTagActive(arg0_el) → {boolean}

Check if the parent tag of an element was active.

  • Method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_el HTMLElement
Returns:
Type:
boolean

pasteEvent(arg0_e)

pasteEvent() - Handles paste event by removing all HTML tags.

  • Method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_e ClipboardEvent

selectionChange(arg0_e, arg1_buttons, arg2_editor) → {boolean}

Internal helper function for monitoring selection changes.

  • Method of: ve.WordProcessor
Source:
Parameters:
Name Type Description
arg0_e Event
arg1_buttons Array.<HTMLElement>
arg2_editor HTMLElement
Returns:
Type:
boolean

addComponent()

Adds the current component to this.parent_el should it exist.

Overrides:
Source:

bind(arg0_container_el)

Manually binds/mounts the present ve.Component into the visual DOM.

Overrides:
Source:
Parameters:
Name Type Description
arg0_container_el HTMLElement

fireFromBinding()

Pseudo-setter from binding. Fires only upon program-driven changes to .v directly, which means that this has to be monitored manually component-side in set v(). This should always come last in set v().

Overrides:
Source:

fireToBinding()

Pseudo-setter to binding. Fires only upon user-driven changes, which means that this has to be monitored manually component-side.

Overrides:
Source:

remove()

Removes the component/element from the DOM.

Overrides:
Source:

removeComponent()

Removes the current component from this.parent_el should it exist.

Overrides:
Source:

setOwner(arg0_value, arg1_owner_array)

Sets the root parent and ownership tree. Influences this.parent_el, this.owner, this.owners.

Overrides:
Source:
Parameters:
Name Type Description
arg0_value
arg1_owner_array

setValueFromObject(arg0_object, arg1_object)

Destructures Object values and transfers them into the .v instance fields of each Vercengen component.

Overrides:
Source:
Parameters:
Name Type Description
arg0_object Object

The Vercengen object to transfer to.

arg1_object Object

The other object to transfer from.