X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fdiv%2Fdialogs%2Fdiv.js;h=c63e061d33cfb432ff56d5902f207531f156b377;hp=619a3f883b70c17e6e7aec45bf599f34bf3cbd9f;hb=c6e377a02b54abc07129d72b632763c727476a15;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6 diff --git a/_source/plugins/div/dialogs/div.js b/_source/plugins/div/dialogs/div.js index 619a3f8..c63e061 100644 --- a/_source/plugins/div/dialogs/div.js +++ b/_source/plugins/div/dialogs/div.js @@ -27,10 +27,10 @@ { var retval = []; var children = element.getChildren(); - for( var i = 0 ; i < children.count() ; i++ ) + for ( var i = 0 ; i < children.count() ; i++ ) { var child = children.getItem( i ); - if( ! ( child.type === CKEDITOR.NODE_TEXT + if ( ! ( child.type === CKEDITOR.NODE_TEXT && ( /^[ \t\n\r]+$/ ).test( child.getText() ) ) ) retval.push( child ); } @@ -55,7 +55,7 @@ delete definition.div; // Exclude 'td' and 'th' when 'wrapping table' - if( editor.config.div_wrapTable ) + if ( editor.config.div_wrapTable ) { delete definition.td; delete definition.th; @@ -94,7 +94,7 @@ this.foreach( function( field ) { // Exclude layout container elements - if( /^(?!vbox|hbox)/.test( field.type ) ) + if ( /^(?!vbox|hbox)/.test( field.type ) ) { if ( !field.setup ) { @@ -149,13 +149,13 @@ var blockTag = editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p'; // collect all included elements from dom-iterator - for( i = 0 ; i < ranges.length ; i++ ) + for ( i = 0 ; i < ranges.length ; i++ ) { iterator = ranges[ i ].createIterator(); - while( ( block = iterator.getNextParagraph() ) ) + while ( ( block = iterator.getNextParagraph() ) ) { // include contents of blockLimit elements. - if( block.getName() in divLimitDefinition ) + if ( block.getName() in divLimitDefinition ) { var j, childNodes = block.getChildren(); for ( j = 0 ; j < childNodes.count() ; j++ ) @@ -164,7 +164,7 @@ else { // Bypass dtd disallowed elements. - while( !dtd[ block.getName() ] && block.getName() != 'body' ) + while ( !dtd[ block.getName() ] && block.getName() != 'body' ) block = block.getParent(); addSafely( containedBlocks, block, database ); } @@ -176,7 +176,7 @@ var blockGroups = groupByDivLimit( containedBlocks ); var ancestor, blockEl, divElement; - for( i = 0 ; i < blockGroups.length ; i++ ) + for ( i = 0 ; i < blockGroups.length ; i++ ) { var currentNode = blockGroups[ i ][ 0 ]; @@ -188,11 +188,11 @@ divElement = new CKEDITOR.dom.element( 'div', editor.document ); // Normalize the blocks in each group to a common parent. - for( j = 0; j < blockGroups[ i ].length ; j++ ) + for ( j = 0; j < blockGroups[ i ].length ; j++ ) { currentNode = blockGroups[ i ][ j ]; - while( !currentNode.getParent().equals( ancestor ) ) + while ( !currentNode.getParent().equals( ancestor ) ) currentNode = currentNode.getParent(); // This could introduce some duplicated elements in array. @@ -410,13 +410,13 @@ }, onOk : function() { - if( command == 'editdiv' ) + if ( command == 'editdiv' ) containers = [ this._element ]; else containers = createDiv( editor, true ); // Update elements attributes - for( var i = 0 ; i < containers.length ; i++ ) + for ( var i = 0 ; i < containers.length ; i++ ) this.commitContent( containers[ i ] ); this.hide(); }