Ticket #5536: 5536.patch
File 5536.patch, 1.3 KB (added by , 15 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
36 36 if ( checkReadOnly( selection ) ) 37 37 return; 38 38 39 var data = evt.data; 39 var range, 40 data = evt.data; 40 41 this.fire( 'saveSnapshot' ); 41 42 42 43 if ( this.dataProcessor ) … … 60 61 // (#6005), we need to make some checks and eventually 61 62 // delete the selection first. 62 63 63 varrange = selection.getRanges()[0],64 range = selection.getRanges()[0], 64 65 endContainer = range && range.endContainer; 65 66 66 67 if ( endContainer && … … 82 83 if ( selIsLocked ) 83 84 this.getSelection().lock(); 84 85 } 86 // Firefox breaks format when pasting using execCommand-inserthtml (#5536). 87 else if ( CKEDITOR.env.gecko ) 88 { 89 range = this.document.getSelection().getRanges()[ 0 ]; 90 // Clean selection. 91 range.extractContents(); 92 var target = range.createBookmark().startNode; 93 var container = new CKEDITOR.dom.element( 'div', this.document ); 94 container.setHtml( data ); 95 96 while( container.getChildCount() ) 97 target.insertBeforeMe( container.getChild( 0 ) ); 98 99 target.remove(); 100 } 85 101 else 86 102 this.document.$.execCommand( 'inserthtml', false, data ); 87 103