Last active
August 29, 2015 13:56
-
-
Save guoxiangke/8877667 to your computer and use it in GitHub Desktop.
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
//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