Browse Source

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

pull/1334/head
Jordan Wright 2 years ago
parent
commit
ea97d6257d
3 changed files with 64 additions and 17 deletions
  1. +1
    -1
      static/js/dist/app/landing_pages.min.js
  2. +15
    -0
      static/js/src/app/landing_pages.js
  3. +48
    -16
      static/js/src/vendor/ckeditor/config.js

+ 1
- 1
static/js/dist/app/landing_pages.min.js
File diff suppressed because it is too large
View File


+ 15
- 0
static/js/src/app/landing_pages.js View File

@ -229,5 +229,20 @@ $(document).ready(function () {
$("#capture_passwords").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()
})

+ 48
- 16
static/js/src/vendor/ckeditor/config.js View File

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

Loading…
Cancel
Save