Astonishing, close to 100K users, and nobody ever realized the TinyMCE plugin information is nonsense:

  • There is no 'font' plugin anymore (don't know for how long). It's all built-in now.
  • Fonts don't use HTML4 <font> tags anymore.
  • Two of the most important plugins, the format and style selects, were erroneously declared as 'font' plugins. The style select is completely mislabeled as "Font styles". Look here to see what it's capable of.
  • The 'style' plugin (a horrible plugin to edit any CSS property), formerly labeled "Style properties", has been renamed to "CSS style", the official name, in order to disambiguate with above style select.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

smk-ka’s picture

Status: Active » Needs review
FileSize
2.04 KB
sun’s picture

Interestingly, I don't even find that 'font' plugin in TinyMCE 2.x... LOL! Looks like this was blatantly taken over from tinymce module ;)

Might be worth to do a general double-check of plugins then. (Not to hold up this patch, of course)

TwoD’s picture

Also related, though I doubt anyone's noticed it either: convert_fonts_to_spans setting has been enabled by default since 3.0a1, and tinymce.inc only checks if to enable it, so unchecking the box on the profile has no effect. I tried forcing it to false, at which point TinyMCE would still generate spans, though it'd preserve existing font tags. That doesn't change after applying the patch so I guess the extended_valid_elements part isn't needed in this case.

Patch looks good and does what it's supposed to, though after applying it I had to recheck the button to make the font selector appear again. Upgrade path for editor settings?

sun’s picture

Component: Code » Editor - TinyMCE
sun’s picture

Status: Needs review » Needs work
+++ editors/tinymce.inc	11 Aug 2010 14:54:30 -0000
@@ -387,6 +387,8 @@ function wysiwyg_tinymce_plugins($editor
+        'formatselect' => t('Block format'), 'styleselect' => t('Styles'),

I just tested manually and the styleselect plugin/button allows to apply arbitrary CSS classes to selected text (not blocks/containers). Kinda weird.

At the very least, I think that the label should contain the term "(CSS) class" instead of "style".

Not sure how to communicate in the label that it only applies to inline nodes, and not to blocks/containers.

+++ editors/tinymce.inc	11 Aug 2010 14:54:30 -0000
@@ -451,13 +453,6 @@ function wysiwyg_tinymce_plugins($editor
-      'extended_valid_elements' => array('font[face|size|color|style],span[class|align|style]'),

I'm a bit worried whether removing this hidden definition of span elements for valid elements might break other (third-party) plugins. Of course, those plugins should normally define extended_valid_elements on their own.

Also not sure what the defaults are - but we need to ensure that the font plugins/buttons actually work as intended with this patch.

+++ editors/tinymce.inc	11 Aug 2010 14:54:30 -0000
@@ -523,7 +518,7 @@ function wysiwyg_tinymce_plugins($editor
     'style' => array(
       'path' => $editor['library path'] . '/plugins/style',
-      'buttons' => array('styleprops' => t('Style properties')),
+      'buttons' => array('styleprops' => t('CSS style')),

The style plugin actually invokes a dialog containing a full-blown style editor; would be a good to clarify that in the label as well; e.g., "Advanced CSS styles"

Powered by Dreditor.

TwoD’s picture

I just tested manually and the styleselect plugin/button allows to apply arbitrary CSS classes to selected text (not blocks/containers). Kinda weird.

If a whole block element, img, p etc is selected, the class will be applied to it instead of a new span.

At the very least, I think that the label should contain the term "(CSS) class" instead of "style".

Starting with TinyMCE 3.3 the 'styleselect' button uses the style_formats setting which allows for more changes than just the class name. It still falls back to using the theme_advanced_styles setting and lastly falls back to parsing available classes from the content_css stylesheet.
How about changing the label to something like "(CSS) styles dropdown/list"?

I'm a bit worried whether removing this hidden definition of span elements for valid elements might break other (third-party) plugins.

The default is

@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|"
+ "onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|"
+ "onkeydown|onkeyup], ... -span

(tag removed if empty) - valid_elements. The main difference being the align attribute but no plugin uses it afaik. I can't find it in the XHTML specification and the HTML 4.01 specs list it as deprecated and not explicitly allowed in span tags. The editor prefers using styles for this purpose anyway.

TwoD’s picture

Version: 6.x-2.1 » 7.x-2.x-dev
Status: Needs work » Needs review
FileSize
1.8 KB

Reroll of #1 with the "Advanced CSS styles" change.

Should we change anything else or is this RTBC? Would like to get this in for the next release.

paskainos’s picture

How about rolling in spellchecker, cross-posted at Add wysiwyg_external_plugins module?

drzraf’s picture

spellchecker is a more complex plugin, why waiting yet another year ?

I rerolled this patch :
- it uses -p1 so git apply applies.
- it removes URL for "safari" (< 3.3) and "flash" (< 3) plugins which are obsolete. I think these plugins should be completely removed, but I'll wait for your opinions.
- it fixes the URL as per #1116442: URLs to TinyMCE plugin wikis have changed (including the comment #4 about tinymce.com URL).

URL changed with:
sed -i 's;http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/;http://www.tinymce.com/wiki.php/Plugin:;'
URL tested with:
sed -n "/Plugin:/s/.*\(http[^']*\).*/\1/p" editors/tinymce.inc|wget --max-redirect=2 -S -i - 2>&1|grep -i http

Jorrit’s picture

Works for me.

TwoD’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the reroll and tests, drzraf!
We could drop the url property completely if we don't have an URL, other than that I think this looks good.

The styleselect dropdown will show up as "Styles" and the more advanced editor is called "Advanced CSS Styles", which I think is enough to imply the first one is simpler (predefined list of available styles) while the latter allows for more granularity.

Any objections to committing this and dealing with spellchecker [and any other plugins introduced in recent versions] in another issue?

drzraf’s picture

fizk’s picture

bump

TwoD’s picture

Version: 7.x-2.x-dev » 7.x-2.1
Status: Reviewed & tested by the community » Fixed

As far as I can tell by looking at http://www.tinymce.com/develop/changelog/index.php?type=tinymce, all the latest and relevant TinyMCE plugin changes should be covered by this patch.

I committed #12 to all branches (D5, D6, D7). Development snapshots will be updated within 12hrs and this patch will be part of the next release.

If there are any disagreements about what to name plugins or buttons, we can take that in a follow-up patch before this reaches a release.

klonos’s picture

Great! Thanx Henrik ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.