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:
Can htmlarea share the same css as the rest of the site?


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.

 


jrd
Novice

Aug 8, 2004, 3:36 PM

Post #1 of 8 (3949 views)
Shortcut
Can htmlarea share the same css as the rest of the site? Can't Post

Hi all. This may be an FQA, but I couldn't find it; apologies in advance if so.

I've installed htmlarea 3.0 beta in a site I'm working on. Functionally it's pretty good, but I'd like it to use the style sheet as the rest of the site, so that wys will really be wyg. I tried commenting out the load of htmlarea.css in a test page which is already loading my site css, but that didn't seem to do it. I'm not enough of a js wizard to be able to read the code that easily yet to see if there are any tidbits there.

Hints? Thanks in advance...


robw
Novice

Aug 8, 2004, 6:43 PM

Post #2 of 8 (3943 views)
Shortcut
Re: [jrd] Can htmlarea share the same css as the rest of the site? [In reply to] Can't Post

I'm new to HTMLArea too, but here's how I understand you do it:

- Make sure you've loaded the CSS plugin:


Code
 HTMLArea.loadPlugin("CSS");



- Then register the plugin using the code from the example. Make sure "editor" is the name of the HTMLArea configuration that you're using on the page.


Code
   // register the CSS plugin 
editor.registerPlugin(CSS, {
combos : [
{ label: "Syntax",
// menu text // CSS class
options: { "None" : "",
"Code" : "code",
"String" : "string",
"Comment" : "comment",
"Variable name" : "variable-name",
"Type" : "type",
"Reference" : "reference",
"Preprocessor" : "preprocessor",
"Keyword" : "keyword",
"Function name" : "function-name",
"Html tag" : "html-tag",
"Html italic" : "html-helper-italic",
"Warning" : "warning",
"Html bold" : "html-helper-bold"
},
context: "pre"
},
{ label: "Info",
options: { "None" : "",
"Quote" : "quote",
"Highlight" : "highlight",
"Deprecated" : "deprecated"
}
}
]
});



- Then include a pointer to your CSS file. Again, make sure you have the correct name for the configuration you're using:


Code
   // load the stylesheet used by our CSS plugin configuration 
editor.config.pageStyle = "@import url(/styles/global.css);";



Now here's my problem. Wink I've done all that and the style sheet loads in Internet Explorer, but it doesn't load in Mozilla. Does anyone know how to fix it?


jrd
Novice

Aug 10, 2004, 7:19 PM

Post #3 of 8 (3867 views)
Shortcut
Re: [robw] Can htmlarea share the same css as the rest of the site? [In reply to] Can't Post

Ok, at this point I'm sure I'm being really dense, but I can't find where to download the CSS plugin. Hints? Also, I see a lot of references to the dynamic CSS plugin, which maybe supercedes the other one?


robw
Novice

Aug 13, 2004, 4:14 AM

Post #4 of 8 (3802 views)
Shortcut
Re: [jrd] Can htmlarea share the same css as the rest of the site? [In reply to] Can't Post

In 3.0-rc1 the CSS plugin is a part of the standard installation. You should see it in your htmlarea/plugins/ directory. It will be automatically loaded if you use the code from earlier in this thread and the directory exists.

However I'm not sure if this is the case with 3.0-beta. You may need to download rc1 instead.

Also, let me know if you get this going and the CSS file loads in Mozilla. I can't get it to work.


jrd
Novice

Aug 13, 2004, 9:06 AM

Post #5 of 8 (3795 views)
Shortcut
Re: [robw] Can htmlarea share the same css as the rest of the site? [In reply to] Can't Post

Yeah, you're correct, it wasn't part of beta, but I later found it in the CVS tree on sourceforge.

I still can't get the thing to work. Tried a number of permutations using the code that you posted. Some of them clearly did *something*, but none had the effect of making the text in the textarea look like the text on the rest of the site. The best I was able to do got plain text to look right, but things like <h2>'s were still wrong.

I'm going to give up on this for now. If somebody can point me at a complete, working example of how to use an arbitrary style sheet to control the look and feel of the content in an html area, it would be most appreciated.


robw
Novice

Aug 13, 2004, 5:27 PM

Post #6 of 8 (3782 views)
Shortcut
Re: [jrd] Can htmlarea share the same css as the rest of the site? [In reply to] Can't Post

Which browser are you using? IE or Mozilla? I can't get it to work at all in Mozilla, but it works well in IE.

Hmm, if you're getting some styles working and not others, is it a CSS syntax issue? Have you tried using a very simple style sheet (e.g. one that only defines the major block tags) just in case?

It would be great if someone else could weigh in to this discussion, we're both having troubles...


jrd
Novice

Aug 13, 2004, 5:46 PM

Post #7 of 8 (3781 views)
Shortcut
Re: [robw] Can htmlarea share the same css as the rest of the site? [In reply to] Can't Post


In Reply To
Which browser are you using? IE or Mozilla? I can't get it to work at all in Mozilla, but it works well in IE.


I tried both IE and moz 1.7 and 1.8, though most of the experiments were done in moz 1.7. FWIW, I did observe the CSS being loaded when I invoked the editor (except for those times when I'd broken it completely) so it sounds like it may not be the same problem you are having.


In Reply To
Hmm, if you're getting some styles working and not others, is it a CSS syntax issue? Have you tried using a very simple style sheet (e.g. one that only defines the major block tags) just in case?


Well, sure, anything's possible. The css I'm using seems to work correctly in all the browsers I've tried, but that's no guarantee that it's correct.

I haven't tried concocting a very simple css to try debugging it from that end.

If I get motivated this weekend I may try starting from scratch from rc1, and work with the dynamiccss example; judging from the comments in one of the other fora here, that one may be easier to deal with.


DarrylB
User

Jan 24, 2005, 12:48 PM

Post #8 of 8 (3049 views)
Shortcut
Re: [jrd] Can htmlarea share the same css as the rest of the site? [In reply to] Can't Post

Does anyone know of a way to modify this a bit, and modify the action of buttons?
I.e. for the <B> button, i want to change it to use my CSS Strong...

Tnx..

 
 
 


Search for (options)