setHeight(height)
|
Set Editor component height to height px.
oboutGetEditor("editor").setHeight(700);
|
ContentChanged()
|
Returns true if Editor's content was modified,
overwise - false.
var changed = oboutGetEditor("editor").ContentChanged();
|
getWindow()
|
Get Editor's inner iframe content window as a Window object.
var win = oboutGetEditor("editor").getWindow();
win.print();
|
getDocument()
|
Get inner Editor's document as a HTMLDocument object.
var doc = oboutGetEditor("editor").getDocument();
|
TextSelected()
|
Returnstrueif some text is selected (highlighted)
in Editing panel, otherwisefalse.
if(!oboutGetEditor("editor").TextSelected()) alert("Select some text");
See also working example.
|
SelectedTextNodes()
|
Returns array of selected (highlighted)TextNodesin Editing panel.
var nodes = oboutGetEditor("editor").SelectedTextNodes();
var output= "Selected Text Nodes content:\n\n";
for(var i=0; i<nodes.length; i++) output +="["+nodes[i].data+"]\n";
alert(output);
See also working example.
|
getContent([pr])
|
Get current Editor's HTML content as a string.
Ifprparameter is set
and istruethen result string will be formatted (containing"\n"characters).
var oldContent = oboutGetEditor("editor").getContent();
See also working example.
|
getContentWait(fn[,pr])
|
The function get current Editor's HTML content as a string and passes it to postback function fn
as argument. This function uses "EasyBox" while executing.
Parameterpr has the same meaning as in getContent() function.
function EditorOnSubmit(editor) { function check(str) { if(str.length > 1000) { setTimeout(function(){alert("Content is too large!");},0); } else editor.submit(); }
editor.getContentWait(check); return false; }
|
setContent(HTML[,org])
|
Set new Editor's HTML content. If org parameter is defined and
is true, this new content will be considered as original and
ContentChanged() function call will return false after
new Editor's HTML content set. Otherwise ContentChanged() returns true.
If HTML parameter is not a string parameter,
Editor's content will not be updated.
In this case, if org parameter is defined and
is true, current Editor's content will be considered as original.
oboutGetEditor("editor").setContent("<span style='color:blue'>Hello</span>");
See also working example.
|
focusEditor()
|
Set focus to editing panel.
oboutGetEditor("editor").focusEditor();
|
InsertHTML(HTML)
|
Inserts HTML at the current selection/caret position.
Returns true on success and false otherwise.
var retVal = oboutGetEditor("editor").InsertHTML("<span style='color:blue'>Hello</span>");
See also working example.
|
SurroundHTML(S1,S2)
|
Surrounds the currently selected text with the given strings.
Returns true on success and false otherwise.
var retVal = oboutGetEditor("editor").SurroundHTML("<i>","</i>");
See also working example.
|
AssignClassName(CN)
|
Assigns the class name to the currently selected text or element.
Returns true on success and false otherwise.
var retVal = oboutGetEditor("editor").AssignClassName("alert");
See also working example.
|
ExecCommand(cmd,val)
|
Executes specified command at the current selection/caret position.
Available commands are:
| forecolor | set foreground color to val | | backcolor | set backgound color to val | | fontname | set font family to val | | fontsize | set font size to val (1,2,3,...) | | bold | toggle bold style | | italic | toggle italic style | | underline | toggle underline style | | strikeThrow | toggle strikeThrow style | | subScript | toggle subScript style | | superScript | toggle superScript style | | justifyLeft | justify to left | | justifyCenter | justify to center | | justifyRight | justify to right |
oboutGetEditor("editor").ExecCommand("forecolor","#0000FF");
If the specified command doesn't use val,
the second parameter can be omitted:
oboutGetEditor("editor").ExecCommand("bold");
See also working example.
|
QueryCommand(cmd)
|
Returns value of specified query command at the current caret position.
Available query commands are:
| forecolor | foreground color value | | backcolor | backgound color value | | fontname | font family value | | fontsize | font size value | | bold | bold style status (true/false) | | italic | italic style status (true/false) | | underline | underline style status (true/false) | | strikeThrow | strikeThrow style status (true/false) | | subScript | subScript style status (true/false) | | superScript | superScript style status (true/false) |
var curColor = oboutGetEditor("editor").QueryCommand("forecolor");
See also working example.
|
chMode(Mode)
|
Set editing mode. Mode is a string and can have next values:
- text - HTML text mode
- html - Design mode
- preview - Preview mode
oboutGetEditor("editor").chMode("text");
See also working example.
|
noContextMenuAttributeName()
|
Returns name of special attribute used by Editor's Context Menu processor.
This feature is used in functions for custom defined Context Menu Items.
var aName = oboutGetEditor("editor").noContextMenuAttributeName();
See CustomCM.aspx example in downloaded zip file.
|
attachedIdAttributeName()
|
Returns name of special attribute used by Editor's Context Menu processor.
This feature is used in functions for custom defined Context Menu Items.
var aName = oboutGetEditor("editor").attachedIdAttributeName();
See CustomCM.aspx example in downloaded zip file.
|
setVisibility(Visibility)
|
Set Editor's component visibility (true/false).
oboutGetEditor("editor").setVisibility(false); // hide editor's component
...
oboutGetEditor("editor").setVisibility(true); // show editor's component
See also working example.
|
submit()
|
Submits the form without Editor's validation.
oboutGetEditor("editor").submit();
|
SaveContent()
|
Saves Editor's content for undo operation. It is called automatically in
SurroundHTML and InsertHTML functions.
oboutGetEditor("editor").SaveContent();
|
RestoreContent()
|
Executes undo operation.
oboutGetEditor("editor").RestoreContent();
|
DeleteNode()
|
Removes node from Editor's content.
oboutGetEditor("editor").DeleteNode(someNode);
|
getRange()
|
Get current range(caret position or selection) in Editor's content.
var savedRange = oboutGetEditor("editor").getRange();
|
setRange(range)
|
Restores previously saved range with focusing in Editor's content.
var savedRange = oboutGetEditor("editor").getRange();
...
oboutGetEditor("editor").setRange(savedRange);
|