mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Made the editor area a bit bigger. Replaced colored toolbar icons with black and white icons for more consistency. Expanded the custom config script so toolbar options can be easily modified.
This commit is contained in:
parent
528155798d
commit
16e6126304
@ -8,4 +8,23 @@ CKEDITOR.editorConfig = function( config ) {
|
||||
// config.language = 'fr';
|
||||
// config.uiColor = '#AADC6E';
|
||||
config.extraPlugins = 'timestamp,dndfiles,eqneditor,fileupload';
|
||||
|
||||
// Toolbar configuration
|
||||
config.toolbar = [
|
||||
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ] },
|
||||
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
|
||||
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },
|
||||
{ name: 'forms', items: [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField' ] },
|
||||
'/',
|
||||
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
|
||||
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ] },
|
||||
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
|
||||
{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe', 'FileUpload', 'Timestamp', 'EqnEditor' ] },
|
||||
'/',
|
||||
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
|
||||
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
|
||||
{ name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] },
|
||||
{ name: 'others', items: [ '-' ] },
|
||||
{ name: 'about', items: [ 'About' ] }
|
||||
];
|
||||
};
|
||||
|
||||
@ -80,8 +80,6 @@ CKEDITOR.plugins.add( 'dndfiles', {
|
||||
// End the progress bar
|
||||
progressJs().end();
|
||||
|
||||
console.log(data);
|
||||
|
||||
var html = '';
|
||||
for(var idx = 0; idx < data.attachments.length; idx++) {
|
||||
var att = data.attachments[idx];
|
||||
|
||||
@ -11,8 +11,6 @@ CKEDITOR.dialog.add( 'fileuploadDialog', function( editor ) {
|
||||
var lang = editor.lang.image2;
|
||||
var commonLang = editor.lang.common
|
||||
|
||||
console.log(commonLang);
|
||||
|
||||
return {
|
||||
|
||||
// Basic properties of the dialog window: title, minimum size.
|
||||
@ -107,7 +105,7 @@ CKEDITOR.dialog.add( 'fileuploadDialog', function( editor ) {
|
||||
fail: function() {
|
||||
// End the progress bar
|
||||
progressJs().end();
|
||||
console.log("error");
|
||||
console.log("Error while uploading file...");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 620 B After Width: | Height: | Size: 626 B |
BIN
scripts/ckeditor/plugins/timestamp/icons/timestamp.png
Executable file → Normal file
BIN
scripts/ckeditor/plugins/timestamp/icons/timestamp.png
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 831 B |
@ -7,8 +7,12 @@ $(document).ready(function() {
|
||||
// if you try to use it immediately after CKEDITOR.replace('editor');
|
||||
CKEDITOR.on('instanceReady', function (ev) {
|
||||
|
||||
// Create a new command with the desired exec function
|
||||
var editor = ev.editor;
|
||||
|
||||
// Make the editor bigger
|
||||
editor.resize("100%", "500");
|
||||
|
||||
// Create a new command with the desired exec function
|
||||
var overridecmd = new CKEDITOR.command(editor, {
|
||||
exec: function(editor){
|
||||
// Replace this with your desired save button code
|
||||
@ -37,6 +41,8 @@ $(document).ready(function() {
|
||||
|
||||
var dialogObj = dialogDefinition.dialog;
|
||||
dialogObj.on("show", function() {
|
||||
// This code will open the Upload tab.
|
||||
this.selectPage('Upload');
|
||||
// replace the submit function with something useless
|
||||
dialogObj.getContentElement( 'Upload', 'upload' ).submit = function() {
|
||||
return false;
|
||||
@ -104,7 +110,6 @@ $(document).ready(function() {
|
||||
// add all the other attachments that were previously added
|
||||
$( "input[name^='attachment']" ).each(function(idx, el) {
|
||||
formData.append($(el).attr('name'), $(el).attr('value'));
|
||||
// console.log(el);
|
||||
});
|
||||
|
||||
formData.append('drop-count', files.length); // number of files dropped that should be sent
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user