Index: _source/plugins/styles/plugin.js
===================================================================
--- _source/plugins/styles/plugin.js (revision 5347)
+++ _source/plugins/styles/plugin.js Tue Apr 20 02:35:43 CST 2010
@@ -550,7 +550,7 @@
styleRange.insertNode( styleNode );
// Let's merge our new style with its neighbors, if possible.
- mergeSiblings( styleNode );
+ styleNode.mergeSiblings();
// As the style system breaks text nodes constantly, let's normalize
// things for performance.
@@ -624,7 +624,7 @@
* no difference that they're separate entities in the DOM tree. So, merge
* them before removal.
*/
- mergeSiblings( element );
+ element.mergeSiblings();
removeFromElement( this, element );
}
@@ -1057,51 +1057,14 @@
if ( firstChild )
{
// Check the cached nodes for merging.
- mergeSiblings( firstChild );
+ firstChild.mergeSiblings();
if ( lastChild && !firstChild.equals( lastChild ) )
- mergeSiblings( lastChild );
+ lastChild.mergeSiblings();
}
}
}
- function mergeSiblings( element )
- {
- if ( !element || element.type != CKEDITOR.NODE_ELEMENT || !CKEDITOR.dtd.$removeEmpty[ element.getName() ] )
- return;
-
- mergeElements( element, element.getNext(), true );
- mergeElements( element, element.getPrevious() );
- }
-
- function mergeElements( element, sibling, isNext )
- {
- if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT )
- {
- var hasBookmark = sibling.getAttribute( '_fck_bookmark' );
-
- if ( hasBookmark )
- sibling = isNext ? sibling.getNext() : sibling.getPrevious();
-
- if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT && element.isIdentical( sibling ) )
- {
- // Save the last child to be checked too, to merge things like
- // =>
- var innerSibling = isNext ? element.getLast() : element.getFirst();
-
- if ( hasBookmark )
- ( isNext ? sibling.getPrevious() : sibling.getNext() ).move( element, !isNext );
-
- sibling.moveChildren( element, !isNext );
- sibling.remove();
-
- // Now check the last inner child (see two comments above).
- if ( innerSibling )
- mergeSiblings( innerSibling );
- }
- }
- }
-
function getElement( style, targetDocument )
{
var el;
Index: _source/plugins/scayt/plugin.js
===================================================================
--- _source/plugins/scayt/plugin.js (revision 5340)
+++ _source/plugins/scayt/plugin.js Tue Apr 20 02:24:29 CST 2010
@@ -67,6 +67,11 @@
var scayt_control = new window.scayt( oParams );
+ scayt_control.afterMarkupRemove.push( function( node )
+ {
+ ( new CKEDITOR.dom.element( node, scayt_control.document ) ).mergeSiblings();
+ } );
+
// Copy config.
var lastInstance = plugin.instances[ editor.name ];
if ( lastInstance )
@@ -257,7 +262,7 @@
var protocol = document.location.protocol;
// Default to 'http' for unknown.
protocol = protocol.search( /https?:/) != -1? protocol : 'http:';
- var baseUrl = 'svc.spellchecker.net/spellcheck31/lf/scayt/scayt22.js';
+ var baseUrl = 'svc.spellchecker.net/spellcheck31/lf/scayt24/loader__base.js';
var scaytUrl = editor.config.scayt_srcUrl || ( protocol + '//' + baseUrl );
var scaytConfigBaseUrl = plugin.parseUrl( scaytUrl ).path + '/';
Index: _source/core/dom/node.js
===================================================================
--- _source/core/dom/node.js (revision 5189)
+++ _source/core/dom/node.js Tue Apr 20 02:36:56 CST 2010
@@ -550,6 +550,46 @@
target.append( this.remove(), toStart );
},
+ mergeSiblings : ( function()
+ {
+ function mergeElements( element, sibling, isNext )
+ {
+ if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT )
+ {
+ var hasBookmark = sibling.getAttribute( '_fck_bookmark' );
+
+ if ( hasBookmark )
+ sibling = isNext ? sibling.getNext() : sibling.getPrevious();
+
+ if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT && element.isIdentical( sibling ) )
+ {
+ // Save the last child to be checked too, to merge things like
+ // =>
+ var innerSibling = isNext ? element.getLast() : element.getFirst();
+
+ if ( hasBookmark )
+ ( isNext ? sibling.getPrevious() : sibling.getNext() ).move( element, !isNext );
+
+ sibling.moveChildren( element, !isNext );
+ sibling.remove();
+
+ // Now check the last inner child (see two comments above).
+ if ( innerSibling )
+ innerSibling.mergeSiblings();
+ }
+ }
+ }
+
+ return function()
+ {
+ if ( this.type != CKEDITOR.NODE_ELEMENT || !CKEDITOR.dtd.$removeEmpty[ this.getName() ] )
+ return;
+
+ mergeElements( this, this.getNext(), true );
+ mergeElements( this, this.getPrevious() );
+ }
+ } )(),
+
/**
* Removes this node from the document DOM.
* @param {Boolean} [preserveChildren] Indicates that the children