Created
August 25, 2011 09:21
-
-
Save garryyao/1170303 to your computer and use it in GitHub Desktop.
CKEditor Iframe dialog sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @example An iframe-based dialog with frame window fit dialog size. | |
*/ | |
( function() { | |
CKEDITOR.plugins.add( 'iframe-fit-size', | |
{ | |
requires: [ 'iframedialog' ], | |
init: function( editor ) | |
{ | |
var height = 480, width = 750; | |
CKEDITOR.dialog.addIframe( | |
'myiframedialogDialog', | |
'Smiley', | |
'http://www.google.com', width, height, | |
function() | |
{ | |
// Iframe loaded callback. | |
}, | |
{ | |
onOk : function() | |
{ | |
// Dialog onOk callback. | |
} | |
} | |
); | |
editor.addCommand( 'myiframedialog', new CKEDITOR.dialogCommand( 'myiframedialogDialog' ) ); | |
editor.ui.addButton( 'Myiframedialog', | |
{ | |
label: 'My Iframe in dialog', | |
command: 'myiframedialog', | |
icon: this.path + 'images/icon.gif' | |
} ); | |
} | |
} ); | |
} )(); | |
var toolbar = CKEDITOR.config.toolbar_Full; | |
toolbar[toolbar.length-1].items.push( 'Myiframedialog' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment