Changes between Initial Version and Version 1 of Ticket #9829, comment 12


Ignore:
Timestamp:
Jan 11, 2013, 12:50:45 PM (11 years ago)
Author:
Piotrek Koszuliński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9829, comment 12

    initial v1  
    44These methods aren't part of unit tests. {{{DataFilter#test()}}} is a public method which plugins use to check if some content is allowed. It accepts the string based format accepted by allowedContent configuration and basic {{{CKEDITOR.style}}} objects.
    55
     6[[BR]]
     7
    68> On second thought and on grepping the code base, it seems like this is necessary to figure out whether a button should be allowed to appear at all in the toolbar, i.e. to check whether it doesn't conflict with the `dataFilter` configuration?
    79
    810Exactly :). BTW. `git diff master...t/9892` is convenient way of checking what's changed since this branch diverged from master.
     11
     12[[BR]]
     13
    914
    1015>
     
    1318
    1419Hmm. You're right. I asked for feedback, so at least basic comments for the most important stuff would be great. I'll add them asap.
     20
     21[[BR]]
    1522
    1623>
     
    2128"blue" doesn't look like a tag for me, because semicolons are used for rules separation. But you may be right that grouping classes by "()" will be clearer for people who hasn't spent hours starring at allowedContent like me :D. Let's see what others think.
    2229
     30[[BR]]
     31
    2332>Even better would be if it would resemble a well-known syntax: inspired by regular expressions syntax, it could become this:
    2433> {{{
     
    2837>
    2938
    30 I omitted pipes leaving them for values separator. If we'll decide to implement simple values checking then it would be great to have: {{{img[attr=val1|val2|val3, attr2=...]}}}. Also in regexp like fashion. Comma also has one advantage over pipe for being an attributes, classes and styles separator - in natural language we used to put space after it, what makes text more readable. And this is now supported by {{{dataFilter}}}. However, such a space would change regexp meaning.
     39I omitted pipes leaving them for values separator. If we'll decide to implement simple values checking then it would be great to have: {{{img[attr=val1|val2|val3, attr2=...]}}}. Also in regexp like fashion. Comma also has one advantage over pipe for being an attributes, classes and styles separator - in natural language we used to put space after it, what makes text more readable. And this is now supported by {{{dataFilter}}}. However, such a space after pipe would change regexp meaning.
     40
     41[[BR]]
    3142
    3243>
     
    4152Opposite way is presented by the 'editor 3' (4th one :). Buttons are explicitly removed from toolbar by 'removeButtons' and 'removePlugins' configs and their features are magically stripped out from content of the editor. See that there are no image, no anchors, no strike-through *in the content* of editor 3.
    4253
     54[[BR]]
     55
    4356> > justify - here I had problem how to verify if these buttons are allowed - I'm checking only for 'p{text-align}'
    4457> That makes sense, but I just wanted to make sure that one thing will become possible eventually: in Drupal, we don't ever want `style` attributes in our HTML content. Everything should be CSS-overridable. What we want instead for alignment, is the use of classes. IIRC, it's possible to have the alignment buttons set classes on elements, so that's a non-issue, but I want to make sure that it's also possible that we can also configure `allowedContent` accordingly.
    4558
    4659:) I was wondering if anyone will notice that I forgot about this. You're right that [http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-justifyClasses it is possible to force justify to apply classes rather than inline styles]. Plugin should take that into consideration and basing on configuration allow styles or classes. It's of course doable, but I forgot about that :).
     60
     61[[BR]]
    4762
    4863>
     
    5570In any case - updating dialogs will require some amount of work, but it would be pretty easy work - each config dependent field should be displayed/enabled if it is validated by {{{dataFilter.test()}}}. We need to check if we can simplify this task even more by some magic.
    5671
     72[[BR]]
     73
    5774>
    5875> > I hope that you liked my child :). Feedback is greatly appreciated. Especially regarding API.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy