/** * @license Copyright (c) 2003-2013, 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 ), body = doc.getBody(), script = doc.getById( 'cke_actscrpt' ); script && script.remove(); body.setAttribute( 'contenteditable', true ); // 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() { doc.$.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( 1 ); processed = 1; } processed && domEvent.preventDefault(); }, this ); editor.fire( 'ariaWidget', new CKEDITOR.dom.element( win.frameElement ) ); // Handle pending focus. if ( doc.getWindow().getFrame().removeCustomData( 'pendingFocus' ) ) body.focus(); } // If pasteDialogCommit wasn't canceled by e.g. editor.getClipboardData // then fire paste event. // Do not use editor#paste, because it would start from beforePaste event. editor.on( 'pasteDialogCommit', function( evt ) { if ( evt.data ) editor.fire( 'paste', { type: 'auto', dataValue: evt.data } ); }, null, null, 1000 ); 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(); // Set dialog title to the custom value (set e.g. in editor.openDialog callback) and reset this value. // If custom title not set, use default one. this.parts.title.setHtml( this.customTitle || lang.title ); this.customTitle = null; }, 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: '