Skip to content

Commit

Permalink
Merge branch 't/10097' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Feb 20, 2013
2 parents 013be3c + ebaf7c6 commit 69dcd98
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
16 changes: 9 additions & 7 deletions core/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
fragment.forEach( function( el ) {
if ( el.type == CKEDITOR.NODE_ELEMENT )
filterFn( el, rules, transformations, toBeRemoved, toHtml );
else if ( el.type == CKEDITOR.NODE_COMMENT && el.value.match( /^{cke_protected}(?!{C})/ ) ) {
else if ( el.type == CKEDITOR.NODE_COMMENT && el.value.match( /^\{cke_protected\}(?!\{C\})/ ) ) {
if ( !filterProtectedElement( el, protectedRegexs, filterFn, rules, transformations, toHtml ) )
toBeRemoved.push( el );
}
Expand Down Expand Up @@ -596,7 +596,7 @@
// Return true when all items are valid.
function applyRuleToArray( itemsRule, items, validItems ) {
if ( !itemsRule )
return;
return false;

// True means that all elements of array are accepted (the asterix was used for classes).
if ( itemsRule === true )
Expand All @@ -613,7 +613,7 @@

function applyRuleToHash( itemsRule, items, validItems ) {
if ( !itemsRule )
return;
return false;

if ( itemsRule === true )
return true;
Expand Down Expand Up @@ -667,7 +667,7 @@

for ( i = 0; i < props.length; ++i ) {
prop = props[ i ];
if ( prop.indexOf( '!' ) == 0 )
if ( prop.indexOf( '!' ) === 0 )
req.push( ( props[ i ] = prop.slice( 1 ) ) );
}

Expand All @@ -677,7 +677,7 @@
// Filter element protected with a comment.
// Returns true if protected content is ok, false otherwise.
function filterProtectedElement( comment, protectedRegexs, filterFn, rules, transformations, toHtml ) {
var source = decodeURIComponent( comment.value.replace( /^{cke_protected}/, '' ) ),
var source = decodeURIComponent( comment.value.replace( /^\{cke_protected\}/, '' ) ),
protectedFrag,
toBeRemoved = [],
node, i, match;
Expand Down Expand Up @@ -898,7 +898,7 @@
return {};

var keys = str.split( /\s*,\s*/ ).sort(),
obj = {}
obj = {};

while ( keys.length )
obj[ keys.shift() ] = TEST_VALUE;
Expand Down Expand Up @@ -1004,7 +1004,7 @@
}

// < elements >< styles, attributes and classes >< separator >
var rulePattern = /^([a-z0-9*\s]+)((?:\s*{[!\w\-,\s\*]+}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
var rulePattern = /^([a-z0-9*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
groupsPatterns = {
styles: /{([^}]+)}/,
attrs: /\[([^\]]+)\]/,
Expand Down Expand Up @@ -1179,6 +1179,8 @@
return value in validator;
};
}

return false;
}

//
Expand Down
2 changes: 1 addition & 1 deletion core/htmldataprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
* @returns {String}
*/
toHtml: function( data, context, fixForBody ) {
var editor = this.editor
var editor = this.editor;

// Fall back to the editable as context if not specified.
if ( !context && context !== null )
Expand Down
2 changes: 2 additions & 0 deletions core/htmlparser/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend( new CKEDITOR.html
}

this.value = comment;

return true;
},

/**
Expand Down
5 changes: 3 additions & 2 deletions core/htmlparser/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ CKEDITOR.htmlParser.cssStyle = function() {
// different type, then make the replacement filter itself.
if ( element.type != CKEDITOR.NODE_ELEMENT ) {
this.replaceWith( element );
element.filter( filter );
return;
return false;
}

// This indicate that the element has been dropped by
Expand Down Expand Up @@ -240,6 +239,8 @@ CKEDITOR.htmlParser.cssStyle = function() {

if ( !element.isEmpty )
this.filterChildren( filter );

return true;
},

/**
Expand Down
2 changes: 1 addition & 1 deletion plugins/format/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CKEDITOR.plugins.add( 'format', {
}

// Hide entire combo when all formats are rejected.
if ( stylesCount == 0 )
if ( stylesCount === 0 )
return;

editor.ui.addRichCombo( 'Format', {
Expand Down
2 changes: 2 additions & 0 deletions plugins/preview/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
doc.body.innerHTML += '';
}, 0 );
}

return true;
}
};

Expand Down
1 change: 0 additions & 1 deletion plugins/stylescombo/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@
}
styles = {};
stylesList = [];
loadStylesSet();
}
});
}
Expand Down

0 comments on commit 69dcd98

Please sign in to comment.