214 posts
  • Has sold $40,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
+2 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
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
wpstrong says

Add this to your “Insert” button:

   jQuery('.button').click(function(){
                           parent.tinymce.activeEditor.execCommand('mceInsertContent',false,'[myshortcode] [/myshortcode]');
                                     parent.tb_remove()
                                })
                 
214 posts
  • Has sold $40,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
+2 more
codeex says

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

214 posts
  • Has sold $40,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Has referred 1+ members
  • Has collected 1+ items on Envato Market
+2 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