Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove buttons from redactor wysiwyg

This is my code:

http://jsfiddle.net/KfVJK/

This is the code to add redactor:

$(document).ready(
            function()
            {
                $('#redactor_content').redactor();
            }
        );​

I want to limit the number of buttons on the toolbar. For example only have basic formatting like bold, italic, etc.

How can I remove buttons from the toolbar?

like image 600
Jimmy Avatar asked Oct 24 '12 11:10

Jimmy


2 Answers

Use the buttons setting:

var buttons = ['formatting', '|', 'bold', 'italic'];

$('#redactor').redactor({buttons: buttons});

This is extract from documentation:

By default, this setting contains the following array of toolbar's buttons:

['html', '|', 'formatting', '|', 'bold', 'italic', 'deleted', '|', 
'unorderedlist', 'orderedlist', 'outdent', 'indent', '|',
'image', 'video', 'file', 'table', 'link', '|',
'fontcolor', 'backcolor', '|', 'alignment', '|', 'horizontalrule']

// additional buttons
// 'underline', 'alignleft', 'aligncenter', 'alignright', 'justify'
// If you wish to set your own array, set it in this option:

$('#redactor').redactor({
    buttons: ['html', '|', 'formatting', '|', 'bold', 'italic'] 
});
like image 113
Michal Klouda Avatar answered Oct 26 '22 03:10

Michal Klouda


After go through their docs, I would suggest you to setting your button as following:

$('#redactor').redactor({
    buttons: ['formatting', '|', 'bold', 'italic'] 
});

DEMO: http://jsfiddle.net/KfVJK/3/

like image 26
Eli Avatar answered Oct 26 '22 03:10

Eli