You are not logged in.
Hi.
I have currently been testing FCKeditor for a while.
It is an editor with great future possibilities but at the moment it
has to many compatibility conflicts between different browsers (IE / FF)
because of different handling of TAGs.
Lucky me, to find Xinha. Did some quick testing today and all my complaints
with FCKeditor actually works here.... Great.
What remains now is to ask some questions about how it deals with classes.
Questions:
1. How do I apply a class to the className of BODY of editor?
Hopefully by being able to set BODY className at editor startup or after it has initialized.
If that is not doable, is there a workaround.
Example please.
2. How do I change class for BODY dynamically?
I want to use javascript from the page where the editor is placed to change the body class after the
editor has initialized. Hopefully to be able to change the BODY className.
I need to do this from outside the buttons panel because I want to control two editor instances at the same time.
Is that possible out of the box?
If not, is there a workaround?
3. How do I insert HTML in the editor at cursor position using javascript?
I also want to do that from outside the editor buttons area or eventually by creating a custom button.
Would like to see example of solution to both.
4. How do I enable classes for the inserted HTML ref. Q3?
The inserted HTML ref. Q3 are to use some classes.
Where do I enable those classes for the editor?
Note: The classes used for the inserted HTML should "normally" not be accessible for
the editor (writer).
5. I want enable some custom tags and inline styles for the editor. How do I make styles like the one below accessible from a dropdown inside the editor button area?
<span style="line-height:150%">SELECTED TEXT</span>
<span style="font-size:150%">SELECTED TEXT</span>
I want it to work like this:
Writer select some text and then select "FontSize=150%" from the dropdown.
Then code (custom or core) should put a SPAN tag around selected text with the inline style font-size:150%
Hope the above is doable and flexible....
Best luck with the project
Last edited by bongobongo (2005-09-23 04:43:42)
Offline
So, is it possible to do the things above?
Offline
1. How do I apply a class to the className of BODY of editor?
try this in your config:
editor._onGenerate = function() {
this._doc.body.className = 'yourClass'
}
2. How do I change class for BODY dynamically?
you might use the same as in 1. - you conly must have access to the editor-object.
3. How do I insert HTML in the editor at cursor position using javascript?
editor.insertHTML('html...');
...again you must have the editor-object.
4. HTML ref. Q3 ?? what is that? please explain a bit more what you need...
5. use css-classes - the Stylist-plugin or the DynamicCSS-plugin or CSS-plugin will help you.
Niko
Offline
Hi and thanks for reply.
More regarding Question 4.
I want to insert some premade HTML into editor.
This HTML uses classes.
Example:
<div class="classname">
more HTML stuff here
</div>
So what I need is a way to tell Xinha editor which external stylesheet(s) should be enabled with the editor.
Best regards
Offline
using this you can specify the stylesheet:
editor.config.pageStyle = "@import url(yourfile.css);";
you can of course ave several @imports here.
Niko
Offline
Thanks for answers....
Will test soon. :-)
Offline