1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| <script>
$(document).ready(function() {
$tabs=$("#example").tabs({
load:function(event, ui){
if(ui.index==0){
$('#divEditor').append('<textarea name="editor" id="editor"></textarea>');
$('#editor').tinymce({
script_url : 'tinymce/jscripts/tiny_mce/tiny_mce.js',
theme : "advanced",
language: "fr",
mode : "exact",
elements : 'editor',
plugins : "style,table,save,emotions,insertdatetime,print,nonbreaking",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontsizeselect,|forecolor,forecolorpicker ,backcolor,removeformat",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,|,insertdate,inserttime,|,emotions",
theme_advanced_buttons3 :"",
height:"250px",
width:"360px",
setup : function(ed) {
ed.onInit.add(function(ed) {
tinyMCE.execCommand('mceRepaint');
});
}
});
};
if(ui.index==2){
$('#divEditor').append('<textarea name="editor" id="editor"></textarea>');
$('#editor').tinymce({
script_url : 'tinymce/jscripts/tiny_mce/tiny_mce.js',
theme : "advanced",
language: "fr",
mode : "exact",
elements : 'editor',
plugins : "style,table,save,emotions,insertdatetime,print,nonbreaking",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontsizeselect,|forecolor,forecolorpicker ,backcolor,removeformat",
theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,|,insertdate,inserttime,|,emotions",
theme_advanced_buttons3 :"tablecontrols",
height:"250px",
width:"360px",
setup : function(ed) {
ed.onInit.add(function(ed) {
tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');
tinyMCE.execCommand('mceRepaint');
});
}
});
}
},
select:function(event, ui){
if($('#editor').length!=0){
tinyMCE.get('editor').remove();
$('#editor').remove();
};
}
});
});
</script> |
Partager