Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CKEditor 4 - replaceAll() with custom config

After checking the source code, it seems that CKEDITOR.replaceAll function can't pass any custom config on call.

Is there any workaround, so that I can pass different custom config to specific textarea?

e.g. I want all textarea that has class "advanced" have different browse image path from textarea with class "normal"

like image 325
adods Avatar asked Mar 31 '26 19:03

adods


1 Answers

CKEDITOR.replaceAll(function(textarea,config) {
    if(textarea.className == "advanced")
    {
        config.removeButtons = 'About';
        return true;
    }
    else if(textarea.className == "basic")
    {
        config.removeButtons = 'Cut,Copy,Paste,About,Save,NewPage,DocProps,Preview,Templates,PasteFromWord,SelectAll,Scayt,SpellChecker,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,Flash,Smiley,Styles,Font,FontSize,Blockquote,Format,Image,Table,Link';
        config.uiColor = '#AADC6E';
        return true;
    }
});
like image 162
Anna Oleksiuk Avatar answered Apr 03 '26 07:04

Anna Oleksiuk