Editor

KISSY Editor. xclass: 'editor'.

parents: Component.Controller

defined in: base.js

Class

Attributes

  • customLink {String[]} Custom css link url for editor.
  • customStyle {String} Custom style for editor.
  • data {String} Current editor's content
  • document {Node} iframe 's document
  • formatData {String} Current editor's format content
  • iframe {Node} iframe
  • mode {} editor mode.
  • Editor. POSITION {} <static> Enum for node position
  • Editor. RANGE {} <static> Enum for range
  • Editor. SELECTION {} <static> selection type enum
  • statusBarEl {Node} status bar element
  • textarea {Node} textarea
  • toolBarEl {Node} toolbar element
  • window {Node} iframe 's contentWindow

Methods

  • addButton (id, cfg, ButtonType) 将 button ui 和点击功能分离
  • addCommand (name, obj) Add a command object to current editor.
  • addCustomLink (link) Add css link to current editor
  • addCustomStyle (cssText, id) Add style text to current editor
  • addSelect (id, cfg, SelectType) 将button ui 和点击功能分离 按钮必须立刻显示出来,功能可以慢慢加载
  • Editor. baseZIndex (z) <static> 获得全局最大值
  • blur () Make current editor lose focus
  • checkSelectionChange () Check whether selection has changed since last check point.
  • docReady (func) Add callback which will called when editor document is ready (fire when editor is renderer from textarea/source)
  • execCommand (name) Whether current editor has specified command.
  • focus () Make current editor has focus
  • getControl (id) Retrieve control by id.
  • getControls () Retrieve all controls.
  • getDocHtml () Get full html content of editor 's iframe.
  • getSelection () Get selection instance of current editor.
  • hasCommand (name) Whether current editor has specified command instance.
  • insertElement (element) Insert a element into current editor.
  • insertHtml (data, dataFilter) Insert html string into current editor.
  • notifySelectionChange () Fire selectionChange manually.
  • removeCustomLink (link) Remove css link from current editor.
  • removeCustomStyle (id) Remove style text with specified id from current editor
  • showDialog (name, args) Show dialog
  • sync () Synchronize textarea value with editor data.

Class Detail

  • Editor ()
    KISSY Editor. xclass: 'editor'.

Attributes Detail

  • customLink {String[]} Custom css link url for editor.
  • customStyle {String} Custom style for editor.
  • data {String} Current editor's content
  • document {Node} iframe 's document
  • formatData {String} Current editor's format content
  • iframe {Node} iframe
  • mode editor mode. wysiswyg mode:1 source mode:0
    Default Value
    wysiswyg mode
  • Editor. POSITION <static> Enum for node position
    Defined in:dom.js.
  • Editor. RANGE <static> Enum for range
    Defined in:range.js.
  • Editor. SELECTION <static> selection type enum
    Defined in:selection.js.
  • statusBarEl {Node} status bar element
  • textarea {Node} textarea
  • toolBarEl {Node} toolbar element
  • window {Node} iframe 's contentWindow

Methods Detail

  • addButton (id, cfg, ButtonType) view source
    将 button ui 和点击功能分离
    Defined in:index.js.
    Parameters
    •   id
    •   cfg
    •   ButtonType
  • addCommand (name, obj) view source
    Add a command object to current editor.
    Defined in:editor.js.
    Parameters
    •   name {string} Command name.
    •   obj {Object} Command object.
  • addCustomLink (link) view source
    Add css link to current editor
    Defined in:editor.js.
    Parameters
    •   link {String}
  • addCustomStyle (cssText, id) view source
    Add style text to current editor
    Defined in:editor.js.
    Parameters
    •   cssText {string}
    •   id
  • addSelect (id, cfg, SelectType) view source
    将button ui 和点击功能分离 按钮必须立刻显示出来,功能可以慢慢加载
    Defined in:index.js.
    Parameters
    •   id
    •   cfg
    •   SelectType
  • Editor. baseZIndex (z) <static> view source
    获得全局最大值
    Defined in:zIndexManager.js.
    Parameters
    •   z
  • blur () view source
    Make current editor lose focus
    Defined in:editor.js.
  • checkSelectionChange () view source
    Check whether selection has changed since last check point.
    Defined in:editor.js.
  • docReady (func) view source
    Add callback which will called when editor document is ready (fire when editor is renderer from textarea/source)
    Defined in:editor.js.
    Parameters
    •   func {Function}
  • execCommand (name) view source
    Whether current editor has specified command. Refer: https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla
    Defined in:editor.js.
    Parameters
    •   name {string} Command name.
  • focus () view source
    Make current editor has focus
    Defined in:editor.js.
  • getControl (id) view source
    Retrieve control by id.
    Defined in:editor.js.
    Parameters
    •   id
  • getControls () view source
    Retrieve all controls.
    Defined in:editor.js.
    Returns
    • {*}
  • getDocHtml () view source
    Get full html content of editor 's iframe.
    Defined in:editor.js.
  • getSelection () view source
    Get selection instance of current editor.
    Defined in:editor.js.
  • hasCommand (name) view source
    Whether current editor has specified command instance.
    Defined in:editor.js.
    Parameters
    •   name {string}
  • insertElement (element) view source
    Insert a element into current editor.
    Defined in:editor.js.
    Parameters
  • insertHtml (data, dataFilter) view source
    Insert html string into current editor.
    Defined in:editor.js.
    Parameters
    •   data {string}
    •   dataFilter
  • notifySelectionChange () view source
    Fire selectionChange manually.
    Defined in:editor.js.
  • removeCustomLink (link) view source
    Remove css link from current editor.
    Defined in:editor.js.
    Parameters
    •   link {String}
  • removeCustomStyle (id) view source
    Remove style text with specified id from current editor
    Defined in:editor.js.
    Parameters
    •   id
  • showDialog (name, args) view source
    Show dialog
    Defined in:editor.js.
    Parameters
    •   name {String} Dialog name
    •   args Arguments passed to show
  • sync () view source
    Synchronize textarea value with editor data.
    Defined in:editor.js.
blog comments powered by Disqus
Top