<rte>
Adds the capability to edit rich-text pages.

JavaScript: lz.rte
extends <html> » <view> » <node> » lz.Eventable »

<rte> is a <html> that allows editing of rich-text pages. The rte component uses the dijit.Editor from the dojo toolkit.

For best results in Flash (like the html component), set the wmode attribute to 'transparent' when embedding the application. See examples/extensions/html-swf.jsp for an example. See examples/extensions/rte.lzx for an example of embedding <rte> in a window.

<canvas height="400">
    <include href="extensions/rte.lzx"/>

    <rte width="600" height="400">Initial contents that you can edit.</rte>
    </canvas>

rte extends <html>.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
dojo_css string String dijit/themes/ read/write
  Dojo stylesheet root (relative to dojo_root). This value is ignored if dojo_root is empty. Default value is 'dijit/themes/'
dojo_js string String dojo/dojo.js read/write
  Dojo library to load (relative to dojo_root). This value is ignored if dojo_root is empty. Default value is 'dojo/dojo.js'. If you want to load an uncompressed version of dojo, specify 'dojo/dojo.js.uncompressed.js'
dojo_locale string String   read/write
  dojo locale to use. Default value is '' which will use the locale from the browser.
dojo_root string String   read/write
  root url where Dojo library is loaded. An empty string (default) will load the library from Google. This path must end with a '/'. For example, if you have a local version located at /trunk, you would specify something like '/trunk/dojo-release-1.5.0/'.
dojo_theme string String tundra read/write
  dojo theme to use. Default value is 'tundra' Other values in dojo 1.5 are soria, nihilo, claro
editorready expression Boolean false readonly
  If true, the rte editor is ready to receive commands
extra_plugins string String   read/write
  Comma-separated list of additional dijit.Editor plugins to load. An empty string (default) will load only the plugins used by default.
text html html   read/write
  The initial value of the text to edit. The text is updated while the rte is running.
toolbar_order string String undo,redo,|,cut,copy,paste,|,bold,italic,underline,strikethrough,|,insertOrderedList,insertUnorderedList,indent,outdent,|,justifyLeft,justifyRight,justifyCenter,justifyFull,|,foreColor,hiliteColor,|,createLink,unlink,insertImage,|,print,smiley,||,fontName,fontSize read/write
  dijit.Editor toolbar order. The list of items to show in the editor toolbar. The default is to show all toolbar features. A '|' inserts a separator between blocks of toolbars. A '||' will force a linebreak in the toolbar.
wrapperfile string String   read/write
  Location of the html wrapper file used by the editor. An empty string (default) loads the system wrapper file. If a custom wrapper file is used, the path is relative to where the application runs from.

Methods

addButton()
rte.addButton(attributes : Object, delegate : lz.handler);
Adds a button(or image button) above the rte with the specified text and attributes.
Parameter Name Type Description
attributes Object attributes suitable for the html <input> tag. If the src attribute is used to point to an image, the path is relative to where the application is loaded from.
delegate lz.handler An LzDelegate which will be called with the user clicks on the text button.
Returns Type Description
  String unique button id

execCommand()
rte.execCommand(cmd : String, arg : String);
Execute an editor command. The argument is ignored for commands that do not take an argument. This allows lzx code to emulate an editor plugin.
Parameter Name Type Description
cmd String Command to execute (Example: 'bold')
arg String Argument required for certain commands.

getText()
rte.getText(delegate : lz.handler);
Returns the html string displayed in this editor. getText() gets the value from the editor and can contain information that is not yet reflected in the text attribute.
Parameter Name Type Description
delegate lz.handler An LzDelegate which will be called with the editor contents.

insertHtml()
rte.insertHtml(html : String);
Insert the specified html in the editor.
Parameter Name Type Description
html String html to insert at the insertion point.

setText()
rte.setText(html : String);
Set the edit text (html). If the rte editor is running, the html in the editor is changed.
Parameter Name Type Description
html String Replaces the edit text with the specified html.

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Name Description
oneditorready The oneditor event is generated whenever the rte editor is completely loaded.
ontext The ontext event is generated whenever the rte text content changes.

Events inherited from <html>

onload, onready

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy