开发者

hiding controls in FCKEditor

i am using FCKEditor but i dont want all the buttons that are in the to开发者_StackOverflowolbar area i want only some of them is there any way to hide them using css or javascript or in any other way.


Have you looked into the ability to customize the fckeditor toolbar?

http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Toolbar
http://developer.mindtouch.com/en/kb/Configure_the_FCKeditor_toolbar

There's FCKConfig.js which uses JSON configuration.

FCKConfig.ToolbarSets["Default"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
] ;

FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;


For the version 3

There is a file called config.js There You can change the default config value... for example

    CKEDITOR.editorConfig = function( config )
    {
        config.entities = false;
        config.entities_greek = false;
        config.enterMode = 2;//  'br' ;
        config.shiftEnterMode = 1 ; // 'p';

        config.toolbar =
        [
            ['Source','Preview'],
            ['Bold', 'Italic',,'Underline','Strike','-','Subscript','Superscript'],
            ['NumberedList', 'BulletedList', '-', 'Link', 'Unlink'],
            ['Cut','Copy','Paste','PasteText','PasteFromWord'],
            ['Outdent','Indent','Blockquote'],
            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
            ['Link','Unlink','Anchor'],
            ['Image','Flash','Table','HorizontalRule','SpecialChar', 'Templates'],
            ['Format','Font','FontSize'],
            ['TextColor','BGColor'],
            ['Maximize', 'ShowBlocks']                
        ];            
    };

Notes

for the moment you load the ckeditor.js, the CKEDITOR is global, so you can change the editorConfig anywhere on your javascript this way and not only on this config.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜