5

I have a tiny MCE button but I'd like to make it open a modal window(like for the spellcheck). How do I go about doing this?

tinymce.create('tinymce.plugins.tinyplugin', {

        init : function(ed, url){
            ed.addButton('tinyplugin', {
            title : 'map',
                onclick : function() {
                   // make my pop up window?
                },
                image: url + "/icon.png"
            });
        }
    });

1 Answer 1

4

This works:

 tinymce.create('tinymce.plugins.tinyplugin', {

        init : function(ed, url){

            ed.addButton('tinyplugin', {
            title : 'map',
                onclick : function() {
                    tb_show("", "../wp-content/plugins/myplugin/test.php?");
                    tinymce.DOM.setStyle(["TB_overlay", "TB_window", "TB_load"], "z-index", "999999")
                },
                image: url + "/icon.png",

            });



        }
    });

The ? after the test.php is important or else the link will be broken.

1
  • 1
    Great! That works :) Select your answer as correct..
    – Sisir
    Commented Feb 18, 2013 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.