2012-10-24 49 views
5

删除按钮,这是我的代码:从主编所见即所得

http://jsfiddle.net/KfVJK/

这是添加主编代码:

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

我想限制在工具栏上的按钮数。例如,只有像粗体,斜体等基本格式。

如何从工具栏中删除按钮?

回答

7

使用buttons设置:

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

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

这是documentation提取物:

默认情况下,该设置包含了工具栏的 按钮下面的数组:

['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'] 
});