This property specifies the styles rules to be contained in the STYLE element within the HEAD section of the document in EditLive! for Java. This property is mainly for use with content that has been pasted in from MS Word, where it is important to maintain the imported MS Word styles.
JavaScript object.setStyles(strStyles)
strStyles Required. A string specifying the style rules to be loaded into a STYLE element in the HEAD section of the document within the EditLive! for Java applet.
The following code would set the initial style rules of the document within EditLive! for Java to be equal to "body{ font-family: arial; background-color: white;}h1{ font-family: helvetica, arial, sans-serif; font-size: 16pt; font-style: normal; font-weight: bold;}p, td, th{ font-size: 12pt;}". This style information will be used to render the contents of EditLive! for Java and will only be visible in the HTML View.
Note: The string passed to the setStyles property must be URL encoded or encoded using the JavaScript escape function. The example below uses the JavaScript escape function.
var editlivejava1;
editlivejava1 = new EditLiveJava("ELJApplet1","600","400");
editlivejava1.setBody(escape("<p>Initial contents of Ephox EditLive! for Java</p>"));
editlive1.setStyles(escape('body{ font-family: arial; background-color: white;}h1{ font-family: helvetica, arial, sans-serif; font-size: 16pt; font-style: normal; font-weight: bold;}p, td, th{ font-size: 12pt;}'));
The string passed to the setStyles property must be URL encoded or encoded using the JavaScript escape function.
The styles information is retrieved from EditLive! for Java in the same way that the overall content is.
As in the example above, the string that is passed to the setStyles property should be fully escaped to avoid JavaScript errors.
Copyright © 2001-2004 Ephox Corporation. All Rights Reserved.