X-Git-Url: https://scm.cri.ensmp.fr/git/ckeditor.git/blobdiff_plain/256592bf803e851aa7fc953e08a6e9e58d970f8c..871bad8291b6dbc29d489d95d185458caab25158:/skins/ckeditor/_source/plugins/clipboard/dialogs/paste.js diff --git a/skins/ckeditor/_source/plugins/clipboard/dialogs/paste.js b/skins/ckeditor/_source/plugins/clipboard/dialogs/paste.js new file mode 100644 index 0000000..9a659ed --- /dev/null +++ b/skins/ckeditor/_source/plugins/clipboard/dialogs/paste.js @@ -0,0 +1,223 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.dialog.add( 'paste', function( editor ) +{ + var lang = editor.lang.clipboard; + var isCustomDomain = CKEDITOR.env.isCustomDomain(); + + function onPasteFrameLoad( win ) + { + var doc = new CKEDITOR.dom.document( win.document ), + docElement = doc.$; + + var script = doc.getById( 'cke_actscrpt' ); + script && script.remove(); + + CKEDITOR.env.ie ? + docElement.body.contentEditable = "true" : + docElement.designMode = "on"; + + // IE before version 8 will leave cursor blinking inside the document after + // editor blurred unless we clean up the selection. (#4716) + if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) + { + doc.getWindow().on( 'blur', function() + { + docElement.selection.empty(); + } ); + } + + doc.on( "keydown", function( e ) + { + var domEvent = e.data, + key = domEvent.getKeystroke(), + processed; + + switch( key ) + { + case 27 : + this.hide(); + processed = 1; + break; + + case 9 : + case CKEDITOR.SHIFT + 9 : + this.changeFocus( true ); + processed = 1; + } + + processed && domEvent.preventDefault(); + }, this ); + + editor.fire( 'ariaWidget', new CKEDITOR.dom.element( win.frameElement ) ); + } + + return { + title : lang.title, + + minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 370 : 350, + minHeight : CKEDITOR.env.quirks ? 250 : 245, + onShow : function() + { + // FIREFOX BUG: Force the browser to render the dialog to make the to-be- + // inserted iframe editable. (#3366) + this.parts.dialog.$.offsetHeight; + + this.setupContent(); + }, + + onHide : function() + { + if ( CKEDITOR.env.ie ) + this.getParentEditor().document.getBody().$.contentEditable = 'true'; + }, + + onLoad : function() + { + if ( ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) && editor.lang.dir == 'rtl' ) + this.parts.contents.setStyle( 'overflow', 'hidden' ); + }, + + onOk : function() + { + this.commitContent(); + }, + + contents : [ + { + id : 'general', + label : editor.lang.common.generalTab, + elements : [ + { + type : 'html', + id : 'securityMsg', + html : '