Hey All,
Earlier this evening I had what I thought was a simple task to remove the "email" link type from the link type drop down. After spending some time searching I ended up just digging into the plugin system and came up with the following (rather than directly modifying link.js)
Thougth I would share in the event others were looking for an easy way to modify the link types.
Earlier this evening I had what I thought was a simple task to remove the "email" link type from the link type drop down. After spending some time searching I ended up just digging into the plugin system and came up with the following (rather than directly modifying link.js)
Thougth I would share in the event others were looking for an easy way to modify the link types.
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" dialog).
if (dialogName == 'link') {
// Get a reference to the "Link Info" tab.
var infoTab = dialogDefinition.getContents('info');
// Get a reference to the link type
var linkOptions = infoTab.get('linkType');
// set the array to your preference
linkOptions['items'] = [['URL', 'url'], ['Link to anchor in the text', 'anchor']];
}
});