我想在編輯者添加自定義按鈕等。我把你的代碼和我的目的更改了代碼。它爲我,你可以去看看:
$(document).ready(
function()
{
$('.redactor').redactor({
focus: true,
buttonsAdd: ['|', 'token'],
buttonsCustom: {
token: {
title: 'Ajouter une variable',
dropdown: {
header: {title: 'Entête',callback: function(obj){obj.insertHtml('%header%');}},
footer: {title: 'Signature',callback: function(obj){obj.insertHtml('%footer%');}},
last_name: {title: 'Nom',callback: function(obj){obj.insertHtml('%last_name%');}},
first_name: {title: 'Prénom',callback: function(obj){obj.insertHtml('%first_name%');}},
date: {title: 'Date',callback: function(obj){obj.insertHtml('%date%');}},
contract: {title: 'Contrat',callback: function(obj){obj.insertHtml('%contract%');}}
}
}
}
});
}
);
乾杯