I have configured my own custom image repository using ckeditor image plugin.
Now i want to change the size of image dialog. I have checked a lot but found properties for changing height and width of file browser and ckeditor itself only.
How could i change the size of image dialog that appears on oncliking the image icon in ckeditor toolbar.
Here is my code:
CKEDITOR.editorConfig = function( config ) {
config.height = '350px';
//config.width = '1000px';
config.uiColor = '#d6d6d6';
config.fullPage = true;
config.extraPlugins = 'importdoc,docprops';
config.scayt_autoStartup = true;
config.filebrowserBrowseUrl = 'jcrPage';
config.filebrowserImageBrowseUrl = 'jcrPage';
config.filebrowserImageUploadUrl = 'imageUpload';
config.filebrowserWindowHeight = 500;
config.filebrowserWindowWidth = 500;
config.filebrowserImageWindowWidth = 700;
config.filebrowserImageWindowHeight = 700;
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode'] },
{ name: 'editing', groups: [ 'find', 'selection'] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'styles' },
{ name: 'colors' },
];
config.removePlugins = 'flash, iframe, templates, div, source, smiley, save, newpage';
config.removeDialogTabs = 'image:advanced';
};
Thanks
Size of the dialog is controlled by 4 properties: width, height, minWidth, minHeight.
And to know how to customize a definition of an existing dialog, please refer to my previous answer: How do I customize a ckeditor 4.2 builtin plugin like links?
Related
I am trying to setup CKEditor Table Tools and I had some difficulties, could someone please help me?
Is there a way to transform the table tools buttons on a kind of a Dropdown Menu? I want my user to be able to use all the buttons, but without using so much space on my toolbar, so if they could press a button that would reveal all the table tools buttons would be great!
How do I fix positions for the buttons? Now, everytime my CKEditor reloads, buttons are on a different position, and that's bad for the user.
How do I create buttons groups? Now my table tools buttons look like this:
but I'd like them to have organized groups as in the Demo page (http://doksoft.com/soft/ckeditor-table-tools/demo.html), like this:
Here is my current config file (some stuff are commented because I was learning):
CKEDITOR.editorConfig = function( config ) {
// %REMOVE_START%
// The configuration options below are needed when running CKEditor from source files.
config.plugins = 'basicstyles,dialogui,dialog,clipboard,button,toolbar,entities,floatingspace,wysiwygarea,indent,indentlist,list,undo,autogrow,base64image,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,resize,imageresize,eqneditor,find,listblock,richcombo,font,htmlwriter,indentblock,symbol,justify,liststyle,menubutton,pastetext,pastefromword,wordcount,pastebase64,removeformat,showborders,scayt,tabletools,lineutils,widget';
config.skin = 'moonocolor';
// %REMOVE_END%
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for a single toolbar row.
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'forms' },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'tools' },
{ name: 'others' },
{ name: 'about' }
//{ name: 'doksoft', groups: ['doksoft_table'] }
];
// config.toolbar = [
// ['doksoft_table_conf','doksoft_table_new'] ,
// ['undo', 'scayt']
// ];
//config.toolbar_name = [ [ 'doksoft_table_conf,doksoft_table_new,doksoft_table_row_conf,doksoft_table_col_conf,doksoft_table_cell_conf,doksoft_table_add_row_up,doksoft_table_add_row_down,doksoft_table_add_col_left,doksoft_table_add_col_right,doksoft_table_add_cell_left,doksoft_table_add_cell_right,doksoft_table_row_move_up,doksoft_table_row_move_down,doksoft_table_col_move_left,doksoft_table_col_move_right,doksoft_table_delete_col,doksoft_table_delete_row,doksoft_table_delete_cell,doksoft_table_merge_cells,doksoft_table_merge_cell_right,doksoft_table_merge_cell_down,doksoft_table_split_cell_hor,doksoft_table_split_cell_vert' ] ];
// The default plugins included in the basic setup define some buttons that
// are not needed in a basic editor. They are removed here.
config.removeButtons = 'Cut,Copy,Paste,Anchor,Strike,Font,Replace,Table';
// Dialog windows are also simplified.
config.removeDialogTabs = 'link:advanced';
config.language = 'pt-br';
config.width = 575;
//Opções do contador de palavras
config.wordcount = {
// Whether or not you want to show the Word Count
showWordCount: true,
// Whether or not you want to show the Char Count
showCharCount: false,
// Whether or not to include Html chars in the Char Count
countHTML: false
}
// Opções do corretor automático em PT-BR
config.scayt_autoStartup = true;
config.scayt_sLang = 'pt_BR';
config.scayt_uiTabs = '1,1,0';
//Tamanhos padrão de fonte
config.fontSize_defaultLabel = '12';
config.extraPlugins = 'dragresize,doksoft_table_new,doksoft_table_conf,doksoft_table_row_conf,doksoft_table_col_conf,doksoft_table_cell_conf,doksoft_table_row_move_up,doksoft_table_row_move_down,doksoft_table_col_move_left,doksoft_table_col_move_right,doksoft_table_add_row_up,doksoft_table_add_row_down,doksoft_table_add_col_left,doksoft_table_add_col_right,doksoft_table_add_cell_left,doksoft_table_add_cell_right,doksoft_table_delete_col,doksoft_table_delete_row,doksoft_table_delete_cell,doksoft_table_merge_cells,doksoft_table_merge_cell_right,doksoft_table_merge_cell_down,doksoft_table_split_cell_hor,doksoft_table_split_cell_vert';
config.fontSize_sizes = '6/8px;8/11px;9/12px;10/14px;11/15px;12/16px;14/19px;16/22px;18/24px;20/27px;22/30px;24/32px;26/35px;28/38px;36/48px;54/72px;72/96px;';
};
I'm using windows 10, chrome 44.0.2403.157 m and CKEditor 4.5.3
CKEditor does not support dropdown button menues by default. You need additional plugin for that.
Define not as a group but as single buttons set. See (3).
Here is toolbar configuration for you:
config.toolbar = [
['doksoft_table_new'],
['doksoft_table_conf','doksoft_table_row_conf','doksoft_table_col_conf','doksoft_table_cell_conf'],
['doksoft_table_add_row_up','doksoft_table_add_row_down','doksoft_table_add_col_left','doksoft_table_add_col_right'],
['doksoft_table_add_cell_left','doksoft_table_add_cell_right'],
['doksoft_table_row_move_up','doksoft_table_row_move_down','doksoft_table_col_move_left','doksoft_table_col_move_right'],
['doksoft_table_delete_col','doksoft_table_delete_row','doksoft_table_delete_cell'],
['doksoft_table_merge_cells','doksoft_table_merge_cell_right','doksoft_table_merge_cell_down'],
['doksoft_table_split_cell_hor','doksoft_table_split_cell_vert']
];
my config.js is as follow
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
config.height='10em';
// The toolbar groups arrangement, optimized for a single toolbar row.
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'forms' },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
/*{ name: 'links' },*/
{ name: 'insert' },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'tools' },
{ name: 'others' }
/*{ name: 'about' }*/
];
config.enterMode = CKEDITOR.ENTER_BR;
// The default plugins included in the basic setup define some buttons that
// are not needed in a basic editor. They are removed here.
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
// Dialog windows are also simplified.
config.removeDialogTabs = 'link:advanced';
config.extraPlugins = 'scayt';
};
by adding config.extraPlugins = 'scayt'; my Ckeditor is getting disabled I put scayt folder in plugins folder of CKEditor. Please help if you know what wrong I did. I want to add spell checker in CKeditor.
I was struggeling with this too.
The solution for me was that the toolbar option had to start with a Capital "S"
so I had to use 'Scayt' instead of 'scayt'
CKEDITOR.config.toolbar_MA = [
['Scayt', '-', 'Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo', 'Source'],
];
CKEDITOR.config.disableNativeSpellChecker = false;
CKEDITOR.config.defaultLanguage = 'fr';
CKEDITOR.config.language = 'fr';
// Turn on SCAYT automatically
CKEDITOR.config.scayt_autoStartup = true;
CKEDITOR.config.scayt_sLang = 'fr_FR';
Try adding this:
config.scayt_autoStartup = true;
I didn't define:
config.extraPlugins = 'scayt';
And it was working
EDIT
You can also try initiating in javascript like here: http://jsfiddle.net/ddan/usz40fb5/
var editor;
function createEditor( lang ) {
editor && editor.destroy();
editor = CKEDITOR.replace( 'editor', {
plugins: 'wysiwygarea,sourcearea,basicstyles,toolbar,scayt',
// Turn on SCAYT automatically
scayt_autoStartup: true,
language: lang,
} );
}
createEditor( 'en' );
EDIT
Based on your comment:
This one must work. Using version 4.4.3. The example I give is using CDN for ckeditor. If you want to replace to local js feel free to include your own script or download that script and load in from local library.
<!-- CKeditor 4.4.3 -->
<script src="http://cdn.ckeditor.com/4.4.3/standard/ckeditor.js"></script>
<textarea id="editor"> worng spelling</textarea>
<script>
// Shorthand for $( document ).ready()
$(function() {
CKEDITOR.replace( 'editor', {
scayt_autoStartup: true
});
});
</script>
See working example: http://jsfiddle.net/ddan/KS3p4/8/
I'm having trouble setting up CKEditor. I managed to make it work, production-wise, but now I need to tweak some options like:
config.entities_latin = false;
(inside config.js), and it doesn't work, it still changes caracters like: šđžćčšđ to &Scaron etc.
I have tried the: config.autoParagraph = false; this doesn't work too.
However if I delete some elements from: config.toolbarGroups = [ ] (this works)..
Please notice that I have to use the basic version (for some reason, standard and full version doesn't work at all on server, only locally) :S
Anyone, help please...
This is entire config.js:
/**
* #license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
config.contentsLanguage = 'hr';
config.entities_latin = false;
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for a single toolbar row.
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'forms' },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'tools' },
{ name: 'others' }
];
// The default plugins included in the basic setup define some buttons that
// we don't want too have in a basic editor. We remove them here.
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
// Let's have it basic on dialogs as well.
config.removeDialogTabs = 'link:advanced';
};
Depends on which version you have. Try removing all entities. This works for me, my cke output is 100% XML compatible.
config.entities = false;
config.removePlugins = 'entities';
You can add config.entities_greek = false; or the latin one too but I don't really think it's necessary.
I'm using CKEditor 4.1.1 and can't figure out how to show the Insert Image button in th toolbar. This is my current CKEditor configuration in config.js.
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for a single toolbar row.
config.toolbarGroups = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'forms' },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'tools' },
{ name: 'others' },
{ name: 'about' }
];
// The default plugins included in the basic setup define some buttons that
// we don't want too have in a basic editor. We remove them here.
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript,Font,SpellChecker';
config.disableNativeSpellChecker = false;
config.removePlugins = 'scayt,menubutton,contextmenu';
// Let's have it basic on dialogs as well.
config.removeDialogTabs = 'link:advanced';
};
How should I modify this to show the Insert Image button?
I have been reading the documentation and trying various things, but nothing has worked thus far.
I used to have the same issues long time ago. I have opened my old site code to check it out for you :
try to add this to your config.js
in the config.toolbarGroups Object
{ name: 'insert', items: [ 'Image']},
instead of
{ name: 'insert'},
if that doesn't work replace image with lowercase
Btw I have found this documentation which might be helpful
Good Luck
first you need to check your
CKEditor Which css using for example
CK Editor\skins\office2003\editor.css in that you can add image the icon of image button i searched and checked it works for me
.cke_skin_office2003 .cke_button a.cke_button_ICONNAME .cke_icon
{
background-image:url(ICONNAME.png);
background-repeat:repeat;
background-position:0px;
}
hopes it helps some one
Make sure you install the Image (https://ckeditor.com/cke4/addon/image). Extract the downloaded file, and put into plugins folder in ckeditor installation path. after that, edit your config.js file put line like below:
CKEDITOR.editorConfig = function( config ) {
.....
config.extraPlugins = 'image';
});
Reload your page and done.
I am using CKEditor 4 with inline editing. I want to set custom height to the CKEditor toolbar that appears. I looked around and found a solution
config.height = 300;
config.width = 550;
I wrote the above two lines in the config.js file. But sadly, its not working for me.
Any Ideas? Or inline editing doesnt support custom height?
EDIT :
I alsp tried this in my js
editor.resize( 900, 300 );
but no luck
Just use the linebreak '/' as Zee suggested in the comment area.
For example:
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'basicstyles', 'cleanup'] },
'/',
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
{ name: 'links' },
...
]
The linebreak will break the buttons into two rows.