While working with fckeditor in wysiwyg we where confused that custom css styles are getting ignored by fckeditor.
Comparing tinymce.inc and fckeditor.inc i see there's a missing settings wrapper for css_classes settings.
I'm currently checking how to bring this in.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 671528-3-fck-styles.patch | 1.36 KB | alan d. |
| #4 | 671528-2-fck-styles.patch | 945 bytes | alan d. |
| #1 | 671528_wysiwyg_styles.patch | 841 bytes | miro_dietiker |
Comments
Comment #1
miro_dietikerTried adding it using the CustomStyles dropdown.
In fckeditor an Element like span is needed to assign attributes and styles. How should this work in general?
I'm pretty sure the usage of t() needs work (omitted in tinymce.inc too). But we'd need something to translate the class titles into the right language.
What do you think of it?
Comment #2
twodWe should omit t() here. t() stores all the untranslated strings it finds in the database, so everything entered into the textarea will be permanently saved if it gets this far. There will also be no way to remove any translations if a class is removed from the textarea, nor will it be easy to figure out in which context these titles are used when encountered during translation. I don't know of a good solution to this problem unless the editor provides an easy way to translate the classnames prior to printing them out, which I don't think it does.
I'm on crack. Are you, too?
Comment #3
sunComment #4
alan d. commented@miro Just a word of warning about t(), is is not meant to take user data directly anyway. I guess these classes are escaped before being presented to the user, I hate security updates!
Tested on the following:
version = "6.x-2.x-dev"
datestamp = "1265329172"
The styles applied fine into a span element.
One very cool feature would be to support the target element attribute rather than always applying to a span. See the sites/all/libraries/fckeditor/fckstyles.xml
Comment #5
alan d. commentedAnd the very first time that I required the defined classes was on a p tag, so here is an updated one that allows for three arguments on the list. The third, if present and not empty, is used for the target element.
Do these tags require a check_plain?
Comment #6
hawleyal commentedThis patch does add the custom CSS classes.
However, it only removes the first FCKeditor class (Red Title).
It leaves the rest of the FCKeditor classes intact.
I need to be able to control what classes my users can see and click.
Thanks.
-AH
Comment #7
nrackleff commentedSubscribing
Comment #8
japanitrat commentedsubscribe