htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
multiple areas + plugins + HTMLArea.replace()


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


doktor
New User

May 24, 2004, 7:15 AM

Post #1 of 8 (4897 views)
Shortcut
multiple areas + plugins + HTMLArea.replace() Can't Post

So far, having 1 or many textareas, which I want to use with htmlarea I just followed the instructions from the developer's page

At the bottom of the page there was a piece of js:
HTMLArea.replace("textarea_id",config);

as amny times as needed, replacing textarea_id with a proper id, of course

Everything works fine with both Mozilla and IE.
Now, I wanted to add TableOperations plugin and I'm a bit confused.

I haven't found any solution which fits the method I'm using now (replace functions at the bottom of the page). I found only 'body-onLoad-method', which is slightely different in other aspects.
Any of you know a method of adding any additional plugins while using the replace() method at the bottom of the page to invoke htmlareas?

Thanks


JimmyVH
Novice

Aug 24, 2004, 3:58 AM

Post #2 of 8 (4706 views)
Shortcut
Re: [doktor] multiple areas + plugins + HTMLArea.replace() [In reply to] Can't Post

I have the same problem here. When using the HTMLArea.replace method as shown in a simple example below, the other plugin's won't work anymore.

How can this be solved?

var config = new HTMLArea.Config();

config.hideSomeButtons(" insertimage createlink popupeditor showhelp about ");

var editor1 = new HTMLArea("body1");
HTMLArea.replace('body1', config);
editor1.registerPlugin(ContextMenu);

Thanks in advance


JimmyVH
Novice

Aug 24, 2004, 4:33 AM

Post #3 of 8 (4700 views)
Shortcut
Re: [JimmyVH] multiple areas + plugins + HTMLArea.replace() [In reply to] Can't Post

I found my answer in here:

http://www.interactivetools.com/forum/gforum.cgi?post=27181;search_string=register%20plugin%20htmlarea.replace;t=search_engine#27181

var editor1 = new HTMLArea("body1", config);
editor1.registerPlugin(ContextMenu);

Instead of replacing the HTMLArea, you need to add the configuration in the beginning. Then you can combine it with multiple areas while only defining it once and you're still able to register plugins.

Finally I got it all working with multiple areas. Cool

Thanks again to the developer of this nice Editor!!!


JimmyVH
Novice

Aug 24, 2004, 4:43 AM

Post #4 of 8 (4698 views)
Shortcut
Re: [JimmyVH] multiple areas + plugins + HTMLArea.replace() [In reply to] Can't Post

In case you have multiple areas, it seems you only have to register the plugins to one of them. The other one takes them over from the first one. If you register them to the second one as well, you'll end up with all plugins twice in your second editor.

EXAMPLE:

var config = new HTMLArea.Config();

config.hideSomeButtons(" insertimage createlink popupeditor showhelp about ");

var editor1 = new HTMLArea("body1", config);
editor1.registerPlugin(ContextMenu);
editor1.registerPlugin(CSS, css_plugin_args);
editor1.registerPlugin(TableOperations);
editor1.generate();

var editor2 = new HTMLArea("body2", config);
setTimeout(function() {
editor2.generate();
}, 50);
}

This code will show your plugins in both areas and use the same config for both of them. Took me a while to figure that out. Hope this will help some of you. Smile


Viperal
Novice

Aug 24, 2004, 5:31 AM

Post #5 of 8 (4694 views)
Shortcut
Re: [doktor] multiple areas + plugins + HTMLArea.replace() [In reply to] Can't Post

Here you go mate, was tring to figure it out for a will but you know. Took me two our to addapt my php knowledge to java but now i know more.

// Load plugins
HTMLArea.loadPlugin("SpellChecker");
HTMLArea.loadPlugin("CharacterMap");

// My replace all function
HTMLArea.viperalreplaceAll = function(config) {
var tas = document.getElementsByTagName("textarea");
for (var i = tas.length; i > 0;) {
editor = new HTMLArea(tas[--i], config);
if (i == 1) {
editor.registerPlugin(CharacterMap);
editor.registerPlugin(SpellChecker);
}
editor.generate();
}
};

// the replace all call
HTMLArea.viperalreplaceAll(config);


hopew it helps. now if i can figur out how to make this thing add the editor.registerPlugin(CharacterMap); dynamicly i can add have it as a replacement in the js file..

Arr how do you make arsays in jave. should be simple enoght for even me. Will report back.


Viperal
Novice

Aug 24, 2004, 3:18 PM

Post #6 of 8 (4675 views)
Shortcut
Re: [Viperal] multiple areas + plugins + HTMLArea.replace() [In reply to] Can't Post

Ok this seems to work better with one editor and more than one editor. The other one had a problem with not loading with one editor.

<script type="text/javascript">
HTMLArea.loadPlugin("CharacterMap");
HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("SmilesPlus");
//HTMLArea.loadPlugin("CSS");
HTMLArea.loadPlugin("ContextMenu");
HTMLArea.loadPlugin("ListType");
HTMLArea.loadPlugin("CharacterMap");
//HTMLArea.loadPlugin("DynamicCSS");
HTMLArea.loadPlugin("ImageManager");

HTMLArea.viperalreplaceAll = function(config) {
var tas = document.getElementsByTagName("textarea");
var loop = 0;
for (var i = tas.length; i > 0;) {
editor = new HTMLArea(tas[--i], config);
/*Make this a array */

if (loop == 0)
{
// load the stylesheet used by our CSS plugin configuration
//editor.config.pageStyle = "@import url(themes/cpgnuke/style/style.css);";

editor.registerPlugin(CharacterMap);
editor.registerPlugin(TableOperations);
editor.registerPlugin(SmilesPlus);
editor.registerPlugin(ListType);
//editor.registerPlugin(DynamicCSS);
}
editor.registerPlugin(ContextMenu);
loop= loop + 1;
editor.generate();
}
};


JimmyVH
Novice

Aug 25, 2004, 3:16 AM

Post #7 of 8 (4645 views)
Shortcut
Re: [JimmyVH] multiple areas + plugins + HTMLArea.replace() [In reply to] Can't Post


In Reply To
In case you have multiple areas, it seems you only have to register the plugins to one of them. The other one takes them over from the first one. If you register them to the second one as well, you'll end up with all plugins twice in your second editor.

EXAMPLE:

var config = new HTMLArea.Config();

config.hideSomeButtons(" insertimage createlink popupeditor showhelp about ");

var editor1 = new HTMLArea("body1", config);
editor1.registerPlugin(ContextMenu);
editor1.registerPlugin(CSS, css_plugin_args);
editor1.registerPlugin(TableOperations);
editor1.generate();

var editor2 = new HTMLArea("body2", config);
setTimeout(function() {
editor2.generate();
}, 50);
}

This code will show your plugins in both areas and use the same config for both of them. Took me a while to figure that out. Hope this will help some of you. Smile



Hi Viperal,

I'll try them! tx. The one above is doing the job as well, of course it's not a replaceAll one! I'm currently stuck with getting the default font size set. I got it set with pt's but after changing my pt's to px as descibed below its not working anymore

http://www.interactivetools.com/forum/gforum.cgi?post=30752;search_string=default%20font%20size;#30752

The px thing is working, but only the default one is not anymore. I tried setting config.fontSize="13px" and set font-size:13px in my custom.css, but still it shows me 10px as my default. Pirate


cornernote
New User

Jan 22, 2005, 5:13 AM

Post #8 of 8 (3778 views)
Shortcut
Re: [JimmyVH] multiple areas + plugins + HTMLArea.replace() [In reply to] Can't Post

I have tried several versions of this, and all do the same thing. They work and show the plugins using replaceAll(). The problem is that they will not submit the data to the next page. The data that goes to the next page is the same as what was originaly in the textarea. If I put the old replaceAll() back into place then it works perfectly. It appreas that some final step is not being completed.

Any help would be much appriciated.

 
 
 


Search for (options)