607 posts WeNotMe
  • 5 Years of Membership
  • Author Level 7
  • Elite Author
  • Trendsetter
+4 more
codeex
says

Hi,

We are updating our shortcode plugin to something user friendly. Sorry for a newbie question..
anyway, in our editor.js We have this code

{text: 'Alert', onclick : function() {
   tb_show("", "../wp-content/plugins/typo-shortcodes/inc/new.php?");
   tinymce.DOM.setStyle(["TB_overlay", "TB_window", "TB_load"], "z-index", "999999");
}},

it’s working fine and the new.php file has this button “Insert” and when I click it the codes will not insert in the content area.. How do you guys do it to insert in the content area?

thanks

38 posts
  • Affiliate Level 3
  • Author Level 7
  • Beta Tester
  • Collector Level 2
+4 more
wpstrong
says

Add this to your “Insert” button:

   jQuery('.button').click(function(){
                           parent.tinymce.activeEditor.execCommand('mceInsertContent',false,'[myshortcode] [/myshortcode]');
                                     parent.tb_remove()
                                })
                 
607 posts WeNotMe
  • 5 Years of Membership
  • Author Level 7
  • Elite Author
  • Trendsetter
+4 more
codeex
says

thanks man, I will give it a try!..

607 posts WeNotMe
  • 5 Years of Membership
  • Author Level 7
  • Elite Author
  • Trendsetter
+4 more
codeex
says

I tried adding image on my dropdown in tinymce but it’s not working..

(function($) {
"use strict";   

   tinymce.PluginManager.add( 'typo_path', function( editor, url ) {

      editor.addButton( 'typo_shortcodes', {
         type: 'splitbutton',
         image : url+'/img/social_icons.png',
         title:  'Typo Shortcodes',
         onclick : function(e) {},
         menu: [
            {text: 'Alerts',onclick:function(){

            }},
         ]
      });

   });

})(jQuery);
by
by
by
by
by
by