See update 3 for the bug found (if a bug ?)
************************
****** UPDATE 1: ****
************************
I have found another way to make this work 100% (allmost).
I can use the Styles combo instead and just define the styles for the H elements I need.
If the user then apply a H1 style then he can just select the text and reapply the same style to remove it.
The only thing I miss now is this:
I would like to add a "Normal" option to the Style combo.
When selected the previously applied tag around the text should be removed.
Basically it should work identically as when you select the (reapply the) style (again) to remove it.
Reason for this that I think it is more intuitive for the endusers to see the "Normal" style in the Style combo.
Okay, if you have been told that you can reapply same style to remove it you will probably rember it next time.
But if nobody is there to tell you.... then you might get stuck....
So is that possible?
***********************
***** UPDATE 2. ****
***********************
Arghh.. Found one other quirk.
When using the Style combo I can actually apply different H styles to same text.
A minor quirk for me since I'm unable to reflect nested H tags in my PDF reports.
Is there a way to force the style combo to remove a previously inserted style before inserting the new one?
So If I select some normal text and apply H1 tag.
Then If I reselect same text and apply a H3 tag then I want the first H1 tag removed before applying the last one.
*****************************
***** UPDATE 3. BUG? ****
*****************************
More quirks, is this a BUG?
If I write "First line", then hit enter twice (two BR inserted) then write "Second line", then enter twice again,
and then write "Third line".
So it looks like this in editor:
First line
Second line
Third line
Then if I select the "Second line" and apply the H3 style from the Style combo and then hit the the
Undo button.
What happens is that "Third line" is removed and not my previously added style.
Is it supposed to be like that?
I would expect my latest applied style to be removed, and not my "Third line" to be deleted.
I also tested this on the demo page on http://www.fckeditor.net and found the same to happpen.
Basically the Undo button does not work on applied styles using the Style combo.
It (Undo button) do work on applied stuff using the Format, Font and Size combos.
How can I make the Undo button also work on stuff applied using the Style combo?
*********************************
*** ORIGINAL QUESTION ****
*********************************
I have these settings in fckconfig.js
...
...
FCKConfig.EnterMode = 'br' ;
FCKConfig.ShiftEnterMode = 'br' ;
....
....
FCKConfig.FontFormats = 'h1;h2;h3;h4;h5;h6' ;
Okay, let say I select some text and click the FontFormats select and select H1.
H1 tags is then put around the text.
Now, how can I remove those tags. And get back to how it looked before the H1 tags where inserted?
What I would like to know is how can I get something similar to the "Normal" option in the select as when
you use a "p" within the FontFormats string (above).
My problem is that if I put the "p" in the FontFormats string then, when selecting that option when e.g. a
H1 formatted text is selected, then the H1 tags are removed (good), and P tags are inserted (not so good).
So what are my options:
I only want to allow these options:
FCKConfig.FontFormats = 'h1;h2;h3;h4;h5;h6' ;
But I still want to offer the enduser the possibility to remove the inserted H1 tags easily.
How can I show Normal in the select and make it just remove the H1 (or H2, H3 etc) tags and not add any other tags?
If the above is not possible, then is there any workarounds to make this work.
As it is now, offering H1, H2, H3 tags but no Normal (option... that just remove the previously inserted tags) then it becomes hard to remove the inserted H1, H2 etc tags for the enduser.
Okay, some of you may say, what a bummer, why not just allow the P tags in the html?
Well, normally that would be okay. But not in this particular situation.
I need to restrict the enduser to produce HTML that only allows some specific tags which are later to be used to produce
reports in different formats (PDF, Word, HTML).
So I found that If I only allow STRONG, EM, U, A, BR and the H tags then it becomes easy for me to produce the reports for the documents above with same look to the reports.
My only challenge is now to allow the enduser to easily remove inserted H tags and be able to remove them easily as well.
Maybe it would be nice if FCK added the option to make p (Normal) option in the Format select to just remove the previously
inserted tags when in this mode:
FCKConfig.EnterMode = 'br' ;
FCKConfig.ShiftEnterMode = 'br' ;
But that is for the future.... and I need something I can make work as soon as possible.
Anybody that can help me out here?
Tue, 07/24/2007 - 11:45
#1