|
EditLive! 4.0 Integration BasicsEphox, November 2001 Summary:This article outlines how to integrate EditLive! 4.0 into your own HTML page. Client-side JavaScript is used to create and customize the EditLive! object. ContentsGetting Started Getting StartedBefore You Integrate EditLive!Before you integrate EditLive! you should have viewed the online demos at www.ephox.com, and downloaded and installed the latest Ephox EditLive! 4.0 Development Kit. You should then copy the entire editlive folder to your web server. This folder is installed with the EditLive! 4.0 Development Kit. Prerequisite SkillsEditLive! integration requires basic knowledge of client-side JavaScript and HTML. Integrating EditLive!The following steps should be carried out to integrate EditLive! into an existing HTML page:
Please note: This code is not integrated into the web page that you wish to edit using EditLive!. This HTML page is a separate Web page which incorporates EditLive!, into which the web content to be modified is then loaded. Step 1 - Include External Script FilesIn order to integrate EditLive! into an existing Web page, several files need to be linked to your page. These files provide access to the EditLive! application programming interface (API) to use the properties and methods that are available. Place the SCRIPT tags linking these files to your page in the HEAD section of your Web page.
Step 2 - Insert A SCRIPT BlockInsert a SCRIPT block at the location in your HTML page where you want EditLive! to appear.
Step 3 - Configure Global VariablesConfigure the global variables before you load an instance of EditLive!. The most important global variable is setDownloadDirectory, which sets where the EditLive! installation files (the "editlive" folder) can be found. This variable must be set correctly for EditLive! to install on your end-users' computers. This location needs to be relative to where your HTML page will be stored on the server.
For more information about configuring global variables refer to The EditLiveGlobal object. Step 4 - Create an EditLive ObjectCreate an instance of EditLive! in your HTML page by using the JavaScript API to create a new "EditLive" JavaScript object.
The syntax of this function is:
The parameters to the EditLive function are:
Step 5 - Set EditLive!'s PropertiesAfter creating the EditLive object, you can now refer to it to initialize and customize EditLive!. This is done using the EditLive! API which was made accessible by referencing the external EditLive! script files in Step 1. These properties and methods are set in a function that is called when the web page is first loaded. Firstly, name this onload function.
Then, use this function to define the initial properties and methods of the EditLive! object. Important properties to set include:
The following is an example of a function that sets the EditLive! object to:
Putting It All TogetherPutting all the steps together results in the HTML code shown below,
Next StepsTo see some specific examples of how to integrate EditLive! into a variety of applications please see the Developers section of our web site.
|
|
||||||||||||||||||||||||||||||||||||||||||
| Copyright © 1999-2005 Ephox Corporation. All Rights Reserved. 'Ephox' is a registered trademark of Ephox Corporation. Java and the Java Powered logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. |