Commit 60116948 by Scott

Allow CKeditor config to be overridden more easily

parent 3737a3ab
......@@ -4,35 +4,33 @@
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// 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' },
// NOTE: if you make changes to this file, make sure that you do not overwrite it when upgrading Q2A!
// The toolbar arrangement, two rows of buttons
config.toolbar = [
{ name: 'basic', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ] },
{ name: 'color', items: [ 'TextColor', 'BGColor' ] },
{ name: 'align', items: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
{ name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' }
{ name: 'font', items: [ 'Font', 'FontSize', 'Format' ] },
{ name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote' ] },
{ name: 'links', items: [ 'Link', 'Unlink' ] },
{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },
{ name: 'last', items: [ 'RemoveFormat', 'Maximize' ] }
];
// Remove some buttons provided by the standard plugins, which are
// not needed in the Standard(s) toolbar.
config.removeButtons = 'Underline,Subscript,Superscript';
// Set the most common block elements.
// Set the most common block elements
config.format_tags = 'p;h1;h2;h3;pre';
config.entities = false;
// Make dialogs simpler
config.removeDialogTabs = 'image:advanced;link:advanced;table:advanced';
// Use native spell checking (note: Ctrl+right-click is required for native context menu)
config.disableNativeSpellChecker = false;
// Simplify the dialog windows.
config.removeDialogTabs = 'image:advanced;link:advanced';
};
......@@ -125,28 +125,9 @@ class qa_wysiwyg_editor
$qa_content['script_src'][] = $scriptsrc;
$qa_content['script_lines'][] = array(
// Most CKeditor config occurs in ckeditor/config.js
"var qa_wysiwyg_editor_config = {",
// The toolbar arrangement, two rows of buttons
" toolbar: [",
" { name: 'basic', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ] },",
" { name: 'color', items: [ 'TextColor', 'BGColor' ] },",
" { name: 'align', items: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },",
" { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteFromWord', '-', 'Undo', 'Redo' ] },",
" '/',",
" { name: 'font', items: [ 'Font', 'FontSize', 'Format' ] },",
" { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote' ] },",
" { name: 'links', items: [ 'Link', 'Unlink' ] },",
" { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },",
" { name: 'last', items: [ 'RemoveFormat', 'Maximize' ] }",
" ],",
// Set the most common block elements.
" format_tags: 'p;h1;h2;h3;pre',",
" entities: false,",
// Make dialogs simpler.
" removeDialogTabs: 'image:advanced;link:advanced;table:advanced',",
// Use native spell checking (note: Ctrl+right-click is required for native context menu).
" disableNativeSpellChecker: false,",
// Set language to Q2A site language, falling back to English if not available.
" defaultLanguage: 'en',",
" language: " . qa_js(qa_opt('site_language')) . ",",
......@@ -155,8 +136,6 @@ class qa_wysiwyg_editor
($uploadimages ? " filebrowserImageUploadUrl: $imageUploadUrl," : ""),
($uploadall ? " filebrowserUploadUrl: $fileUploadUrl," : ""),
// Prevent config file being loaded
" customConfig: ''",
"};",
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment