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 - Add-Ons:
CSS plugin problem with multiple instances


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.

 


dupontv
Novice

May 13, 2004, 5:10 AM

Post #1 of 8 (22385 views)
Shortcut
CSS plugin problem with multiple instances Can't Post

Hi,

I have a problem with the CSS plugin when inserting multiple htmlareas into the same page and registering the CSS plugin for each.

Every htmlArea seems to register all plugins : If I have 3 htmlareas on the page (with different names) then each has 3 'Styles' dropdown. Only the last one seem to work.

here is my code sample
HTML HEAD :

Code
 <script type="text/javascript">  
_editor_url = "./media/htmlarea/";
_editor_lang = "en";
</script>

<!-- load the main htmlArea files -->
<script type="text/javascript" src="./media/htmlarea/htmlarea.js"></script>

<!-- load the htmlArea plugins-->
<script type="text/javascript">
//HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("CSS");
//HTMLArea.loadPlugin("ContextMenu");

var htmlarea_config = new HTMLArea.Config();
htmlarea_config.toolbar = [
[
"formatblock", "space",
"bold", "italic", "underline", "separator",
"strikethrough","separator",
"copy", "cut", "paste", "space"
],

[
"justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator",
"inserthorizontalrule", "createlink", "inserttable", "htmlmode"
]
];



var css_plugin_args = {
combos : [
{ label: "My Style",
options: { "None" : "content_none",
"Title" : "content_title",
"Sub title" : "content_sub_title",
"Main" : "content_main_text",
"Footer" : "content_footer"
}
}
]
};
htmlarea_config.pageStyle = "@import url(http://localhost/ausyweb2/styles/ffe_content.css);";
</script>


Inside the BODY

Code
 <script type="text/javascript" defer="1">  

var html_editor_14 = new HTMLArea("file_sharing_text_14", htmlarea_config);


html_editor_14.registerPlugin(CSS, css_plugin_args);

setTimeout(function() {
html_editor_14.generate();
}, 50*14);



</script>
<textarea id="file_sharing_text_14" name="file_sharing_text_14" rows="30" cols="60" ></textarea>


Code
 				<script type="text/javascript" defer="1">  

var html_editor_2 = new HTMLArea("file_sharing_text_2", htmlarea_config);


html_editor_2.registerPlugin(CSS, css_plugin_args);

setTimeout(function() {
html_editor_2.generate();
}, 50*2);



</script>
<textarea id="file_sharing_text_2" name="file_sharing_text_2" rows="30" cols="60" ></textarea>

Vincent Dupont
(Belgium)


cocce
New User

May 25, 2004, 7:38 AM

Post #2 of 8 (22328 views)
Shortcut
Re: [dupontv] CSS plugin problem with multiple instances [In reply to] Can't Post

Hi [dupontv], i solved something like this..

I m not sure is your problem... but take a look about this.

http://www.interactivetools.com/forum/gforum.cgi?post=28795#28795

Bye Bye

Cocce
Th3 C0cc3


jollyjumper
Novice

Aug 24, 2004, 1:38 PM

Post #3 of 8 (22075 views)
Shortcut
Re: [dupontv] CSS plugin problem with multiple instances [In reply to] Can't Post

Hi Vincent,

I was wondering if you have succeeded with a sollution for this problem.

I'm experiencing the same, except I've got it with every plugin I use(eg. TableOperations give a lot of buttons when using multiple boxes, and also the multiple dropdown lists).

Greetz Jolly.


dupontv
Novice

Aug 25, 2004, 2:47 AM

Post #4 of 8 (22042 views)
Shortcut
Re: [jollyjumper] CSS plugin problem with multiple instances [In reply to] Can't Post

Hi,

No good changes yet. I'll keep you informed if I find something.



Vincent
Vincent Dupont
(Belgium)


JimmyVH
Novice

Aug 25, 2004, 3:39 AM

Post #5 of 8 (22037 views)
Shortcut
Re: [dupontv] CSS plugin problem with multiple instances [In reply to] Can't Post

Try it like this:



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);
}


I had the same problem with a table bar for every htmlarea in every htmlarea and with the above I got rid of the extra ones. Hope it will help you.


jollyjumper
Novice

Aug 26, 2004, 4:18 AM

Post #6 of 8 (22020 views)
Shortcut
Re: [JimmyVH] CSS plugin problem with multiple instances [In reply to] Can't Post

Hi Jimmy,

You've said it removes all the extra bars, but is it also possible to have 1 editor with the tableoperations bar and one without?

Greetz Jolly.


JimmyVH
Novice

Aug 26, 2004, 5:27 AM

Post #7 of 8 (22017 views)
Shortcut
Re: [jollyjumper] CSS plugin problem with multiple instances [In reply to] Can't Post

Probably when defining the configs seperately it will work. Try the code below.


var editor1 = new HTMLArea("body1");

editor1.config.hideSomeButtons(" insertimage createlink popupeditor showhelp about ");
editor1.registerPlugin(ContextMenu);
editor1.registerPlugin(CSS, css_plugin_args);
editor1.registerPlugin(TableOperations);
editor1.generate();

var editor2 = new HTMLArea("body2");

editor2.config.hideSomeButtons(" insertimage createlink popupeditor showhelp about ");
editor2.registerPlugin(ContextMenu);
editor2.registerPlugin(CSS, css_plugin_args);
setTimeout(function() {
editor2.generate();
}, 50);
}


dupontv
Novice

Sep 8, 2004, 3:54 PM

Post #8 of 8 (21892 views)
Shortcut
Re: [JimmyVH] CSS plugin problem with multiple instances [In reply to] Can't Post

Thank you guys for your answers, but the problem remains.

I also tried the tips cited at http://www.interactivetools.com/forum/gforum.cgi?post=28795#28795
  • I tried to ass "context = obj.context" in css.js under CSS.prototype.onSelect
  • I tried to add "updatecontextclass : combo.updatecontextclass" in css.js under css_class




without success.

I don't understand. My 2 or 3 htmlarea's have distinct names (the js var and the html name for the tag). There is a setTimeout for every "generate" call with various delays. The config and css args are the same because they are loaded in PHP from a config file

win 2k
IE 6.0


I also tried the DynamicCSS plugin, and the same problem appears...


Vincent
Vincent Dupont
(Belgium)

(This post was edited by dupontv on Sep 8, 2004, 4:22 PM)

 
 
 


Search for (options)