PluginProbe ʕ •ᴥ•ʔ
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid / 7.0.2
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid v7.0.2
7.9.3 7.9.2 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.2.0 4.2.1 4.2.2 4.2.3 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 6.0.0 7.0.0 7.0.1 7.0.2 7.1.0 7.2.0 7.2.1 7.2.10 7.2.11 7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 7.2.7 7.2.8 7.2.9 7.3.0 7.3.1 7.4.0 7.4.1 7.4.2 7.4.3 7.5.0 7.6.0 7.6.1 7.7.0 7.7.1 7.7.10 7.7.11 7.7.12 7.7.13 7.7.14 7.7.15 7.7.16 7.7.17 7.7.18 7.7.19 7.7.2 7.7.20 7.7.21 7.7.22 7.7.3 7.7.4 7.7.5 7.7.6 7.7.7 7.7.8 7.7.9 7.8.0 7.8.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.9.0 7.9.1
the-post-grid / assets / js / mce-button.js
the-post-grid / assets / js Last commit date
admin-preview.js 3 years ago admin.js 3 years ago blocks-placeholder.js 3 years ago editor-el.js 3 years ago mce-button.js 3 years ago post-grid-blocks.js 3 years ago rttpg.js 3 years ago tpg-el-editor.js 3 years ago
mce-button.js
62 lines
1 (function() {
2 tinymce.PluginManager.add('rt_tpg_scg', function( editor, url ) {
3 var tlpsc_tag = 'the-post-grid';
4
5
6 //add popup
7 editor.addCommand('rt_tpg_scg_popup', function(ui, v) {
8 //setup defaults
9
10 editor.windowManager.open( {
11 title: 'The Post Grid ShortCode',
12 width: jQuery( window ).width() * 0.3,
13 height: (jQuery( window ).height() - 36 - 50) * 0.1,
14 id: 'rt-tpg-insert-dialog',
15 body: [
16 {
17 type : 'container',
18 html : '<span class="rt-loading">Loading...</span>'
19 },
20 ],
21 onsubmit: function( e ) {
22
23 var shortcode_str;
24 var id = jQuery("#scid").val();
25 var title = jQuery( "#scid option:selected" ).text();
26 if(id && id != 'undefined'){
27 shortcode_str = '[' + tlpsc_tag;
28 shortcode_str += ' id="'+id+'" title="'+ title +'"';
29 shortcode_str += ']';
30 }
31 if(shortcode_str) {
32 editor.insertContent(shortcode_str);
33 }else{
34 alert('No short code selected');
35 }
36 }
37 });
38
39 putScList();
40 });
41
42 //add button
43 editor.addButton('rt_tpg_scg', {
44 icon: 'rt_tpg_scg',
45 tooltip: 'The Post Grid',
46 cmd: 'rt_tpg_scg_popup',
47 });
48
49 function putScList(){
50 var dialogBody = jQuery( '#rt-tpg-insert-dialog-body' )
51 jQuery.post( ajaxurl, {
52 action: 'rtTPGShortCodeList'
53 }, function( response ) {
54
55 dialogBody.html(response);
56 console.log(response);
57 });
58
59 }
60
61 });
62 })();