htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
CSS styles available to user


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.

 


rje
New User

Jan 8, 2004, 1:44 PM

Post #1 of 3 (2004 views)
Shortcut
CSS styles available to user Can't Post

I can't seem to figure out how to offer my CSS styles to a user using a drop down list in the toolbar when using htmlArea v.20? Is this possible?

Thanks.


joework
Novice

Dec 10, 2004, 9:31 AM

Post #2 of 3 (1706 views)
Shortcut
Re: [rje] CSS styles available to user [In reply to] Can't Post

Indeed is it?


jonnyl
Novice

Dec 12, 2004, 4:48 AM

Post #3 of 3 (1689 views)
Shortcut
Re: [joework] CSS styles available to user [In reply to] Can't Post

First of course you need a .css document containing the overall layout of the page including the classes you want to offer to users of your htmlArea implementation.

In editor.js point "this stylesheet" to the URL of your css file.

Then alter this.toolbar to include ['fontstyle'].

In the document which loads htmlArea you need to create a config-object. In a script-snippet after the textarea add the following:


Code
  <script language="javascript1.2">  
var config = new Object(); // create new config objectconfig.fontstyles = [
{ name: "Header 1", className: "headline", classStyle: "Some CSS-description" },
{ name: "Header 2", className: "headline2", classStyle: "Some CSS-description" },
{ name: "Header 3", className: "headline4", classStyle: "Some CSS-description" }
];editor_generate('nameOfMyTextarea', config);
</script>



Since the classes you are offering to your users are already defined in the css-document you do not have to include the descriptions, writing classStyle: "" should suffice.


(This post was edited by jonnyl on Dec 12, 2004, 4:51 AM)

 
 
 


Search for (options)