Anyone have any idea how to hide the "Cancel" button on the addIframe dialog? I just want an "Ok" down there and can't see how to turn off that darn Cancel.
I figured out a way to do this using a jQuery call in the <body onload>. Since all the buttons in the iframedialog have the same class, you can call the parent's jQuery function (assuming you have jQuery loaded on the parent page):
In the <head> section of the file that loads in the <iframe> of the iframedialog:
<script type="text/javascript"> function fixDialogButtons() { parent.$('.cke_dialog_ui_button_cancel').hide(); parent.$('.cke_dialog_ui_button').each(function(){ var content = parent.$(this).html(); content = content.replace(/Ok/ig,'Close'); parent.$(this).html(content); parent.$(this).attr('title','Close'); }); } </script>
Re: Hiding Cancel button on addIframe dialog
(function() { CKEDITOR.plugins.add('youtube', { requires : ['iframedialog', 'fakeobjects'], init : function(editor) { var iframeWindow = null; var me = this; CKEDITOR.dialog.add('youtube_dialog', function() { return { title : 'YouTube Dialog', minWidth : 550, minHeight : 200, contents : [{ id : 'iframe', label : 'Insert YouTube Movie...', expand : true, elements : [{ type : 'iframe', src : me.path + 'dialogs/youtube.html', width : '100%', height : '100%', onContentLoad : function() { var iframe = document.getElementById(this._.frameId); iframeWindow = iframe.contentWindow; } }] }], onOk : function() { this._.editor.insertHtml('<cke:youtube url="' + iframeWindow.document.getElementById('url').value + '">YouTube Video Place Marker</cke:youtube>'); } }; }); editor.addCommand('youtube', new CKEDITOR.dialogCommand('youtube_dialog')); editor.ui.addButton('YouTube', { label : 'Insert YouTube Movie...', command : 'youtube', icon : this.path + 'images/icon.gif' }); editor.addCss('.cke_youtube {' + 'width: 80px;' + 'height: 80px;' + 'background: url(' + CKEDITOR.getUrl(this.path + 'images/placeholder.png') + ') no-repeat center center;' + 'border: solid 1px #A9A9A9;' + '}'); }, afterInit : function(editor) { var dataProcessor = editor.dataProcessor, dataFilter = dataProcessor && dataProcessor.dataFilter; if (dataFilter) { dataFilter.addRules({ elements : { 'cke:youtube' : function(element) { return editor.createFakeParserElement(element, 'cke_youtube', 'youtube', true); } } }, 5); } } }); })();Appreciate the help. Thanks
Re: Hiding Cancel button on addIframe dialog
In the <head> section of the file that loads in the <iframe> of the iframedialog:
<script type="text/javascript">
function fixDialogButtons()
{
parent.$('.cke_dialog_ui_button_cancel').hide();
parent.$('.cke_dialog_ui_button').each(function(){
var content = parent.$(this).html();
content = content.replace(/Ok/ig,'Close');
parent.$(this).html(content);
parent.$(this).attr('title','Close');
});
}
</script>
And then in the <body> tag:
<body onload="fixDialogButtons();">