The functions described in this chapter may only be used before initializing an instance of edit-on Pro as they are used to configure the applet. Calling the function loadEditor will start the initialization of the corresponding editor instance.
editOnPro
object editOnPro (
string strWidth
string strHeight
string strName
string strId
string strObj
)
Constructor for the editOnPro object. Creates an editor object with the width strWidth , the height strHeight , the name strName and the id strId .
The value of strObj must always be the same as the name of the editOnPro object you are creating.
eop = new editOnPro(725, 350, "myEditor", "myId", "eop");
setCodeBase
void setCodeBase(
string strCodebase
)The URL location strCodebase is used as the editor's codebase.
eop.setCodebase("http://myserver.com/EOP");addArchive
void addArchive (
string strArchive
string strVersion
)Specifies a Java archive to be loaded in addition to the editor's archive. To load multiple additional archives, call this function for each archive. strArchive specifies the URL to the archive to be loaded. Use strVersion to specify a version number for the archive. If caching is enabled, this version number will be used when caching the archive.
eop.addArchive("myarchive.jar","1.0.8.0);setArchive
void setArchive(
string strArchive
)Specifies the URL to the applet Java Archive.
eop.setArchive("edit-on-pro-4.jar");setParam
void setParam(
string strProperty
string strValue
)The parameter strProperty with the value strValue is added to the editor parameters.
eop.setParam("sourceview","true");setBodyOnly
void setBodyOnly(
boolean bodyonly
)Determines whether the "bodyonly" mode should be activated or not.
eop.disableCaching();
disableCaching
void disableCaching()
Disables the applet caching feature for this instance of the editor. Caching is enabled by default unless this method is called before initializing the editor.
eop.disableCaching();
setConfig
void setConfig(
string sConfig
)Specifies the editor's configuration as string.
strConf =
' <?xml version="1.0" encoding="UTF-8"?><config> ... </config> ';
eop.setConfig(strConf);setConfigURL
void
setConfigURL(
string sURL
)Specifies the URL location of the editor's configuration file. May be relative to the applet's codebase.
eop.setConfigURL("config.xml");setExportAsNumerical
void setExportAsNumerical(
boolean bExportAsNum
)Sets the value of the exportasnumerical property.
eop.setExportAsNumerical(true);
Characters will only be exported as entities if they are not supported by the encoding specified in the document. If characters are supported by the specified encoding, they will be exported as such.
setHeartBeatInterval
void setHeartBeatInterval(
string strInterval
)Specifies in which interval (in seconds) the editor will perform a HTTP request to the URL specified by setHeartBeatInterval . The default interval is 60 seconds.
eop.setHeartBeatInterval("30");setHeartBeatURL
void setHeartBeatURL(
string strURL
)Specifies an URL the editor will perform a GET request to in the interval specified by setHearBeatInterval or in an interval of 60 seconds if setHeartBeatInterval is not specified. This can e.g. be used to prevent a session from timing out if you are using sessions.
eop.setHeartBeatURL("http://yourserver.com/session.htm");setHiddenLoading
void setHiddenLoading(
boolean bState
[boolean displayOnLoad]
[int loadingIndicatorOffset]
[int loadingIndicatorTimeout]
)The argument bState specifies if the editor should be visible while it is loading. If set to true, an animated image will be displayed while the editor is loading.
displayOnLoad specifies if the editor should be displayed once it is fully loaded. If set to false, the editor will remain hidden until the method showEditor is called.
loadingIndicatorOffset specifies the time in milliseconds after which the progress indicator should be displayed from the moment on the editor has started loading.
loadingIndicatorTimeout specifies the time in milliseconds after which the progress indicator will not be displayed anymore if an error occured when loading the editor.
eop.setHiddenLoading(true);
setLoadingIndicator
void setLoadingIndicator(
string strIndicator
)If hidden loading is enabled, this specifies the HTML code that is displayed while the editor is loading.
strLoad = "The editor is loading. Please wait."; eop.setLoadingIndicator(strLoad);
setLicenseKey
void setLicenseKey(
string strLicenseKey
)Sets the value of the licensekey property.
eop.setLicenseKey("licensekey.xml");setLocaleCode
void setLocaleCode(
string strLocale
)
Sets the value of the locale property.
eop.setLocaleCode("en_US");setLocaleURL
void
setLocaleURL(
string strLocaleURL
)
Sets the value of the localeurl property.
eop.setLocaleURL("locale_it_IT.xml");setNewDocumentDialog
void setNewDocumentDialog(
boolean bNewDocDialog
)Sets the value of the newdocumentdialog property.
eop.setNewDocumentDialog(false);
setStandAloneHeight
void setStandAloneHeight (
string sHeight
)Sets the default height of the editor in stand-alone mode in pixels.
eop.setStandAloneHeight("500");setStandAloneWidth
void setStandAloneWidth (
string sWidth
)Sets the default width of the editor in stand-alone mode in pixels.
eop.setStandAloneWidth("500");setStartUpScreenBackgroundColor
void setStartUpScreenBackgroundColor (
string strColor
)Specifies the background color of the applet during initialization.
eop.setStartUpScreenBackgroundColor("#ffffff");setStartUpScreenTextColor
void setStartUpScreenTextColor (
string strColor
)
Specifies the color of the text displayed in the applet during initialization.
eop.setStartUpScreenTextColor("#000000");setUIConfig
void setUIConfig(
string sUIConfig
)Specifies the user interface configuration as string.
strUIConfig = ' <?xml version="1.0" encoding="UTF-8"?>
<uiconfig> <actions> ... </actions>
<menubar> ... </menubar> <toolbar> ...
</toolbar> <contextmenu> ... </contextmenu>
</uiconfig> ';
eop.setUIConfigURL("uiconfig.xml");setUIConfigURL
void setUIConfigURL(
string sURL
)Specifies the URL location of the editor's user interface configuration file. May be relative to the applet's codebase.
eop.setUIConfigURL("uiconfig.xml");setUnsupportedBrowserEvent
void setUnsupportedBrowserEvent(
string sEvent
)If this is specified, the function with the name sEvent will be called if the browser / OS combination that is used is not supported.
eop.setUnsupportedBrowserEvent("myFunc");setIconRepositoryURL
void setIconRepositoryURL(
string sIconRepositoryURL
)Specifies a repository from which the editor loads the toolbar icons. If this repository is specified, the applet will first look for icons in the repository. If the icon can not be found in the repository, it is loaded from the edit-on Pro JAR file.
If a relative path is used for the repository, it is resolved relative to the editor's codebase.
eop.setIconRepositoryURL("myicons/");setDefaultFont
void setDefaultFont(
string sDefaultFont
)Specifies the default font used to display the editor's content where no font is otherwise specified.
This font is only used to render the editor's content, and is not exported in any way.
eop.setDefaultFont("Arial");setEventHandler
void setEventHandler(
string sEvent, string sFunction
)Calls the function sFunc every time the event sEvent is fired. For details about available events, please see the chapter Event Handlers.
eop.setEventHandler("ONDATALOADED","onDataLoaded");loadEditor
void loadEditor()
Inserts and initializes the editor at the location in the document where this function is executed.
eop.loadEditor();
preloadApplet
void preloadApplet(
string codebase
boolean enableJREAutoDownload
[string JREAutoDownloadURL]
[string JREMinVersion]
)This initializes the JVM and additionally preloads the applet JAR file into the JRE cache. This function should be used on a page before the editor is loaded in order to speed up subsequent start times of the editor.
The function preloadApplet can be used independently of the editOnPro class. It should be used on a page of your system which does not contain the editor itself, and before the editor is actually instanciated. It is not recommended to use this function on a page containing edit-on Pro.
codebase
Specifies the location of the editor's codebase resp. of "preload.jar" which will be loaded to initialize the JVM.
enableJREAutoDownload
This will only have an effect in Internet Explorer. If set to true, the browser will try to install a JRE from the location specified by JREAutoDownloadURL and no Java was detected or the Java version is below the version specified by JREMinVersion .
JREAutoDownloadURL (optional)
This is only supported in Internet Explorer. If set and no JVM is installed, the browser will try to install a JVM from the specified location.
JREMinVersion (optional)
This is only supported in Internet Explorer. This parameter must be set if JREAutoDownloadURL was set. This specifies the minimum version of the JRE that should be installed.
preloadApplet("eopro",
true,
"http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab",
"1,4,2");preloadJVM
void preloadJVM(
string codebase
boolean enableJREAutoDownload
[string JREAutoDownloadURL]
[string JREMinVersion]
)This initializes the JVM. This function should be used on a page before the editor is loaded in order to initialize the Java VM. If the Java VM is already started before the editor is loaded, the startup time of the editor will seem faster to the editor, as the start of the Java VM itself can be quite time consuming on some systems.
The function preloadJVM can be used independently of the editOnPro class. It should be used on a page of your system which does not contain the editor itself, and before the editor is actually instanciated. Its only purpose is to ensure the JVM is already started when accessing a page with an instance of edit-on Pro. It is not recommended to use this function on a page containing edit-on Pro.
codebase
Specifies the location of the editor's codebase resp. of "preload.jar" which will be loaded to initialize the JVM.
enableJREAutoDownload
This will only have an effect in Internet Explorer. If set to true, the browser will try to install a JRE from the location specified by JREAutoDownloadURL and no Java was detected or the Java version is below the version specified by JREMinVersion .
JREAutoDownloadURL (optional)
This is only supported in Internet Explorer. If set and no JVM is installed, the browser will try to install a JVM from the specified location.
JREMinVersion (optional)
This is only supported in Internet Explorer. This parameter must be set if JREAutoDownloadURL was set. This specifies the minimum version of the JRE that should be installed.
preloadJVM("eopro",
true,
"http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab",
"1,4,2");All functions (excepted get functions) described in this chapter will not be executed immediately as they are called. When they are called, they will first be queued and be executed in sequence when the method pumpEvents() is called.
acceptAll
void acceptAll()
Accepts all changes made in the document and ends comparison mode.
This only has an effect if VersioTrack is enabled in your license.
eop.acceptAll();
addStyleSheet
void addStyleSheet(
string strStyles
)Loads styles from strStyles into the editor.
myStyles = "p { text-decoration:underline; }";
eop.addStyleSheet(myStyles);cleanStyleSheet
void cleanStyleSheet()
Erases any existing styles within the document. Styles available in the editor because of an external style sheet file will still be available.
eop.cleanStyleSheet();
compareDocumentContents
void compareDocumentContents(
string strDoc1,
string strDoc2
)Loads and compares two documents as string.
This only has an effect if VersioTrack is enabled in your license.
strDoc1 = "<p>Some content</p>"; strDoc2 = "<p>Some more content</p>"; eop.compareDocumentContents(strDoc1, strDoc2);
compareDocumentContentToEditorContent
void compareDocumentContentToEditorContent(
string strDoc
)Compares the document specified by the string strDoc to the editor content.
This only has an effect if VersioTrack is enabled in your license.
strDoc = "<p>Some content</p>"; eop.compareDocumentToEditorContent(strDoc1);
compareDocuments
void compareDocuments(
string strURL1,
string strURL2
)Loads and compares two documents from an URI.
This only has an effect if VersioTrack is enabled in your license.
strURL1 = "http://www.yourserver.com/doc1.htm"; strURL2 = "http://www.yourserver.com/doc2.htm"; eop.compareDocuments(strURL1, strURL2);
compareDocumentToEditorContent
void compareDocumentToEditorContent(
string strURL
)Compares the document from the specified URL strURL to the editor content.
This only has an effect if VersioTrack is enabled in your license.
strURL = "http://www.myserver.com/doc.htm"; eop.compareDocumentToEditorContent(strDoc1);
decode
string decode(
string strEncodedString
)Decodes all HTML entities contained in the specified string to character data and returns the decoded string.
strEncodedString = "&"; strDecodedString = eop.decode(strEncodedString); //This will return "&"
encode
string encode(
string strDecodedString
)Encodes the specified string according to the encoding specified in the applet by the encoding property. If no encoding is specified, the string will be HTML encoded.
strDecodedString = "&"; strEncodedString = eop.encode(strDecodedString); //This will return "&"
enforceReadOnlyAPI
void enforceReadOnlyAPI(
boolean bEnforce
)Toggles whether or not the JavaScript API methods can modify the content of read-only custom elements (i.e. any custom element where any of the custom CSS properties "ro-readonlycontent", "ro-readonlyelement" or "ro-formattingonly" are set to true).
If set to "false", it is possible to use JavaScript API methods to modify the content of read-only areas.
Setting bEnforce to true prevents read-only areas from being modified by JavaScript API methods (such as setHTMLData).
eop.enforceReadOnlyAPI(false); eop.pumpEvents();
getActiveSpellChecker
string getActiveSpellChecker()
Returns the localeid of the currently active spell-checker language. The localeid is used in the XML locale file of the editor to map the strings used in dialogs and the localeid attributes of the elements defined in the user interface configuration file to the localized strings of the corresponding language, e.g. "LANGUAGE_AMERICAN" corresponds to "American English".
strLang = eop.getActiveSpellChecker();
getBase
string getBase()
Returns the value of the base property.
base = eop.getBase();
getBlockElementAttributes
Array getBlockElementAttributes()
Returns an associative array containing the attributes of the current block level element (e.g. " <p> " or " <div> ") and their values. The attribute names of the element form the keys of the array returned by the function, while the attribute values are its values.
arr = eop.getBlockElementAttributes();
msg = "";
for (var prop in arr) {
msg += prop+'="'+arr[prop]+'"\n';
}
if(msg.length<1) msg = "No attributes";
alert(msg);getCharNoSpacesStatistic
string getCharNoSpacesStatistic()
Retrieves the number of characters contained in the document. White spaces are ignored.
noSpacesStat = eop.getCharNoSpacesStatistic();
getBookmarks
Array getBookmarks(boolean bSorted)
Returns an array containing the names of all bookmarks in the document. The boolean parameter bSorted indicates if this array should be sorted according to the position where the bookmark occurs in the document.
function getBookmarks() {
arr = eop.getBookmarks(true);
msg = "";
for (var prop in arr) {
msg += prop+'="'+arr[prop]+'"\n';
}
if(msg.length<1) msg = "No bookmarks";
alert(msg);
}getCharWithSpacesStatistic
string getCharWithSpacesStatistic()
Retrieves the number of characters contained in the document including white spaces.
charStat = eop.getCharWithSpacesStatistic();
getCurrentElement
string getCurrentElement()
Retrieves the element at the current cursor position, including the textual content as well as all children elements.
curElement = eop.getCurrentElement();
getCurrentElementContent
string getCurrentElementContent()
Retrieves the content of the element at the cursor position, including the textual content as well as all child elements.
curElementContent = eop.getCurrentElementContent();
getCurrentTableColumnCellAttributes
Array getCurrentTableColumnCellAttributes()
Returns the attributes of all table cells in the current table column. The array that is returned is a multi-dimensional array consisting of an array of all table cells of the current column and an array of all attributes for each cell.
function alertTableColumnCellAttributes() {
arr = eop.getCurrentTableColumnCellAttributes();
str = "";
for (key in arr) {
str += "Cell: " + key + " Attributes: {";
for (innerKey in arr[key]) {
str += "\n\t" + innerKey + ": " + arr[key][innerKey];
}
str += "\n}\n";
}
alert(str);
}getCurrentTableRowCellAttributes
Array getCurrentTableRowCellAttributes()
Returns the attributes of all table cells in the current table row. The array that is returned is a multi-dimensional array consisting of an array of all table cells of the current row and an array of all attributes for each cell.
function alertTableRowCellAttributes() {
arr = eop.getCurrentTableRowCellAttributes();
str = "";
for (key in arr) {
str += "Cell: " + key + " Attributes: {";
for (innerKey in arr[key]) {
str += "\n\t" + innerKey + ": " + arr[key][innerKey];
}
str += "\n}\n";
}
alert(str);
}getCustomField
string getCustomField()
Retrieves the value of the customfield property.
customField = eop.getCustomField();
getDTDBase
string getDTDBase()
Retreives the base URL that is used to resolve relative DTDs if it is set.
strBase = eop.getDTDBase();
getElementAttributes
Array getElementAttributes()
Returns an associative array containing the attributes of the current element and their values. The attribute names of the element form the keys of the array returned by the function, while the attribute values are its values.
arr = eop.getElementAttributes();
msg = "";
for (var prop in arr) {
msg += prop +'="'+arr[prop]+'"\n';
}
if(msg.length<1) msg = "No attributes";
alert(msg);getEncoding
string getEncoding()
Retrieves the value of the encoding property.
curEncoding = eop.getEncoding();
getExportAsNumerical
boolean getExportAsNumerical()
Retrieves the value of the exportasnumerical property.
bExportAsNumerical = eop.getExportAsNumerical();
getGetErrorTarget
string getGetErrorTarget()
Retrieves the value of the geterrortarget property.
curGetErrorTarget = eop.getGetErrorTarget();
getGetErrorURL
string getGetErrorURL()
Retrieves the value of the geterrorurl property.
curGetErrorURL = eop.getGetErrorURL();
getGetHTMLDataURL
string getGetHTMLDataURL()
Retrieves the value of the gethtmldataurl property.
curGetHTMLDataURL = eop.getGetHTMLDataURL();
getGetOKTarget
string getGetOKTarget()
Retrieves the value of the getoktarget property.
curGetOKTarget = eop.getGetOKTarget();
getGetOKURL
string getGetOKURL()
Retrieves the value of the getokurl property.
curGetOKURL = eop.getGetOKURL();
getHeadElementContent
string getHeadElementContent()
Retrieves the content of the document's <head>...</head> element. This has no effect if the bodyonly property is set to "true".
headElementContent = eop.getHeadElementContent();
getHTMLData
string getHTMLData()
Retrieves all content from the editor.
strContent = eop.getHTMLData();
getImageBase
string getImageBase()
Returns the value of the imagebase property.
imgBase = eop.getImageBase();
This method is deprecated as of edit-on Pro version 4.2. Please use automaticallygetBase instead.
getImagesStatistic
string getImagesStatistic()
Retrieves the number of images contained in the document.
noImages = eop.getImagesStatistic();
getLinesStatistic
string getLinesStatistic()
Retrieves the number of lines contained in the document.
noLines = eop.getLinesStatistic();
getLocaleCode
string getLocaleCode()
Retrieves the value of the locale property.
curLocale = eop.getLocaleCode();
getLocaleFromBrowser
string getLocaleFromBrowser()
Returns the locale of the browser as string which can be used to set the editor's locale via setLocaleCode property. This will set the editor's locale to the browser's locale.
eop.setLocaleCode(eop.getLocaleCode());
getLocaleURL
string getLocaleURL()
Retrieves the value of the localeurl property.
curLocaleURL = eop.getLocaleURL();
getNewDocumentDialog
boolean getNewDocumentDialog()
Retrieves the value of the newdocumentdialog property.
bDocDialog = eop.getNewDocumentDialog();
getParagraphsStatistic
string getParagraphsStatistic()
Retrieves the number of paragraphs contained in the document.
noParas = eop.getParagraphsStatistic();
getParentElementByName
string getParentElementByName(
string strParent
)Starting from the caret position, searches for a parent element called strParent and retrieves the element, including the textual content as well as all children elements.
parentElement = eop.getParentElementByName("p");getParentElementByNameContent
string getParentElementByNameContent(
string strParent
)Starting from the caret position, searches for a parent element called strParent and retrieves the textual content as well as all children elements of the element.
parentElementContent = eop.getParentElementByNameContent("p");getParentElementByNameAttributes
string getParentElementByNameAttributes(
string strParent
)Starting from the caret position, searches for a parent element called strParent and retrieves all attributes of the element as an array.
attributes = eop.getParentElementByNameAttributes("p");getPlainText
string getPlainText()
Retrieves the content from the editor as plain text without any tags. Line breaks ("<br/>) and paragraphs ("<p></p>") will be transformed to CRLF while all other tags are removed.
strPlainText = eop.getPlainText();
getPostErrorMessage
string getPostErrorMessage()
If an error occured when using the direct HTTP POST API to post the editor's content, this method returns null or the error returned by the server-side script that was the target of the POST operation.
See Direct HTTP Connection API for more details.
strError = eop.getPostErrorMessage();
getReadOnly
boolean getReadOnly()
Returns whether the editor is currently in read-only state. Returns true if the editor currently is in read-only state and can not be edited.
bState = eop.getReadOnly();
getSelectedHTMLData
string getSelectedHTMLData()
Retrieves the selected HTML data from the editor.
sel = eop.getSelectedHTMLData();
getSetErrorTarget
string getSetErrorTarget()
Retrieves the value of the seterrortarget property.
setErrTarget = eop.getSetErrorTarget();
getSetErrorURL
string getSetErrorURL()
Retrieves the value of the seterrorurl property.
curSetErrorURL = eop.getSetErrorURL();
getSetOKTarget
string getSetOKTarget()
Retrieves the value of the setoktarget property.
curSetOKTarget = eop.getSetOKTarget();
getSetOKURL
string getSetOKURL()
Retrieves the value of the setokurl property.
curSetOKURL = eop.getSetOKURL();
getSourceView
boolean getSourceView()
Retrieves the value of the sourceview property.
bSourceView = eop.getSourceView();
getStandAloneMode
boolean getStandAloneMode()
Returns the value of the standalonemode property.
bStMode = eop.getStandAloneMode();
getStatistics
Array getWordsStatistic()
Returns an associative array containing the number of images, lines, paragraphs, characters without spaces, characters with spaces and words contained in the document. The folowing keys are available in the associative array returned by getWordStatistics : images , lines , paragraphs , charNoSpaces , charWithSpaces . words .
arr = eop.getStatistics();
msg = "";
for (var prop in arr) {
msg += prop+": "+arr[prop]+"\n";
}
alert(msg);getWebDAVCookieString
Array getWebDAVCookieString()
Retrieves an associative array containing available Webdav cookies in case the user has previously logged into the Wedav repository using one of edit-on Pro's Webdav dialogs.
cookie = eop.getWebDAVCookieString();
getWordsStatistic
string getWordsStatistic()
Retrieves the number of words contained in the document.
noWords = eop.getWordsStatistic();
hasContentChanged
boolean hasContentChanged()
Retrieves the state of the document in the editor. Returns true if the document if the document was modified and returns false if it was not modified. The state of hasContentChanged() is reset after calling getHTMLData() .
bChanged = eop.hasContentChanged();
jumpToBookmark
void jumpToBookmark(
string sName
int mode
)Jumps to a specific bookmark in the document.
The parameter sName is the name of the bookmark the caret should jump to.
The parameter mode is the type of jump to perform. There are three types of jump: you can select the bookmark, place the caret before the bookmark, or place the caret after the bookmark.
The constants available for the mode parameter are (assuming your edit-on Pro JavaScript object is called "eop"):
eop.JUMPTOBOOKMARK_SELECT: jumps to the bookmark and selects it.
eop.JUMPTOBOOKMARK_BEFORE: places the caret before the bookmark.
eop.JUMPTOBOOKMARK_AFTER: places the caret after the bookmark.
eop.jumpToBookmark("daffodil",eop.JUMPTOBOOKMARK_SELECT);
eop.pumpEvents();insertCustomTag
void insertCustomTag(
string strTagName
boolean bEmpty
string strAttributes
)If bEmpty is set to true, the empty element strTagName is inserted at the cursor position.
If bEmpty is set to false, the element strTagName is inserted around the current selection. The element will have the attributes specified by strAttributes .
eop.insertCustomTag("mycustomtag",false,"myattrib='somevalue'");insertImage
void insertImage(
string strSrc
string strAlt
string strWidth
string strHeight
string strBorder
)Inserts an image (GIF, JPG or PNG format) from the URL strSrc at the current cursor location.
strWidth , strHeight and strBorder specify the image's width, height and border width resp. strAlt specifies the image's ALT text.
strSrc = "http://www.google.com/images/logo.gif"; strWidth = "200"; strHeight = "100"; strBorder = "1"; strAlt = "some text describing the image..."; eop.insertImage(strSrc, strAlt, strWidth, strHeight, strBorder);
insertHTMLData
void insertHTMLData(
string strContents
)Inserts strContents at the cursor position.
strContents = "<p>Paragraph with <strong>strong</strong> text</p>"; eop.insertHTMLData(strContents);
insertHTMLDataFromURL
void insertHTMLDataFromURL(
string strURL
)Inserts content from strURL at the cursor position.
eop.insertHTMLDataFromURL("http://www.w3.org");invokeAction
void invokeAction(
string actionID,
[string selectedItem],
[string eventHandler]
)This emulates the clicking of the action actionID in the applet's menu bar, tool bar or context menu. If the action that should be fired corresponds to a drop-down box, the optional parameter selectedItem is used to select a specific item from the drop-down box. For a description of all available actions see the chapter Actions .
The parameter eventHandler specifies an event handler function which is called once the action specified by the first parameter actionID has finished executing. If no event handler should be called, pass null as argument to this method.
eop.invokeAction("BOLD");
eop.invokeAction("BOLD",null,"myHandler");
eop.invokeAction("ADVANCEDSTYLESHEET","H1");
eop.invokeAction("ADVANCEDSTYLESHEET","H1","myHandler");
isActionEnabled
boolean isActionEnabled()
Returns whetheran edit-on Pro user interface action such as "BOLD", "ITALIC", ect. is enabled or not. If the action is enabled, it can be used from within the user interface. If it is disabled, every control using the action will be disabled and greyed out.
bIsActive = eop.isActionEnabled();
isVersioTrackEnabled
boolean isVersioTrackEnabled()
Returns whether or not VersioTrack is enabled in this instance of edit-on Pro.
bIsEnabled eop.isVersioTrackEnabled();
postDocumentToServer
void postDocumentToServer()
Performs a POST request to the URL specified by the gethtmldataurl property. The editor's content is stored in a field called HTMLDATA .
eop.postDocumentToServer();
rejectAll
void rejectAll()
Rejects all changes made in the document and ends comparison mode.
This only has an effect if VersioTrack is enabled in your license.
eop.rejectAll();
removeCurrentTableColumnCellAttributes
void removeCurrentTableColumnCellAttributes( Array attributes )
Removes all attributes of all cells of the current table column if the attribute name corresponds to an attribute name given in the array.
function removeTableColumnCellAttributes() {
arr = new Array("height","width");
eop.removeCurrentTableColumnCellAttributes(arr);
eop.pumpEvents();
}removeCurrentTableRowCellAttributes
void removeCurrentTableRowCellAttributes( Array attributes )
Removes all attributes of all cells of the current table row if the attribute name corresponds to an attribute name given in the array.
function removeTableRowCellAttributes() {
arr = new Array("height","width");
eop.removeCurrentTableRowCellAttributes(arr);
eop.pumpEvents();
}removeParentElementByNameAttributes
void removeParentElementByNameAttributes(
String strParent
Array arrAttribs
)Searches for a parent element specified by strParent from the caret position. If a parent with this name is found, removes the attributes specified in arrAttribs from the element.
arr = new Array();
arr[0] = "style";
arr[1] = "id";
eop.removeParentElementByNameAttributes("p", arr);
eop.pumpEvents();setActionEnabled
void setActionEnabled(
string strAction
boolean bState
)Sets the state of an edit-on Pro user interface action such as "BOLD", "ITALIC", ect. If set to true, the action is enabled and can be used from within the user interface. If it is set to false, the action is disabled. If it is integrated in the user interface, every control using the action will be disabled and greyed out.
eop.setActionEnabled("BOLD",false);setActiveSpellChecker
string setActiveSpellChecker(string strLang)
Sets the localeid of the currently active spell-checker language. The localeid is used in the XML locale file of the editor to map the strings used in dialogs and the localeid attributes of the elements defined in the user interface configuration file to the localized strings of the corresponding language, e.g. "LANGUAGE_AMERICAN" corresponds to "American English".
The following spell-checker language localeids are available per default in the editor:
American English: LANGUAGE_AMERICAN
British English: LANGUAGE_BRITISH
Canadian English: LANGUAGE_CANADIAN
German: LANGUAGE_GERMAN
French: LANGUAGE_FRENCH
Spanish: LANGUAGE_SPANISH
Italian: LANGUAGE_ITALIAN
Dutch: LANGUAGE_DUTCH
Swedish: LANGUAGE_SWEDISH
Finish: LANGUAGE_FINISH
Norwegian: LANGUAGE_NORWEGIAN
Danish: LANGUAGE_DANISH
Brazilian Porzuguese: LANGUAGE_BRAZILIAN_PORTUGUESE
Portuguese: LANGUAGE_PORTUGUESE
American Medical: LANGUAGE_AMERICAN_MEDICAL
British Medical: LANGUAGE_BRITISH_MEDICAL
American Legal: LANGUAGE_AMERICAN_LEGAL
British Legal: LANGUAGE_BRITISH_LEGAL
eop.setActiveSpellChecker("LANGUAGE_AMERICAN");setBase
void setBase(
string strBase
)Sets the value of the base property.
eop.setBase("http://www.w3.org");setBlockElementAttributes
void setBlockElementAttributes(
Array arrAttribs
)Sets the attributes and attribute values of the current block level element (e.g. " <p> " or " <div> "). Use an associative array containing key-value pairs of the attributes and their values to set the attributes.
arr = new Array(); arr["style"] = "color: red;"; arr["align"] = "left"; eop.setBlockElementAttributes(arr);
setCaretAtDocumentStart
void setCaretAtDocumentStart()
Sets the caret at the start of the document inside th editor.
eop.setCaretAtDocumentStart();
setCaretAfterNextBookmark
void setCaretAfterNextBookmark()
Sets the caret at the end of the next bookmark found in the document starting from the caret position.
eop.setCaretAfterNextBookmark();
setCaretAfterPreviousBookmark
void setCaretAfterPreviousBookmark()
Sets the caret at the end of the previous bookmark found in the document starting from the caret position.
eop.setCaretAfterPreviousBookmark();
setCurrentElementContent
void setCurrentElementContent(
string strContent
)Sets the content of the tag at the current cursor position.
eop.setCurrentElementContent("the new content");setCurrentTableColumnCellAttributes
void setCurrentTableColumnCellAttributes( Array attributes )
Sets the attributes of all cells of the current table column. If an attribute is already present in a table cell of the current column, its value is overwritten with the new value.
function setTableColumnCellAttributes() {
arr = new Array("height");
arr["height"] = 10;
eop.setCurrentTableColumnCellAttributes(arr);
eop.pumpEvents();
}setCurrentTableRowCellAttributes
void setCurrentTableRowCellAttributes( Array attributes )
Sets the attributes of all cells of the current table row. If an attribute is already present in a table cell of the current row, its value is overwritten with the new value.
function setTableRowCellAttributes() {
arr = new Array("height");
arr["height"] = 10;
eop.setCurrentTableRowCellAttributes(arr);
eop.pumpEvents();
}setCustomField
void setCustomField(
string strFieldValue
)Sets the value of the customfield property.
eop.setCustomField("myvalue");setDTDBase
void setDTDBase(
string strBase
)Specifies the base URL which is used by the editor to resolve the DTDs with a relative path.
eop.setDTDBase("http://www.myserver.com/dtds/");setEncoding
void setEncoding(
string strEncoding
)Sets the encoding used by the editor.
eop.setEncoding("UTF8");setGetErrorTarget
void setGetErrorTarget(
string strGetErrTarget
)Sets the value of the geterrortarget property.
eop.setGetErrorTarget("_new");setGetErrorURL
void setGetErrorURL(
string strGetErrURL
)Sets the value of the geterrorurl property.
eop.setGetErrorURL("_new");setGetHTMLDataURL
void setGetHTMLDataURL(string strGetHTMLDataURL)
Sets the value of the gethtmldataurl property.
eop.setGetHTMLDataURL("http://www.realobjects.com");setHeadElementContent
void setHeadElementContent(string strContent)
Sets the document's <head>...</head> element content.
headElmContent =
"<meta http-equiv='Content-type' content='text/html' />";
eop.setHeadElementContent(headElmContent);setGetOKTarget
void setGetOKTarget(
string strGetOKTarget
)Sets the value of the getoktarget property.
eop.setGetOKTarget("_blank");setGetOKURL
void setGetOKURL(
string strGetOKURL
)Sets the value of the getokurl property.
eop.setGetOKURL("http://myserver.com/ok.htm");setHelpURL
void setHelpURL(
string sURL
)Specifies the URL that will opened if the HELP action is called. If this method is not used, the online help corresponding to the localeCode specified in the editor is opened.
setHelpURL("http://www.yourserver.com/userguide.html");setHTMLData
void setHTMLData(
string strContent
)Loads strContent into the editor.
strContent = "<p>Paragraph with <strong>strong</strong> text</p>"; eop.setHTMLData(strContent);
setHTMLDataFromURL
void setHTMLDataFromURL(
string strURL
)Loads a HTML page from strURL into the editor.
eop.setHTMLDataFromURL("http://www.w3.org");setElementAttributes
void setElementAttributes(
Object attribs
)Sets the attributes and attribute values of the current element. Use an object containing key-value pairs of the attributes and their values to set the attributes.
obj = new Object(); obj["width"] = "100"; obj["height"] = "200"; obj["src"] = "http:eop//myserver/image.gif"; eop.setElementAttributes(obj);
setIgnoreFilter
void setIgnoreFilter(
string strFilter
)eop.setIgnoreFilter(filter);
setImageBase
void setImageBase(
string strBase
)Specifies a filter for elements which will be ignored in comparison mode. For details, see Ignoring Changes
eop.setImageBase("http://www.w3.org");This method is deprecated as of edit-on Pro version 4.2. Please use setBase instead.
setLookAndFeel
void setLookAndFeel(
string strLookAndFeel
)Sets the look and feel used by the editor. The look and feels supported by default by the editor are:
Motif Look and Feel:
com.sun.java.swing.plaf.motif.MotifLookAndFeel
Windows Look and Feel:
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Mac Aqua Look and Feel:
apple.laf.AquaLookAndFeel
Metal Look and Feel:
javax.swing.plaf.metal.MetalLookAndFeel
strPlaf = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; eop.setLookAndFeel(strPlaf);
setNextBookmarkWrapAroundEnabled
void setNextBookmarkWrapAroundEnabled(
boolean bEnabled
)Enables wrap around when searching for the next bookmark in a document using the setCaretAfterNextBookmark API method or the GOTONEXTBOOKMARK action.
eop.setNextBookmarkWrapAroundEnabled();
setParentElementByNameAttributes
void setParentElementByNameAttributes(
String strParent
Object attribs
)Searches for a parent element specified by strParent from the caret position. If a parent with this name is found, sets the attributes and attribute values of the element. Use an object containing key-value pairs of the attributes and their values to set the attributes.
obj = new Object();
obj["style"] = "color: red;";
obj["lang"] = "en";
eop.setParentElementByNameAttributes("p",obj);setParentElementByNameContent
void setParentElementByNameContent(
String strParent
String strContent
)Searches for a parent element specified by strParent from the caret position. If a parent with this name is found, the content of the element is replaced with the content specified by strContent.
eop.setParentElementByNameContent("p","<span>new content</span>");setPreviousBookmarkWrapAroundEnabled
void setPreviousBookmarkWrapAroundEnabled(
boolean bEnabled
)Enables wrap around when searching for the previous bookmark in a document using the setCaretAfterPreviousBookmark API method or the GOTOPREVIOUSBOOKMARK action.
eop.setPreviousBookmarkWrapAroundEnabled();
setReadOnly
void setReadOnly(
boolean bState
)Toggles editing in the editor. If setReadOnly is set to true, no editing actions can be performed anymore in the editor.
The JavaScript API functions will still function normaly when editing is disabled.
eop.setReadOnly(true);
setSetErrorTarget
void setSetErrorTarget(
string strSetErrorTarget
)Sets the value of the seterrortarget property.
eop.setSetErrorTarget("_blank");setSetErrorURL
void setSetErrorURL(
string strSetErrorURL
)Sets the value of the seterrorurl property.
eop.setSetErrorURL("http://myserver.com/error.htm");setSetOKTarget
void setSetOKTarget(
string strSetOKTarget
)Sets the value of the setoktarget property.
eop.setSetOKTarget("_new");setSetOKURL
void setSetOKURL(
string strSetOKURL
)Sets the value of the setokurl property.
eop.setSetOKURL("http://myserver.com/ok.htm");setSourceView
void setSourceView(
boolean bSourceView
)If set to false, the "Source View" tab of the editor is hidden. If set to true , the "Source View" tab is displayed again.
eop.setSourceView(false);
setStandAloneMode
void setStandAloneMode(
boolean bStandAloneMode
)Sets the value of the standalonemode property.
eop.setStandAloneMode(false);
setStyleSheet
void setStyleSheet(
string strStyles
)Loads styles from strStyles into the editor. These styles will overwrite any existing styles within the editor. If you want to add styles without overwriting the existing styles use addStyleSheet .
eop.setStyleSheet("p { color:blue; }");setStyleSheetURL
void setStyleSheetURL(
string strURL
)Loads styles from a style sheet document residing at strURL into the editor.
eop.setStyleSheetURL("http://myserver.com/styles.css"); setTemplate
void setTemplate(
string strTemplate
)Loads the template strTemplate into the editor.
strTemplate = " <!DOCTYPE html SYSTEM 'xhtml1-transitional-eop.dtd'>
<html>
<head>
<title>My Template</title>
</head>
<body>
<p> </p>
</body>
</html>";
eop.setTemplate(strTemplate);
setTemplateURL
void setTemplateURL(
string strTemplateURL
)Loads a template from the URL strTemplateURL into the editor.
eop.setTemplateURL("http://myserver.com/template.xhtml");setWebDAVCookieString
void setWebDAVCookieString(
String cookie
);Sets a cookie to be used in all of the editor's WebDAV connections. The string should consist of name=value pairs separated by a semicolon: "name1=value1;name2=value2;...".
eop.setWebDAVCookieString("myWebdavRepository=WebdavPort/Path;JSESSION=A4545B6767CBEA34535546576756767");showWYSIWYGAreaOnly
void showWYSIWYGAreaOnly(
boolean bShow
)If bShow is true, only the editor's WYSIWYG area will be visible. The whole canvas, UI and tab pane are hidden and only the WYSIWYG area is displayed. Setting bShow to false reverses this effect.
eop.showWYSIWYGAreaOnly(true);
uploadImages
void uploadImages(
string strFunc
)Calling this function will open the "Upload Images" dialog. When the "OK" or "Cancel" button is clicked in this dialog, the applet will call the JavaScript function strFunc and pass an associative array containing information about the upload of each image that was uploaded as argument to the JavaScript function if "OK" was clicked. The JavaScript function strFunc will receive false as argument if "Cancel" was clicked.
eop.uploadImages("saveFunc");Calling the uploadImages function inside an event queue will halt the event cycle. I.e., if you are calling any other methods that need to be registered in the queue after the uploadImages function, call pumpEvents within the definition of uploadImages ' event handler.
This method is deprecated as of edit-on Pro.2. Please use uploadToRepository instead.
uploadToRepository
void uploadToRepository(
string strType
string strFunc
)Calling this function will open the upload dialogs of the type specified by strType . The possible types are UPLOADALL , UPLOADOBJECTSANDIMAGES , UPLOADIMAGES , UPLOADOBJECTS and UPLOADDOCUMENT . When the "OK" or "Cancel" button is clicked in this dialog, the applet will call the JavaScript function strFunc and pass an associative array containing information about the upload of each file that was uploaded as argument to the JavaScript function if "OK" was clicked. The JavaScript function strFunc will receive false as argument if "Cancel" was clicked.
eop.uploadToRepository("UPLOADIMAGES","saveFunc");Calling the uploadToRepository function inside an event queue will halt the event cycle. I.e., if you are calling any other methods that need to be registered in the queue after the uploadToRepository function, call pumpEvents within the definition of uploadToRepository ' event handler.
resizeEditor
void resizeEditor(
int width
int height
)Resizes the editor to the specified width and height in pixels.
eop.resizeEditor(600, 400);
showEditor
void resizeEditor()
Displays the editor if it was previously hidden using hideEditor or loaded using setHiddenLoading with the argument displayOnLoad set to false.
Although this is method is a set method, it is exempt from the queue. Thus, the method is executed immediately when it is called, and no calling of pumpEvents is required. This method does not tamper with the event queue in any way.
eop.showEditor();
hideEditor
void hideEditor(
boolean noCollapse
)Although this is method is a set method, it is exempt from the queue. Thus, the method is executed immediately when it is called, and no calling of pumpEvents is required. This method does not tamper with the event queue in any way.
Hides the editor when it is called. If noCollapse is set to true, the editor will behave like an XML element with the style "visibility: hidden", i.e. while it will no longer be visible, it will still take up the same space as before it was hidden.
If noCollapse is set to false, the editor is hidden and take up a minimal amount of space in the document while it is hidden.
eop.showEditor();
Although this is method is a set method, it is exempt from the queue. Thus, the method is executed immediately when it is called, and no calling of pumpEvents is required. This method does not tamper with the event queue in any way.