|
You are here: Home / Documentation / Use HTMLArea as WYSIWYG editor |
Use HTMLArea as WYSIWYG editorHTMLArea configuration and troubleshootingWhile it's true that all you need is one line of JavaScript to create an htmlArea WYSIWYG editor, you can also specify more configuration settings in the code to control how the editor works and looks. For details how to configure, see the original HTMLArea website http://dynarch.com/mishoo/htmlarea.epl Customize HTMLAreaAs mentioned in the HTMLArea docs, never make modifications in the original HTMLArea sources. Apply all extensions and configurations in separate files. I made all the customization in a new file called htmlareaconfig.js and saved the file in the same directory as the htmlarea sources. It is important to load the plugins first, then create the HTMLArea widget en then let the widget create its HTML on a body onload event, or else Internet Explorer will never display the WYSIWYG editor. My htmlareaconfig.js file:
// Register
plugins In /inc/app/cms/forms/add/sitellite_page/index.php changes the following lines somewhat:
page_add_script ('_editor_url =
"/htmlarea/"; Plugins get not initialized: Preload PluginsSometimes the plugins don't get loaded. Then try the this: In htmlarea.js in the function
'HTMLArea.loadPlugin' include the javascript for the plugins by a
document.write() instead of the elegant DOM methode. It solved the
problem in IE for me. Mozilla offcourse had no problems with it...
HTMLArea.loadPlugin =
function(pluginName) { See also this topic: http://www.interactivetools.com/forum/gforum.cgi?post=31315#31315 Full screen editing doesn't work in IE and MozillaThe browser doesn't like relative paths, change the code on approximately line15 in /htmlarea/popups/fullscreen.html with:
<script
type="text/javascript"> And add a try and cache to the _CloseOnExit(ev) function, see http://www.interactivetools.com/forum/gforum.cgi?post=30160#30160 for details:
function _CloseOnEsc(ev) { Go to the HTMLArea.cloneObject Method in htmlarea.js and use the following code in the second 'else' node:
} else for (var n in obj) { >HTML Tidy doesn't work>This plugin requires at least PHP version 4.3 to function. See arabolds code at http://www.interactivetools.com/forum/gforum.cgi?post=25740#25740 to make the HTML Tidy plugin work with at least PHP version 4.1. and remove the bug that caused the generated JavaScript to fail. The string that is returned from tidy has to be escaped twice: The modified part of /htmlarea/plugins/HtmlTidy/html-tidy-logic.php:
// Create a set of javascript
code to compile a new source string
// proc_open
replacement Sometime an iframe doesn't get declared, the following code will fix that. See http://www.interactivetools.com/forum/gforum.cgi?post=28972#28972. Add this code to /htmlarea/plugins/HtmlTidy/html-tidy.js:
if (!
parent.document.getElementById('htiframe_id') &&
HTMLArea.is_ie) { AuthorRob Juurlink (rob@juurlink.org) Page 1: Introduction to HTMLArea |
|
Copyright © 2008, SIMIAN systems Inc. All rights reserved. Privacy policy Some of the icons on this site were created by the Gnome Project. |