Ticket #6082 (closed New Feature: fixed)

Opened 4 years ago

Last modified 4 years ago

Introduce the useComputedState setting to control default toolbar states

Reported by: fredck Owned by: fredck
Priority: Normal Milestone: CKEditor 3.4
Component: UI : Toolbar Version:
Keywords: IBM Cc: satya, damo

Description

There are two toolbar features that use computed values to indicate their on/off states: alignment and bidi.

In some cases though, it's better to give the user the possibility to explicitly apply these features. For example, a user may create contents in LTR, and publish them in various formats, including RTL.

To solve this case, we could introduce the useComputedState setting, which would be a generic flag indicating whether computed values or "real" values should be used by plugins on their state evaluation.

Attachments

6082.patch (4.6 KB) - added by fredck 4 years ago.
6082_2.patch (5.6 KB) - added by fredck 4 years ago.
6082_3.patch (6.8 KB) - added by fredck 4 years ago.
6082_4.patch (7.0 KB) - added by fredck 4 years ago.

Change History

Changed 4 years ago by fredck

comment:1 Changed 4 years ago by fredck

  • Owner set to fredck
  • Status changed from new to review

comment:2 Changed 4 years ago by Saare

  • Status changed from review to review_failed
  • We should also consider the "direction" CSS property in the bidi plugin (of course, it's priority is higher so it should be checked before the dir attribute).
  • We should also consider the "align" attribute in the justify plugin (of course, it's priority is lower so it should be checked after the "text-align" CSS property).
  • In the justify plugin, we should use .replace( alignRemoveRegex, '' ) even if we're not using the computed state.

Changed 4 years ago by fredck

comment:3 Changed 4 years ago by fredck

  • Status changed from review_failed to review

comment:4 follow-up: ↓ 5 Changed 4 years ago by Saare

  • Status changed from review to review_failed
  • Load the following html:
    <div style="text-align: right">
    	<p style="text-align: left">
    		This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>
    </div>
    
  • Click on the paragarph.
  • Click on the 'Left Justify' button.

The paragraph moves to the right instead of staying at the left.

Changed 4 years ago by fredck

comment:5 in reply to: ↑ 4 Changed 4 years ago by fredck

  • Status changed from review_failed to review

Replying to Saare:

Note that in your tc, it *is* correct to have the paragraph moving right. The only problem is that it was not anymore possible to make it left aligned.

With this new patch, I've fixed that, and also optimized other cases, still trying to make the solution simple and efficient.

comment:6 Changed 4 years ago by Saare

  • Status changed from review to review_failed
  • You can remove the alignRemoveRegex variable.
  • I can not anymore use the justify buttons AT ALL when `useComputedState' is true.

Changed 4 years ago by fredck

comment:7 Changed 4 years ago by fredck

  • Status changed from review_failed to review

Ops... it was a small last minute change before creating the previous patch. One char changed, and everything should be ok now.

comment:8 Changed 4 years ago by Saare

  • Status changed from review to review_passed

Please add the @since tag to the config description before commiting.

comment:9 Changed 4 years ago by fredck

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

Fixed with [5784].

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy