Jump to content

User talk:Gerbrant/gui/htmlEdit.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Gerbrant (talk | contribs) at 05:19, 14 December 2006 (correct example). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Gerbrant.gui.htmlEdit
A WYSIWYG HTML editing control that can be used by other scripts.
If the script is loaded, you can test it by pasting the following in the address bar:
javascript:void document.body.appendChild(new Gerbrant.gui.htmlEdit("Some <b>bold</b> and <i>cursive</i> text.").getElement());

Constructor

[edit]
function(html, width, height, onload)
Constructs an HTML editing control.
html
The control can be preloaded with some HTML. Note that no full HTML file can be specified, only the body text.
width
The desired width of the control. Defaults to "100%".
height
The desired height of the control. Defaults to "10em".
onload
A function to call when the control has finished loading and the content is editable.

Object members

[edit]
getElement()
Returns the HTML element of the control, for insertion in the HTML object using the DOM.
getHTML()
Returns the HTML text of the control. Only available when the content is editable.
setHTML()
Sets the HTML text of the control. Only available when the content is editable.