Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#27773 closed defect (bug) (fixed)

RTL for TinyMCE buttons

Reported by: azaozz's profile azaozz Owned by: azaozz's profile 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 10 years ago.
27773.1.patch (4.2 KB) - added by azaozz 10 years ago.

Download all attachments as: .zip

Change History (11)

@azaozz
10 years ago

#1 @azaozz
10 years 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.

#2 follow-up: @nacin
10 years 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;
}

#3 follow-up: @ocean90
10 years 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

#4 @nacin
10 years 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.

#5 in reply to: ↑ 3 @DrewAPicture
10 years ago

  • Keywords needs-docs added

Replying to ocean90:

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

@azaozz
10 years ago

#6 @azaozz
10 years 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.

#7 in reply to: ↑ 2 @azaozz
10 years 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.

#8 @azaozz
10 years 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

#9 @azaozz
10 years 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.