Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.5.3
[ckeditor.git]
/
_source
/
plugins
/
clipboard
/
dialogs
/
paste.js
diff --git
a/_source/plugins/clipboard/dialogs/paste.js
b/_source/plugins/clipboard/dialogs/paste.js
index
2bc3142
..
e0813ec
100644
(file)
--- a/
_source/plugins/clipboard/dialogs/paste.js
+++ b/
_source/plugins/clipboard/dialogs/paste.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-13,7
+13,8
@@
CKEDITOR.dialog.add( 'paste', function( editor )
var doc = new CKEDITOR.dom.document( win.document ),
\r
docElement = doc.$;
\r
\r
var doc = new CKEDITOR.dom.document( win.document ),
\r
docElement = doc.$;
\r
\r
- doc.getById( 'cke_actscrpt' ).remove();
\r
+ var script = doc.getById( 'cke_actscrpt' );
\r
+ script && script.remove();
\r
\r
CKEDITOR.env.ie ?
\r
docElement.body.contentEditable = "true" :
\r
\r
CKEDITOR.env.ie ?
\r
docElement.body.contentEditable = "true" :
\r
@@
-74,18
+75,24
@@
CKEDITOR.dialog.add( 'paste', function( editor )
'</script></body>' +
\r
'</html>';
\r
\r
'</script></body>' +
\r
'</html>';
\r
\r
+ var src =
\r
+ CKEDITOR.env.air ?
\r
+ 'javascript:void(0)' :
\r
+ isCustomDomain ?
\r
+ 'javascript:void((function(){' +
\r
+ 'document.open();' +
\r
+ 'document.domain=\'' + document.domain + '\';' +
\r
+ 'document.close();' +
\r
+ '})())"'
\r
+ :
\r
+ '';
\r
+
\r
var iframe = CKEDITOR.dom.element.createFromHtml(
\r
'<iframe' +
\r
' class="cke_pasteframe"' +
\r
' frameborder="0" ' +
\r
' allowTransparency="true"' +
\r
var iframe = CKEDITOR.dom.element.createFromHtml(
\r
'<iframe' +
\r
' class="cke_pasteframe"' +
\r
' frameborder="0" ' +
\r
' allowTransparency="true"' +
\r
- // Support for custom document.domain in IE.
\r
- ( isCustomDomain ?
\r
- ' src="javascript:void((function(){' +
\r
- 'document.open();' +
\r
- 'document.domain=\'' + document.domain + '\';' +
\r
- 'document.close();' +
\r
- '})())"' : '' ) +
\r
+ ' src="' + src + '"' +
\r
' role="region"' +
\r
' aria-label="' + lang.pasteArea + '"' +
\r
' aria-describedby="' + this.getContentElement( 'general', 'pasteMsg' ).domId + '"' +
\r
' role="region"' +
\r
' aria-label="' + lang.pasteArea + '"' +
\r
' aria-describedby="' + this.getContentElement( 'general', 'pasteMsg' ).domId + '"' +
\r
@@
-93,16
+100,16
@@
CKEDITOR.dialog.add( 'paste', function( editor )
'></iframe>' );
\r
\r
iframe.on( 'load', function( e )
\r
'></iframe>' );
\r
\r
iframe.on( 'load', function( e )
\r
- {
\r
- e.removeListener();
\r
- var doc = iframe.getFrameDocument().$;
\r
- // Custom domain handling is needed after each document.open().
\r
- doc.open();
\r
- if ( isCustomDomain )
\r
- doc.domain = document.domain;
\r
- doc.write( htmlToLoad );
\r
- doc.close();
\r
- }, this );
\r
+ {
\r
+ e.removeListener();
\r
+
\r
+ var doc = iframe.getFrameDocument();
\r
+ doc.write( htmlToLoad );
\r
+
\r
+ if ( CKEDITOR.env.air )
\r
+ onPasteFrameLoad.call( this, doc.getWindow().$ );
\r
+ },
\r
+ this );
\r
\r
iframe.setCustomData( 'dialog', this );
\r
\r
\r
iframe.setCustomData( 'dialog', this );
\r
\r
@@
-157,7
+164,12
@@
CKEDITOR.dialog.add( 'paste', function( editor )
var container = this.getContentElement( 'general', 'editing_area' ).getElement(),
\r
iframe = container.getElementsByTag( 'iframe' ).getItem( 0 ),
\r
editor = this.getParentEditor(),
\r
var container = this.getContentElement( 'general', 'editing_area' ).getElement(),
\r
iframe = container.getElementsByTag( 'iframe' ).getItem( 0 ),
\r
editor = this.getParentEditor(),
\r
- html = iframe.$.contentWindow.document.body.innerHTML;
\r
+ body = iframe.getFrameDocument().getBody(),
\r
+ bogus = body.getBogus(),
\r
+ html;
\r
+ bogus && bogus.remove();
\r
+ // Saving the contents in variable so changes until paste is complete will not take place (#7500)
\r
+ html = body.getHtml();
\r
\r
setTimeout( function(){
\r
editor.fire( 'paste', { 'html' : html } );
\r
\r
setTimeout( function(){
\r
editor.fire( 'paste', { 'html' : html } );
\r