CKEDITOR.replace('{{ name }}', { customConfig: '', toolbar: 'Basic', width: '{{ width }}', height: '{{ height }}', resize_enabled: false, {% if contents_css is defined %}contentsCss: {{ contents_css }},{% endif %} language: '{{ language }}', uiColor: '{{ ui_color }}', {% if browsefromlinkdialog %}filebrowserBrowseUrl: '{{ upload_browser }}&snippet=1&filters=links', {% endif %} //3.x & 4.x {% if browsefromimagedialog %}filebrowserImageBrowseUrl: '{{ upload_browser }}&snippet=1&filters=images', {% endif %} //3.x & 4.x allowedContent: true, disableNativeSpellChecker: false, removePlugins: 'elementspath', toolbar_Basic: [ //CKE 4.x would also support a new group-based format, which is //slightly better for a11y ['Cut','Copy','Paste','PasteText','PasteFromWord'], ['Undo','Redo'], ['Link','Unlink','Image','SpecialChar'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], '/', ['Format','Font','FontSize'], ['Bold','Italic','Underline','Strike'], ['TextColor','BGColor'], ['RemoveFormat', 'Blockquote'], ['Source','ShowBlocks'], ['About'] ] }); CKEDITOR.on('dialogDefinition', function(ev){ var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if(dialogName == 'link'){ for(var index=0; index < dialogDefinition.contents.length; index++){ var tab = dialogDefinition.contents[index]; if(tab.id == 'advanced'){ dialogDefinition.contents.splice(index, 1); index -= 1; } if(tab.id == 'target'){ var elem = null; for(var i=0; i < tab.elements.length; i++){ if (tab.elements[i].type == 'hbox'){ elem = tab.elements[i]; break; } } if ( elem ) { var child = null; for(var i=0; i < elem.children.length; i++){ if (elem.children[i].type == 'select'){ child = elem.children[i]; break; } } if ( child ) { for(var i=0; i < child.items.length; i++){ if (child.items[i][1] == 'popup'){ child.items.splice(i, 1); break; } } } } } } } });