PluginProbe
Powerkit – Supercharge your WordPress Site / trunk
Powerkit – Supercharge your WordPress Site vtrunk
3.1.1 3.1.0 3.0.9 3.0.8 trunk 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 All 87 releases
powerkit / modules / basic-elements / admin / js / admin-powerkit-basic-elements.js

admin-powerkit-basic-elements.js in Powerkit – Supercharge your WordPress Site trunk, at modules/basic-elements/admin/js/admin-powerkit-basic-elements.js

49 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2
3 var powerkit_basic_shortcodes;
4 var powerkit_basic_shortcodes_content;
5
6 ( function() {
7 tinymce.create( 'tinymce.plugins.powerkit_basic_shortcodes', {
8 init: function( ed, url ) {
9 ed.addButton( 'powerkit_basic_shortcodes_button', {
10 title: 'Basic Shortcodes',
11 image: url.substring( 0, url.length - 3 ) + '/images/icon.png',
12 onclick: function() {
13
14 powerkit_basic_shortcodes = ed.selection;
15 powerkit_basic_shortcodes_content = ed.selection.getContent();
16
17 var width = jQuery( window ).width(),
18 H = jQuery( window ).height(),
19 W = ( 720 < width ) ? 720 : width;
20 W = W - 80;
21 H = H - 84;
22
23
24 var shortcodes_loaded = jQuery( '#powerkit_basic_shortcodes_holder' ).length;
25
26 if ( shortcodes_loaded ) {
27
28 tb_show( 'Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=powerkit_basic_shortcodes' );
29 jQuery( '#TB_window' ).addClass( 'powerkit_basic_shortcodes_window' );
30
31 } else {
32
33 jQuery( "body" ).append( '<div id="powerkit_basic_shortcodes_holder" style="display: none;"><div id="powerkit_basic_shortcodes"></div></div>' );
34
35 jQuery.get( 'admin-ajax.php?action=powerkit_basic_shortcodes_sections', function( data ) {
36 jQuery( '#powerkit_basic_shortcodes' ).html( data );
37 tb_show( 'Basic Shortcodes', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=powerkit_basic_shortcodes' );
38 jQuery( '#TB_window' ).addClass( 'powerkit_basic_shortcodes_window' );
39 } );
40 }
41 }
42 } );
43 },
44 createControl: function( n, cm ) {
45 return null;
46 },
47 } );
48 tinymce.PluginManager.add( 'powerkit_basic_shortcodes', tinymce.plugins.powerkit_basic_shortcodes );
49 } )();