Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9994 closed New Feature (fixed)

Mark which allowed content rules were added by which features

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.1 RC
Component: General Version:
Keywords: Drupal Cc: wim.leers@…

Description (last modified by Jakub Ś)

This isssue is extraced from #9829.

Make it possible to create feature => allowed content object.

Since Drupal will have something like drag&drop toolbar builder it will need to know which button adds which "allowed content"

Change History (10)

comment:1 Changed 4 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:2 Changed 4 years ago by Piotrek Koszuliński

Summary: Mark which allowed content rules were adde by which featuresMark which allowed content rules were added by which features

comment:3 Changed 4 years ago by Jakub Ś

Description: modified (diff)

comment:4 Changed 4 years ago by Piotrek Koszuliński

I pushed quick preview of how this issue should be solved to t/9994.

With this code it is possible to create a feature => contentn map.

var rules = CKEDITOR.instances.editor1.filter.allowedContent,
	rule, name
	obj = {};

for ( var i = rules.length; i > 0; ) {
	rule = rules[ --i ];
	name = rule.featureName || ':(';
	if ( !obj[ name ] )
		obj[ name ] = [];
	obj[ name ].push( rule );
}

// obj contains feature => content map

This is not complete yet, so you'll see few rules without names (in ':(' property).

comment:5 Changed 4 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:6 Changed 4 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed t/9994 to dev and tests (both based on t/9829).

Last edited 4 years ago by Piotrek Koszuliński (previous) (diff)

comment:7 Changed 4 years ago by Piotrek Koszuliński

Rebased branched on major.

comment:8 Changed 4 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:9 Changed 4 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Merged to major on git:85dfc91 on dev and 5263b41 on tests.

comment:10 Changed 4 years ago by Wim Leers

Quite elegant patch :)

Referenced at http://drupal.org/node/1894644#comment-7115604, where this feature will be put to use.

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