WordPress.org

Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#27773 closed defect (bug) (fixed)

RTL for TinyMCE buttons

Reported by: azaozz Owned by: azaozz
Milestone: 3.9 Priority: high
Severity: normal Version: 3.9
Component: TinyMCE Keywords: has-patch commit needs-docs
Focuses: rtl Cc:

Description

TinyMCE doesn't look right in RTL mode.

Attachments (2)

27773.patch (1.4 KB) - added by azaozz 12 months ago.
27773.1.patch (4.2 KB) - added by azaozz 12 months ago.

Download all attachments as: .zip

Change History (11)

@azaozz12 months ago

comment:1 @azaozz12 months ago

  • Keywords has-patch commit added

Apart from the 'directionality' setting, TinyMCE 4.0 needs another setting in the translation object. 27773.patch also fixes adding the LTR button.

comment:2 follow-up: @nacin12 months ago

Seems fine. Was theme_advanced_buttons1 some older thing? Do we need to be back compat with that?

This particular CSS should instead be:

/* @noflip */
.mce-rtl .mce-flow-layout > div > div {
    direction: rtl;
}

comment:3 follow-up: @ocean9012 months ago

The PHP docs should be updated for the change in src/wp-includes/functions.php too.


Was theme_advanced_buttons1 some older thing? Do we need to be back compat with that?

All theme_advanced_* settings are gone, since the "simple" and "advanced" themes where removed in 4.0.

ack "theme_advanced_" -l returns in trunk:

  • wp-includes/functions.php (handled by this patch)
  • wp-includes/js/tinymce/utils/form_utils.js (does it need a change?)

in 3.8:

  • wp-includes/class-wp-editor.php
  • wp-includes/functions.php
  • wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js
  • wp-includes/js/tinymce/plugins/fullscreen/editor_plugin_src.js
  • wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm
  • wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
  • wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
  • wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js
  • wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js
  • wp-includes/js/tinymce/themes/advanced/editor_template.js
  • wp-includes/js/tinymce/themes/advanced/editor_template_src.js
  • wp-includes/js/tinymce/themes/advanced/js/image.js
  • wp-includes/js/tinymce/themes/advanced/js/link.js
  • wp-includes/js/tinymce/themes/advanced/js/source_editor.js
  • wp-includes/js/tinymce/utils/form_utils.js

comment:4 @nacin12 months ago

  • Owner set to azaozz
  • Status changed from new to assigned

azaozz: Good to go given the quick adjustments pointed out by ocean90 and me.

comment:5 in reply to: ↑ 3 @DrewAPicture12 months ago

  • Keywords needs-docs added

Replying to ocean90:

The PHP docs should be updated for the change in src/wp-includes/functions.php too.

@azaozz12 months ago

comment:6 @azaozz12 months ago

In 27773.1.patch:

  • Add _dir: 'rtl' to the TinyMCE translation object.
  • Fix editor.css for RTL. Use /* @noflip */ for CSSJanus.
  • Fix the Edit and Delete buttons position for wpview and images.
  • Fix _mce_set_direction() documentation and adding of the 'ltr' button.

comment:7 in reply to: ↑ 2 @azaozz12 months ago

Replying to nacin:

Yeah, as @ocean90 points out, this is the old setting for the toolbar buttons, the new one is 'toolbar1'. Our filters for adding buttons haven't changed, but _mce_set_direction() works on the whole init array after we have added the buttons as a string.

We probably can merge _mce_set_direction() in WP_Editors. Currently it is run by a default filter. If a plugin wants to change any of the RTL settings, it still has to hook in 'tiny_mce_before_init' and now also in 'wp_mce_translation'.

The theme_advanced_styles used in form_utils.js is for back-compat. The whole /tinymce/utils/ directory is part of the compat3x plugin.

comment:8 @azaozz12 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 28094:

RTL for TinyMCE:

  • Add _dir: 'rtl' to the TinyMCE translation object.
  • Fix editor.css for RTL.
  • Fix the Edit and Delete buttons position for wpview and images.
  • For _mce_set_direction(), update documentation and fix adding the 'ltr' button.

Fixes #27773

comment:9 @azaozz12 months ago

Committed with the extra changes for easier testing. Feel free to reopen if other tweaks are needed.

Note: See TracTickets for help on using tickets.