Skip to content

Instantly share code, notes, and snippets.

@guoxiangke
Last active August 29, 2015 13:56
Show Gist options
  • Save guoxiangke/8877667 to your computer and use it in GitHub Desktop.
Save guoxiangke/8877667 to your computer and use it in GitHub Desktop.
//Ckedit 定制!隐藏finder链接和图像,并设定默认值 for drupal
if(typeof(CKEDITOR) === 'object')
CKEDITOR.on( 'dialogDefinition', function( ev )
{
// Take the dialog name and its definition from the event
// data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// Check if the definition is from the dialog we're
// interested on (the Link and Image dialog).
if (dialogName == 'image' )
{
// remove Upload tab
dialogDefinition.removeContents( 'advanced' );
dialogDefinition.removeContents( 'target' );
dialogDefinition.removeContents( 'Link' );
dialogDefinition.onShow = function () {
// This code will open the Advanced tab.
this.selectPage('Upload');
};
}
if ( dialogName == 'link') {
// remove Upload tab
dialogDefinition.removeContents( 'advanced' );
dialogDefinition.removeContents( 'target' );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment