Try adding this code before yuour plugin
if (!RedactorPlugins) var RedactorPlugins = {};
RedactorPlugins.fontsize = {
init: function(){
var fonts = [10, 11, 12, 14, 16, 18, 20, 24, 28, 30];
var that = this;
var dropdown = {};
$.each(fonts, function(i, s){
dropdown['s' + i] = { title: s + 'px', callback: function() { that.setFontsize(s); } };
});
dropdown['remove'] = { title: 'Remove font size', callback: function() { that.resetFontsize(); } };
this.buttonAdd( 'fontsize', 'Change font size', false, dropdown);
},
setFontsize: function(size){
this.inlineSetStyle('font-size', size + 'px');
},
resetFontsize: function(){
this.inlineRemoveStyle('font-size');
}
};
Also remove any extra code to ensure you're having a problem with the code in question. Maybe also stick it in a document ready event
<script type="text/javascript">
$(document).ready(
function()
{
$('#redactor_content').redactor({
focus: true,
plugins: ['fontsize']
});
}
);
</script>
Code works for me.