Forum
Remove some default options in Redactor
I added the source plugin to the default Redactor following the description I found on this page: https://docs.grabaperch.com/api/editors/ Now I wanted to remove some options from the default configuration. Having a look at the core file does not give any help to me. Can anyone give me some advice how this could be done? Here's my config.js so far:
Perch.UserConfig.redactor = function(){
var get = function(profile, config, field) {
if (config.plugins.indexOf('source') === -1) config.plugins.push('source');
if (config.plugins.indexOf('fontcolor') === -1) config.plugins.push('fontcolor');
return config;
};
var load = function(cb) {
if (typeof jQuery.Redactor.prototype.source == 'undefined') {
jQuery.getScript(Perch.path+'/addons/plugins/editors/redactor-plugins/fontcolor.js', function(){
jQuery.getScript(Perch.path+'/addons/plugins/editors/redactor-plugins/source.js', cb);
});
} else {
cb();
}
};
return {
'get': get,
'load': load
}
}();
Thanks a lot!
The configuration is the
config
object that is passed to yourget()
method. You can modify this and then return it.So if you wanted to change the
formatting
option, for example, you could do that with:Great, thanks a lot, Drew!