Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
60116948
Commit
60116948
authored
Jan 31, 2015
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow CKeditor config to be overridden more easily
parent
3737a3ab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
47 deletions
+24
-47
config.js
qa-plugin/wysiwyg-editor/ckeditor/config.js
+22
-24
qa-wysiwyg-editor.php
qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php
+2
-23
No files found.
qa-plugin/wysiwyg-editor/ckeditor/config.js
View file @
60116948
...
...
@@ -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'
;
};
qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php
View file @
60116948
...
...
@@ -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: ''"
,
"};"
,
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment