Skip to content
Permalink
Browse files

Merge branch 't/9994' into major

  • Loading branch information...
Reinmar committed Feb 15, 2013
2 parents 3a9b2c5 + 50d3db0 commit 85dfc9167eb8cb89838ca81dd145e654838274ed
Showing with 23 additions and 14 deletions.
  1. +3 −1 core/editor.js
  2. +12 −7 core/filter.js
  3. +6 −4 plugins/liststyle/plugin.js
  4. +2 −2 plugins/tabletools/plugin.js
@@ -557,7 +557,9 @@
* @param {CKEDITOR.commandDefinition} commandDefinition The command definition.
*/
addCommand: function( commandName, commandDefinition ) {
return this.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );
commandDefinition.name = commandName.toLowerCase();
var cmd = new CKEDITOR.command( this, commandDefinition );
return this.commands[ commandName ] = cmd;
},

/**
@@ -72,9 +72,9 @@
this.customConfig = false;

// Add editor's default rules.
this.allow( 'p br', 1 );
this.allow( allowedContent, 1 );
this.allow( editor.config.extraAllowedContent, 1 );
this.allow( 'p br', 'default', 1 );
this.allow( allowedContent, 'config', 1 );
this.allow( editor.config.extraAllowedContent, 'extra', 1 );

//
// Add filter listeners to toHTML and toDataFormat events.
@@ -97,7 +97,7 @@
// Rules object passed in editorOrRules argument - initialize standalone filter.
else {
this.customConfig = false;
this.allow( editorOrRules, 1 );
this.allow( editorOrRules, 'default', 1 );
}
};

@@ -106,12 +106,13 @@
* Adds specified rules to the filter.
*
* @param {Object/String/CKEDITOR.style/Object[]/String[]/CKEDITOR.style[]} newRules
* @param {String} [featureName] Name of a feature that allows this content.
* @param {Boolean} [overrideCustom] By default this method will reject any rules
* if default {@link CKEDITOR.config#allowedContent} is defined. Pass `true`
* to force rules addition.
* @returns {Boolean} Whether rules were accepted.
*/
allow: function( newRules, overrideCustom ) {
allow: function( newRules, featureName, overrideCustom ) {
if ( this.disabled )
return false;

@@ -133,7 +134,7 @@
newRules = convertStyleToRules( newRules );
else if ( CKEDITOR.tools.isArray( newRules ) ) {
for ( i = 0; i < newRules.length; ++i )
ret = this.allow( newRules[ i ], overrideCustom );
ret = this.allow( newRules[ i ], featureName, overrideCustom );
return ret; // Return last status.
}

@@ -156,6 +157,9 @@
if ( groupName.charAt( 0 ) != '$' )
rule.elements = groupName;

if ( featureName )
rule.featureName = featureName.toLowerCase();

// Save rule and remember to optimize it.
this.allowedContent.push( rule );
rulesToOptimize.push( rule );
@@ -297,6 +301,7 @@
* @param feature.allowedContent HTML that can be generated by this feature.
* @param feature.requiredContent Minimal HTML that this feature must be allowed to
* generate for it to be able to function at all.
* @param {String} feature.name Name of this feature.
* @returns {Boolean} Whether this feature can be enabled.
*/
addFeature: function( feature ) {
@@ -313,7 +318,7 @@

// If default configuration (will be checked inside #allow()),
// then add allowed content rules.
this.allow( feature.allowedContent );
this.allow( feature.allowedContent, feature.name );

this.addTransformations( feature.contentTransformations );
this.addContentForms( feature.contentForms );
@@ -11,19 +11,21 @@
if ( editor.blockless )
return;

var cmd = new CKEDITOR.dialogCommand( 'numberedListStyle', {
var def, cmd;

def = new CKEDITOR.dialogCommand( 'numberedListStyle', {
requiredContent: 'ol',
allowedContent: 'ol{list-style-type}[start]'
} );
editor.addCommand( 'numberedListStyle', cmd );
cmd = editor.addCommand( 'numberedListStyle', def );
editor.addFeature( cmd );
CKEDITOR.dialog.add( 'numberedListStyle', this.path + 'dialogs/liststyle.js' );

cmd = new CKEDITOR.dialogCommand( 'bulletedListStyle', {
def = new CKEDITOR.dialogCommand( 'bulletedListStyle', {
requiredContent: 'ul',
allowedContent: 'ul{list-style-type}'
} );
editor.addCommand( 'bulletedListStyle', cmd );
cmd = editor.addCommand( 'bulletedListStyle', def );
editor.addFeature( cmd );
CKEDITOR.dialog.add( 'bulletedListStyle', this.path + 'dialogs/liststyle.js' );

@@ -679,8 +679,8 @@
}
});
}
function addCmd( name, cmd ) {
editor.addCommand( name, cmd );
function addCmd( name, def ) {
var cmd = editor.addCommand( name, def );
editor.addFeature( cmd );
}

0 comments on commit 85dfc91

Please sign in to comment.
You can’t perform that action at this time.