PageSourceSearch

https://parqueferrol.es/wp-content/plugins/easypromos/js/easypromos-mce-button.js?ver=7.1.2

js parqueferrol.es collected 2026-10-05 01:23:42 UTC 6,627 bytes, 145 lines download raw bytes

1(function() {
2
3    if (typeof tinymce !== 'undefined' && tinymce !== null) {
4        tinymce.create('tinymce.plugins.easypromos_mce_button', {
5            init: function(editor,url) {
6                editor.addButton('easypromos_mce_button', {
7                    title: 'Easypromos',
8                    icon: 'insertdatetime',
9                    onclick:function() { tinyMCE.activeEditor.execCommand('easypromos_embed'); changeType('embed'); }
10                    
11                });
12
13                data = {};
14
15                editor.addCommand('easypromos_embed',function() {
16                    var data = {
17                        promo_id: '',
18                        type: 'embed', 
19                        width: '100%',
20                        frequency: 24,
21                        delay: 5,
22                        platform: 'pr'
23                    }
24                    editor.windowManager.open({
25                        title: 'Insert Shortcode Easypromos',
26                        data: data,
27                        body: [
28                            {
29                                name: 'promo_id',
30                                type: 'textbox',
31                                label: 'Promo ID',
32                                value: data.promo_id,
33                                onchange: function() { data.promo_id = this.value(); }
34                            }, {
35                                name: 'type',
36                                type: 'listbox', 
37                                label: 'Type',
38                                tooltip: 'Embed: display the promotion by embedding it on your website or blog. Pop-up: show your promotion as a pop-up. Determine the delay and frequency settings for your pop-up',
39                                id: 'easyp_listbox',
40                                values: [
41                                    {
42                                        value: 'embed',
43                                        text: 'Embed'
44                                    }, {
45                                        value: 'popup',
46                                        text: 'Pop-up'
47                                    }
48                                ],
49                                onchange: function() { 
50                                    data.type = this.value(); 
51                                },
52                                onclick: function() {
53                                    changeType(this.value());
54                                }
55                            }, {
56                                name: 'platform',
57                                type: 'listbox',
58                                label: 'Version',
59                                values: [
60                                    {
61                                        value: 'pr',
62                                        text: 'Premium'
63                                    }, {
64                                        value: 'wl',
65                                        text: 'White Label / Corporate'
66                                    }
67                                ],
68                                onchange: function() { data.platform = this.value(); }
69                            }, {
70                                id: 'easyp_embed',
71                                name: 'width',
72                                type: 'textbox',
73                                label: 'Width',
74                                tooltip: 'px or %',
75                                value: data.width,
76                                onchange: function() { data.width = this.value(); }
77                            }, {
78                                id: 'easyp_popup_fr',
79                                name: 'frequency',
80                                type: 'textbox',
81                                label: 'Frequency',
82                                tooltip: 'Decide how often the pop-up window will appear',
83                                value: data.frequency,
84                                onchange: function() { data.frequency = this.value(); }
85                            }, {
86                                id: 'easyp_popup_de',
87                                name: 'delay',
88                                type: 'textbox',
89                                label: 'Delay',
90                                tooltip: 'Decide after how long the pop-up window will appear',
91                                value: data.frequency,
92                                onchange: function() { data.delay = this.value(); }
93                            }
94                        ],
95                        onSubmit: function(e) {
96                            var shortcode = '[Easypromos';
97                            data = tinymce.extend(data, e.data);
98
99
100                            shortcode += ' promo_id="' + data.promo_id + '"';
101                            shortcode += ' type="' + data.type + '"';
102                            shortcode += ' platform="' + data.platform 
102+ '"';
103                            if(data.type == 'embed') {
104                                shortcode += ' width="' + data.width + '"';
105                            } else {
106                                shortcode += ' frequency="' + data.frequency + '"';
107                                shortcode += ' delay="' + data.delay + '"';
108                            }
109
110
111                            shortcode += ' /]';
112
113                            tinymce.execCommand('mceInsertContent', false, shortcode);
114                        }
115                    })
116                });
117            },
118            createControl: function(n,cm) {
119                return null;
120            },
121            getInfo: function() {
122                return {
123                    longname: 'Easypromos plugin',
124                    author: 'Easypromos',
125                    authorurl: 'https://www.easypromosapp.com',
126                    infourl: 'https://www.easypromosapp.com',
127                    version: '1.3.9'
128                }
129            }
130        });
131        tinymce.PluginManager.add('easypromos_mce_button',tinymce.plugins.easypromos_mce_button);
132    }
133})();
134
135function changeType(e) {
136    if(e=='embed') {
137        document.getElementById('easyp_embed').disabled=false;
138        document.getElementById('easyp_popup_fr').disabled=true;
139        document.getElementById('easyp_popup_de').disabled=true;
140    } else {
141        document.getElementById('easyp_embed').disabled=true;
142        document.getElementById('easyp_popup_fr').disabled=false;
143        document.getElementById('easyp_popup_de').disabled=false;
144    }
145}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.