0

This is an example for tiny mce with a custom jquery ui theme:
http://fiddle.tinymce.com/IDbaab

and this is an example for tiny mce with all functions enabled:
http://fiddle.tinymce.com/baaaab

How can I comebine these 2?

Writing everything like this

'<input type="checkbox" id="bold" data-mce-command="bold" /><label for="bold">B</label>' +
'<input type="checkbox" id="italic" data-mce-command="italic" /><label for="italic">I</label>' +

would really stupid, is there a better and easy solution?

4

3 に答える 3

0

I'm not sure if this will work but couldn't you generate that html from the "theme_advanced_buttons" option?

var html = '';
$.each(theme_advanced_buttons.split(',|,'), function(){
   $.each(theme_advanced_buttons.split(','), function(id, value){
      html += '<input type="checkbox" id="'+value+'" data-mce-command="'+value+'" /><label for="'+value+'">'+value+'</label>';
   });
   html += 'separator_html';
});

You would probably need another array to define the displayed text (B, I etc)

于 2012-06-06T14:12:05.587 に答える
0

http://fiddle.tinymce.com/IDbaab/2

here, I have added an Underline Button

'U' +

above, checkbox is type of button, data-mce-command attribute defines which command it will run and label for it

you should do this for all commands...

于 2012-06-06T14:14:44.810 に答える
0

I'm using ckeditor now, much better http://ckeditor.com/
Also, the new tiny editor has an improved theme

于 2014-03-24T09:31:20.980 に答える