­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ var bsc_shortcode; var bsc_shortcode_content; (function() { tinymce.create('tinymce.plugins.bsc_shortcodes', { init: function(ed, url) { ed.addButton('bsc_button', { title: 'Basic Shortcodes', image: url.substring(0, url.length - 3) + "/images/icon.png", onclick: function() { bsc_shortcode = ed.selection; bsc_shortcode_content = ed.selection.getContent(); var width = jQuery(window).width(), H = jQuery(window).height(), W = (720 < width) ? 720 : width; W = W - 80; H = H - 84; var shortcodes_loaded = jQuery("#bsc_holder").length; if (shortcodes_loaded) { tb_show('Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=bsc_shortcodes'); jQuery('#TB_window').addClass('bsc_window'); } else { jQuery("body").append(''); jQuery.get('admin-ajax.php?action=bsc_generate_admin_sections', function(data) { jQuery('#bsc_shortcodes').html(data); tb_show('Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=bsc_shortcodes'); jQuery('#TB_window').addClass('bsc_window'); }); } } }); }, createControl: function(n, cm) { return null; }, }); tinymce.PluginManager.add('bsc_shortcodes', tinymce.plugins.bsc_shortcodes); })();