179 posts
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Bought between 1 and 9 items
  • Has been a member for 4-5 years
  • Austria
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
  • Elite Author
  • Referred between 10 and 49 users
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Envato Studio (Microlancer) Beta Tester
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
wpstrong says

Add this to your “Insert” button:

   jQuery('.button').click(function(){
                           parent.tinymce.activeEditor.execCommand('mceInsertContent',false,'[myshortcode] [/myshortcode]');
                                     parent.tb_remove()
                                })
                 
179 posts
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Bought between 1 and 9 items
  • Has been a member for 4-5 years
  • Austria
codeex says

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

179 posts
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Bought between 1 and 9 items
  • Has been a member for 4-5 years
  • Austria
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