PopBox For Elementor - Version 1.0.6

Version Description

  • NEW: Added On Page load popup module - does not fire on mobile devices.
  • NEW: Added a Switch control to load the stop Video propagation script when the popup is closed.
  • EXPERIMENTAL: Track PopBox button click event through Google Analytics - needs testing and feedback.
  • NEW: Regenerated a new pot file easier plugin translation
  • TWEAKS: Minor CSS tweaks
Download this release

Release Info

Developer norewp
Plugin Icon wp plugin PopBox For Elementor
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

css/popup.css CHANGED
@@ -21,6 +21,20 @@
21
  }
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  .modal-body {
25
  padding: 0px !important;
26
  }
@@ -52,4 +66,15 @@ body.modal-open .modal {
52
  position: absolute;
53
  right: 0;
54
  top: 0;
 
 
 
 
 
 
 
 
 
 
 
55
  }
21
  }
22
  }
23
 
24
+ @media screen and (max-width: 1024px) {
25
+ .modal {
26
+ display: block;
27
+ vertical-align: middle;
28
+ width: 100%;
29
+ margin: 0 auto;
30
+ padding-top: 80px;
31
+ }
32
+
33
+ .modal.modal-onload {
34
+ display: none;
35
+ }
36
+ }
37
+
38
  .modal-body {
39
  padding: 0px !important;
40
  }
66
  position: absolute;
67
  right: 0;
68
  top: 0;
69
+ }
70
+
71
+ .modal-backdrop {
72
+ display: none;
73
+ }
74
+
75
+ .modal-footer .nothanks {
76
+ background-color: #ffffff;
77
+ color: #333333;
78
+ padding: 8px 12px;
79
+ cursor: pointer;
80
  }
js/jquery.cookie.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.0
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as anonymous module.
11
+ define(['jquery'], factory);
12
+ } else {
13
+ // Browser globals.
14
+ factory(jQuery);
15
+ }
16
+ }(function ($) {
17
+
18
+ var pluses = /\+/g;
19
+
20
+ function encode(s) {
21
+ return config.raw ? s : encodeURIComponent(s);
22
+ }
23
+
24
+ function decode(s) {
25
+ return config.raw ? s : decodeURIComponent(s);
26
+ }
27
+
28
+ function stringifyCookieValue(value) {
29
+ return encode(config.json ? JSON.stringify(value) : String(value));
30
+ }
31
+
32
+ function parseCookieValue(s) {
33
+ if (s.indexOf('"') === 0) {
34
+ // This is a quoted cookie as according to RFC2068, unescape...
35
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
36
+ }
37
+
38
+ try {
39
+ // Replace server-side written pluses with spaces.
40
+ // If we can't decode the cookie, ignore it, it's unusable.
41
+ s = decodeURIComponent(s.replace(pluses, ' '));
42
+ } catch(e) {
43
+ return;
44
+ }
45
+
46
+ try {
47
+ // If we can't parse the cookie, ignore it, it's unusable.
48
+ return config.json ? JSON.parse(s) : s;
49
+ } catch(e) {}
50
+ }
51
+
52
+ function read(s, converter) {
53
+ var value = config.raw ? s : parseCookieValue(s);
54
+ return $.isFunction(converter) ? converter(value) : value;
55
+ }
56
+
57
+ var config = $.cookie = function (key, value, options) {
58
+
59
+ // Write
60
+ if (value !== undefined && !$.isFunction(value)) {
61
+ options = $.extend({}, config.defaults, options);
62
+
63
+ if (typeof options.expires === 'number') {
64
+ var days = options.expires, t = options.expires = new Date();
65
+ t.setDate(t.getDate() + days);
66
+ }
67
+
68
+ return (document.cookie = [
69
+ encode(key), '=', stringifyCookieValue(value),
70
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
71
+ options.path ? '; path=' + options.path : '',
72
+ options.domain ? '; domain=' + options.domain : '',
73
+ options.secure ? '; secure' : ''
74
+ ].join(''));
75
+ }
76
+
77
+ // Read
78
+
79
+ var result = key ? undefined : {};
80
+
81
+ // To prevent the for loop in the first place assign an empty array
82
+ // in case there are no cookies at all. Also prevents odd result when
83
+ // calling $.cookie().
84
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
85
+
86
+ for (var i = 0, l = cookies.length; i < l; i++) {
87
+ var parts = cookies[i].split('=');
88
+ var name = decode(parts.shift());
89
+ var cookie = parts.join('=');
90
+
91
+ if (key && key === name) {
92
+ // If second argument (value) is a function it's a converter...
93
+ result = read(cookie, value);
94
+ break;
95
+ }
96
+
97
+ // Prevent storing a cookie that we couldn't decode.
98
+ if (!key && (cookie = read(cookie)) !== undefined) {
99
+ result[name] = cookie;
100
+ }
101
+ }
102
+
103
+ return result;
104
+ };
105
+
106
+ config.defaults = {};
107
+
108
+ $.removeCookie = function (key, options) {
109
+ if ($.cookie(key) !== undefined) {
110
+ // Must not alter options, thus extending a fresh object...
111
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
112
+ return true;
113
+ }
114
+ return false;
115
+ };
116
+
117
+ }));
js/popup.js CHANGED
@@ -1,3 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  jQuery(document).ready(function($){
2
  $('.modal-popup').click(function(){
3
  var popup_id = $(this).attr('data-target');
1
+ var isMobile = {
2
+ Android: function() {
3
+ return navigator.userAgent.match(/Android/i);
4
+ },
5
+ BlackBerry: function() {
6
+ return navigator.userAgent.match(/BlackBerry/i);
7
+ },
8
+ iOS: function() {
9
+ return navigator.userAgent.match(/iPhone|iPad|iPod/i);
10
+ },
11
+ Opera: function() {
12
+ return navigator.userAgent.match(/Opera Mini/i);
13
+ },
14
+ Windows: function() {
15
+ return navigator.userAgent.match(/IEMobile/i);
16
+ },
17
+ any: function() {
18
+ return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
19
+ }
20
+ };
21
+
22
  jQuery(document).ready(function($){
23
  $('.modal-popup').click(function(){
24
  var popup_id = $(this).attr('data-target');
languages/lm-modal.pot DELETED
@@ -1,55 +0,0 @@
1
- #, fuzzy
2
- msgid ""
3
- msgstr ""
4
- "Project-Id-Version: PACKAGE VERSION\n"
5
- "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2016-10-18 22:20+0000\n"
7
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
- "Language-Team: \n"
10
- "Language: \n"
11
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Loco https://localise.biz/"
16
-
17
- #: LM-popup.php:36
18
- msgid "Popups"
19
- msgstr ""
20
-
21
- #: LM-popup.php:37 LM-popup.php:105
22
- msgid "Popup"
23
- msgstr ""
24
-
25
- #: LM-popup.php:38
26
- msgid "All Popups"
27
- msgstr ""
28
-
29
- #: LM-popup.php:39 LM-popup.php:40 LM-popup.php:41
30
- msgid "Add New Popup"
31
- msgstr ""
32
-
33
- #: LM-popup.php:42
34
- msgid "Edit Popup"
35
- msgstr ""
36
-
37
- #: LM-popup.php:111
38
- msgid "Choose Popup"
39
- msgstr ""
40
-
41
- #. Name of the plugin
42
- msgid "Elementor Popups"
43
- msgstr ""
44
-
45
- #. Description of the plugin
46
- msgid "Popup element for Elementor Page Builder"
47
- msgstr ""
48
-
49
- #. Author of the plugin
50
- msgid "Avi Bashari"
51
- msgstr ""
52
-
53
- #. Author URI of the plugin
54
- msgid "https://facebook.com/bashari10"
55
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/modal-for-elementor.pot ADDED
@@ -0,0 +1,484 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: PopBox For Elementor\n"
5
+ "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2018-02-19 20:53+0000\n"
7
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
+ "Language-Team: \n"
10
+ "Language: \n"
11
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Loco https://localise.biz/"
16
+
17
+ #: modal-for-elementor.php:69
18
+ msgid ""
19
+ "Elementor Starter is not working because you need to activate the Elementor "
20
+ "plugin."
21
+ msgstr ""
22
+
23
+ #: modal-for-elementor.php:70
24
+ msgid "Activate Elementor Now"
25
+ msgstr ""
26
+
27
+ #: modal-for-elementor.php:78
28
+ msgid ""
29
+ "Modal For Elementor is not working because you need to install the Elemenor "
30
+ "plugin"
31
+ msgstr ""
32
+
33
+ #: modal-for-elementor.php:79
34
+ msgid "Install Elementor Now"
35
+ msgstr ""
36
+
37
+ #: modal-for-elementor.php:93
38
+ msgid ""
39
+ "Modal For Elementor is not working because you are using an old version of "
40
+ "Elementor."
41
+ msgstr ""
42
+
43
+ #: modal-for-elementor.php:94
44
+ msgid "Update Elementor Now"
45
+ msgstr ""
46
+
47
+ #: modal-for-elementor.php:136
48
+ msgid "PopBoxes"
49
+ msgstr ""
50
+
51
+ #: modal-for-elementor.php:137
52
+ msgid "PopBox"
53
+ msgstr ""
54
+
55
+ #: modal-for-elementor.php:138
56
+ msgid "All PopBoxes"
57
+ msgstr ""
58
+
59
+ #: modal-for-elementor.php:139 modal-for-elementor.php:140
60
+ #: modal-for-elementor.php:141
61
+ msgid "Add New PopBox"
62
+ msgstr ""
63
+
64
+ #: modal-for-elementor.php:142
65
+ msgid "Edit PopBox"
66
+ msgstr ""
67
+
68
+ #: plugin.php:38
69
+ msgid "NoreWP's Elementor Modules"
70
+ msgstr ""
71
+
72
+ #: widgets/popup.php:26
73
+ msgid "PopBox: On Click"
74
+ msgstr ""
75
+
76
+ #: widgets/popup.php:36 widgets/popup-load.php:36
77
+ msgid "Extra Small"
78
+ msgstr ""
79
+
80
+ #: widgets/popup.php:37 widgets/popup-load.php:37
81
+ msgid "Small"
82
+ msgstr ""
83
+
84
+ #: widgets/popup.php:38 widgets/popup-load.php:38
85
+ msgid "Medium"
86
+ msgstr ""
87
+
88
+ #: widgets/popup.php:39 widgets/popup-load.php:39
89
+ msgid "Large"
90
+ msgstr ""
91
+
92
+ #: widgets/popup.php:40 widgets/popup-load.php:40
93
+ msgid "Extra Large"
94
+ msgstr ""
95
+
96
+ #: widgets/popup.php:73
97
+ msgid "Trigger Button"
98
+ msgstr ""
99
+
100
+ #: widgets/popup.php:79
101
+ msgid "Type"
102
+ msgstr ""
103
+
104
+ #: widgets/popup.php:83
105
+ msgid "Default"
106
+ msgstr ""
107
+
108
+ #: widgets/popup.php:84
109
+ msgid "Info"
110
+ msgstr ""
111
+
112
+ #: widgets/popup.php:85
113
+ msgid "Success"
114
+ msgstr ""
115
+
116
+ #: widgets/popup.php:86
117
+ msgid "Warning"
118
+ msgstr ""
119
+
120
+ #: widgets/popup.php:87
121
+ msgid "Danger"
122
+ msgstr ""
123
+
124
+ #: widgets/popup.php:94
125
+ msgid "Text"
126
+ msgstr ""
127
+
128
+ #: widgets/popup.php:96 widgets/popup.php:97
129
+ msgid "Click me"
130
+ msgstr ""
131
+
132
+ #: widgets/popup.php:103
133
+ msgid "Alignment"
134
+ msgstr ""
135
+
136
+ #: widgets/popup.php:107 widgets/popup.php:297 widgets/popup-load.php:130
137
+ #: widgets/popup-load.php:270
138
+ msgid "Left"
139
+ msgstr ""
140
+
141
+ #: widgets/popup.php:111 widgets/popup-load.php:134
142
+ msgid "Center"
143
+ msgstr ""
144
+
145
+ #: widgets/popup.php:115 widgets/popup.php:296 widgets/popup-load.php:138
146
+ #: widgets/popup-load.php:269
147
+ msgid "Right"
148
+ msgstr ""
149
+
150
+ #: widgets/popup.php:119
151
+ msgid "Justified"
152
+ msgstr ""
153
+
154
+ #: widgets/popup.php:130
155
+ msgid "Size"
156
+ msgstr ""
157
+
158
+ #: widgets/popup.php:139
159
+ msgid "Icon"
160
+ msgstr ""
161
+
162
+ #: widgets/popup.php:148
163
+ msgid "Icon Position"
164
+ msgstr ""
165
+
166
+ #: widgets/popup.php:152
167
+ msgid "Before"
168
+ msgstr ""
169
+
170
+ #: widgets/popup.php:153
171
+ msgid "After"
172
+ msgstr ""
173
+
174
+ #: widgets/popup.php:163
175
+ msgid "Icon Spacing"
176
+ msgstr ""
177
+
178
+ #: widgets/popup.php:184
179
+ msgid "Typography"
180
+ msgstr ""
181
+
182
+ #: widgets/popup.php:193
183
+ msgid "Turn on GA Track Event?"
184
+ msgstr ""
185
+
186
+ #: widgets/popup.php:199
187
+ msgid "Track the PopBox button click event throught Google Analytics."
188
+ msgstr ""
189
+
190
+ #: widgets/popup.php:206
191
+ msgid ""
192
+ "EXPERIMENTAL: Feedback on results & if working or not will be greatly "
193
+ "appreciated!"
194
+ msgstr ""
195
+
196
+ #: widgets/popup.php:217
197
+ msgid "Google Track Text"
198
+ msgstr ""
199
+
200
+ #: widgets/popup.php:219
201
+ msgid "PopBox Button Clicked"
202
+ msgstr ""
203
+
204
+ #: widgets/popup.php:220
205
+ msgid ""
206
+ "Enter text to be sent to Google Analytics as part of the button click event -"
207
+ " the PopBox title would be ideal!"
208
+ msgstr ""
209
+
210
+ #: widgets/popup.php:230
211
+ msgid "NOTE: You need to have Google Analytics enabled for this to work!"
212
+ msgstr ""
213
+
214
+ #: widgets/popup.php:241 widgets/popup-load.php:214
215
+ msgid "View"
216
+ msgstr ""
217
+
218
+ #: widgets/popup.php:251 widgets/popup-load.php:224
219
+ msgid "PopBox Content"
220
+ msgstr ""
221
+
222
+ #: widgets/popup.php:257
223
+ msgid "Select Modal Content"
224
+ msgstr ""
225
+
226
+ #: widgets/popup.php:267 widgets/popup-load.php:240
227
+ msgid "Video Content?"
228
+ msgstr ""
229
+
230
+ #: widgets/popup.php:273 widgets/popup-load.php:246
231
+ msgid ""
232
+ "Does the PopBox content contain a video? Setting this to Yes will stop the "
233
+ "video from playing when the popup is closed."
234
+ msgstr ""
235
+
236
+ #: widgets/popup.php:280 widgets/popup-load.php:253
237
+ msgid "Show Close Button"
238
+ msgstr ""
239
+
240
+ #: widgets/popup.php:282 widgets/popup-load.php:255
241
+ msgid "Hide"
242
+ msgstr ""
243
+
244
+ #: widgets/popup.php:283 widgets/popup-load.php:256
245
+ msgid "Show"
246
+ msgstr ""
247
+
248
+ #: widgets/popup.php:294 widgets/popup-load.php:267
249
+ msgid "Switch Button Position"
250
+ msgstr ""
251
+
252
+ #: widgets/popup.php:308 widgets/popup-load.php:281
253
+ msgid "Icon Size"
254
+ msgstr ""
255
+
256
+ #: widgets/popup.php:325 widgets/popup-load.php:298
257
+ msgid "Close Padding"
258
+ msgstr ""
259
+
260
+ #: widgets/popup.php:326 widgets/popup-load.php:299
261
+ msgid ""
262
+ "Please note that padding bottom has no effect - Left/Right padding will "
263
+ "depend on button position!"
264
+ msgstr ""
265
+
266
+ #: widgets/popup.php:339 widgets/popup-load.php:312
267
+ msgid "Close Text"
268
+ msgstr ""
269
+
270
+ #: widgets/popup.php:341 widgets/popup-load.php:314
271
+ msgid "Close"
272
+ msgstr ""
273
+
274
+ #: widgets/popup.php:343 widgets/popup-load.php:316
275
+ msgid "Add call to action i.e \"Close\" before the popup close X"
276
+ msgstr ""
277
+
278
+ #: widgets/popup.php:351 widgets/popup-load.php:190 widgets/popup-load.php:324
279
+ msgid "Close Typography"
280
+ msgstr ""
281
+
282
+ #: widgets/popup.php:362
283
+ msgid "Button"
284
+ msgstr ""
285
+
286
+ #: widgets/popup.php:372
287
+ msgid "Settings"
288
+ msgstr ""
289
+
290
+ #: widgets/popup.php:380 widgets/popup.php:685 widgets/popup-load.php:502
291
+ msgid "Border"
292
+ msgstr ""
293
+
294
+ #: widgets/popup.php:390 widgets/popup.php:695 widgets/popup-load.php:202
295
+ #: widgets/popup-load.php:512
296
+ msgid "Border Radius"
297
+ msgstr ""
298
+
299
+ #: widgets/popup.php:410
300
+ msgid "Text Padding"
301
+ msgstr ""
302
+
303
+ #: widgets/popup.php:425
304
+ msgid "Colors"
305
+ msgstr ""
306
+
307
+ #: widgets/popup.php:432 widgets/popup.php:468
308
+ msgid "Text Color"
309
+ msgstr ""
310
+
311
+ #: widgets/popup.php:444 widgets/popup.php:479
312
+ msgid "Background Color"
313
+ msgstr ""
314
+
315
+ #: widgets/popup.php:461
316
+ msgid "Hover"
317
+ msgstr ""
318
+
319
+ #: widgets/popup.php:490
320
+ msgid "Border Color"
321
+ msgstr ""
322
+
323
+ #: widgets/popup.php:504
324
+ msgid "Animation"
325
+ msgstr ""
326
+
327
+ #: widgets/popup.php:519 widgets/popup-load.php:336
328
+ msgid "Modal Container"
329
+ msgstr ""
330
+
331
+ #: widgets/popup.php:527 widgets/popup-load.php:344
332
+ msgid "Container Max-Width"
333
+ msgstr ""
334
+
335
+ #: widgets/popup.php:554 widgets/popup-load.php:371
336
+ msgid "Select and configure the required modal overlay background type below"
337
+ msgstr ""
338
+
339
+ #: widgets/popup.php:574 widgets/popup-load.php:391
340
+ msgid "Modal Content"
341
+ msgstr ""
342
+
343
+ #: widgets/popup.php:590 widgets/popup-load.php:407
344
+ msgid "Popup Window Background"
345
+ msgstr ""
346
+
347
+ #: widgets/popup.php:600 widgets/popup-load.php:417
348
+ msgid "Close Button Color"
349
+ msgstr ""
350
+
351
+ #: widgets/popup.php:612 widgets/popup-load.php:429
352
+ msgid "Modal Width"
353
+ msgstr ""
354
+
355
+ #: widgets/popup.php:639 widgets/popup-load.php:456
356
+ msgid "Top Offset"
357
+ msgstr ""
358
+
359
+ #: widgets/popup.php:666 widgets/popup-load.php:483
360
+ msgid "Padding"
361
+ msgstr ""
362
+
363
+ #: widgets/popup-load.php:26
364
+ msgid "PopBox: On Load"
365
+ msgstr ""
366
+
367
+ #: widgets/popup-load.php:73
368
+ msgid "PopBox Settings"
369
+ msgstr ""
370
+
371
+ #: widgets/popup-load.php:91
372
+ msgid "Numbers Only!"
373
+ msgstr ""
374
+
375
+ #: widgets/popup-load.php:92
376
+ msgid ""
377
+ "The number of seconds to wait before displaying the popup - ex: 3000 = 3 "
378
+ "seconds"
379
+ msgstr ""
380
+
381
+ #: widgets/popup-load.php:99
382
+ msgid "Never Show Again"
383
+ msgstr ""
384
+
385
+ #: widgets/popup-load.php:105
386
+ msgid ""
387
+ "Allow visitors to dismiss the popup indefinately - this allows for better UX "
388
+ "for those who have already taken action."
389
+ msgstr ""
390
+
391
+ #: widgets/popup-load.php:112
392
+ msgid "Dismiss Text"
393
+ msgstr ""
394
+
395
+ #: widgets/popup-load.php:114
396
+ msgid "Don't Show Again"
397
+ msgstr ""
398
+
399
+ #: widgets/popup-load.php:115
400
+ msgid "Dismis Text!"
401
+ msgstr ""
402
+
403
+ #: widgets/popup-load.php:116
404
+ msgid "Text to show for the dismiss option"
405
+ msgstr ""
406
+
407
+ #: widgets/popup-load.php:126
408
+ msgid "Dismiss Alignment"
409
+ msgstr ""
410
+
411
+ #: widgets/popup-load.php:157
412
+ msgid "Footer Padding"
413
+ msgstr ""
414
+
415
+ #: widgets/popup-load.php:173
416
+ msgid "Dismiss Button Padding"
417
+ msgstr ""
418
+
419
+ #: widgets/popup-load.php:230
420
+ msgid "Select Popup Content"
421
+ msgstr ""
422
+
423
+ #: widgets/popup-load.php:399
424
+ msgid ""
425
+ "Select and configure the required popup modal window's background type below"
426
+ msgstr ""
427
+
428
+ #: widgets/popup-load.php:534
429
+ msgid "Dismiss Options"
430
+ msgstr ""
431
+
432
+ #: widgets/popup-load.php:541
433
+ msgid "Dismiss Settings"
434
+ msgstr ""
435
+
436
+ #: widgets/popup-load.php:546
437
+ msgid "Set background for the dimiss footer section"
438
+ msgstr ""
439
+
440
+ #: widgets/popup-load.php:554
441
+ msgid "Footer Background"
442
+ msgstr ""
443
+
444
+ #: widgets/popup-load.php:564
445
+ msgid "Footer Border Color"
446
+ msgstr ""
447
+
448
+ #: widgets/popup-load.php:575
449
+ msgid "Dismiss Button"
450
+ msgstr ""
451
+
452
+ #: widgets/popup-load.php:580
453
+ msgid "Dismiss Button Color"
454
+ msgstr ""
455
+
456
+ #: widgets/popup-load.php:592
457
+ msgid "Set background for the dimiss button"
458
+ msgstr ""
459
+
460
+ #: widgets/popup-load.php:600
461
+ msgid "Button Background"
462
+ msgstr ""
463
+
464
+ #. Name of the plugin
465
+ msgid "PopBox For Elementor"
466
+ msgstr ""
467
+
468
+ #. Description of the plugin
469
+ msgid ""
470
+ "Create content-rich popboxes for your site using the power of Elementor Page "
471
+ "Builder"
472
+ msgstr ""
473
+
474
+ #. URI of the plugin
475
+ msgid "https://designsbynore.com/popups/popbox/"
476
+ msgstr ""
477
+
478
+ #. Author of the plugin
479
+ msgid "Zulfikar Nore"
480
+ msgstr ""
481
+
482
+ #. Author URI of the plugin
483
+ msgid "https://designsbynore.com/"
484
+ msgstr ""
modal-for-elementor.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: PopBox For Elementor
4
  * Description: Create content-rich popboxes for your site using the power of Elementor Page Builder
5
- * Version: 1.0.5
6
  * Author: Zulfikar Nore
7
  * Author URI: https://designsbynore.com/
8
  * Plugin URI: https://designsbynore.com/popups/popbox/
@@ -12,7 +12,7 @@
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
- define( 'MODAL_ELEMENTOR_VERSION', '1.0.5' );
16
 
17
  define( 'MODAL_ELEMENTOR__FILE__', __FILE__ );
18
  define( 'MODAL_ELEMENTOR_PLUGIN_BASE', plugin_basename( MODAL_ELEMENTOR__FILE__ ) );
@@ -118,9 +118,10 @@ function register_popup_style() {
118
  array ( 'modal-popup' )
119
  );
120
  }
121
-
122
  wp_enqueue_script( 'bootstrap', plugin_dir_url( __FILE__ ) . 'js/bootstrap.js', array( 'jquery' ), null, true );
123
  wp_enqueue_script( 'modal-popup-js', plugin_dir_url( __FILE__ ) . 'js/popup.js', array( 'jquery', 'bootstrap' ), null, true );
 
124
  }
125
 
126
  /* create new custom post type named popup */
2
  /**
3
  * Plugin Name: PopBox For Elementor
4
  * Description: Create content-rich popboxes for your site using the power of Elementor Page Builder
5
+ * Version: 1.0.6
6
  * Author: Zulfikar Nore
7
  * Author URI: https://designsbynore.com/
8
  * Plugin URI: https://designsbynore.com/popups/popbox/
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
+ define( 'MODAL_ELEMENTOR_VERSION', '1.0.6' );
16
 
17
  define( 'MODAL_ELEMENTOR__FILE__', __FILE__ );
18
  define( 'MODAL_ELEMENTOR_PLUGIN_BASE', plugin_basename( MODAL_ELEMENTOR__FILE__ ) );
118
  array ( 'modal-popup' )
119
  );
120
  }
121
+ wp_enqueue_script( 'jquery-cookie', plugin_dir_url( __FILE__ ) . 'js/jquery.cookie.js', array( 'jquery' ), null, false );
122
  wp_enqueue_script( 'bootstrap', plugin_dir_url( __FILE__ ) . 'js/bootstrap.js', array( 'jquery' ), null, true );
123
  wp_enqueue_script( 'modal-popup-js', plugin_dir_url( __FILE__ ) . 'js/popup.js', array( 'jquery', 'bootstrap' ), null, true );
124
+
125
  }
126
 
127
  /* create new custom post type named popup */
plugin.php CHANGED
@@ -2,6 +2,7 @@
2
  namespace ElementorModal;
3
 
4
  use ElementorModal\Widgets\ElementorModal;
 
5
 
6
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
7
 
@@ -25,14 +26,16 @@ class ElementorModalPlugin {
25
 
26
  private function includes() {
27
  require __DIR__ . '/widgets/popup.php';
 
28
  }
29
 
30
  private function register_widget() {
31
  \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() );
 
32
  \Elementor\Plugin::instance()->elements_manager->add_category(
33
  'norewp-elements',
34
  [
35
- 'title' => 'NoreWP\'s Elementor Modules',
36
  'icon' => 'fa fa-plug'
37
  ],
38
  1
2
  namespace ElementorModal;
3
 
4
  use ElementorModal\Widgets\ElementorModal;
5
+ use ElementorModal\Widgets\ElementorModalLoad;
6
 
7
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
 
26
 
27
  private function includes() {
28
  require __DIR__ . '/widgets/popup.php';
29
+ require __DIR__ . '/widgets/popup-load.php';
30
  }
31
 
32
  private function register_widget() {
33
  \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() );
34
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModalLoad() );
35
  \Elementor\Plugin::instance()->elements_manager->add_category(
36
  'norewp-elements',
37
  [
38
+ 'title' => __( 'NoreWP\'s Elementor Modules', 'modal-for-elementor' ),
39
  'icon' => 'fa fa-plug'
40
  ],
41
  1
readme.txt CHANGED
@@ -4,24 +4,24 @@ Donate link: https://www.paypal.me/NoreMarketing/5
4
  Tags: PopBox, Modal, Popup, Elementor
5
  Requires at least: 4.4
6
  Tested up to: 4.9
7
- Stable tag: 1.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Add a modal widget for Elementor Page Builder.
12
 
13
  == Description ==
14
 
15
- NOTE: Modal For Elementor is now PopBox For Elementor and development will now be continued by Zulfikar Nore of NoreWP :)
16
-
17
  PopBox for Elementor allows the creation of beautiful templates with Elementor Page Builder for use with the included Popbox overlay script.
18
 
19
- An Admin menu will be added on your Wordpress Dashboard sidepane named PopBoxes. This is the custom post type (CPT) you'll use to create the content of the PopBox.
20
 
21
  A custom module will also be added to Elementor Page Builder edit screen to be used for the customization of the trigger button embedded on your page.
22
  Simply select one of the PopBox content created via the CPT to be shown when the trigger button is clicked.
23
 
24
- Brief video on setup (Sorry for the lack of sound): https://youtu.be/M3B9aLLTXKY
 
 
25
 
26
 
27
  == Installation ==
@@ -32,6 +32,14 @@ Brief video on setup (Sorry for the lack of sound): https://youtu.be/M3B9aLLTXKY
32
  Go to settings > permalinks and click save. (you need to do that in order to register the popup post types.)
33
 
34
  == Changelog ==
 
 
 
 
 
 
 
 
35
  = 1.0.5 =
36
  * FIX: PHP Error of undefined variable $close
37
 
4
  Tags: PopBox, Modal, Popup, Elementor
5
  Requires at least: 4.4
6
  Tested up to: 4.9
7
+ Stable tag: 1.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Adds a popup modal widget for Elementor Page Builder.
12
 
13
  == Description ==
14
 
 
 
15
  PopBox for Elementor allows the creation of beautiful templates with Elementor Page Builder for use with the included Popbox overlay script.
16
 
17
+ An Admin menu will be added on your Wordpress Dashboard sidepane named PopBoxes. This is the custom post type (CPT) you'll use to create the content of the PopBoxs.
18
 
19
  A custom module will also be added to Elementor Page Builder edit screen to be used for the customization of the trigger button embedded on your page.
20
  Simply select one of the PopBox content created via the CPT to be shown when the trigger button is clicked.
21
 
22
+ WP Elevation Studio Troy Dean shows us how to use PopBox for Elementor to create easy and stunning popup forms:
23
+
24
+ https://www.youtube.com/watch?v=IFOGbLsAgo4
25
 
26
 
27
  == Installation ==
32
  Go to settings > permalinks and click save. (you need to do that in order to register the popup post types.)
33
 
34
  == Changelog ==
35
+
36
+ = 1.0.6 =
37
+ * NEW: Added On Page load popup module - does not fire on mobile devices.
38
+ * NEW: Added a Switch control to load the stop Video propagation script when the popup is closed.
39
+ * EXPERIMENTAL: Track PopBox button click event through Google Analytics - needs testing and feedback.
40
+ * NEW: Regenerated a new pot file easier plugin translation
41
+ * TWEAKS: Minor CSS tweaks
42
+
43
  = 1.0.5 =
44
  * FIX: PHP Error of undefined variable $close
45
 
widgets/popup-load.php ADDED
@@ -0,0 +1,693 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorModal\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+ use Elementor\Group_Control_Typography;
7
+ use Elementor\Scheme_Typography;
8
+ use Elementor\Scheme_Color;
9
+ use Elementor\Group_Control_Border;
10
+ use Elementor\Group_Control_Background;
11
+ use Elementor\Group_Control_Box_Shadow;
12
+ use Elementor\Frontend;
13
+ use WP_Query;
14
+
15
+
16
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
+
18
+ class ElementorModalLoad extends Widget_Base {
19
+
20
+ protected $_has_template_content = false;
21
+
22
+ public function get_name() {
23
+ return 'popup-load';
24
+ }
25
+ public function get_title() {
26
+ return __( 'PopBox: On Load', 'modal-for-elementor' );
27
+ }
28
+ public function get_icon() {
29
+ return 'eicon-text-field';
30
+ }
31
+ public function get_categories() {
32
+ return [ 'norewp-elements' ];
33
+ }
34
+ public static function get_button_sizes() {
35
+ return [
36
+ 'xs' => __( 'Extra Small', 'modal-for-elementor' ),
37
+ 'sm' => __( 'Small', 'modal-for-elementor' ),
38
+ 'md' => __( 'Medium', 'modal-for-elementor' ),
39
+ 'lg' => __( 'Large', 'modal-for-elementor' ),
40
+ 'xl' => __( 'Extra Large', 'modal-for-elementor' ),
41
+ ];
42
+ }
43
+ protected function get_popups() {
44
+ $popups_query = new WP_Query( array(
45
+ 'post_type' => 'elementor-popup',
46
+ 'posts_per_page' => -1,
47
+ ) );
48
+
49
+ if ( $popups_query->have_posts() ) {
50
+ $popups_array = array();
51
+ $popups = $popups_query->get_posts();
52
+
53
+ $i = 0;
54
+ foreach( $popups as $popap ) {
55
+ $popups_array[$popap->ID] = $popap->post_title;
56
+ if($i === 0)
57
+ $selected = $popap->ID;
58
+ $i++;
59
+ }
60
+
61
+ $popups = array(
62
+ 'first_popup' => $selected,
63
+ 'popups' => $popups_array,
64
+ );
65
+ return $popups;
66
+ }
67
+ }
68
+ protected function _register_controls() {
69
+
70
+ $this->start_controls_section(
71
+ 'section_button',
72
+ [
73
+ 'label' => __( 'PopBox Settings', 'modal-for-elementor' ),
74
+ ]
75
+ );
76
+
77
+ $this->add_control(
78
+ 'popbox_onload_info',
79
+ [
80
+ 'label' => __( 'NOTE: Mobile Devices Are Not Supported!', 'elementor-designer' ),
81
+ 'type' => Controls_Manager::RAW_HTML,
82
+ ]
83
+ );
84
+
85
+ $this->add_control(
86
+ 'popbox_load_delay',
87
+ [
88
+ 'label' => __( 'Popup Delay', 'elementor-designer' ),
89
+ 'type' => Controls_Manager::NUMBER,
90
+ 'default' => 3000,
91
+ 'title' => __( 'Numbers Only!', 'modal-for-elementor' ),
92
+ 'description' => __( 'The number of seconds to wait before displaying the popup - ex: 3000 = 3 seconds', 'modal-for-elementor' ),
93
+ ]
94
+ );
95
+
96
+ $this->add_control(
97
+ 'modal_dismissable',
98
+ [
99
+ 'label' => __( 'Never Show Again', 'modal-for-elementor' ),
100
+ 'type' => Controls_Manager::SWITCHER,
101
+ 'default' => '',
102
+ 'label_on' => 'YES',
103
+ 'label_off' => 'NO',
104
+ 'return_value' => 'yes',
105
+ 'description' => __( 'Allow visitors to dismiss the popup indefinately - this allows for better UX for those who have already taken action.', 'modal-for-elementor' ),
106
+ ]
107
+ );
108
+
109
+ $this->add_control(
110
+ 'dismissable_text',
111
+ [
112
+ 'label' => __( 'Dismiss Text', 'modal-for-elementor' ),
113
+ 'type' => Controls_Manager::TEXT,
114
+ 'default' => __( 'Don\'t Show Again', 'modal-for-elementor' ),
115
+ 'title' => __( 'Dismis Text!', 'modal-for-elementor' ),
116
+ 'description' => __( 'Text to show for the dismiss option', 'modal-for-elementor' ),
117
+ 'condition' => [
118
+ 'modal_dismissable' => 'yes',
119
+ ],
120
+ ]
121
+ );
122
+
123
+ $this->add_responsive_control(
124
+ 'dismiss_align',
125
+ [
126
+ 'label' => __( 'Dismiss Alignment', 'modal-for-elementor' ),
127
+ 'type' => Controls_Manager::CHOOSE,
128
+ 'options' => [
129
+ 'left' => [
130
+ 'title' => __( 'Left', 'modal-for-elementor' ),
131
+ 'icon' => 'fa fa-align-left',
132
+ ],
133
+ 'center' => [
134
+ 'title' => __( 'Center', 'modal-for-elementor' ),
135
+ 'icon' => 'fa fa-align-center',
136
+ ],
137
+ 'right' => [
138
+ 'title' => __( 'Right', 'modal-for-elementor' ),
139
+ 'icon' => 'fa fa-align-right',
140
+ ],
141
+ ],
142
+ 'default' => 'center',
143
+ 'tablet_default' => 'center',
144
+ 'mobile_default' => 'center',
145
+ 'selectors' => [
146
+ '{{WRAPPER}} .modal-footer' => 'text-align: {{VALUE}};',
147
+ ],
148
+ 'condition' => [
149
+ 'modal_dismissable' => 'yes',
150
+ ],
151
+ ]
152
+ );
153
+
154
+ $this->add_control(
155
+ 'dismiss_footer_padding',
156
+ [
157
+ 'label' => __( 'Footer Padding', 'modal-for-elementor' ),
158
+ 'type' => Controls_Manager::DIMENSIONS,
159
+ 'size_units' => [ 'px', 'em', '%' ],
160
+ 'selectors' => [
161
+ '{{WRAPPER}} .modal-footer' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
162
+ ],
163
+ 'separator' => 'before',
164
+ 'condition' => [
165
+ 'modal_dismissable' => 'yes',
166
+ ],
167
+ ]
168
+ );
169
+
170
+ $this->add_control(
171
+ 'dismiss_text_padding',
172
+ [
173
+ 'label' => __( 'Dismiss Button Padding', 'modal-for-elementor' ),
174
+ 'type' => Controls_Manager::DIMENSIONS,
175
+ 'size_units' => [ 'px', 'em', '%' ],
176
+ 'selectors' => [
177
+ '{{WRAPPER}} .modal-footer .nothanks' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
178
+ ],
179
+ 'separator' => 'before',
180
+ 'condition' => [
181
+ 'modal_dismissable' => 'yes',
182
+ ],
183
+ ]
184
+ );
185
+
186
+ $this->add_group_control(
187
+ Group_Control_Typography::get_type(),
188
+ [
189
+ 'name' => 'dismiss_typography',
190
+ 'label' => __( 'Close Typography', 'modal-for-elementor' ),
191
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
192
+ 'selector' => '{{WRAPPER}} .modal-footer .nothanks',
193
+ 'condition' => [
194
+ 'modal_dismissable' => 'yes',
195
+ ],
196
+ ]
197
+ );
198
+
199
+ $this->add_control(
200
+ 'dismiss_button_radius',
201
+ [
202
+ 'label' => __( 'Border Radius', 'modal-for-elementor' ),
203
+ 'type' => Controls_Manager::DIMENSIONS,
204
+ 'size_units' => [ 'px', '%' ],
205
+ 'selectors' => [
206
+ '{{WRAPPER}} .modal-footer .nothanks' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
207
+ ],
208
+ ]
209
+ );
210
+
211
+ $this->add_control(
212
+ 'view',
213
+ [
214
+ 'label' => __( 'View', 'modal-for-elementor' ),
215
+ 'type' => Controls_Manager::HIDDEN,
216
+ 'default' => 'traditional',
217
+ ]
218
+ );
219
+ $this->end_controls_section();
220
+
221
+ $this->start_controls_section(
222
+ 'section_popup',
223
+ [
224
+ 'label' => __( 'PopBox Content', 'modal-for-elementor' ),
225
+ ]
226
+ );
227
+ $this->add_control(
228
+ 'popup',
229
+ [
230
+ 'label' => __( 'Select Popup Content', 'modal-for-elementor' ),
231
+ 'type' => Controls_Manager::SELECT,
232
+ 'default' => $this->get_popups()['first_popup'],
233
+ 'options' => $this->get_popups()['popups'],
234
+ ]
235
+ );
236
+
237
+ $this->add_control(
238
+ 'modal_has_video',
239
+ [
240
+ 'label' => __( 'Video Content?', 'modal-for-elementor' ),
241
+ 'type' => Controls_Manager::SWITCHER,
242
+ 'default' => '',
243
+ 'label_on' => 'YES',
244
+ 'label_off' => 'NO',
245
+ 'return_value' => 'yes',
246
+ 'description' => __( 'Does the PopBox content contain a video? Setting this to Yes will stop the video from playing when the popup is closed.', 'modal-for-elementor' ),
247
+ ]
248
+ );
249
+
250
+ $this->add_control(
251
+ 'close_button',
252
+ [
253
+ 'label' => __( 'Show Close Button', 'modal-for-elementor' ),
254
+ 'type' => Controls_Manager::SWITCHER,
255
+ 'label_off' => __( 'Hide', 'modal-for-elementor' ),
256
+ 'label_on' => __( 'Show', 'modal-for-elementor' ),
257
+ 'default' => 'yes',
258
+ 'selectors' => [
259
+ '{{WRAPPER}} button.close' => 'display: inherit;',
260
+ ],
261
+ ]
262
+ );
263
+
264
+ $this->add_control(
265
+ 'close_button_pos',
266
+ [
267
+ 'label' => __( 'Switch Button Position', 'modal-for-elementor' ),
268
+ 'type' => Controls_Manager::SWITCHER,
269
+ 'label_off' => __( 'Right', 'modal-for-elementor' ),
270
+ 'label_on' => __( 'Left', 'modal-for-elementor' ),
271
+ 'default' => '',
272
+ 'selectors' => [
273
+ '{{WRAPPER}} button.close' => 'left: 0;',
274
+ ],
275
+ ]
276
+ );
277
+
278
+ $this->add_control(
279
+ 'close_size',
280
+ [
281
+ 'label' => __( 'Icon Size', 'modal-for-elementor' ),
282
+ 'type' => Controls_Manager::SLIDER,
283
+ 'range' => [
284
+ 'px' => [
285
+ 'min' => 6,
286
+ 'max' => 300,
287
+ ],
288
+ ],
289
+ 'selectors' => [
290
+ '{{WRAPPER}} button.close i' => 'font-size: {{SIZE}}{{UNIT}};',
291
+ ],
292
+ ]
293
+ );
294
+
295
+ $this->add_control(
296
+ 'close_padding',
297
+ [
298
+ 'label' => __( 'Close Padding', 'modal-for-elementor' ),
299
+ 'description' => __( 'Please note that padding bottom has no effect - Left/Right padding will depend on button position!', 'modal-for-elementor' ),
300
+ 'type' => Controls_Manager::DIMENSIONS,
301
+ 'size_units' => [ 'px', 'em', '%' ],
302
+ 'selectors' => [
303
+ '{{WRAPPER}} button.close' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
304
+ ],
305
+ 'separator' => 'before',
306
+ ]
307
+ );
308
+
309
+ $this->add_control(
310
+ 'close_text',
311
+ [
312
+ 'label' => __( 'Close Text', 'modal-for-elementor' ),
313
+ 'type' => Controls_Manager::TEXT,
314
+ 'placeholder' => __( 'Close', 'modal-for-elementor' ),
315
+ 'default' => '',
316
+ 'description' => __( 'Add call to action i.e "Close" before the popup close X', 'modal-for-elementor' ),
317
+ ]
318
+ );
319
+
320
+ $this->add_group_control(
321
+ Group_Control_Typography::get_type(),
322
+ [
323
+ 'name' => 'close_typography',
324
+ 'label' => __( 'Close Typography', 'modal-for-elementor' ),
325
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
326
+ 'selector' => '{{WRAPPER}} button.close:not(i)',
327
+ ]
328
+ );
329
+
330
+ $this->end_controls_section();
331
+
332
+ //Modal Container Optins Start Here
333
+ $this->start_controls_section(
334
+ 'modalstyle',
335
+ [
336
+ 'label' => __( 'Modal Container', 'modal-for-elementor' ),
337
+ 'tab' => Controls_Manager::TAB_STYLE,
338
+ ]
339
+ );
340
+
341
+ $this->add_responsive_control(
342
+ 'modal_content_max_width',
343
+ [
344
+ 'label' => __( 'Container Max-Width', 'modal-for-elementor' ),
345
+ 'type' => Controls_Manager::SLIDER,
346
+ 'default' => [
347
+ 'size' => 720,
348
+ 'unit' => 'px',
349
+ ],
350
+ 'range' => [
351
+ 'px' => [
352
+ 'min' => 0,
353
+ 'max' => 1920,
354
+ 'step' => 1,
355
+ ],
356
+ '%' => [
357
+ 'min' => 5,
358
+ 'max' => 100,
359
+ ],
360
+ ],
361
+ 'size_units' => [ '%', 'px' ],
362
+ 'selectors' => [
363
+ '{{WRAPPER}} .modal-content' => 'max-width: {{SIZE}}{{UNIT}} !important;',
364
+ ],
365
+ ]
366
+ );
367
+
368
+ $this->add_control(
369
+ 'overlay_hint',
370
+ [
371
+ 'label' => __( 'Select and configure the required modal overlay background type below', 'modal-for-elementor' ),
372
+ 'type' => Controls_Manager::RAW_HTML,
373
+ ]
374
+ );
375
+
376
+ $this->add_group_control(
377
+ Group_Control_Background::get_type(),
378
+ [
379
+ 'name' => 'modal_bgcolor',
380
+ 'types' => [ 'classic', 'gradient' ],
381
+ 'default' => 'rgba(0,0,0,0.7)',
382
+ 'selector' => '{{WRAPPER}} .modal',
383
+ ]
384
+ );
385
+
386
+ $this->end_controls_section();
387
+
388
+ $this->start_controls_section(
389
+ 'modalcontentstyle',
390
+ [
391
+ 'label' => __( 'Modal Content', 'modal-for-elementor' ),
392
+ 'tab' => Controls_Manager::TAB_STYLE,
393
+ ]
394
+ );
395
+
396
+ $this->add_control(
397
+ 'modal_window_hint',
398
+ [
399
+ 'label' => __( 'Select and configure the required popup modal window\'s background type below', 'modal-for-elementor' ),
400
+ 'type' => Controls_Manager::RAW_HTML,
401
+ ]
402
+ );
403
+
404
+ $this->add_group_control(
405
+ Group_Control_Background::get_type(),
406
+ [
407
+ 'label' => __( 'Popup Window Background', 'modal-for-elementor' ),
408
+ 'name' => 'modal_window_bg',
409
+ 'types' => [ 'none', 'classic', 'gradient' ],
410
+ 'selector' => '{{WRAPPER}} .modal-content',
411
+ ]
412
+ );
413
+
414
+ $this->add_control(
415
+ 'button_close_text_color',
416
+ [
417
+ 'label' => __( 'Close Button Color', 'modal-for-elementor' ),
418
+ 'type' => Controls_Manager::COLOR,
419
+ 'default' => '',
420
+ 'selectors' => [
421
+ '{{WRAPPER}} button.close' => 'color: {{VALUE}};',
422
+ ],
423
+ ]
424
+ );
425
+
426
+ $this->add_responsive_control(
427
+ 'modal_content_width',
428
+ [
429
+ 'label' => __( 'Modal Width', 'modal-for-elementor' ),
430
+ 'type' => Controls_Manager::SLIDER,
431
+ 'default' => [
432
+ 'size' => 60,
433
+ 'unit' => '%',
434
+ ],
435
+ 'range' => [
436
+ 'px' => [
437
+ 'min' => 0,
438
+ 'max' => 1920,
439
+ 'step' => 1,
440
+ ],
441
+ '%' => [
442
+ 'min' => 25,
443
+ 'max' => 100,
444
+ ],
445
+ ],
446
+ 'size_units' => [ '%', 'px' ],
447
+ 'selectors' => [
448
+ '{{WRAPPER}} .modal-content' => 'width: {{SIZE}}{{UNIT}} !important;',
449
+ ],
450
+ ]
451
+ );
452
+
453
+ $this->add_responsive_control(
454
+ 'modal_content_top',
455
+ [
456
+ 'label' => __( 'Top Offset', 'modal-for-elementor' ),
457
+ 'type' => Controls_Manager::SLIDER,
458
+ 'default' => [
459
+ 'size' => 5,
460
+ 'unit' => '%',
461
+ ],
462
+ 'range' => [
463
+ 'px' => [
464
+ 'min' => 0,
465
+ 'max' => 1000,
466
+ 'step' => 1,
467
+ ],
468
+ '%' => [
469
+ 'min' => 0,
470
+ 'max' => 100,
471
+ ],
472
+ ],
473
+ 'size_units' => [ '%', 'px' ],
474
+ 'selectors' => [
475
+ '{{WRAPPER}} .modal-content' => 'margin-top: {{SIZE}}{{UNIT}};',
476
+ ],
477
+ ]
478
+ );
479
+
480
+ $this->add_responsive_control(
481
+ 'modal_content_padding',
482
+ [
483
+ 'label' => __( 'Padding', 'modal-for-elementor' ),
484
+ 'type' => Controls_Manager::DIMENSIONS,
485
+ 'size_units' => [ 'px', '%', 'em' ],
486
+ 'default' => [
487
+ 'top' => 0,
488
+ 'left' => 0,
489
+ 'right' => 0,
490
+ 'bottom' => 0,
491
+ ],
492
+ 'selectors' => [
493
+ '{{WRAPPER}} .modal-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
494
+ ],
495
+ ]
496
+ );
497
+
498
+ $this->add_group_control(
499
+ Group_Control_Border::get_type(),
500
+ [
501
+ 'name' => 'modal_border',
502
+ 'label' => __( 'Border', 'modal-for-elementor' ),
503
+ 'placeholder' => '1px',
504
+ 'default' => '1px',
505
+ 'selector' => '{{WRAPPER}} .modal-content',
506
+ ]
507
+ );
508
+
509
+ $this->add_control(
510
+ 'modal_border_radius',
511
+ [
512
+ 'label' => __( 'Border Radius', 'modal-for-elementor' ),
513
+ 'type' => Controls_Manager::DIMENSIONS,
514
+ 'size_units' => [ 'px', '%' ],
515
+ 'selectors' => [
516
+ '{{WRAPPER}} .modal-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
517
+ ],
518
+ ]
519
+ );
520
+
521
+ $this->add_group_control(
522
+ Group_Control_Box_Shadow::get_type(),
523
+ [
524
+ 'name' => 'popbox_content_box_shadow',
525
+ 'selector' => '{{WRAPPER}} .modal-content',
526
+ ]
527
+ );
528
+
529
+ $this->end_controls_section();
530
+
531
+ $this->start_controls_section(
532
+ 'modaldismisstyle',
533
+ [
534
+ 'label' => __( 'Dismiss Options', 'modal-for-elementor' ),
535
+ 'tab' => Controls_Manager::TAB_STYLE,
536
+ ]
537
+ );
538
+
539
+ $this->start_controls_tabs( 'dismiss_tabs' );
540
+
541
+ $this->start_controls_tab( 'dismiss_footer_settings', [ 'label' => __( 'Dismiss Settings', 'modal-for-elementor' ) ] );
542
+
543
+ $this->add_control(
544
+ 'dimiss_footer_hint',
545
+ [
546
+ 'label' => __( 'Set background for the dimiss footer section', 'modal-for-elementor' ),
547
+ 'type' => Controls_Manager::RAW_HTML,
548
+ ]
549
+ );
550
+
551
+ $this->add_group_control(
552
+ Group_Control_Background::get_type(),
553
+ [
554
+ 'label' => __( 'Footer Background', 'modal-for-elementor' ),
555
+ 'name' => 'dimiss_footer_bg',
556
+ 'types' => [ 'none', 'classic', 'gradient' ],
557
+ 'selector' => '{{WRAPPER}} .modal-footer',
558
+ ]
559
+ );
560
+
561
+ $this->add_control(
562
+ 'dimiss_border_color',
563
+ [
564
+ 'label' => __( 'Footer Border Color', 'modal-for-elementor' ),
565
+ 'type' => Controls_Manager::COLOR,
566
+ 'default' => '',
567
+ 'selectors' => [
568
+ '{{WRAPPER}} .modal-footer' => 'border-top-color: {{VALUE}};',
569
+ ],
570
+ ]
571
+ );
572
+
573
+ $this->end_controls_tab();
574
+
575
+ $this->start_controls_tab( 'dismiss_button_settings', [ 'label' => __( 'Dismiss Button', 'modal-for-elementor' ) ] );
576
+
577
+ $this->add_control(
578
+ 'dimiss_text_color',
579
+ [
580
+ 'label' => __( 'Dismiss Button Color', 'modal-for-elementor' ),
581
+ 'type' => Controls_Manager::COLOR,
582
+ 'default' => '',
583
+ 'selectors' => [
584
+ '{{WRAPPER}} .modal-footer .nothanks' => 'color: {{VALUE}};',
585
+ ],
586
+ ]
587
+ );
588
+
589
+ $this->add_control(
590
+ 'dimiss_button_hint',
591
+ [
592
+ 'label' => __( 'Set background for the dimiss button', 'modal-for-elementor' ),
593
+ 'type' => Controls_Manager::RAW_HTML,
594
+ ]
595
+ );
596
+
597
+ $this->add_group_control(
598
+ Group_Control_Background::get_type(),
599
+ [
600
+ 'label' => __( 'Button Background', 'modal-for-elementor' ),
601
+ 'name' => 'dismiss_button_bg',
602
+ 'types' => [ 'none', 'classic', 'gradient' ],
603
+ 'selector' => '{{WRAPPER}} .modal-footer .nothanks',
604
+ ]
605
+ );
606
+
607
+ $this->end_controls_tab();
608
+
609
+ $this->end_controls_tabs();
610
+
611
+ $this->end_controls_section();
612
+
613
+ }
614
+ protected function render() {
615
+ $settings = $this->get_settings();
616
+ $close = $settings['close_text'];
617
+ $dismiss = $settings['modal_dismissable'];
618
+ $dismiss_text = $settings['dismissable_text'];
619
+ $has_video = $settings['modal_has_video'];
620
+ $delay = ! empty( $settings['popbox_load_delay'] ) ? (int)$settings['popbox_load_delay'] : 3000;
621
+ $selectedPopup = new WP_Query( array( 'p' => $settings['popup'], 'post_type' => 'elementor-popup' ) );
622
+ if ( $selectedPopup->have_posts() ) {
623
+
624
+ $selectedPopup->the_post();
625
+
626
+ ?>
627
+ <!-- PopBox -->
628
+ <div class="modal modal-onload fade" id="popup-<?php echo $selectedPopup->post->ID; ?>" tabindex="-1" role="dialog" aria-labelledby="popup-<?php echo $selectedPopup->post->ID; ?>-label">
629
+ <div class="modal-content">
630
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
631
+ <span aria-hidden="true">
632
+ <?php echo $close; ?> <i class="fa fa-close"></i></span>
633
+ </button>
634
+ <div class="modal-body">
635
+ <?php
636
+ $elementor = get_post_meta( $selectedPopup->post->ID, '_elementor_edit_mode', true );
637
+ if ( $elementor ) {
638
+ $frontend = new Frontend;
639
+ echo $frontend->get_builder_content( $selectedPopup->post->ID, true );
640
+ } else {
641
+ the_content();
642
+ }
643
+ ?>
644
+ </div>
645
+ <?php if ( $dismiss ) { ?>
646
+ <div class="modal-footer">
647
+ <span class="nothanks" data-dismiss="modal" aria-hidden="true"><?php echo $dismiss_text; ?></span>
648
+ </div>
649
+ <?php } ?>
650
+ </div>
651
+ </div>
652
+ <script type="text/javascript">
653
+ (function($) {
654
+ $(document).ready(function() {
655
+ // If no cookie with our chosen name (e.g. no_thanks)...
656
+ if ($.cookie("no_thanks_popup_<?php echo $selectedPopup->post->ID; ?>") == null) {
657
+ // Show the modal, with delay func.
658
+ function show_modal(){
659
+ $('#popup-<?php echo $selectedPopup->post->ID; ?>').modal();
660
+ }
661
+ // Set delay func. time in milliseconds
662
+ if(!isMobile.any() ) {
663
+ window.setTimeout(show_modal, <?php echo $delay; ?>);
664
+ }
665
+ }
666
+ // On click of specified class (e.g. 'nothanks'), trigger cookie, with expiration in year 9999
667
+ $(".nothanks").click(function() {
668
+ document.cookie = "no_thanks_popup_<?php echo $selectedPopup->post->ID; ?>=true; expires=Fri, 31 Dec 9999 23:59:59 UTC";
669
+ });
670
+ });
671
+ })(jQuery);
672
+ </script>
673
+ <?php
674
+ if ( $has_video ) { ?>
675
+ <script type="text/javascript">
676
+ (function($) {
677
+ $('#popup-<?php echo $selectedPopup->post->ID; ?>').on('hide.bs.modal', function(e) {
678
+ var $if = $(e.delegateTarget).find('iframe');
679
+ var src = $if.attr("src");
680
+ $if.attr("src", '/empty.html');
681
+ $if.attr("src", src);
682
+ });
683
+ })(jQuery);
684
+ </script>
685
+ <!-- PopBox -->
686
+ <?php }
687
+ wp_reset_postdata();
688
+
689
+ }
690
+ }
691
+ protected function _content_template() {}
692
+
693
+ }
widgets/popup.php CHANGED
@@ -23,7 +23,7 @@ class ElementorModal extends Widget_Base {
23
  return 'popup';
24
  }
25
  public function get_title() {
26
- return __( 'PopBox', 'modal-for-elementor' );
27
  }
28
  public function get_icon() {
29
  return 'eicon-button';
@@ -187,6 +187,54 @@ class ElementorModal extends Widget_Base {
187
  ]
188
  );
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  $this->add_control(
191
  'view',
192
  [
@@ -200,7 +248,7 @@ class ElementorModal extends Widget_Base {
200
  $this->start_controls_section(
201
  'section_popup',
202
  [
203
- 'label' => __( 'Modal Content', 'modal-for-elementor' ),
204
  ]
205
  );
206
  $this->add_control(
@@ -212,6 +260,19 @@ class ElementorModal extends Widget_Base {
212
  'options' => $this->get_popups()['popups'],
213
  ]
214
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
  $this->add_control(
217
  'close_button',
@@ -446,6 +507,8 @@ class ElementorModal extends Widget_Base {
446
  );
447
 
448
  $this->end_controls_tab();
 
 
449
 
450
  $this->end_controls_section();
451
 
@@ -650,9 +713,13 @@ class ElementorModal extends Widget_Base {
650
 
651
  }
652
  protected function render() {
653
- $settings = $this->get_settings();
654
- $close = $settings['close_text'];
 
 
 
655
  $selectedPopup = new WP_Query( array( 'p' => $settings['popup'], 'post_type' => 'elementor-popup' ) );
 
656
  if ( $selectedPopup->have_posts() ) {
657
 
658
  $selectedPopup->the_post();
@@ -680,7 +747,7 @@ class ElementorModal extends Widget_Base {
680
  <!-- PopBox:popboxRender -->
681
  <!-- PopBox trigger button -->
682
  <div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
683
- <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>
684
  <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>>
685
  <?php if ( ! empty( $settings['icon'] ) ) : ?>
686
  <span <?php echo $this->get_render_attribute_string( 'icon-align' ); ?>>
@@ -712,18 +779,20 @@ class ElementorModal extends Widget_Base {
712
  </div>
713
  </div>
714
  </div>
715
- <script type="text/javascript">
716
- (function($) {
717
- $('#popup-<?php echo $selectedPopup->post->ID; ?>').on('hide.bs.modal', function(e) {
718
- var $if = $(e.delegateTarget).find('iframe');
719
- var src = $if.attr("src");
720
- $if.attr("src", '/empty.html');
721
- $if.attr("src", src);
722
- });
723
- })(jQuery);
724
- </script>
 
 
725
  <!-- PopBox -->
726
- <?php
727
  wp_reset_postdata();
728
 
729
  }
23
  return 'popup';
24
  }
25
  public function get_title() {
26
+ return __( 'PopBox: On Click', 'modal-for-elementor' );
27
  }
28
  public function get_icon() {
29
  return 'eicon-button';
187
  ]
188
  );
189
 
190
+ $this->add_control(
191
+ 'ga_track_event_on',
192
+ [
193
+ 'label' => __( 'Turn on GA Track Event?', 'modal-for-elementor' ),
194
+ 'type' => Controls_Manager::SWITCHER,
195
+ 'default' => '',
196
+ 'label_on' => 'YES',
197
+ 'label_off' => 'NO',
198
+ 'return_value' => 'yes',
199
+ 'description' => __( 'Track the PopBox button click event throught Google Analytics.', 'modal-for-elementor' ),
200
+ ]
201
+ );
202
+
203
+ $this->add_control(
204
+ 'ga_tracking_info',
205
+ [
206
+ 'label' => __( 'EXPERIMENTAL: Feedback on results & if working or not will be greatly appreciated!', 'modal-for-elementor' ),
207
+ 'type' => Controls_Manager::RAW_HTML,
208
+ 'condition' => [
209
+ 'ga_track_event_on' => 'yes',
210
+ ],
211
+ ]
212
+ );
213
+
214
+ $this->add_control(
215
+ 'ga_track_event',
216
+ [
217
+ 'label' => __( 'Google Track Text', 'modal-for-elementor' ),
218
+ 'type' => Controls_Manager::TEXT,
219
+ 'default' => __( 'PopBox Button Clicked', 'modal-for-elementor' ),
220
+ 'description' => __( 'Enter text to be sent to Google Analytics as part of the button click event - the PopBox title would be ideal!', 'modal-for-elementor' ),
221
+ 'condition' => [
222
+ 'ga_track_event_on' => 'yes',
223
+ ],
224
+ ]
225
+ );
226
+
227
+ $this->add_control(
228
+ 'ga_tracking_notes',
229
+ [
230
+ 'label' => __( 'NOTE: You need to have Google Analytics enabled for this to work!', 'modal-for-elementor' ),
231
+ 'type' => Controls_Manager::RAW_HTML,
232
+ 'condition' => [
233
+ 'ga_track_event_on' => 'yes',
234
+ ],
235
+ ]
236
+ );
237
+
238
  $this->add_control(
239
  'view',
240
  [
248
  $this->start_controls_section(
249
  'section_popup',
250
  [
251
+ 'label' => __( 'PopBox Content', 'modal-for-elementor' ),
252
  ]
253
  );
254
  $this->add_control(
260
  'options' => $this->get_popups()['popups'],
261
  ]
262
  );
263
+
264
+ $this->add_control(
265
+ 'modal_has_video',
266
+ [
267
+ 'label' => __( 'Video Content?', 'modal-for-elementor' ),
268
+ 'type' => Controls_Manager::SWITCHER,
269
+ 'default' => '',
270
+ 'label_on' => 'YES',
271
+ 'label_off' => 'NO',
272
+ 'return_value' => 'yes',
273
+ 'description' => __( 'Does the PopBox content contain a video? Setting this to Yes will stop the video from playing when the popup is closed.', 'modal-for-elementor' ),
274
+ ]
275
+ );
276
 
277
  $this->add_control(
278
  'close_button',
507
  );
508
 
509
  $this->end_controls_tab();
510
+
511
+ $this->end_controls_tabs();
512
 
513
  $this->end_controls_section();
514
 
713
 
714
  }
715
  protected function render() {
716
+ $settings = $this->get_settings();
717
+ $close = $settings['close_text'];
718
+ $has_video = $settings['modal_has_video'];
719
+ $ga_track = $settings['ga_track_event'];
720
+
721
  $selectedPopup = new WP_Query( array( 'p' => $settings['popup'], 'post_type' => 'elementor-popup' ) );
722
+
723
  if ( $selectedPopup->have_posts() ) {
724
 
725
  $selectedPopup->the_post();
747
  <!-- PopBox:popboxRender -->
748
  <!-- PopBox trigger button -->
749
  <div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
750
+ <a <?php echo $this->get_render_attribute_string( 'button' ); ?> onclick="ga('send', 'event', 'modal-popup-<?php echo $selectedPopup->post->ID; ?>', 'Click', '<?php echo $ga_track; ?>');" >
751
  <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>>
752
  <?php if ( ! empty( $settings['icon'] ) ) : ?>
753
  <span <?php echo $this->get_render_attribute_string( 'icon-align' ); ?>>
779
  </div>
780
  </div>
781
  </div>
782
+ <?php
783
+ if ( $has_video ) { ?>
784
+ <script type="text/javascript">
785
+ (function($) {
786
+ $('#popup-<?php echo $selectedPopup->post->ID; ?>').on('hide.bs.modal', function(e) {
787
+ var $if = $(e.delegateTarget).find('iframe');
788
+ var src = $if.attr("src");
789
+ $if.attr("src", '/empty.html');
790
+ $if.attr("src", src);
791
+ });
792
+ })(jQuery);
793
+ </script>
794
  <!-- PopBox -->
795
+ <?php }
796
  wp_reset_postdata();
797
 
798
  }