1

Topic: button , how to refresh automaticaly the editor

Hi ,
I have a problem with the bbcode plug in.
When I click the button , I have the content of div class automaticaly but if the selection contain bbcode , it will appear but not be updated and I must update with the html button.

Here is my code :

ed.addButton("marquee", {
                    title : "marquee",
                    image : "Themes/default/tiny_mce/plugins/icon/move.gif",
                    onclick : function() {
                    ed.selection.setContent("<div class=\"marquee\">" + ed.selection.getContent({format : "str"}) + " <!--marquee--></div><br>");
                    }
                 });


Without "selection" it's normally work but with "selection" , it doesn't work

Can you help me please ?

2

Re: button , how to refresh automaticaly the editor

Nobody ?

3

Re: button , how to refresh automaticaly the editor

I find the solution , it can be usefull

             ed.addButton("marquee", {
                    title : "marquee",
                    image : "Themes/default/tiny_mce/plugins/icon/move.gif",
                    onclick : function() {
                    tinyMCE.activeEditor.selection.setContent("<div class=\"marquee\">" + tinyMCE.activeEditor.selection.getContent({format : "str"}) + " <!--marquee--></div><br>");
                    tinyMCE.activeEditor.setContent(tinyMCE.activeEditor.getContent());
                    }
                 });