PluginProbe
WP Ultimate Post Grid / 1.7.2
WP Ultimate Post Grid v1.7.2
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / vendor / vafpress / public / js / shortcodes.js

shortcodes.js in WP Ultimate Post Grid 1.7.2, at vendor/vafpress/public/js/shortcodes.js

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function($){
2 function create(sg)
3 {
4 tinymce.create('tinymce.plugins.' + sg.name, {
5 init: function(ed, url) {
6 var cmd_cb = function(name) {
7 return function() {
8 $('#' + name + '_modal').reveal({ animation: 'none' });
9 $('#' + name + '_modal').css('top', parseInt($('#' + name + '_modal').css('top')) - window.scrollY);
10 $('#' + name + '_modal').unbind('reveal:close.vp_sc');
11 $('#' + name + '_modal').bind('reveal:close.vp_sc', function () {
12 $('.vp-sc-menu-item.active').find('.vp-sc-form').scReset().vp_slideUp();
13 $('.vp-sc-menu-item.active').removeClass('active');
14 });
15 $('#' + name + '_modal').unbind('vp_insert_shortcode.vp_tinymce');
16 $('#' + name + '_modal').bind('vp_insert_shortcode.vp_tinymce', function(event, code) {
17 ed.selection.setContent(code);
18 $(ed.getElement()).insertAtCaret(code);
19 });
20 }
21 }
22 ed.addCommand(sg.name + '_cmd', cmd_cb(sg.name));
23 ed.addButton(sg.name, {title: sg.button_title, cmd: sg.name + '_cmd', image: sg.main_image});
24 },
25 getInfo: function() {
26 return {
27 longname: 'Vafpress Framework',
28 author : 'Vafpress'
29 };
30 }
31 });
32 }
33
34 for (var i = 0; i < vp_sg.length; i++){
35 create(vp_sg[i]);
36 }
37
38 })(jQuery);
39
40 for (var i = 0; i < vp_sg.length; i++){
41 tinymce.PluginManager.add(vp_sg[i].name, tinymce.plugins[vp_sg[i].name]);
42 }
43