Ticket #1138 (closed enhancement: fixed)
added API functions Xinha.getEditor(), Xinha.prototype.getPluginInstance(), Xinha.addOnloadHandler()
| Reported by: | ray | Owned by: | gogo |
|---|---|---|---|
| Priority: | Milestone: | 0.95 | |
| Component: | Xinha Core | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Xinha.getEditor()
Returns a editor object referenced by the id or name of the textarea or the textarea node itself
For example to retrieve the HTML of an editor made out of the textarea with the id "myTextArea" you would do<br />
var editor = Xinha.getEditor("myTextArea");
var html = editor.getEditorContent();
Xinha.prototype.getPluginInstance(plugin)
Sometimes one wants to call a plugin method directly, e.g. from outside the editor.
This function returns the respective editor's instance of a plugin.
For example you might want to have a button to trigger SaveSubmit?'s save() method:
<button type="button" onclick="Xinha.getEditor('myTextArea').getPluginInstance('SaveSubmit').save();return false;">Save</button>
Xinha.addOnloadHandler(function)
Adds a function that is executed in the moment the DOM is ready, but as opposed to window.onload before images etc. have been loaded
see http://dean.edwards.name/weblog/2006/06/again/
