Opened 12 years ago
Last modified 10 years ago
#10356 confirmed New Feature
"learn mode" for ACF
Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.1 |
Keywords: | Cc: |
Description
Many people will disable ACF because it modifies whatever content exists upon initial load if the classes, attributes, styles... haven't been added to the allowedContent.
A simple example is the stylesheet parser: you have been forced to make it disable the ACF in order to have things work.
Instead, the ACF could have an optional "learn mode" that adds whatever exists in the initial source to the allowedContent for that instance (maybe even configurable to work only on elements/classes/attributes/styles)
So now the stylesheet parser doesn't need to completely disable ACF: the first run of ACF sees some classes that aren't included in the ACF, so it adds those classes. Then the stylesheet is loaded and adds all the desired classes for the content. Nothing has been lost. The user then tries to paste something from an external page and the ACF is run and cleans up removing anything undesired. If the user copies and pastes something inside the editor, then all that content now is allowed and no filtering happens. everyone is happy.
Change History (3)
comment:1 Changed 12 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 10 years ago by
This would be very helpful to me - I have a web site that uses CKEditor. Surprised to hear that a one-year-old site would be considered 'legacy'! There is a lot of content in the site, and figuring out the ACF rules would be painful in the extreme. That is why I disabled ACF, however this also means lots of noise gets injected into the HTML, which makes our product look bad. A learn mode would be terrific.
If a plugin could be made that scanned the HTML stored in the currently displayed page, and then create very restrictive rules to allow only the HTML elements and attributes found in the page, it could then combine those rules with any existing allow/disallow rules via user assistance. The plugin would pop up a dialog that allows the the user accept, ignore or negate the changes, one by one or use checkboxes to perform operations on multiple rules, thereby moving each selected element/attribute between the Allowed and Disallowed statuses, or removing them from both statuses.
comment:3 Changed 10 years ago by
I neglected to say the user would then have to copy the generated JS to their ckeditor folder manually
Quote from #10136:
Lear mode could help us solve this issue, because the ACF could be learning from the beginning to the instanceReady, so it would also include stylesheets.
And this is very interesting idea in general - it solves the common problem when one wants to limit pasting, but he doesn't want to configure ACF.
Although:
Anyway, thanks Alfonso for a great idea!