Cleaned up CKEditor link dialog to be more simple. Related to #1327

pull/1334/head
Jordan Wright 2018-12-27 14:54:04 -06:00
parent af293da9f5
commit ea97d6257d
3 changed files with 64 additions and 17 deletions

File diff suppressed because one or more lines are too long

View File

@ -229,5 +229,20 @@ $(document).ready(function () {
$("#capture_passwords").toggle() $("#capture_passwords").toggle()
$("#redirect_url").toggle() $("#redirect_url").toggle()
}) })
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 window you are interested in (the "Link" dialog window).
if (dialogName == 'link') {
dialogDefinition.minWidth = 500
dialogDefinition.minHeight = 100
// Remove the linkType field
var infoTab = dialogDefinition.getContents('info');
infoTab.get('linkType').hidden = true;
}
});
load() load()
}) })

View File

@ -3,27 +3,57 @@
* For licensing, see LICENSE.md or http://ckeditor.com/license * For licensing, see LICENSE.md or http://ckeditor.com/license
*/ */
CKEDITOR.editorConfig = function( config ) { CKEDITOR.editorConfig = function (config) {
// Define changes to default configuration here. // Define changes to default configuration here.
// For complete reference see: // For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config // http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows. // The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [ config.toolbarGroups = [{
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, name: 'clipboard',
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, groups: ['clipboard', 'undo']
{ name: 'links' }, },
{ name: 'insert' }, {
{ name: 'forms' }, name: 'editing',
{ name: 'tools' }, groups: ['find', 'selection', 'spellchecker']
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, },
{ name: 'others' }, {
name: 'links'
},
{
name: 'insert'
},
{
name: 'forms'
},
{
name: 'tools'
},
{
name: 'document',
groups: ['mode', 'document', 'doctools']
},
{
name: 'others'
},
'/', '/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, {
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, name: 'basicstyles',
{ name: 'styles' }, groups: ['basicstyles', 'cleanup']
{ name: 'colors' }, },
{ name: 'about' } {
name: 'paragraph',
groups: ['list', 'indent', 'blocks', 'align', 'bidi']
},
{
name: 'styles'
},
{
name: 'colors'
},
{
name: 'about'
}
]; ];
// Remove some buttons provided by the standard plugins, which are // Remove some buttons provided by the standard plugins, which are
@ -37,4 +67,6 @@ CKEDITOR.editorConfig = function( config ) {
config.fullPage = true; config.fullPage = true;
config.allowedContent = true; config.allowedContent = true;
config.startupMode = "source"; config.startupMode = "source";
config.linkShowAdvancedTab = false
config.linkShowTargetTab = false
}; };