Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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"
            });
        }
    });
share|improve this question
add comment

1 Answer 1

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.

share|improve this answer
1  
Great! That works :) Select your answer as correct.. –  Sisir Feb 18 '13 at 10:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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