Popup Maker – Popup Forms, Optins & More - Version 1.4.3

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Popup Maker – Popup Forms, Optins & More
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

assets/css/popup-maker-admin.css DELETED
@@ -1,493 +0,0 @@
1
- /* UI */
2
- h3.title {
3
- font-size: 16px !important;
4
- color: #9aba27;
5
- text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.125);
6
- }
7
-
8
- #popuptitlediv #popuptitle {
9
- background-color: #fff;
10
- font-size: 1.5em;
11
- height: 1.8em;
12
- line-height: 100%;
13
- margin: 0;
14
- outline: medium none;
15
- padding: 2px 8px;
16
- width: 100%;
17
- }
18
-
19
- #popuptitlediv #popuptitle input {
20
- color: #777;
21
- font-size: 1.7em;
22
- padding: 11px 10px;
23
- position: absolute;
24
- }
25
-
26
- #popuptitlediv #popuptitle-prompt-text {
27
- font-size: 1.4em;
28
- padding: 8px 10px;
29
- }
30
-
31
- #titlediv #title {
32
- margin: 0 0 1em;
33
- height: 40px !important;
34
- }
35
-
36
- .posttypediv, .taxonomydiv {
37
- margin-bottom: 10px;
38
- clear: both;
39
- overflow: auto;
40
- }
41
-
42
- #major-publishing-actions {
43
- text-align: right;
44
- }
45
-
46
- #trigger-popmake-preview {
47
- padding: 5px;
48
- }
49
-
50
- /*
51
-
52
- input[type="text"], select {
53
- font-size: 13px;
54
- margin: 0;
55
- height: 30px!important;
56
- line-height: 28px!important;
57
- padding: 0 6px 2px!important;
58
- box-shadow: 0 1px 0 rgb(255, 255, 255) inset, 0 1px 0 rgba(0, 0, 0, 0.08);
59
- }
60
- */
61
- input[type="range"] {
62
- vertical-align: middle;
63
- }
64
-
65
- input.popmake-range-manual {
66
- padding-right: 25px !important;
67
- }
68
-
69
- /*
70
- input[type="text"], select {
71
- border-radius: 3px;
72
- border-style: solid;
73
- border-width: 1px;
74
- box-sizing: border-box;
75
- cursor: pointer;
76
- display: inline-block;
77
- font-size: 13px;
78
- margin: 0;
79
- text-decoration: none;
80
- white-space: nowrap;
81
- height: 30px!important;
82
- line-height: 28px!important;
83
- padding: 0 12px 2px!important;
84
- background: none repeat scroll 0 0 rgb(247, 247, 247)!important;
85
- border-color: rgb(204, 204, 204);
86
- box-shadow: 0 1px 0 rgb(255, 255, 255) inset, 0 1px 0 rgba(0, 0, 0, 0.08);
87
- color: rgb(85, 85, 85);
88
- vertical-align: top!important;
89
- }
90
- input[type="text"] {
91
- background-color: rgb(247, 247, 247)!important;
92
- }
93
- input[type="range"] {
94
- background: transparent!important;
95
- border:none!important;
96
- outline:0;
97
- box-shadow:none;
98
- }
99
-
100
- button.popmake-range-minus, button.popmake-range-plus {
101
- height:30px;
102
- width:30px;
103
- text-align: center;
104
- }
105
-
106
- */
107
- option.bold {
108
- font-weight: bold;
109
- font-size: 1.125em;
110
- }
111
-
112
- /* Range Slider Adjusters */
113
- .popmake-range-manual {
114
- padding-right: 25px;
115
- text-align: right;
116
- width: 80px;
117
- }
118
-
119
- .range-value-unit {
120
- position: relative;
121
- display: inline-block;
122
- margin-left: -30px;
123
- margin-right: 10px;
124
- width: 20px;
125
- text-align: left;
126
- }
127
-
128
- /* Form Table Dividers */
129
- .title-divider th {
130
- border-top: 1px solid #ccc;
131
- padding: 0;
132
- }
133
-
134
- .form-table td, .form-table tr {
135
- padding-top: 10px;
136
- }
137
-
138
- .title-divider .title {
139
- font-size: 1.125em;
140
- padding-left: 0 !important;
141
- padding-top: 20px !important;
142
- padding-bottom: 0 !important;
143
- }
144
-
145
- /* Marketing & Standouts */
146
- /* Menu Highlight */
147
- #menu-posts-popup ul.wp-submenu li:nth-child(0n+9) a {
148
- color: #9ABA27;
149
- }
150
-
151
- /* Upgrade Tips */
152
- .popmake-upgrade-tip {
153
- color: #333;
154
- line-height: 2em !important;
155
- }
156
-
157
- div.popmake-upgrade-tip {
158
- margin-bottom: 15px;
159
- display: block;
160
- font-weight: bold;
161
- }
162
-
163
- .popmake-upgrade-tip img {
164
- float: left;
165
- margin-right: 15px;
166
- }
167
-
168
- /* Theme Builder */
169
- #popmake_popup_theme_preview {
170
- z-index: 100;
171
- }
172
-
173
- #popmake_popup_theme_preview .inside {
174
- margin-top: 0;
175
- background: url(http://s.wordpress.com/mshots/v1/http://www.wordpress.org) no-repeat center top;
176
- }
177
-
178
- #popmake_popup_theme_preview .empreview {
179
- padding-top: 25px;
180
- }
181
-
182
- .example-popup, .example-popup:before, .example-popup:after,
183
- .example-popup *, .example-popup *:before, .example-popup *:after {
184
- -moz-box-sizing: border-box;
185
- }
186
-
187
- .empreview .example-popup-overlay {
188
- position: absolute;
189
- display: block;
190
- width: 100%;
191
- height: 100%;
192
- top: 0;
193
- left: 0;
194
- }
195
-
196
- .empreview .example-popup {
197
- display: block;
198
- position: relative;
199
- width: 95%;
200
- max-width: 400px;
201
- margin: 0 auto 25px;
202
- font-size: 16px;
203
- position: relative;
204
- z-index: 99;
205
- }
206
-
207
- .empreview .example-popup .close-popup {
208
- text-decoration: none;
209
- text-align: center;
210
- line-height: 1;
211
- position: absolute;
212
- font-weight: bold;
213
- cursor: pointer;
214
- min-width: 1em;
215
- }
216
-
217
- /* Sidebar */
218
- .popmake-support-links {
219
- list-style: none;
220
- }
221
-
222
- .popmake-support-links li {
223
- margin-bottom: 10px;
224
- }
225
-
226
- .popmake-support-links a {
227
- color: #20252b;
228
- font-family: "Montserrat";
229
- font-size: 1.25em;
230
- text-transform: uppercase;
231
- text-decoration: none;
232
- }
233
-
234
- .popmake-support-links a span {
235
- margin-left: 10px;
236
- }
237
-
238
- .popmake-support-links a img {
239
- top: 6px;
240
- position: relative;
241
- min-width: 24px;
242
- max-width: 24px;
243
- min-height: 24px;
244
- max-height: 24px;
245
- }
246
-
247
- .button.rounded {
248
- box-shadow: none;
249
- border: 0;
250
- border-radius: 2px;
251
- padding-left: 18px;
252
- padding-right: 18px;
253
- -webkit-transition: -webkit-transform .5s;
254
- transition: transform .5s;
255
- margin-bottom: 10px;
256
- }
257
-
258
- .button.rounded:hover, .button.rounded:focus {
259
- -webkit-transform: scale(1.125);
260
- -ms-transform: scale(1.125);
261
- transform: scale(1.125);
262
- }
263
-
264
- #popmake_popup_support {
265
- margin-bottom: 10px;
266
- }
267
-
268
- #popmake_popup_share {
269
- background: transparent;
270
- border: 0;
271
- padding: 0;
272
- box-shadow: none;
273
- }
274
-
275
- #popmake_popup_share .handlediv {
276
- display: none;
277
- }
278
-
279
- #popmake_popup_share .hndle {
280
- display: none;
281
- }
282
-
283
- #popmake_popup_share .inside {
284
- margin: 0 0 20px;
285
- padding: 0;
286
- }
287
-
288
- .loveit-shareit {
289
- font-weight: 700 !important;
290
- font-size: 28px !important;
291
- color: #333;
292
- text-transform: uppercase;
293
- }
294
-
295
- .loveit-shareit span {
296
- color: #9ABA27;
297
- }
298
-
299
- .follow-box {
300
- text-align: center;
301
- padding: 14px 36px;
302
- background: #fff;
303
- border: 1px solid #e5e5e5;
304
- }
305
-
306
- .share-buttons {
307
- margin: 0 auto;
308
- width: 68%;
309
- display: block;
310
- clear: both;
311
- }
312
-
313
- .share-buttons li {
314
- text-align: center;
315
- width: 32%;
316
- display: inline-block;
317
- float: left;
318
- margin-right: 1%;
319
- margin-bottom: 0;
320
- }
321
-
322
- .share-buttons li:last-child {
323
- margin-right: 0;
324
- }
325
-
326
- /* Welcome Page */
327
- .popmake-badge {
328
- padding-top: 150px;
329
- height: 52px;
330
- width: 185px;
331
- color: #666;
332
- font-weight: bold;
333
- font-size: 14px;
334
- text-align: center;
335
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
336
- margin: 0 -5px;
337
- background: url("../images/welcome/logo.png") no-repeat center center;
338
- }
339
-
340
- .about-wrap .popmake-badge {
341
- position: absolute;
342
- top: 0;
343
- right: 0;
344
- }
345
-
346
- .popmake-welcome-screenshots {
347
- float: right;
348
- margin-left: 10px !important;
349
- padding: 0 7.5em;
350
- }
351
-
352
- .popmake-wrap .feature-section {
353
- margin-top: 20px;
354
- }
355
-
356
- .tab-box {
357
- margin-top: 40px;
358
- position: relative;
359
- border: 1px solid #ccc;
360
- max-width: 500px;
361
- padding: 20px 10px 5px;
362
- }
363
-
364
- .tab-box h4 {
365
- font: 13px/30px "Open Sans", sans-serif;
366
- font-weight: bold;
367
- position: absolute;
368
- background: #ccc;
369
- display: inline-block;
370
- padding: 0 10px;
371
- top: -48px;
372
- left: -1px;
373
- }
374
-
375
- .tab-box a {
376
- font: 300 18px/1.125 "Oswald";
377
- color: #9ABA27;
378
- }
379
-
380
- .tab-box button {
381
- font: 300 18px/1.125 "Oswald";
382
- color: #fff;
383
- background: #9ABA27;
384
- box-shadow: none;
385
- border: 0;
386
- padding: 5px 10px 7px;
387
- cursor: pointer;
388
- -webkit-transition: -webkit-transform .5s;
389
- transition: transform .5s;
390
- }
391
-
392
- .tab-box button:hover {
393
- -webkit-transform: scale(1.125);
394
- -ms-transform: scale(1.125);
395
- transform: scale(1.125);
396
- }
397
-
398
- #popmake-preview {
399
- position: fixed;
400
- z-index: 9999999 !important;
401
- }
402
-
403
- #popmake-overlay {
404
- z-index: 9999998 !important;
405
- }
406
-
407
- /* Extensions Page */
408
- .extensions-available {
409
- display: block;
410
- }
411
-
412
- .extensions-available img {
413
- width: 100%;
414
- display: block;
415
- height: auto;
416
- max-width: 100%;
417
- }
418
-
419
- .extensions-available li {
420
- box-sizing: border-box;
421
- border: 1px solid #ccc;
422
- background: #fff;
423
- vertical-align: top;
424
- width: 280px;
425
- margin: 0 10px 20px;
426
- display: inline;
427
- float: left;
428
- box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25);
429
- }
430
-
431
- .extensions-available h3 {
432
- text-align: center;
433
- font-size: 16px !important;
434
- }
435
-
436
- .extensions-available h3 a {
437
- color: inherit;
438
- }
439
-
440
- .extensions-available li > .action-links {
441
- margin: 0 10px;
442
- text-align: center;
443
- display: block;
444
- }
445
-
446
- .extensions-available .action-links .button {
447
- display: inline-block;
448
- margin-bottom: 10px;
449
- margin-top: 10px;
450
- padding: 7px 30px;
451
- font-weight: bold;
452
- height: auto;
453
- position: relative;
454
- -webkit-transition: -webkit-transform .5s;
455
- transition: transform .5s;
456
- }
457
-
458
- .extensions-available .action-links .button.install {
459
- background: #00a651;
460
- }
461
-
462
- .extensions-available p {
463
- margin: 10px;
464
- color: #717171;
465
- font-size: 14px;
466
- text-align: center;
467
- font-style: italic;
468
- min-height: 7.5em;
469
- }
470
-
471
- .extensions-available a {
472
- display: block;
473
- text-align: center;
474
- text-decoration: none;
475
- }
476
-
477
- @media only screen and (max-width: 360px) {
478
- .extensions-available li {
479
- display: block;
480
- margin: 0 0 10px;
481
- width: 100%;
482
- }
483
- }
484
- @media only screen and (min-width: 361px) and (max-width: 768px) {
485
- .extensions-available li {
486
- width: 320px;
487
- }
488
- }
489
- @media only screen and (min-width: 769px) and (max-width: 980px) {
490
- .extensions-available li {
491
- width: 240px;
492
- }
493
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/popup-maker-admin.min.css DELETED
@@ -1 +0,0 @@
1
- h3.title{font-size:16px!important;color:#9aba27;text-shadow:1px 1px 1px rgba(0,0,0,.125)}#popuptitlediv #popuptitle{background-color:#fff;font-size:1.5em;height:1.8em;line-height:100%;margin:0;outline:0;padding:2px 8px;width:100%}#popuptitlediv #popuptitle input{color:#777;font-size:1.7em;padding:11px 10px;position:absolute}#popuptitlediv #popuptitle-prompt-text{font-size:1.4em;padding:8px 10px}#titlediv #title{margin:0 0 1em;height:40px!important}.posttypediv,.taxonomydiv{margin-bottom:10px;clear:both;overflow:auto}#major-publishing-actions{text-align:right}#trigger-popmake-preview{padding:5px}input[type=range]{vertical-align:middle}input.popmake-range-manual{padding-right:25px!important}option.bold{font-weight:700;font-size:1.125em}.popmake-range-manual{padding-right:25px;text-align:right;width:80px}.range-value-unit{position:relative;display:inline-block;margin-left:-30px;margin-right:10px;width:20px;text-align:left}.title-divider th{border-top:1px solid #ccc;padding:0}.form-table td,.form-table tr{padding-top:10px}.title-divider .title{font-size:1.125em;padding-left:0!important;padding-top:20px!important;padding-bottom:0!important}#menu-posts-popup ul.wp-submenu li:nth-child(0n+9) a{color:#9ABA27}.popmake-upgrade-tip{color:#333;line-height:2em!important}div.popmake-upgrade-tip{margin-bottom:15px;display:block;font-weight:700}.popmake-upgrade-tip img{float:left;margin-right:15px}#popmake_popup_theme_preview{z-index:100}#popmake_popup_theme_preview .inside{margin-top:0;background:url(http://s.wordpress.com/mshots/v1/http://www.wordpress.org) center top no-repeat}#popmake_popup_theme_preview .empreview{padding-top:25px}.example-popup,.example-popup *,.example-popup :after,.example-popup :before,.example-popup:after,.example-popup:before{-moz-box-sizing:border-box}.empreview .example-popup-overlay{position:absolute;display:block;width:100%;height:100%;top:0;left:0}.empreview .example-popup{display:block;width:95%;max-width:400px;margin:0 auto 25px;font-size:16px;position:relative;z-index:99}.empreview .example-popup .close-popup{text-decoration:none;text-align:center;line-height:1;position:absolute;font-weight:700;cursor:pointer;min-width:1em}.popmake-support-links{list-style:none}.popmake-support-links li{margin-bottom:10px}.popmake-support-links a{color:#20252b;font-family:Montserrat;font-size:1.25em;text-transform:uppercase;text-decoration:none}.popmake-support-links a span{margin-left:10px}.popmake-support-links a img{top:6px;position:relative;min-width:24px;max-width:24px;min-height:24px;max-height:24px}.button.rounded{box-shadow:none;border:0;border-radius:2px;padding-left:18px;padding-right:18px;-webkit-transition:-webkit-transform .5s;transition:transform .5s;margin-bottom:10px}.button.rounded:focus,.button.rounded:hover{-webkit-transform:scale(1.125);-ms-transform:scale(1.125);transform:scale(1.125)}#popmake_popup_support{margin-bottom:10px}#popmake_popup_share{background:0 0;border:0;padding:0;box-shadow:none}#popmake_popup_share .handlediv,#popmake_popup_share .hndle{display:none}#popmake_popup_share .inside{margin:0 0 20px;padding:0}.loveit-shareit{font-weight:700!important;font-size:28px!important;color:#333;text-transform:uppercase}.loveit-shareit span{color:#9ABA27}.follow-box{text-align:center;padding:14px 36px;background:#fff;border:1px solid #e5e5e5}.share-buttons{margin:0 auto;width:68%;display:block;clear:both}.share-buttons li{text-align:center;width:32%;display:inline-block;float:left;margin-right:1%;margin-bottom:0}.share-buttons li:last-child{margin-right:0}.popmake-badge{padding-top:150px;height:52px;width:185px;color:#666;font-weight:700;font-size:14px;text-align:center;text-shadow:0 1px 0 rgba(255,255,255,.8);margin:0 -5px;background:url(../images/welcome/logo.png) center center no-repeat}.about-wrap .popmake-badge{position:absolute;top:0;right:0}.popmake-welcome-screenshots{float:right;margin-left:10px!important;padding:0 7.5em}.popmake-wrap .feature-section{margin-top:20px}.tab-box{margin-top:40px;position:relative;border:1px solid #ccc;max-width:500px;padding:20px 10px 5px}.tab-box h4{font:13px/30px "Open Sans",sans-serif;font-weight:700;position:absolute;background:#ccc;display:inline-block;padding:0 10px;top:-48px;left:-1px}.tab-box a{font:300 18px/1.125 Oswald;color:#9ABA27}.tab-box button{font:300 18px/1.125 Oswald;color:#fff;background:#9ABA27;box-shadow:none;border:0;padding:5px 10px 7px;cursor:pointer;-webkit-transition:-webkit-transform .5s;transition:transform .5s}.tab-box button:hover{-webkit-transform:scale(1.125);-ms-transform:scale(1.125);transform:scale(1.125)}#popmake-preview{position:fixed;z-index:9999999!important}#popmake-overlay{z-index:9999998!important}.extensions-available{display:block}.extensions-available img{width:100%;display:block;height:auto;max-width:100%}.extensions-available li{box-sizing:border-box;border:1px solid #ccc;background:#fff;vertical-align:top;width:280px;margin:0 10px 20px;display:inline;float:left;box-shadow:1px 1px 4px rgba(0,0,0,.25)}.extensions-available h3{text-align:center;font-size:16px!important}.extensions-available h3 a{color:inherit}.extensions-available li>.action-links{margin:0 10px;text-align:center;display:block}.extensions-available .action-links .button{display:inline-block;margin-bottom:10px;margin-top:10px;padding:7px 30px;font-weight:700;height:auto;position:relative;-webkit-transition:-webkit-transform .5s;transition:transform .5s}.extensions-available .action-links .button.install{background:#00a651}.extensions-available p{margin:10px;color:#717171;font-size:14px;text-align:center;font-style:italic;min-height:7.5em}.extensions-available a{display:block;text-align:center;text-decoration:none}@media only screen and (max-width:360px){.extensions-available li{display:block;margin:0 0 10px;width:100%}}@media only screen and (min-width:361px) and (max-width:768px){.extensions-available li{width:320px}}@media only screen and (min-width:769px) and (max-width:980px){.extensions-available li{width:240px}}
 
assets/css/popup-maker-site.css DELETED
@@ -1,161 +0,0 @@
1
- .popmake, .popmake:before, .popmake:after,
2
- .popmake *, .popmake *:before, .popmake *:after {
3
- /* Safari/Chrome, other WebKit */
4
- /* Firefox, other Gecko */
5
- box-sizing: border-box;
6
- }
7
-
8
- html.popup-open,
9
- .popup-open body {
10
- overflow: hidden;
11
- }
12
-
13
- .popmake-overlay {
14
- position: fixed;
15
- display: none;
16
- width: 100%;
17
- height: 100%;
18
- top: 0;
19
- left: 0;
20
- z-index: 1999999998;
21
- overflow-x: hidden;
22
- overflow-y: auto;
23
- }
24
-
25
- .popmake {
26
- top: 100px;
27
- visibility: hidden;
28
- position: absolute;
29
- display: none;
30
- z-index: 1999999999;
31
- }
32
-
33
- .popmake > .popmake-close {
34
- text-decoration: none;
35
- text-align: center;
36
- line-height: 1;
37
- position: absolute;
38
- font-weight: bold;
39
- cursor: pointer;
40
- min-width: 1em;
41
- }
42
-
43
- .popmake.responsive {
44
- left: 50%;
45
- margin-left: -40%;
46
- width: 95%;
47
- height: auto;
48
- overflow: visible;
49
- }
50
-
51
- .popmake.responsive .popmake-content img {
52
- max-width: 100%;
53
- height: auto;
54
- }
55
-
56
- @media only screen and (min-width: 768px) {
57
- .popmake.size-nano {
58
- margin-left: -5%;
59
- width: 10%;
60
- }
61
-
62
- .popmake.size-micro {
63
- margin-left: -10%;
64
- width: 20%;
65
- }
66
-
67
- .popmake.size-tiny {
68
- margin-left: -15%;
69
- width: 30%;
70
- }
71
-
72
- .popmake.size-small {
73
- margin-left: -20%;
74
- width: 40%;
75
- }
76
-
77
- .popmake.size-medium {
78
- margin-left: -30%;
79
- width: 60%;
80
- }
81
-
82
- .popmake.size-normal {
83
- margin-left: -30%;
84
- width: 70%;
85
- }
86
-
87
- .popmake.size-large {
88
- margin-left: -35%;
89
- width: 80%;
90
- }
91
-
92
- .popmake.size-xlarge {
93
- margin-left: -47.5%;
94
- width: 95%;
95
- }
96
-
97
- .popmake.fixed {
98
- position: fixed;
99
- }
100
- }
101
- @media only screen and (max-width: 767px) {
102
- .popmake.fixed {
103
- position: absolute;
104
- }
105
- }
106
- .popmake.custom-position {
107
- left: auto;
108
- top: auto;
109
- margin-left: inherit;
110
- }
111
-
112
- .popmake.scrollable .popmake-content {
113
- overflow: auto;
114
- overflow-y: scroll;
115
- max-height: 95%;
116
- }
117
-
118
- .popmake .popmake-content :last-child {
119
- margin-bottom: 0;
120
- }
121
-
122
- .popmake iframe.formidable {
123
- width: 100%;
124
- overflow: visible;
125
- }
126
-
127
- .powered-by-popmake {
128
- bottom: -28px;
129
- display: block;
130
- left: 0;
131
- margin: 0 auto;
132
- position: absolute;
133
- text-align: center;
134
- width: 100%;
135
- }
136
-
137
- .powered-by-popmake > a {
138
- display: inline-block;
139
- max-width: 205px;
140
- }
141
-
142
- .powered-by-popmake img {
143
- max-width: 100%;
144
- width: 100%;
145
- }
146
-
147
- .powered-by-popmake.small {
148
- bottom: -22px;
149
- }
150
-
151
- .powered-by-popmake.small > a {
152
- max-width: 125px;
153
- }
154
-
155
- .powered-by-popmake.large {
156
- bottom: -30px;
157
- }
158
-
159
- .powered-by-popmake.large > a {
160
- max-width: 285px;
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/popup-maker-site.min.css DELETED
@@ -1 +0,0 @@
1
- .popmake,.popmake *,.popmake :after,.popmake :before,.popmake:after,.popmake:before{box-sizing:border-box}.popup-open body,html.popup-open{overflow:hidden}.popmake-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;z-index:1999999998;overflow-x:hidden;overflow-y:auto}.popmake{top:100px;visibility:hidden;position:absolute;display:none;z-index:1999999999}.popmake>.popmake-close{text-decoration:none;text-align:center;line-height:1;position:absolute;font-weight:700;cursor:pointer;min-width:1em}.popmake.responsive{left:50%;margin-left:-40%;width:95%;height:auto;overflow:visible}.popmake.responsive .popmake-content img{max-width:100%;height:auto}@media only screen and (min-width:768px){.popmake.size-nano{margin-left:-5%;width:10%}.popmake.size-micro{margin-left:-10%;width:20%}.popmake.size-tiny{margin-left:-15%;width:30%}.popmake.size-small{margin-left:-20%;width:40%}.popmake.size-medium{margin-left:-30%;width:60%}.popmake.size-normal{margin-left:-30%;width:70%}.popmake.size-large{margin-left:-35%;width:80%}.popmake.size-xlarge{margin-left:-47.5%;width:95%}.popmake.fixed{position:fixed}}@media only screen and (max-width:767px){.popmake.fixed{position:absolute}}.popmake.custom-position{left:auto;top:auto;margin-left:inherit}.popmake.scrollable .popmake-content{overflow:auto;overflow-y:scroll;max-height:95%}.popmake .popmake-content :last-child{margin-bottom:0}.popmake iframe.formidable{width:100%;overflow:visible}.powered-by-popmake{bottom:-28px;display:block;left:0;margin:0 auto;position:absolute;text-align:center;width:100%}.powered-by-popmake>a{display:inline-block;max-width:205px}.powered-by-popmake img{max-width:100%;width:100%}.powered-by-popmake.small{bottom:-22px}.powered-by-popmake.small>a{max-width:125px}.powered-by-popmake.large{bottom:-30px}.powered-by-popmake.large>a{max-width:285px}
 
assets/js/popup-maker-admin.js DELETED
@@ -1,1050 +0,0 @@
1
- /**
2
- * Popup Maker v1.3.6
3
- */
4
-
5
- var PopMakeAdmin;
6
- (function () {
7
- "use strict";
8
- PopMakeAdmin = {
9
- init: function () {
10
- //PopMakeAdmin.initialize_tabs();
11
- if (jQuery('body.post-type-popup form#post').length) {
12
- PopMakeAdmin.initialize_popup_page();
13
- PopMakeAdmin.attachQuickSearchListeners();
14
- PopMakeAdmin.attachTabsPanelListeners();
15
- }
16
- if (jQuery('body.post-type-popup_theme form#post').length) {
17
- PopMakeAdmin.initialize_theme_page();
18
- }
19
- PopMakeAdmin.initialize_color_pickers();
20
- PopMakeAdmin.initialize_range_sliders();
21
-
22
- PopMakeAdmin.initialize_marketing();
23
-
24
-
25
- jQuery(document).keydown(function (event) {
26
- if ((event.which === '115' || event.which === '83') && (event.ctrlKey || event.metaKey)) {
27
- event.preventDefault();
28
- jQuery('body.post-type-popup form#post, body.post-type-popup_theme form#post').submit();
29
- return false;
30
- }
31
- return true;
32
- });
33
- },
34
- initialize_marketing: function () {
35
- jQuery('#menu-posts-popup ul li:eq(-1)').addClass('popmake-menu-highlight');
36
-
37
- jQuery('.popmake-newsletter-optin').show();
38
-
39
- // Modal & Theme Indexes
40
- if (jQuery('#posts-filter').length) {
41
- jQuery('#wpbody-content > .wrap > h2:first').after(jQuery('.popmake-newsletter-optin'));
42
-
43
- // Modal & Theme Editors
44
- } else if (jQuery('#titlediv').length) {
45
- jQuery('#titlediv').append(jQuery('.popmake-newsletter-optin'));
46
-
47
- // Welcome & Similar Pages
48
- } else if (jQuery('.about-text').length && jQuery('.popmake-badge').length) {
49
- jQuery('.nav-tab-wrapper').after(jQuery('.popmake-newsletter-optin'));
50
-
51
- // Settings & Other Tabbed Pages
52
- } else if (jQuery('#poststuff .tabwrapper').length) {
53
- jQuery('#poststuff .tabwrapper').prepend(jQuery('.popmake-newsletter-optin'));
54
-
55
- // Settings & Other Tabbed Pages
56
- } else if (jQuery('#poststuff').length) {
57
- jQuery('#poststuff').prepend(jQuery('.popmake-newsletter-optin'));
58
- }
59
-
60
- jQuery('.popmake-optin-dismiss').on('click', function (event) {
61
- var $this = jQuery(this);
62
- event.preventDefault();
63
- jQuery
64
- .ajax({
65
- url: ajaxurl,
66
- type: 'POST',
67
- dataType: 'json',
68
- data: {
69
- action: "popmake_optin",
70
- popmake_nonce: popmake_admin_ajax_nonce,
71
- optin_dismiss: true,
72
- optin_name: $this.data('optin-name'),
73
- optin_type: $this.data('optin-type')
74
- }
75
- })
76
- .done(function (data) {
77
- if (data.success) {
78
- $this.parents('.popmake-optin').slideUp(function () {
79
- jQuery(this).remove();
80
- });
81
- }
82
- });
83
- });
84
- },
85
- attachTabsPanelListeners: function () {
86
- jQuery('#poststuff').bind('click', function (event) {
87
- var selectAreaMatch, panelId, wrapper, items,
88
- target = jQuery(event.target),
89
- $parent,
90
- $items,
91
- $textarea,
92
- $tag_area,
93
- current_ids,
94
- i,
95
- $item,
96
- id,
97
- name,
98
- removeItem;
99
-
100
-
101
- if (target.hasClass('nav-tab-link')) {
102
- panelId = target.data('type');
103
- wrapper = target.parents('.posttypediv, .taxonomydiv').first();
104
- // upon changing tabs, we want to uncheck all checkboxes
105
- jQuery('input', wrapper).removeAttr('checked');
106
- jQuery('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
107
- jQuery('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
108
- jQuery('.tabs', wrapper).removeClass('tabs');
109
- target.parent().addClass('tabs');
110
- // select the search bar
111
- jQuery('.quick-search', wrapper).focus();
112
- event.preventDefault();
113
- } else if (target.hasClass('select-all')) {
114
- selectAreaMatch = /#(.*)$/.exec(event.target.href);
115
- if (selectAreaMatch && selectAreaMatch[1]) {
116
- items = jQuery('#' + selectAreaMatch[1] + ' .tabs-panel-active .menu-item-title input');
117
- if (items.length === items.filter(':checked').length) {
118
- items.removeAttr('checked');
119
- } else {
120
- items.prop('checked', true);
121
- }
122
- }
123
- } else if (target.hasClass('submit-add-to-menu')) {
124
- $parent = target.parents('.options');
125
- $items = jQuery('.tabs-panel-active input[type="checkbox"]:checked', $parent);
126
- $textarea = jQuery('textarea', $parent);
127
- $tag_area = jQuery('.tagchecklist', $parent);
128
- current_ids = $textarea.val().split(',');
129
- for (i = 0; i < current_ids.length; i += 1) {
130
- current_ids[i] = parseInt(current_ids[i], 10);
131
- }
132
- $items.each(function () {
133
- $item = jQuery(this);
134
- id = parseInt($item.val(), 10);
135
- name = $item.parent('label').siblings('.menu-item-title').val();
136
- if (jQuery.inArray(id, current_ids) === -1) {
137
- current_ids.push(id);
138
- }
139
- $tag_area.append('<span><a class="ntdelbutton" data-id="' + id + '">X</a> ' + name + '</span>');
140
- });
141
- $textarea.text(current_ids.join(','));
142
- event.preventDefault();
143
- } else if (target.hasClass('ntdelbutton')) {
144
- $item = target;
145
- removeItem = parseInt($item.data('id'), 10);
146
- $parent = target.parents('.options');
147
- $textarea = jQuery('textarea', $parent);
148
- $tag_area = jQuery('.tagchecklist', $parent);
149
- current_ids = $textarea.val().split(',');
150
- current_ids = jQuery.grep(current_ids, function (value) {
151
- return parseInt(value, 10) !== parseInt(removeItem, 10);
152
- });
153
- $item.parent('span').remove();
154
- $textarea.text(current_ids.join(','));
155
- }
156
- });
157
- },
158
- attachQuickSearchListeners: function () {
159
- var searchTimer;
160
- jQuery('.quick-search').keypress(function (event) {
161
- var t = jQuery(this);
162
- if (13 === event.which) {
163
- PopMakeAdmin.updateQuickSearchResults(t);
164
- return false;
165
- }
166
- if (searchTimer) {
167
- clearTimeout(searchTimer);
168
- }
169
- searchTimer = setTimeout(function () {
170
- PopMakeAdmin.updateQuickSearchResults(t);
171
- }, 400);
172
- }).attr('autocomplete', 'off');
173
- },
174
- updateQuickSearchResults: function (input) {
175
- var panel, params,
176
- minSearchLength = 2,
177
- q = input.val();
178
- if (q.length < minSearchLength) {
179
- return;
180
- }
181
- panel = input.parents('.tabs-panel');
182
- params = {
183
- 'action': 'menu-quick-search',
184
- 'response-format': 'markup',
185
- 'menu': null,
186
- 'menu-settings-column-nonce': jQuery('#menu-settings-column-nonce').val(),
187
- 'q': q,
188
- 'type': input.attr('name')
189
- };
190
- jQuery('.spinner', panel).show();
191
- jQuery.post(ajaxurl, params, function (menuMarkup) {
192
- PopMakeAdmin.processQuickSearchQueryResponse(menuMarkup, params, panel);
193
- });
194
- },
195
- processQuickSearchQueryResponse: function (resp, req, panel) {
196
- var matched, newID,
197
- form = jQuery('form#post'),
198
- takenIDs = {},
199
- pattern = /menu-item[(\[\^]\]*/,
200
- $items = jQuery('<div>').html(resp).find('li'),
201
- $item;
202
-
203
- if (!$items.length) {
204
- jQuery('.categorychecklist', panel).html('<li><p>' + 'noResultsFound' + '</p></li>');
205
- jQuery('.spinner', panel).hide();
206
- return;
207
- }
208
-
209
- $items.each(function () {
210
- $item = jQuery(this);
211
-
212
- // make a unique DB ID number
213
- matched = pattern.exec($item.html());
214
-
215
- if (matched && matched[1]) {
216
- newID = matched[1];
217
- while (form.elements['menu-item[' + newID + '][menu-item-type]'] || takenIDs[newID]) {
218
- newID = newID - 1;
219
- }
220
-
221
- takenIDs[newID] = true;
222
- if (newID !== matched[1]) {
223
- $item.html(
224
- $item.html().replace(
225
- new RegExp('menu-item\\[' + matched[1] + '\\]', 'g'),
226
- 'menu-item[' + newID + ']'
227
- )
228
- );
229
- }
230
- }
231
- });
232
-
233
- jQuery('.categorychecklist', panel).html($items);
234
- jQuery('.spinner', panel).hide();
235
- jQuery('[name^="menu-item"]').removeAttr('name');
236
- },
237
- initialize_color_pickers: function () {
238
- var self = this;
239
- jQuery('.color-picker').wpColorPicker({
240
- change: function (event) {
241
- self.throttle(setTimeout(function () {
242
- self.update_theme();
243
- }, 5), 250);
244
- var $input = jQuery(event.currentTarget);
245
- if ($input.hasClass('background-color')) {
246
- $input.parents('table').find('.background-opacity').show();
247
- }
248
- },
249
- clear: function (event) {
250
- self.update_theme();
251
- var $input = jQuery(event.currentTarget).prev();
252
- if ($input.hasClass('background-color')) {
253
- $input.parents('table').find('.background-opacity').hide();
254
- }
255
- }
256
- });
257
- },
258
- initialize_range_sliders: function () {
259
-
260
- var input,
261
- $input,
262
- $slider,
263
- $plus,
264
- $minus,
265
- slider = jQuery('<input type="range"/>'),
266
- plus = jQuery('<button class="popmake-range-plus">+</button>'),
267
- minus = jQuery('<button class="popmake-range-minus">-</button>');
268
-
269
- jQuery(document).on('input', 'input[type="range"]', function () {
270
- var $this = jQuery(this);
271
- $this.siblings('.popmake-range-manual').val($this.val());
272
- });
273
- jQuery('.popmake-range-manual').each(function () {
274
- var $this = jQuery(this),
275
- force = $this.data('force-minmax'),
276
- min = parseInt($this.prop('min'), 0),
277
- max = parseInt($this.prop('max'), 0),
278
- step = parseInt($this.prop('step'), 0),
279
- value = parseInt($this.val(), 0);
280
-
281
- $slider = slider.clone();
282
- $plus = plus.clone();
283
- $minus = minus.clone();
284
-
285
- if (force && value > max) {
286
- value = max;
287
- $this.val(value);
288
- }
289
-
290
- $slider
291
- .prop({
292
- 'min': min || 0,
293
- 'max': force || (max && max > value) ? max : value * 1.5,
294
- 'step': step || value * 1.5 / 100,
295
- 'value': value
296
- })
297
- .on('change input', function () {
298
- $this.trigger('input');
299
- });
300
- $this.next().after($minus, $plus);
301
- $this.before($slider);
302
-
303
- });
304
-
305
- jQuery(document)
306
- .on('click', '.popmake-range-manual', function () {
307
- var $this = jQuery(this);
308
- $this.prop('readonly', false);
309
- })
310
- .on('focusout', '.popmake-range-manual', function () {
311
- var $this = jQuery(this);
312
- $this.prop('readonly', true);
313
- })
314
- .on('change', '.popmake-range-manual', function () {
315
-
316
- var $this = jQuery(this),
317
- max = parseInt($this.prop('max'), 0),
318
- step = parseInt($this.prop('step'), 0),
319
- force = $this.data('force-minmax'),
320
- value = parseInt($this.val(), 0);
321
-
322
- $slider = $this.prev();
323
-
324
- if (force && value > max) {
325
- value = max;
326
- $this.val(value);
327
- }
328
-
329
- $slider.prop({
330
- 'max': force || (max && max > value) ? max : value * 1.5,
331
- 'step': step || value * 1.5 / 100,
332
- 'value': value
333
- });
334
-
335
- })
336
- .on('click', '.popmake-range-plus', function (event) {
337
-
338
- event.preventDefault();
339
-
340
- var $this = jQuery(this).siblings('.popmake-range-manual'),
341
- step = parseInt($this.prop('step'), 0),
342
- value = parseInt($this.val(), 0),
343
- val = value + step;
344
-
345
- $slider = $this.prev();
346
-
347
- $this.val(val).trigger('input');
348
- $slider.val(val);
349
-
350
- })
351
- .on('click', '.popmake-range-minus', function (event) {
352
-
353
- event.preventDefault();
354
-
355
- var $this = jQuery(this).siblings('.popmake-range-manual'),
356
- step = parseInt($this.prop('step'), 0),
357
- value = parseInt($this.val(), 0),
358
- val = value - step;
359
-
360
- $slider = $this.prev();
361
-
362
- $this.val(val).trigger('input');
363
- $slider.val(val);
364
-
365
- });
366
-
367
-
368
- input = document.createElement('input');
369
- input.setAttribute('type', 'range');
370
- if (input.type === 'text') {
371
- jQuery('input[type=range]').each(function (index, input) {
372
- $input = jQuery(input);
373
- $slider = jQuery('<div />').slider({
374
- min: parseInt($input.attr('min'), 10) || 0,
375
- max: parseInt($input.attr('max'), 10) || 100,
376
- value: parseInt($input.attr('value'), 10) || 0,
377
- step: parseInt($input.attr('step'), 10) || 1,
378
- slide: function (event, ui) {
379
- jQuery(this).prev('input').val(ui.value);
380
- }
381
- });
382
- $input.after($slider).hide();
383
- });
384
- }
385
- },
386
- initialize_popup_page: function () {
387
- var update_type_options = function ($this) {
388
- var $options = $this.siblings('.options'),
389
- excludes,
390
- others;
391
-
392
- if ($this.is(':checked')) {
393
- $options.show();
394
- if ($this.attr('id') === 'popup_targeting_condition_on_entire_site') {
395
- excludes = $this.parents('#popmake_popup_targeting_condition_fields').find('[id^="targeting_condition-exclude_on_"]');
396
- others = $this.parents('.targeting_condition').siblings('.targeting_condition');
397
- others.hide();
398
- jQuery('> *', others).prop('disabled', true);
399
- excludes.show();
400
- jQuery('> *', excludes).prop('disabled', false);
401
- } else {
402
- jQuery('*', $options).prop('disabled', false);
403
- }
404
- } else {
405
- $options.hide();
406
- if ($this.attr('id') === 'popup_targeting_condition_on_entire_site') {
407
- excludes = $this.parents('#popmake_popup_targeting_condition_fields').find('[id^="targeting_condition-exclude_on_"]');
408
- others = $this.parents('.targeting_condition').siblings('.targeting_condition');
409
- others.show();
410
- jQuery('> *', others).prop('disabled', false);
411
- excludes.hide();
412
- jQuery('> *', excludes).prop('disabled', true);
413
- } else {
414
- jQuery('*', $options).prop('disabled', true);
415
- }
416
- }
417
- },
418
- update_specific_checkboxes = function ($this) {
419
- var $option = $this.parents('.options').find('input[type="checkbox"]:eq(0)'),
420
- exclude = $option.attr('name').indexOf("exclude") >= 0,
421
- type = exclude ? $option.attr('name').replace('popup_targeting_condition_exclude_on_specific_', '') : $option.attr('name').replace('popup_targeting_condition_on_specific_', ''),
422
- type_box = exclude ? jQuery('#exclude_on_specific_' + type) : jQuery('#on_specific_' + type);
423
-
424
- if ($this.is(':checked')) {
425
- if ($this.val() === 'true') {
426
- $option.prop('checked', true);
427
- type_box.show();
428
- jQuery('*', type_box).prop('disabled', false);
429
- } else if ($this.val() === '') {
430
- $option.prop('checked', false);
431
- type_box.hide();
432
- jQuery('*', type_box).prop('disabled', true);
433
- }
434
- }
435
- },
436
- update_size = function () {
437
- if (jQuery("#popup_display_size").val() === 'custom') {
438
- jQuery('.custom-size-only').show();
439
- jQuery('.responsive-size-only').hide();
440
- if (jQuery('#popup_display_custom_height_auto').is(':checked')) {
441
- jQuery('.custom-size-height-only').hide();
442
- } else {
443
- jQuery('.custom-size-height-only').show();
444
- }
445
- } else {
446
- jQuery('.custom-size-only').hide();
447
- if (jQuery("#popup_display_size").val() !== 'auto') {
448
- jQuery('.responsive-size-only').show();
449
- jQuery('#popup_display_custom_height_auto').prop('checked', false);
450
- } else {
451
- jQuery('.responsive-size-only').hide();
452
- }
453
- }
454
- },
455
- update_animation = function () {
456
- jQuery('.animation-speed, .animation-origin').hide();
457
- if (jQuery("#popup_display_animation_type").val() === 'fade') {
458
- jQuery('.animation-speed').show();
459
- } else {
460
- if (jQuery("#popup_display_animation_type").val() !== 'none') {
461
- jQuery('.animation-speed, .animation-origin').show();
462
- }
463
- }
464
- },
465
- update_location = function () {
466
- var $this = jQuery('#popup_display_location'),
467
- table = $this.parents('table'),
468
- val = $this.val();
469
- jQuery('tr.top, tr.right, tr.left, tr.bottom', table).hide();
470
- if (val.indexOf("top") >= 0) {
471
- jQuery('tr.top').show();
472
- }
473
- if (val.indexOf("left") >= 0) {
474
- jQuery('tr.left').show();
475
- }
476
- if (val.indexOf("bottom") >= 0) {
477
- jQuery('tr.bottom').show();
478
- }
479
- if (val.indexOf("right") >= 0) {
480
- jQuery('tr.right').show();
481
- }
482
- },
483
- auto_open_session_cookie_check = function () {
484
- if (jQuery("#popup_auto_open_session_cookie").is(":checked")) {
485
- jQuery('.not-session-cookie').hide();
486
- } else {
487
- jQuery('.not-session-cookie').show();
488
- }
489
- },
490
- auto_open_enabled_check = function () {
491
- if (jQuery("#popup_auto_open_enabled").is(":checked")) {
492
- jQuery('.auto-open-enabled').show();
493
- auto_open_session_cookie_check();
494
- } else {
495
- jQuery('.auto-open-enabled').hide();
496
- }
497
- },
498
- auto_open_reset_cookie_key = function () {
499
- jQuery('#popup_auto_open_cookie_key').val((new Date().getTime()).toString(16));
500
- },
501
- update_popup_preview_title = function () {
502
- if (jQuery('#popuptitle').val() !== '') {
503
- jQuery('#popmake-preview .popmake-title').show().html(jQuery('#popuptitle').val());
504
- } else {
505
- jQuery('#popmake-preview .popmake-title').hide();
506
- }
507
- },
508
- update_popup_preview_content = function () {
509
- var content = '';
510
-
511
- if (jQuery("#wp-content-wrap").hasClass("tmce-active")) {
512
- console.log(1);
513
- content = tinyMCE.activeEditor.getContent();
514
- } else {
515
- console.log(2);
516
- content = jQuery('#content').val();
517
- }
518
-
519
- jQuery
520
- .ajax({
521
- url: ajaxurl,
522
- type: 'POST',
523
- dataType: 'json',
524
- data: {
525
- action: "popmake_popup_preview_content",
526
- popmake_nonce: popmake_admin_ajax_nonce,
527
- popup_id: jQuery('#post_ID').val(),
528
- popup_content: content
529
- }
530
- })
531
- .done(function (data) {
532
- if (data.success) {
533
- jQuery('#popmake-preview .popmake-content').html(data.content);
534
- jQuery('#popmake-preview').popmake('open');
535
- }
536
- });
537
- },
538
- update_popup_preview_data = function () {
539
- var form_values = jQuery("[name^='popup_display_']").serializeArray(),
540
- i,
541
- $popup = jQuery('#popmake-preview'),
542
- data = $popup.data('popmake');
543
-
544
- for (i = 0; form_values.length > i; i += 1) {
545
- if (form_values[i].name.indexOf('popup_display_') === 0) {
546
- data.meta.display[form_values[i].name.replace('popup_display_', '')] = form_values[i].value;
547
- }
548
- }
549
-
550
- $popup.removeClass('theme-' + data.theme_id);
551
-
552
- data.theme_id = jQuery('#popup_theme').val();
553
-
554
- jQuery('#popmake-preview')
555
- .addClass('theme-' + data.theme_id)
556
- .data('popmake', data);
557
- };
558
-
559
- jQuery('#popuptitlediv').insertAfter('#titlediv');
560
- jQuery('[name^="menu-item"]').removeAttr('name');
561
-
562
- jQuery('#trigger-popmake-preview')
563
- .on('click', function (event) {
564
- event.preventDefault();
565
- event.stopPropagation();
566
- update_popup_preview_title();
567
- update_popup_preview_data();
568
- update_popup_preview_content();
569
- return false;
570
- });
571
- jQuery(document)
572
- .on('keydown', '#popuptitle', function (event) {
573
- var keyCode = event.keyCode || event.which;
574
- if (9 === keyCode) {
575
- event.preventDefault();
576
- jQuery('#title').focus();
577
- }
578
- })
579
- .on('keydown', '#title, #popuptitle', function (event) {
580
- var keyCode = event.keyCode || event.which,
581
- target;
582
- if (!event.shiftKey && 9 === keyCode) {
583
- event.preventDefault();
584
- target = jQuery(this).attr('id') === 'title' ? '#popuptitle' : '#insert-media-button';
585
- jQuery(target).focus();
586
- }
587
- })
588
- .on('keydown', '#popuptitle, #insert-media-button', function (event) {
589
- var keyCode = event.keyCode || event.which,
590
- target;
591
- if (event.shiftKey && 9 === keyCode) {
592
- event.preventDefault();
593
- target = jQuery(this).attr('id') === 'popuptitle' ? '#title' : '#popuptitle';
594
- jQuery(target).focus();
595
- }
596
- })
597
- .on('submit', '#post', function (event) {
598
- var title = jQuery('#title').val();
599
- if (title.length === 0 || title.replace(/\s/g, '').length === 0) {
600
- console.log(1);
601
- event.preventDefault();
602
- jQuery('div#notice').remove();
603
- jQuery("<div id='notice' class='error below-h2'><p>A name is required for all popups.</p></div>").insertAfter('h2');
604
- jQuery('#title').focus();
605
- jQuery('#publishing-action .spinner').removeClass('is-active');
606
- jQuery('#publish').removeClass('disabled');
607
- jQuery('#title').prop('required', 'required');
608
- }
609
- })
610
- .on('click', '#popup_display_custom_height_auto', function () {
611
- update_size();
612
- })
613
- .on('click', "#popup_auto_open_session_cookie", function () {
614
- auto_open_session_cookie_check();
615
- })
616
- .on('click', "#popup_auto_open_enabled", function () {
617
- auto_open_enabled_check();
618
- })
619
- .on('click', ".popmake-reset-auto-open-cookie-key", function () {
620
- auto_open_reset_cookie_key();
621
- })
622
- .on('change', "#popup_display_size", function () {
623
- if (jQuery("#popup_display_size").val() !== 'custom' && jQuery("#popup_display_size").val() !== 'auto') {
624
- jQuery('#popup_display_position_fixed, #popup_display_scrollable_content').prop('checked', false);
625
- }
626
- update_size();
627
- })
628
- .on('change', "#popup_display_animation_type", function () {
629
- update_animation();
630
- })
631
- .on('change', '#popup_display_location', function () {
632
- update_location();
633
- });
634
-
635
-
636
- jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]')
637
- .on('click', function () {
638
- update_type_options(jQuery(this));
639
- })
640
- .each(function () {
641
- update_type_options(jQuery(this));
642
- });
643
-
644
- jQuery('input[type="radio"][id*="popup_targeting_condition_"]')
645
- .on('click', function () {
646
- update_specific_checkboxes(jQuery(this));
647
- })
648
- .each(function () {
649
- update_specific_checkboxes(jQuery(this));
650
- });
651
-
652
- jQuery('.posttypediv, .taxonomydiv').each(function () {
653
- var $this = jQuery(this),
654
- $tabs = jQuery('> ul li'),
655
- $sections = jQuery('.tabs-panel', $this);
656
-
657
- $tabs.removeClass('tabs');
658
- $tabs.eq(0).addClass('tabs');
659
- $sections.removeClass('tabs-panel-active').addClass('tabs-panel-inactive').removeAttr('style');
660
- $sections.eq(0).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
661
- });
662
-
663
- update_size();
664
- update_animation();
665
- update_location();
666
-
667
- auto_open_enabled_check();
668
- if (jQuery('#popup_auto_open_cookie_key').val() === '') {
669
- auto_open_reset_cookie_key();
670
- }
671
- },
672
- theme_page_listeners: function () {
673
- var self = this;
674
- jQuery(document)
675
- .on('change', 'select.font-family', function () {
676
- jQuery('select.font-weight option, select.font-style option', jQuery(this).parents('table')).prop('selected', false);
677
- self.update_font_selectboxes();
678
- })
679
- .on('change', 'select.font-weight, select.font-style', function () {
680
- self.update_font_selectboxes();
681
- })
682
- .on('change input focusout', 'select, input', function () {
683
- self.update_theme();
684
- })
685
- .on('change', 'select.border-style', function () {
686
- var $this = jQuery(this);
687
- if ($this.val() === 'none') {
688
- $this.parents('table').find('.border-options').hide();
689
- } else {
690
- $this.parents('table').find('.border-options').show();
691
- }
692
- })
693
- .on('change', '#popup_theme_close_location', function () {
694
- var $this = jQuery(this),
695
- table = $this.parents('table');
696
- jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
697
- jQuery('tr.' + $this.val(), table).show();
698
- });
699
- },
700
- update_theme: function () {
701
- var form_values = jQuery("[name^='popup_theme_']").serializeArray(),
702
- theme = {},
703
- i;
704
- for (i = 0; form_values.length > i; i += 1) {
705
- if (form_values[i].name.indexOf('popup_theme_') === 0) {
706
- theme[form_values[i].name.replace('popup_theme_', '')] = form_values[i].value;
707
- }
708
- }
709
- this.retheme_popup(theme);
710
- },
711
- theme_preview_scroll: function () {
712
- var $preview = jQuery('#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview'),
713
- $parent = $preview.parent(),
714
- startscroll = $preview.offset().top - 50;
715
- jQuery(window).on('scroll', function () {
716
- if (jQuery('> .postbox:visible', $parent).index($preview) === (jQuery('> .postbox:visible', $parent).length - 1) && jQuery(window).scrollTop() >= startscroll) {
717
- $preview.css({
718
- left: $preview.offset().left,
719
- width: $preview.width(),
720
- height: $preview.height(),
721
- position: 'fixed',
722
- top: 50
723
- });
724
- } else {
725
- $preview.removeAttr('style');
726
- }
727
- });
728
- },
729
- update_font_selectboxes: function () {
730
- return jQuery('select.font-family').each(function () {
731
- var $this = jQuery(this),
732
- $font_weight = $this.parents('table').find('select.font-weight'),
733
- $font_style = $this.parents('table').find('select.font-style'),
734
- $font_weight_options = $font_weight.find('option'),
735
- $font_style_options = $font_style.find('option'),
736
- font,
737
- i;
738
-
739
-
740
- // Google Font Chosen
741
- if (popmake_google_fonts[$this.val()] !== undefined) {
742
- font = popmake_google_fonts[$this.val()];
743
-
744
- $font_weight_options.hide();
745
- $font_style_options.hide();
746
-
747
- if (font.variants.length) {
748
- for (i = 0; font.variants.length > i; i += 1) {
749
- if (font.variants[i] === 'regular') {
750
- jQuery('option[value=""]', $font_weight).show();
751
- jQuery('option[value=""]', $font_style).show();
752
- } else {
753
- if (font.variants[i].indexOf('italic') >= 0) {
754
-
755
- console.log('italic');
756
- jQuery('option[value="italic"]', $font_style).show();
757
- }
758
- jQuery('option[value="' + parseInt(font.variants[i], 10) + '"]', $font_weight).show();
759
- }
760
- }
761
- }
762
- // Standard Font Chosen
763
- } else {
764
- $font_weight_options.show();
765
- $font_style_options.show();
766
- }
767
-
768
- $font_weight.parents('tr:first').show();
769
- if ($font_weight.find('option:visible').length <= 1) {
770
- $font_weight.parents('tr:first').hide();
771
- } else {
772
- $font_weight.parents('tr:first').show();
773
- }
774
-
775
- $font_style.parents('tr:first').show();
776
- if ($font_style.find('option:visible').length <= 1) {
777
- $font_style.parents('tr:first').hide();
778
- } else {
779
- $font_style.parents('tr:first').show();
780
- }
781
- });
782
- },
783
- convert_theme_for_preview: function (theme) {
784
- return;
785
- //jQuery.fn.popmake.themes[popmake_default_theme] = this.convert_meta_to_object(theme);
786
- },
787
- convert_meta_to_object: function (data) {
788
- var converted_data = {},
789
- element,
790
- property,
791
- key;
792
-
793
- for (key in data) {
794
- if (data.hasOwnProperty(key)) {
795
- element = key.split(/_(.+)?/)[0];
796
- property = key.split(/_(.+)?/)[1];
797
- if (converted_data[element] === undefined) {
798
- converted_data[element] = {};
799
- }
800
- converted_data[element][property] = data[key];
801
- }
802
- }
803
- return converted_data;
804
- },
805
- initialize_theme_page: function () {
806
- jQuery('#popuptitlediv').insertAfter('#titlediv');
807
-
808
- var self = this,
809
- table = jQuery('#popup_theme_close_location').parents('table');
810
- self.update_theme();
811
- self.theme_page_listeners();
812
- self.theme_preview_scroll();
813
- self.update_font_selectboxes();
814
-
815
- jQuery(document)
816
- .on('click', '.popmake-preview', function (e) {
817
- e.preventDefault();
818
- jQuery('#popmake-preview, #popmake-overlay').css({visibility: "visible"}).show();
819
- })
820
- .on('click', '.popmake-close', function () {
821
- jQuery('#popmake-preview, #popmake-overlay').hide();
822
- });
823
-
824
- jQuery('select.border-style').each(function () {
825
- var $this = jQuery(this);
826
- if ($this.val() === 'none') {
827
- $this.parents('table').find('.border-options').hide();
828
- } else {
829
- $this.parents('table').find('.border-options').show();
830
- }
831
- });
832
-
833
- jQuery('.color-picker.background-color').each(function () {
834
- var $this = jQuery(this);
835
- if ($this.val() === '') {
836
- $this.parents('table').find('.background-opacity').hide();
837
- } else {
838
- $this.parents('table').find('.background-opacity').show();
839
- }
840
- });
841
-
842
- jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
843
- switch (jQuery('#popup_theme_close_location').val()) {
844
- case "topleft":
845
- jQuery('tr.topleft', table).show();
846
- break;
847
- case "topright":
848
- jQuery('tr.topright', table).show();
849
- break;
850
- case "bottomleft":
851
- jQuery('tr.bottomleft', table).show();
852
- break;
853
- case "bottomright":
854
- jQuery('tr.bottomright', table).show();
855
- break;
856
- }
857
- },
858
- retheme_popup: function (theme) {
859
- var $overlay = jQuery('.empreview .example-popup-overlay, #popmake-overlay'),
860
- $container = jQuery('.empreview .example-popup, #popmake-preview'),
861
- $title = jQuery('.title, .popmake-title', $container),
862
- $content = jQuery('.content, .popmake-content', $container),
863
- $close = jQuery('.close-popup, .popmake-close', $container),
864
- container_inset = theme.container_boxshadow_inset === 'yes' ? 'inset ' : '',
865
- close_inset = theme.close_boxshadow_inset === 'yes' ? 'inset ' : '',
866
- link;
867
-
868
- this.convert_theme_for_preview(theme);
869
-
870
- if (popmake_google_fonts[theme.title_font_family] !== undefined) {
871
-
872
- link = "//fonts.googleapis.com/css?family=" + theme.title_font_family;
873
-
874
- if (theme.title_font_weight !== 'normal') {
875
- link += ":" + theme.title_font_weight;
876
- }
877
- if (theme.title_font_style === 'italic') {
878
- if (link.indexOf(':') === -1) {
879
- link += ":";
880
- }
881
- link += "italic";
882
- }
883
- jQuery('body').append('<link href="' + link + '" rel="stylesheet" type="text/css">');
884
- }
885
- if (popmake_google_fonts[theme.content_font_family] !== undefined) {
886
-
887
- link = "//fonts.googleapis.com/css?family=" + theme.content_font_family;
888
-
889
- if (theme.content_font_weight !== 'normal') {
890
- link += ":" + theme.content_font_weight;
891
- }
892
- if (theme.content_font_style === 'italic') {
893
- if (link.indexOf(':') === -1) {
894
- link += ":";
895
- }
896
- link += "italic";
897
- }
898
- jQuery('body').append('<link href="' + link + '" rel="stylesheet" type="text/css">');
899
- }
900
- if (popmake_google_fonts[theme.close_font_family] !== undefined) {
901
-
902
- link = "//fonts.googleapis.com/css?family=" + theme.close_font_family;
903
-
904
- if (theme.close_font_weight !== 'normal') {
905
- link += ":" + theme.close_font_weight;
906
- }
907
- if (theme.close_font_style === 'italic') {
908
- if (link.indexOf(':') === -1) {
909
- link += ":";
910
- }
911
- link += "italic";
912
- }
913
- jQuery('body').append('<link href="' + link + '" rel="stylesheet" type="text/css">');
914
- }
915
-
916
- $overlay.removeAttr('style').css({
917
- backgroundColor: this.convert_hex(theme.overlay_background_color, theme.overlay_background_opacity)
918
- });
919
- $container.removeAttr('style').css({
920
- padding: theme.container_padding + 'px',
921
- backgroundColor: this.convert_hex(theme.container_background_color, theme.container_background_opacity),
922
- borderStyle: theme.container_border_style,
923
- borderColor: theme.container_border_color,
924
- borderWidth: theme.container_border_width + 'px',
925
- borderRadius: theme.container_border_radius + 'px',
926
- boxShadow: container_inset + theme.container_boxshadow_horizontal + 'px ' + theme.container_boxshadow_vertical + 'px ' + theme.container_boxshadow_blur + 'px ' + theme.container_boxshadow_spread + 'px ' + this.convert_hex(theme.container_boxshadow_color, theme.container_boxshadow_opacity)
927
- });
928
- $title.removeAttr('style').css({
929
- color: theme.title_font_color,
930
- lineHeight: theme.title_line_height + 'px',
931
- fontSize: theme.title_font_size + 'px',
932
- fontFamily: theme.title_font_family,
933
- fontStyle: theme.title_font_style,
934
- fontWeight: theme.title_font_weight,
935
- textAlign: theme.title_text_align,
936
- textShadow: theme.title_textshadow_horizontal + 'px ' + theme.title_textshadow_vertical + 'px ' + theme.title_textshadow_blur + 'px ' + this.convert_hex(theme.title_textshadow_color, theme.title_textshadow_opacity)
937
- });
938
- $content.removeAttr('style').css({
939
- color: theme.content_font_color,
940
- //fontSize: theme.content_font_size+'px',
941
- fontFamily: theme.content_font_family,
942
- fontStyle: theme.content_font_style,
943
- fontWeight: theme.content_font_weight
944
- });
945
- $close.html(theme.close_text).removeAttr('style').css({
946
- padding: theme.close_padding + 'px',
947
- height: theme.close_height > 0 ? theme.close_height + 'px' : 'auto',
948
- width: theme.close_width > 0 ? theme.close_width + 'px' : 'auto',
949
- backgroundColor: this.convert_hex(theme.close_background_color, theme.close_background_opacity),
950
- color: theme.close_font_color,
951
- lineHeight: theme.close_line_height + 'px',
952
- fontSize: theme.close_font_size + 'px',
953
- fontFamily: theme.close_font_family,
954
- fontWeight: theme.close_font_weight,
955
- fontStyle: theme.close_font_style,
956
- borderStyle: theme.close_border_style,
957
- borderColor: theme.close_border_color,
958
- borderWidth: theme.close_border_width + 'px',
959
- borderRadius: theme.close_border_radius + 'px',
960
- boxShadow: close_inset + theme.close_boxshadow_horizontal + 'px ' + theme.close_boxshadow_vertical + 'px ' + theme.close_boxshadow_blur + 'px ' + theme.close_boxshadow_spread + 'px ' + this.convert_hex(theme.close_boxshadow_color, theme.close_boxshadow_opacity),
961
- textShadow: theme.close_textshadow_horizontal + 'px ' + theme.close_textshadow_vertical + 'px ' + theme.close_textshadow_blur + 'px ' + this.convert_hex(theme.close_textshadow_color, theme.close_textshadow_opacity)
962
- });
963
- switch (theme.close_location) {
964
- case "topleft":
965
- $close.css({
966
- top: theme.close_position_top + 'px',
967
- left: theme.close_position_left + 'px'
968
- });
969
- break;
970
- case "topright":
971
- $close.css({
972
- top: theme.close_position_top + 'px',
973
- right: theme.close_position_right + 'px'
974
- });
975
- break;
976
- case "bottomleft":
977
- $close.css({
978
- bottom: theme.close_position_bottom + 'px',
979
- left: theme.close_position_left + 'px'
980
- });
981
- break;
982
- case "bottomright":
983
- $close.css({
984
- bottom: theme.close_position_bottom + 'px',
985
- right: theme.close_position_right + 'px'
986
- });
987
- break;
988
- }
989
- jQuery(document).trigger('popmake-admin-retheme', [theme]);
990
- },
991
- serialize_form: function ($form) {
992
- var serialized = {};
993
- jQuery("[name]", $form).each(function () {
994
- var name = jQuery(this).attr('name'),
995
- value = jQuery(this).val(),
996
- nameBits = name.split('['),
997
- previousRef = serialized,
998
- i,
999
- l = nameBits.length,
1000
- nameBit;
1001
- for (i = 0; i < l; i += 1) {
1002
- nameBit = nameBits[i].replace(']', '');
1003
- if (!previousRef[nameBit]) {
1004
- previousRef[nameBit] = {};
1005
- }
1006
- if (i !== nameBits.length - 1) {
1007
- previousRef = previousRef[nameBit];
1008
- } else if (i === nameBits.length - 1) {
1009
- previousRef[nameBit] = value;
1010
- }
1011
- }
1012
- });
1013
- return serialized;
1014
- },
1015
- convert_hex: function (hex, opacity) {
1016
- hex = hex.replace('#', '');
1017
- var r = parseInt(hex.substring(0, 2), 16),
1018
- g = parseInt(hex.substring(2, 4), 16),
1019
- b = parseInt(hex.substring(4, 6), 16),
1020
- result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
1021
- return result;
1022
- },
1023
- debounce: function (callback, threshold) {
1024
- var timeout;
1025
- return function () {
1026
- var context = this, params = arguments;
1027
- window.clearTimeout(timeout);
1028
- timeout = window.setTimeout(function () {
1029
- callback.apply(context, params);
1030
- }, threshold);
1031
- };
1032
- },
1033
- throttle: function (callback, threshold) {
1034
- var suppress = false,
1035
- clear = function () {
1036
- suppress = false;
1037
- };
1038
- return function () {
1039
- if (!suppress) {
1040
- callback();
1041
- window.setTimeout(clear, threshold);
1042
- suppress = true;
1043
- }
1044
- };
1045
- }
1046
- };
1047
- jQuery(document).ready(function () {
1048
- PopMakeAdmin.init();
1049
- });
1050
- }());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/popup-maker-admin.min.js DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * Popup Maker v1.3.6
3
- */
4
- var PopMakeAdmin;!function(){"use strict";PopMakeAdmin={init:function(){jQuery("body.post-type-popup form#post").length&&(PopMakeAdmin.initialize_popup_page(),PopMakeAdmin.attachQuickSearchListeners(),PopMakeAdmin.attachTabsPanelListeners()),jQuery("body.post-type-popup_theme form#post").length&&PopMakeAdmin.initialize_theme_page(),PopMakeAdmin.initialize_color_pickers(),PopMakeAdmin.initialize_range_sliders(),PopMakeAdmin.initialize_marketing(),jQuery(document).keydown(function(e){return"115"!==e.which&&"83"!==e.which||!e.ctrlKey&&!e.metaKey?!0:(e.preventDefault(),jQuery("body.post-type-popup form#post, body.post-type-popup_theme form#post").submit(),!1)})},initialize_marketing:function(){jQuery("#menu-posts-popup ul li:eq(-1)").addClass("popmake-menu-highlight"),jQuery(".popmake-newsletter-optin").show(),jQuery("#posts-filter").length?jQuery("#wpbody-content > .wrap > h2:first").after(jQuery(".popmake-newsletter-optin")):jQuery("#titlediv").length?jQuery("#titlediv").append(jQuery(".popmake-newsletter-optin")):jQuery(".about-text").length&&jQuery(".popmake-badge").length?jQuery(".nav-tab-wrapper").after(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff .tabwrapper").length?jQuery("#poststuff .tabwrapper").prepend(jQuery(".popmake-newsletter-optin")):jQuery("#poststuff").length&&jQuery("#poststuff").prepend(jQuery(".popmake-newsletter-optin")),jQuery(".popmake-optin-dismiss").on("click",function(e){var t=jQuery(this);e.preventDefault(),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_optin",popmake_nonce:popmake_admin_ajax_nonce,optin_dismiss:!0,optin_name:t.data("optin-name"),optin_type:t.data("optin-type")}}).done(function(e){e.success&&t.parents(".popmake-optin").slideUp(function(){jQuery(this).remove()})})})},attachTabsPanelListeners:function(){jQuery("#poststuff").bind("click",function(e){var t,o,n,i,r,a,p,s,l,u,c,_,d,h,y=jQuery(e.target);if(y.hasClass("nav-tab-link"))o=y.data("type"),n=y.parents(".posttypediv, .taxonomydiv").first(),jQuery("input",n).removeAttr("checked"),jQuery(".tabs-panel-active",n).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),jQuery("#"+o,n).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),jQuery(".tabs",n).removeClass("tabs"),y.parent().addClass("tabs"),jQuery(".quick-search",n).focus(),e.preventDefault();else if(y.hasClass("select-all"))t=/#(.*)$/.exec(e.target.href),t&&t[1]&&(i=jQuery("#"+t[1]+" .tabs-panel-active .menu-item-title input"),i.length===i.filter(":checked").length?i.removeAttr("checked"):i.prop("checked",!0));else if(y.hasClass("submit-add-to-menu")){for(r=y.parents(".options"),a=jQuery('.tabs-panel-active input[type="checkbox"]:checked',r),p=jQuery("textarea",r),s=jQuery(".tagchecklist",r),l=p.val().split(","),u=0;u<l.length;u+=1)l[u]=parseInt(l[u],10);a.each(function(){c=jQuery(this),_=parseInt(c.val(),10),d=c.parent("label").siblings(".menu-item-title").val(),-1===jQuery.inArray(_,l)&&l.push(_),s.append('<span><a class="ntdelbutton" data-id="'+_+'">X</a> '+d+"</span>")}),p.text(l.join(",")),e.preventDefault()}else y.hasClass("ntdelbutton")&&(c=y,h=parseInt(c.data("id"),10),r=y.parents(".options"),p=jQuery("textarea",r),s=jQuery(".tagchecklist",r),l=p.val().split(","),l=jQuery.grep(l,function(e){return parseInt(e,10)!==parseInt(h,10)}),c.parent("span").remove(),p.text(l.join(",")))})},attachQuickSearchListeners:function(){var e;jQuery(".quick-search").keypress(function(t){var o=jQuery(this);return 13===t.which?(PopMakeAdmin.updateQuickSearchResults(o),!1):(e&&clearTimeout(e),void(e=setTimeout(function(){PopMakeAdmin.updateQuickSearchResults(o)},400)))}).attr("autocomplete","off")},updateQuickSearchResults:function(e){var t,o,n=2,i=e.val();i.length<n||(t=e.parents(".tabs-panel"),o={action:"menu-quick-search","response-format":"markup",menu:null,"menu-settings-column-nonce":jQuery("#menu-settings-column-nonce").val(),q:i,type:e.attr("name")},jQuery(".spinner",t).show(),jQuery.post(ajaxurl,o,function(e){PopMakeAdmin.processQuickSearchQueryResponse(e,o,t)}))},processQuickSearchQueryResponse:function(e,t,o){var n,i,r,a=jQuery("form#post"),p={},s=/menu-item[(\[\^]\]*/,l=jQuery("<div>").html(e).find("li");return l.length?(l.each(function(){if(r=jQuery(this),n=s.exec(r.html()),n&&n[1]){for(i=n[1];a.elements["menu-item["+i+"][menu-item-type]"]||p[i];)i-=1;p[i]=!0,i!==n[1]&&r.html(r.html().replace(new RegExp("menu-item\\["+n[1]+"\\]","g"),"menu-item["+i+"]"))}}),jQuery(".categorychecklist",o).html(l),jQuery(".spinner",o).hide(),void jQuery('[name^="menu-item"]').removeAttr("name")):(jQuery(".categorychecklist",o).html("<li><p>noResultsFound</p></li>"),void jQuery(".spinner",o).hide())},initialize_color_pickers:function(){var e=this;jQuery(".color-picker").wpColorPicker({change:function(t){e.throttle(setTimeout(function(){e.update_theme()},5),250);var o=jQuery(t.currentTarget);o.hasClass("background-color")&&o.parents("table").find(".background-opacity").show()},clear:function(t){e.update_theme();var o=jQuery(t.currentTarget).prev();o.hasClass("background-color")&&o.parents("table").find(".background-opacity").hide()}})},initialize_range_sliders:function(){var e,t,o,n,i,r=jQuery('<input type="range"/>'),a=jQuery('<button class="popmake-range-plus">+</button>'),p=jQuery('<button class="popmake-range-minus">-</button>');jQuery(document).on("input",'input[type="range"]',function(){var e=jQuery(this);e.siblings(".popmake-range-manual").val(e.val())}),jQuery(".popmake-range-manual").each(function(){var e=jQuery(this),t=e.data("force-minmax"),s=parseInt(e.prop("min"),0),l=parseInt(e.prop("max"),0),u=parseInt(e.prop("step"),0),c=parseInt(e.val(),0);o=r.clone(),n=a.clone(),i=p.clone(),t&&c>l&&(c=l,e.val(c)),o.prop({min:s||0,max:t||l&&l>c?l:1.5*c,step:u||1.5*c/100,value:c}).on("change input",function(){e.trigger("input")}),e.next().after(i,n),e.before(o)}),jQuery(document).on("click",".popmake-range-manual",function(){var e=jQuery(this);e.prop("readonly",!1)}).on("focusout",".popmake-range-manual",function(){var e=jQuery(this);e.prop("readonly",!0)}).on("change",".popmake-range-manual",function(){var e=jQuery(this),t=parseInt(e.prop("max"),0),n=parseInt(e.prop("step"),0),i=e.data("force-minmax"),r=parseInt(e.val(),0);o=e.prev(),i&&r>t&&(r=t,e.val(r)),o.prop({max:i||t&&t>r?t:1.5*r,step:n||1.5*r/100,value:r})}).on("click",".popmake-range-plus",function(e){e.preventDefault();var t=jQuery(this).siblings(".popmake-range-manual"),n=parseInt(t.prop("step"),0),i=parseInt(t.val(),0),r=i+n;o=t.prev(),t.val(r).trigger("input"),o.val(r)}).on("click",".popmake-range-minus",function(e){e.preventDefault();var t=jQuery(this).siblings(".popmake-range-manual"),n=parseInt(t.prop("step"),0),i=parseInt(t.val(),0),r=i-n;o=t.prev(),t.val(r).trigger("input"),o.val(r)}),e=document.createElement("input"),e.setAttribute("type","range"),"text"===e.type&&jQuery("input[type=range]").each(function(e,n){t=jQuery(n),o=jQuery("<div />").slider({min:parseInt(t.attr("min"),10)||0,max:parseInt(t.attr("max"),10)||100,value:parseInt(t.attr("value"),10)||0,step:parseInt(t.attr("step"),10)||1,slide:function(e,t){jQuery(this).prev("input").val(t.value)}}),t.after(o).hide()})},initialize_popup_page:function(){var e=function(e){var t,o,n=e.siblings(".options");e.is(":checked")?(n.show(),"popup_targeting_condition_on_entire_site"===e.attr("id")?(t=e.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),o=e.parents(".targeting_condition").siblings(".targeting_condition"),o.hide(),jQuery("> *",o).prop("disabled",!0),t.show(),jQuery("> *",t).prop("disabled",!1)):jQuery("*",n).prop("disabled",!1)):(n.hide(),"popup_targeting_condition_on_entire_site"===e.attr("id")?(t=e.parents("#popmake_popup_targeting_condition_fields").find('[id^="targeting_condition-exclude_on_"]'),o=e.parents(".targeting_condition").siblings(".targeting_condition"),o.show(),jQuery("> *",o).prop("disabled",!1),t.hide(),jQuery("> *",t).prop("disabled",!0)):jQuery("*",n).prop("disabled",!0))},t=function(e){var t=e.parents(".options").find('input[type="checkbox"]:eq(0)'),o=t.attr("name").indexOf("exclude")>=0,n=o?t.attr("name").replace("popup_targeting_condition_exclude_on_specific_",""):t.attr("name").replace("popup_targeting_condition_on_specific_",""),i=jQuery(o?"#exclude_on_specific_"+n:"#on_specific_"+n);e.is(":checked")&&("true"===e.val()?(t.prop("checked",!0),i.show(),jQuery("*",i).prop("disabled",!1)):""===e.val()&&(t.prop("checked",!1),i.hide(),jQuery("*",i).prop("disabled",!0)))},o=function(){"custom"===jQuery("#popup_display_size").val()?(jQuery(".custom-size-only").show(),jQuery(".responsive-size-only").hide(),jQuery("#popup_display_custom_height_auto").is(":checked")?jQuery(".custom-size-height-only").hide():jQuery(".custom-size-height-only").show()):(jQuery(".custom-size-only").hide(),"auto"!==jQuery("#popup_display_size").val()?(jQuery(".responsive-size-only").show(),jQuery("#popup_display_custom_height_auto").prop("checked",!1)):jQuery(".responsive-size-only").hide())},n=function(){jQuery(".animation-speed, .animation-origin").hide(),"fade"===jQuery("#popup_display_animation_type").val()?jQuery(".animation-speed").show():"none"!==jQuery("#popup_display_animation_type").val()&&jQuery(".animation-speed, .animation-origin").show()},i=function(){var e=jQuery("#popup_display_location"),t=e.parents("table"),o=e.val();jQuery("tr.top, tr.right, tr.left, tr.bottom",t).hide(),o.indexOf("top")>=0&&jQuery("tr.top").show(),o.indexOf("left")>=0&&jQuery("tr.left").show(),o.indexOf("bottom")>=0&&jQuery("tr.bottom").show(),o.indexOf("right")>=0&&jQuery("tr.right").show()},r=function(){jQuery("#popup_auto_open_session_cookie").is(":checked")?jQuery(".not-session-cookie").hide():jQuery(".not-session-cookie").show()},a=function(){jQuery("#popup_auto_open_enabled").is(":checked")?(jQuery(".auto-open-enabled").show(),r()):jQuery(".auto-open-enabled").hide()},p=function(){jQuery("#popup_auto_open_cookie_key").val((new Date).getTime().toString(16))},s=function(){""!==jQuery("#popuptitle").val()?jQuery("#popmake-preview .popmake-title").show().html(jQuery("#popuptitle").val()):jQuery("#popmake-preview .popmake-title").hide()},l=function(){var e="";jQuery("#wp-content-wrap").hasClass("tmce-active")?(console.log(1),e=tinyMCE.activeEditor.getContent()):(console.log(2),e=jQuery("#content").val()),jQuery.ajax({url:ajaxurl,type:"POST",dataType:"json",data:{action:"popmake_popup_preview_content",popmake_nonce:popmake_admin_ajax_nonce,popup_id:jQuery("#post_ID").val(),popup_content:e}}).done(function(e){e.success&&(jQuery("#popmake-preview .popmake-content").html(e.content),jQuery("#popmake-preview").popmake("open"))})},u=function(){var e,t=jQuery("[name^='popup_display_']").serializeArray(),o=jQuery("#popmake-preview"),n=o.data("popmake");for(e=0;t.length>e;e+=1)0===t[e].name.indexOf("popup_display_")&&(n.meta.display[t[e].name.replace("popup_display_","")]=t[e].value);o.removeClass("theme-"+n.theme_id),n.theme_id=jQuery("#popup_theme").val(),jQuery("#popmake-preview").addClass("theme-"+n.theme_id).data("popmake",n)};jQuery("#popuptitlediv").insertAfter("#titlediv"),jQuery('[name^="menu-item"]').removeAttr("name"),jQuery("#trigger-popmake-preview").on("click",function(e){return e.preventDefault(),e.stopPropagation(),s(),u(),l(),!1}),jQuery(document).on("keydown","#popuptitle",function(e){var t=e.keyCode||e.which;9===t&&(e.preventDefault(),jQuery("#title").focus())}).on("keydown","#title, #popuptitle",function(e){var t,o=e.keyCode||e.which;e.shiftKey||9!==o||(e.preventDefault(),t="title"===jQuery(this).attr("id")?"#popuptitle":"#insert-media-button",jQuery(t).focus())}).on("keydown","#popuptitle, #insert-media-button",function(e){var t,o=e.keyCode||e.which;e.shiftKey&&9===o&&(e.preventDefault(),t="popuptitle"===jQuery(this).attr("id")?"#title":"#popuptitle",jQuery(t).focus())}).on("submit","#post",function(e){var t=jQuery("#title").val();(0===t.length||0===t.replace(/\s/g,"").length)&&(console.log(1),e.preventDefault(),jQuery("div#notice").remove(),jQuery("<div id='notice' class='error below-h2'><p>A name is required for all popups.</p></div>").insertAfter("h2"),jQuery("#title").focus(),jQuery("#publishing-action .spinner").removeClass("is-active"),jQuery("#publish").removeClass("disabled"),jQuery("#title").prop("required","required"))}).on("click","#popup_display_custom_height_auto",function(){o()}).on("click","#popup_auto_open_session_cookie",function(){r()}).on("click","#popup_auto_open_enabled",function(){a()}).on("click",".popmake-reset-auto-open-cookie-key",function(){p()}).on("change","#popup_display_size",function(){"custom"!==jQuery("#popup_display_size").val()&&"auto"!==jQuery("#popup_display_size").val()&&jQuery("#popup_display_position_fixed, #popup_display_scrollable_content").prop("checked",!1),o()}).on("change","#popup_display_animation_type",function(){n()}).on("change","#popup_display_location",function(){i()}),jQuery('#popmake_popup_targeting_condition_fields .targeting_condition > input[type="checkbox"]').on("click",function(){e(jQuery(this))}).each(function(){e(jQuery(this))}),jQuery('input[type="radio"][id*="popup_targeting_condition_"]').on("click",function(){t(jQuery(this))}).each(function(){t(jQuery(this))}),jQuery(".posttypediv, .taxonomydiv").each(function(){var e=jQuery(this),t=jQuery("> ul li"),o=jQuery(".tabs-panel",e);t.removeClass("tabs"),t.eq(0).addClass("tabs"),o.removeClass("tabs-panel-active").addClass("tabs-panel-inactive").removeAttr("style"),o.eq(0).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")}),o(),n(),i(),a(),""===jQuery("#popup_auto_open_cookie_key").val()&&p()},theme_page_listeners:function(){var e=this;jQuery(document).on("change","select.font-family",function(){jQuery("select.font-weight option, select.font-style option",jQuery(this).parents("table")).prop("selected",!1),e.update_font_selectboxes()}).on("change","select.font-weight, select.font-style",function(){e.update_font_selectboxes()}).on("change input focusout","select, input",function(){e.update_theme()}).on("change","select.border-style",function(){var e=jQuery(this);"none"===e.val()?e.parents("table").find(".border-options").hide():e.parents("table").find(".border-options").show()}).on("change","#popup_theme_close_location",function(){var e=jQuery(this),t=e.parents("table");jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",t).hide(),jQuery("tr."+e.val(),t).show()})},update_theme:function(){var e,t=jQuery("[name^='popup_theme_']").serializeArray(),o={};for(e=0;t.length>e;e+=1)0===t[e].name.indexOf("popup_theme_")&&(o[t[e].name.replace("popup_theme_","")]=t[e].value);this.retheme_popup(o)},theme_preview_scroll:function(){var e=jQuery("#popmake-theme-editor .empreview, body.post-type-popup_theme form#post #popmake_popup_theme_preview"),t=e.parent(),o=e.offset().top-50;jQuery(window).on("scroll",function(){jQuery("> .postbox:visible",t).index(e)===jQuery("> .postbox:visible",t).length-1&&jQuery(window).scrollTop()>=o?e.css({left:e.offset().left,width:e.width(),height:e.height(),position:"fixed",top:50}):e.removeAttr("style")})},update_font_selectboxes:function(){return jQuery("select.font-family").each(function(){var e,t,o=jQuery(this),n=o.parents("table").find("select.font-weight"),i=o.parents("table").find("select.font-style"),r=n.find("option"),a=i.find("option");if(void 0!==popmake_google_fonts[o.val()]){if(e=popmake_google_fonts[o.val()],r.hide(),a.hide(),e.variants.length)for(t=0;e.variants.length>t;t+=1)"regular"===e.variants[t]?(jQuery('option[value="normal"]',n).show(),jQuery('option[value="normal"]',i).show()):(e.variants[t].indexOf("italic")>=0&&jQuery('option[value="italic"]',i).show(),jQuery('option[value="'+parseInt(e.variants[t],10)+'"]',n).show())}else r.show(),a.show();n.parents("tr:first").show(),n.find("option:visible").length<=1?n.parents("tr:first").hide():n.parents("tr:first").show(),i.parents("tr:first").show(),i.find("option:visible").length<=1?i.parents("tr:first").hide():i.parents("tr:first").show()})},convert_theme_for_preview:function(){},convert_meta_to_object:function(e){var t,o,n,i={};for(n in e)e.hasOwnProperty(n)&&(t=n.split(/_(.+)?/)[0],o=n.split(/_(.+)?/)[1],void 0===i[t]&&(i[t]={}),i[t][o]=e[n]);return i},initialize_theme_page:function(){jQuery("#popuptitlediv").insertAfter("#titlediv");var e=this,t=jQuery("#popup_theme_close_location").parents("table");switch(e.update_theme(),e.theme_page_listeners(),e.theme_preview_scroll(),e.update_font_selectboxes(),jQuery(document).on("click",".popmake-preview",function(e){e.preventDefault(),jQuery("#popmake-preview, #popmake-overlay").css({visibility:"visible"}).show()}).on("click",".popmake-close",function(){jQuery("#popmake-preview, #popmake-overlay").hide()}),jQuery("select.border-style").each(function(){var e=jQuery(this);"none"===e.val()?e.parents("table").find(".border-options").hide():e.parents("table").find(".border-options").show()}),jQuery(".color-picker.background-color").each(function(){var e=jQuery(this);""===e.val()?e.parents("table").find(".background-opacity").hide():e.parents("table").find(".background-opacity").show()}),jQuery("tr.topleft, tr.topright, tr.bottomleft, tr.bottomright",t).hide(),jQuery("#popup_theme_close_location").val()){case"topleft":jQuery("tr.topleft",t).show();break;case"topright":jQuery("tr.topright",t).show();break;case"bottomleft":jQuery("tr.bottomleft",t).show();break;case"bottomright":jQuery("tr.bottomright",t).show()}},retheme_popup:function(e){var t,o=jQuery(".empreview .example-popup-overlay, #popmake-overlay"),n=jQuery(".empreview .example-popup, #popmake-preview"),i=jQuery(".title, .popmake-title",n),r=jQuery(".content, .popmake-content",n),a=jQuery(".close-popup, .popmake-close",n),p="yes"===e.container_boxshadow_inset?"inset ":"",s="yes"===e.close_boxshadow_inset?"inset ":"";switch(this.convert_theme_for_preview(e),void 0!==popmake_google_fonts[e.title_font_family]&&(t="//fonts.googleapis.com/css?family="+e.title_font_family,"normal"!==e.title_font_weight&&(t+=":"+e.title_font_weight),"italic"===e.title_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),void 0!==popmake_google_fonts[e.content_font_family]&&(t="//fonts.googleapis.com/css?family="+e.content_font_family,"normal"!==e.content_font_weight&&(t+=":"+e.content_font_weight),"italic"===e.content_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),void 0!==popmake_google_fonts[e.close_font_family]&&(t="//fonts.googleapis.com/css?family="+e.close_font_family,"normal"!==e.close_font_weight&&(t+=":"+e.close_font_weight),"italic"===e.close_font_style&&(-1===t.indexOf(":")&&(t+=":"),t+="italic"),jQuery("body").append('<link href="'+t+'" rel="stylesheet" type="text/css">')),o.removeAttr("style").css({backgroundColor:this.convert_hex(e.overlay_background_color,e.overlay_background_opacity)}),n.removeAttr("style").css({padding:e.container_padding+"px",backgroundColor:this.convert_hex(e.container_background_color,e.container_background_opacity),borderStyle:e.container_border_style,borderColor:e.container_border_color,borderWidth:e.container_border_width+"px",borderRadius:e.container_border_radius+"px",boxShadow:p+e.container_boxshadow_horizontal+"px "+e.container_boxshadow_vertical+"px "+e.container_boxshadow_blur+"px "+e.container_boxshadow_spread+"px "+this.convert_hex(e.container_boxshadow_color,e.container_boxshadow_opacity)}),i.removeAttr("style").css({color:e.title_font_color,lineHeight:e.title_line_height+"px",fontSize:e.title_font_size+"px",fontFamily:e.title_font_family,fontStyle:e.title_font_style,fontWeight:e.title_font_weight,textAlign:e.title_text_align,textShadow:e.title_textshadow_horizontal+"px "+e.title_textshadow_vertical+"px "+e.title_textshadow_blur+"px "+this.convert_hex(e.title_textshadow_color,e.title_textshadow_opacity)}),r.removeAttr("style").css({color:e.content_font_color,fontFamily:e.content_font_family,fontStyle:e.content_font_style,fontWeight:e.content_font_weight}),a.html(e.close_text).removeAttr("style").css({padding:e.close_padding+"px",height:e.close_height>0?e.close_height+"px":"auto",width:e.close_width>0?e.close_width+"px":"auto",backgroundColor:this.convert_hex(e.close_background_color,e.close_background_opacity),color:e.close_font_color,lineHeight:e.close_line_height+"px",fontSize:e.close_font_size+"px",fontFamily:e.close_font_family,fontWeight:e.close_font_weight,fontStyle:e.close_font_style,borderStyle:e.close_border_style,borderColor:e.close_border_color,borderWidth:e.close_border_width+"px",borderRadius:e.close_border_radius+"px",boxShadow:s+e.close_boxshadow_horizontal+"px "+e.close_boxshadow_vertical+"px "+e.close_boxshadow_blur+"px "+e.close_boxshadow_spread+"px "+this.convert_hex(e.close_boxshadow_color,e.close_boxshadow_opacity),textShadow:e.close_textshadow_horizontal+"px "+e.close_textshadow_vertical+"px "+e.close_textshadow_blur+"px "+this.convert_hex(e.close_textshadow_color,e.close_textshadow_opacity)}),e.close_location){case"topleft":a.css({top:e.close_position_top+"px",left:e.close_position_left+"px"});break;case"topright":a.css({top:e.close_position_top+"px",right:e.close_position_right+"px"});break;case"bottomleft":a.css({bottom:e.close_position_bottom+"px",left:e.close_position_left+"px"});break;case"bottomright":a.css({bottom:e.close_position_bottom+"px",right:e.close_position_right+"px"})}jQuery(document).trigger("popmake-admin-retheme",[e])},serialize_form:function(e){var t={};return jQuery("[name]",e).each(function(){var e,o,n=jQuery(this).attr("name"),i=jQuery(this).val(),r=n.split("["),a=t,p=r.length;for(e=0;p>e;e+=1)o=r[e].replace("]",""),a[o]||(a[o]={}),e!==r.length-1?a=a[o]:e===r.length-1&&(a[o]=i)}),t},convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),i=parseInt(e.substring(4,6),16),r="rgba("+o+","+n+","+i+","+t/100+")";return r},debounce:function(e,t){var o;return function(){var n=this,i=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(n,i)},t)}},throttle:function(e,t){var o=!1,n=function(){o=!1};return function(){o||(e(),window.setTimeout(n,t),o=!0)}}},jQuery(document).ready(function(){PopMakeAdmin.init()})}();
 
 
 
 
assets/js/popup-maker-site.js DELETED
@@ -1,1276 +0,0 @@
1
- /**
2
- * Popup Maker v1.3.6
3
- */
4
- var pm_cookie, pm_remove_cookie;
5
- (function (jQuery) {
6
- "use strict";
7
- var isScrolling = false;
8
- jQuery(window)
9
- .on('scroll', function () {
10
- isScrolling = true;
11
- })
12
- .on('scrollstop', function () {
13
- isScrolling = false;
14
- });
15
-
16
-
17
- if (!jQuery.isFunction(jQuery.fn.on)) {
18
- jQuery.fn.on = function (types, sel, fn) {
19
- return this.delegate(sel, types, fn);
20
- };
21
- jQuery.fn.off = function (types, sel, fn) {
22
- return this.undelegate(sel, types, fn);
23
- };
24
- }
25
-
26
-
27
- jQuery.fn.popmake = function (method) {
28
- // Method calling logic
29
- if (jQuery.fn.popmake.methods[method]) {
30
- return jQuery.fn.popmake.methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
31
- }
32
- if (typeof method === 'object' || !method) {
33
- return jQuery.fn.popmake.methods.init.apply(this, arguments);
34
- }
35
- jQuery.error('Method ' + method + ' does not exist on jQuery.fn.popmake');
36
- };
37
-
38
- jQuery.fn.popmake.version = 1.3;
39
-
40
- jQuery.fn.popmake.last_open_popup = null;
41
- jQuery.fn.popmake.last_open_trigger = null;
42
- jQuery.fn.popmake.last_close_trigger = null;
43
-
44
- jQuery.fn.popmake.methods = {
45
- init: function (options) {
46
- return this.each(function () {
47
- var $this = jQuery(this),
48
- settings = jQuery.extend(true, {}, jQuery.fn.popmake.defaults, $this.data('popmake'), options);
49
-
50
- if (!(settings.theme_id > 0)) {
51
- settings.theme_id = popmake_default_theme;
52
- }
53
-
54
- if (!jQuery('#' + settings.overlay.attr.id).length) {
55
- jQuery('<div>').attr(settings.overlay.attr).appendTo('body');
56
- }
57
-
58
- jQuery(window).on('resize', function () {
59
- if ($this.hasClass('active')) {
60
- jQuery.fn.popmake.utilities.throttle(setTimeout(function () {
61
- $this.popmake('reposition');
62
- }, 25), 500, false);
63
- }
64
- });
65
-
66
- if (typeof popmake_powered_by === 'string' && popmake_powered_by !== '') {
67
- jQuery('.popmake-content', $this).append(jQuery(popmake_powered_by));
68
- }
69
-
70
- $this
71
- .data('popmake', settings)
72
- .trigger('popmakeInit');
73
- return this;
74
- });
75
- },
76
- setup_close: function () {
77
- var $this = jQuery(this),
78
- settings = $this.data('popmake'),
79
- $overlay = jQuery('#popmake-overlay'),
80
- $close = jQuery('.popmake-close', $this);
81
-
82
- $close
83
- .off('click.popmake')
84
- .on("click.popmake", function (e) {
85
- e.preventDefault();
86
- e.stopPropagation();
87
- jQuery.fn.popmake.last_close_trigger = 'Close Button';
88
- $this.popmake('close');
89
- });
90
-
91
- if (settings.meta.close.esc_press || settings.meta.close.f4_press) {
92
- jQuery(window)
93
- .off('keyup.popmake')
94
- .on('keyup.popmake', function (e) {
95
- if (e.keyCode === 27 && settings.meta.close.esc_press) {
96
- jQuery.fn.popmake.last_close_trigger = 'ESC Key';
97
- $this.popmake('close');
98
- }
99
- if (e.keyCode === 115 && settings.meta.close.f4_press) {
100
- jQuery.fn.popmake.last_close_trigger = 'F4 Key';
101
- $this.popmake('close');
102
- }
103
- });
104
- }
105
-
106
- if (settings.meta.close.overlay_click) {
107
- $overlay
108
- .off('click.popmake')
109
- .on('click.popmake', function (e) {
110
- e.preventDefault();
111
- e.stopPropagation();
112
-
113
- jQuery.fn.popmake.last_close_trigger = 'Overlay Click';
114
- $this.popmake('close');
115
-
116
- });
117
- }
118
-
119
- $this.trigger('popmakeSetupClose');
120
- return this;
121
- },
122
- open: function (callback) {
123
- var $this = jQuery(this),
124
- settings = $this.data('popmake');
125
-
126
- if (!settings.meta.display.stackable) {
127
- $this.popmake('close_all');
128
- }
129
-
130
- $this
131
- .css({visibility: "visible"})
132
- .hide()
133
- .addClass('active')
134
- .popmake('setup_close')
135
- .popmake('reposition')
136
- .trigger('popmakeBeforeOpen');
137
-
138
- if (settings.meta.close.button_delay > 0) {
139
- $this.find('.popmake-content + .popmake-close').fadeOut(0);
140
- }
141
-
142
- if ($this.hasClass('preventOpen')) {
143
- $this
144
- .removeClass('preventOpen')
145
- .removeClass('active');
146
- return this;
147
- }
148
-
149
- jQuery('#popmake-overlay')
150
- .prop('class', 'popmake-overlay theme-' + settings.theme_id)
151
- .css({'z-index': settings.meta.display.overlay_zindex || 1999999998});
152
-
153
- $this
154
- .css({'z-index': settings.meta.display.zindex || 1999999999})
155
- .popmake('animate', settings.meta.display.animation_type, function () {
156
-
157
- if (settings.meta.close.button_delay > 0) {
158
- setTimeout(function () {
159
- $this.find('.popmake-content + .popmake-close').fadeIn();
160
- }, settings.meta.close.button_delay);
161
- }
162
-
163
- $this.trigger('popmakeAfterOpen');
164
- jQuery.fn.popmake.last_open_popup = $this;
165
- if (callback !== undefined) {
166
- callback();
167
- }
168
- });
169
- return this;
170
- },
171
- close: function (callback) {
172
- return this.each(function () {
173
- var $this = jQuery(this),
174
- $overlay = jQuery('#popmake-overlay'),
175
- $close = jQuery('.popmake-close', $this),
176
- settings = $this.data('popmake');
177
-
178
- $this.trigger('popmakeBeforeClose');
179
-
180
- if ($this.hasClass('preventClose')) {
181
- $this.removeClass('preventClose');
182
- return this;
183
- }
184
-
185
- $this
186
- .fadeOut(settings.close.close_speed, function () {
187
-
188
- if ($overlay.length && $overlay.is(":visible")) {
189
- $overlay.fadeOut(settings.close.close_speed);
190
- }
191
-
192
- jQuery(window).off('keyup.popmake');
193
- $overlay.off('click.popmake');
194
- $close.off('click.popmake');
195
-
196
- $this
197
- .removeClass('active')
198
- .trigger('popmakeAfterClose');
199
-
200
- jQuery('iframe', $this).filter('[src*="youtube"],[src*="vimeo"]').each(function () {
201
- var $iframe = jQuery(this),
202
- src = $iframe.attr('src')
203
- // Remove autoplay so video doesn't start playing again.
204
- .replace('autoplay=1', '1=1');
205
- $iframe.attr('src', '').attr('src', src);
206
- });
207
-
208
- jQuery('video', $this).each(function () {
209
- this.pause();
210
- });
211
-
212
- if (callback !== undefined) {
213
- callback();
214
- }
215
- });
216
- return this;
217
- });
218
- },
219
- close_all: function () {
220
- jQuery('.popmake.active').popmake('close');
221
- return this;
222
- },
223
- reposition: function (callback) {
224
- jQuery(this).trigger('popmakeBeforeReposition');
225
- var $this = jQuery(this),
226
- settings = $this.data('popmake'),
227
- display = settings.meta.display,
228
- location = display.location,
229
- reposition = {
230
- my: "",
231
- at: ""
232
- },
233
- opacity = false;
234
-
235
- if (location.indexOf('left') >= 0) {
236
- reposition = {
237
- my: reposition.my + " left" + (display.position_left !== 0 ? "+" + display.position_left : ""),
238
- at: reposition.at + " left"
239
- };
240
- }
241
- if (location.indexOf('right') >= 0) {
242
- reposition = {
243
- my: reposition.my + " right" + (display.position_right !== 0 ? "-" + display.position_right : ""),
244
- at: reposition.at + " right"
245
- };
246
- }
247
- if (location.indexOf('center') >= 0) {
248
- if (location === 'center') {
249
- reposition = {
250
- my: "center",
251
- at: "center"
252
- };
253
- } else {
254
- reposition = {
255
- my: reposition.my + " center",
256
- at: reposition.at + " center"
257
- };
258
- }
259
- }
260
- if (location.indexOf('top') >= 0) {
261
- reposition = {
262
- my: reposition.my + " top" + (display.position_top !== 0 ? "+" + (jQuery('body').hasClass('admin-bar') ? parseInt(display.position_top, 10) + 32 : display.position_top) : ""),
263
- at: reposition.at + " top"
264
- };
265
- }
266
- if (location.indexOf('bottom') >= 0) {
267
- reposition = {
268
- my: reposition.my + " bottom" + (display.position_bottom !== 0 ? "-" + display.position_bottom : ""),
269
- at: reposition.at + " bottom"
270
- };
271
- }
272
-
273
-
274
- reposition.my = jQuery.trim(reposition.my);
275
- reposition.at = jQuery.trim(reposition.at);
276
- reposition.of = window;
277
- reposition.collision = 'none';
278
- reposition.using = typeof callback === "function" ? callback : jQuery.fn.popmake.callbacks.reposition_using;
279
-
280
- if ($this.is(':hidden')) {
281
- opacity = $this.css("opacity");
282
- $this.css({
283
- opacity: 0
284
- }).show();
285
- }
286
-
287
- $this
288
- .removeClass('responsive size-nano size-micro size-tiny size-small size-medium size-normal size-large size-xlarge fixed custom-position')
289
- .addClass('size-' + settings.meta.display.size);
290
-
291
-
292
- if (display.position_fixed) {
293
- $this.addClass('fixed');
294
- }
295
- if (settings.meta.display.size === 'custom') {
296
- $this.css({
297
- width: settings.meta.display.custom_width + settings.meta.display.custom_width_unit,
298
- height: settings.meta.display.custom_height_auto ? 'auto' : settings.meta.display.custom_height + settings.meta.display.custom_height_unit
299
- });
300
- } else {
301
- if (settings.meta.display.size !== 'auto') {
302
- $this
303
- .addClass('responsive')
304
- .css({
305
- minWidth: settings.meta.display.responsive_min_width !== '' ? settings.meta.display.responsive_min_width + settings.meta.display.responsive_min_width_unit : 'auto',
306
- maxWidth: settings.meta.display.responsive_max_width !== '' ? settings.meta.display.responsive_max_width + settings.meta.display.responsive_max_width_unit : 'auto'
307
- });
308
- }
309
- }
310
-
311
- $this
312
- .addClass('custom-position')
313
- .position(reposition)
314
- .trigger('popmakeAfterReposition');
315
-
316
- if (opacity) {
317
- $this.css({
318
- opacity: opacity
319
- }).hide();
320
- }
321
- return this;
322
- },
323
- retheme: function (theme) {
324
- jQuery(this).trigger('popmakeBeforeRetheme');
325
- var $this = jQuery(this),
326
- settings = $this.data('popmake'),
327
- $overlay = jQuery('#' + settings.overlay.attr.id),
328
- $container = $this,
329
- $title = jQuery('.' + settings.title.attr.class, $container),
330
- $content = jQuery('> .' + settings.content.attr.class, $container),
331
- $close = jQuery('> .' + settings.close.attr.class, $container),
332
- container_inset,
333
- close_inset;
334
-
335
- if (theme === undefined) {
336
- theme = jQuery.fn.popmake.themes[settings.theme_id];
337
- if (theme === undefined) {
338
- theme = jQuery.fn.popmake.themes[1];
339
- }
340
- }
341
-
342
- container_inset = theme.container.boxshadow_inset === 'yes' ? 'inset ' : '';
343
- close_inset = theme.close.boxshadow_inset === 'yes' ? 'inset ' : '';
344
-
345
- $overlay.removeAttr('style').css({
346
- backgroundColor: jQuery.fn.popmake.utilities.convert_hex(theme.overlay.background_color, theme.overlay.background_opacity),
347
- zIndex: settings.meta.display.overlay_zindex || 998
348
- });
349
- $container.css({
350
- padding: theme.container.padding + 'px',
351
- backgroundColor: jQuery.fn.popmake.utilities.convert_hex(theme.container.background_color, theme.container.background_opacity),
352
- borderStyle: theme.container.border_style,
353
- borderColor: theme.container.border_color,
354
- borderWidth: theme.container.border_width + 'px',
355
- borderRadius: theme.container.border_radius + 'px',
356
- boxShadow: container_inset + theme.container.boxshadow_horizontal + 'px ' + theme.container.boxshadow_vertical + 'px ' + theme.container.boxshadow_blur + 'px ' + theme.container.boxshadow_spread + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.container.boxshadow_color, theme.container.boxshadow_opacity),
357
- zIndex: settings.meta.display.zindex || 999
358
- });
359
- $title.css({
360
- color: theme.title.font_color,
361
- lineHeight: theme.title.line_height + 'px',
362
- fontSize: theme.title.font_size + 'px',
363
- fontFamily: theme.title.font_family,
364
- fontWeight: theme.title.font_weight,
365
- fontStyle: theme.title.font_style,
366
- textAlign: theme.title.text_align,
367
- textShadow: theme.title.textshadow_horizontal + 'px ' + theme.title.textshadow_vertical + 'px ' + theme.title.textshadow_blur + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.title.textshadow_color, theme.title.textshadow_opacity)
368
- });
369
- $content.css({
370
- color: theme.content.font_color,
371
- //fontSize: theme.content.font_size+'px',
372
- fontFamily: theme.content.font_family,
373
- fontWeight: theme.content.font_weight,
374
- fontStyle: theme.content.font_style
375
- });
376
- jQuery('p, label', $content).css({
377
- color: theme.content.font_color,
378
- //fontSize: theme.content.font_size+'px',
379
- fontFamily: theme.content.font_family
380
- });
381
- $close.html(theme.close.text).css({
382
- padding: theme.close.padding + 'px',
383
- height: theme.close.height + 'px',
384
- width: theme.close.width + 'px',
385
- backgroundColor: jQuery.fn.popmake.utilities.convert_hex(theme.close.background_color, theme.close.background_opacity),
386
- color: theme.close.font_color,
387
- lineHeight: theme.close.line_height + 'px',
388
- fontSize: theme.close.font_size + 'px',
389
- fontWeight: theme.close.font_weight,
390
- fontStyle: theme.close.font_style,
391
- fontFamily: theme.close.font_family,
392
- borderStyle: theme.close.border_style,
393
- borderColor: theme.close.border_color,
394
- borderWidth: theme.close.border_width + 'px',
395
- borderRadius: theme.close.border_radius + 'px',
396
- boxShadow: close_inset + theme.close.boxshadow_horizontal + 'px ' + theme.close.boxshadow_vertical + 'px ' + theme.close.boxshadow_blur + 'px ' + theme.close.boxshadow_spread + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.close.boxshadow_color, theme.close.boxshadow_opacity),
397
- textShadow: theme.close.textshadow_horizontal + 'px ' + theme.close.textshadow_vertical + 'px ' + theme.close.textshadow_blur + 'px ' + jQuery.fn.popmake.utilities.convert_hex(theme.close.textshadow_color, theme.close.textshadow_opacity),
398
- left: 'auto',
399
- right: 'auto',
400
- bottom: 'auto',
401
- top: 'auto'
402
- });
403
- switch (theme.close.location) {
404
- case "topleft":
405
- $close.css({
406
- top: theme.close.position_top + 'px',
407
- left: theme.close.position_left + 'px'
408
- });
409
- break;
410
- case "topright":
411
- $close.css({
412
- top: theme.close.position_top + 'px',
413
- right: theme.close.position_right + 'px'
414
- });
415
- break;
416
- case "bottomleft":
417
- $close.css({
418
- bottom: theme.close.position_bottom + 'px',
419
- left: theme.close.position_left + 'px'
420
- });
421
- break;
422
- case "bottomright":
423
- $close.css({
424
- bottom: theme.close.position_bottom + 'px',
425
- right: theme.close.position_right + 'px'
426
- });
427
- break;
428
- }
429
- $this.trigger('popmakeAfterRetheme', [theme]);
430
- return this;
431
- },
432
- animate_overlay: function (style, duration, callback) {
433
- // Method calling logic
434
- var $this = jQuery(this),
435
- settings = $this.data('popmake');
436
- if (settings.meta.display.overlay_disabled) {
437
- callback();
438
- } else {
439
- if (jQuery.fn.popmake.overlay_animations[style]) {
440
- return jQuery.fn.popmake.overlay_animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
441
- }
442
- jQuery.error('Animation style ' + jQuery.fn.popmake.overlay_animations + ' does not exist.');
443
- }
444
- return this;
445
- },
446
- animate: function (style, callback) {
447
- // Method calling logic
448
- if (jQuery.fn.popmake.animations[style]) {
449
- return jQuery.fn.popmake.animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
450
- }
451
- jQuery.error('Animation style ' + jQuery.fn.popmake.animations + ' does not exist.');
452
- return this;
453
- },
454
- animation_origin: function (origin) {
455
- var $this = jQuery(this),
456
- start = {
457
- my: "",
458
- at: ""
459
- };
460
-
461
- switch (origin) {
462
- case 'top':
463
- start = {
464
- my: "left+" + $this.offset().left + " bottom-100",
465
- at: "left top"
466
- };
467
- break;
468
- case 'bottom':
469
- start = {
470
- my: "left+" + $this.offset().left + " top+100",
471
- at: "left bottom"
472
- };
473
- break;
474
- case 'left':
475
- start = {
476
- my: "right top+" + $this.offset().top,
477
- at: "left top"
478
- };
479
- break;
480
- case 'right':
481
- start = {
482
- my: "left top+" + $this.offset().top,
483
- at: "right top"
484
- };
485
- break;
486
- default:
487
- if (origin.indexOf('left') >= 0) {
488
- start = {
489
- my: start.my + " right",
490
- at: start.at + " left"
491
- };
492
- }
493
- if (origin.indexOf('right') >= 0) {
494
- start = {
495
- my: start.my + " left",
496
- at: start.at + " right"
497
- };
498
- }
499
- if (origin.indexOf('center') >= 0) {
500
- start = {
501
- my: start.my + " center",
502
- at: start.at + " center"
503
- };
504
- }
505
- if (origin.indexOf('top') >= 0) {
506
- start = {
507
- my: start.my + " bottom-100",
508
- at: start.at + " top"
509
- };
510
- }
511
- if (origin.indexOf('bottom') >= 0) {
512
- start = {
513
- my: start.my + " top+100",
514
- at: start.at + " bottom"
515
- };
516
- }
517
- start.my = jQuery.trim(start.my);
518
- start.at = jQuery.trim(start.at);
519
- break;
520
- }
521
- start.of = window;
522
- start.collision = 'none';
523
- return start;
524
- }
525
- };
526
-
527
- jQuery.fn.popmake.callbacks = {
528
- reposition_using: function (position) {
529
- jQuery(this).css(position);
530
- }
531
- };
532
-
533
- jQuery.fn.popmake.cookie = {
534
- defaults: {},
535
- raw: false,
536
- json: true,
537
- pluses: /\+/g,
538
- encode: function (s) {
539
- return jQuery.fn.popmake.cookie.raw ? s : encodeURIComponent(s);
540
- },
541
- decode: function (s) {
542
- return jQuery.fn.popmake.cookie.raw ? s : decodeURIComponent(s);
543
- },
544
- stringifyCookieValue: function (value) {
545
- return jQuery.fn.popmake.cookie.encode(jQuery.fn.popmake.cookie.json ? JSON.stringify(value) : String(value));
546
- },
547
- parseCookieValue: function (s) {
548
- if (s.indexOf('"') === 0) {
549
- // This is a quoted cookie as according to RFC2068, unescape...
550
- s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
551
- }
552
-
553
- try {
554
- // Replace server-side written pluses with spaces.
555
- // If we can't decode the cookie, ignore it, it's unusable.
556
- // If we can't parse the cookie, ignore it, it's unusable.
557
- s = decodeURIComponent(s.replace(jQuery.fn.popmake.cookie.pluses, ' '));
558
- return jQuery.fn.popmake.cookie.json ? JSON.parse(s) : s;
559
- } catch (ignore) {
560
- }
561
- },
562
- read: function (s, converter) {
563
- var value = jQuery.fn.popmake.cookie.raw ? s : jQuery.fn.popmake.cookie.parseCookieValue(s);
564
- return jQuery.isFunction(converter) ? converter(value) : value;
565
- },
566
- process: function (key, value, expires, path) {
567
- var result = key ? undefined : {},
568
- t = new Date(),
569
- cookies = document.cookie ? document.cookie.split('; ') : [],
570
- parts,
571
- name,
572
- cookie,
573
- i,
574
- l;
575
- // Write
576
-
577
- if (value !== undefined && !jQuery.isFunction(value)) {
578
-
579
- switch (typeof expires) {
580
- case 'number':
581
- t.setTime(+t + expires * 864e+5);
582
- expires = t;
583
- break;
584
- case 'string':
585
- t.setTime(jQuery.fn.popmake.utilities.strtotime("+" + expires) * 1000);
586
- expires = t;
587
- break;
588
- }
589
-
590
- document.cookie = [
591
- jQuery.fn.popmake.cookie.encode(key), '=', jQuery.fn.popmake.cookie.stringifyCookieValue(value),
592
- expires ? '; expires=' + expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
593
- path ? '; path=' + path : ''
594
- ].join('');
595
- return;
596
- }
597
-
598
- for (i = 0, l = cookies.length; i < l; i += 1) {
599
- parts = cookies[i].split('=');
600
- name = jQuery.fn.popmake.cookie.decode(parts.shift());
601
- cookie = parts.join('=');
602
-
603
- if (key && key === name) {
604
- // If second argument (value) is a function it's a converter...
605
- result = jQuery.fn.popmake.cookie.read(cookie, value);
606
- break;
607
- }
608
-
609
- // Prevent storing a cookie that we couldn't decode.
610
- cookie = jQuery.fn.popmake.cookie.read(cookie);
611
- if (!key && cookie !== undefined) {
612
- result[name] = cookie;
613
- }
614
- }
615
-
616
- return result;
617
- },
618
- remove: function (key) {
619
- if (jQuery.pm_cookie(key) === undefined) {
620
- return false;
621
- }
622
- jQuery.pm_cookie(key, '', -1);
623
- return !jQuery.pm_cookie(key);
624
- }
625
- };
626
-
627
- pm_cookie = jQuery.pm_cookie = jQuery.fn.popmake.cookie.process;
628
- pm_remove_cookie = jQuery.pm_remove_cookie = jQuery.fn.popmake.cookie.remove;
629
-
630
- jQuery.fn.popmake.utilities = {
631
- convert_hex: function (hex, opacity) {
632
- hex = hex.replace('#', '');
633
- var r = parseInt(hex.substring(0, 2), 16),
634
- g = parseInt(hex.substring(2, 4), 16),
635
- b = parseInt(hex.substring(4, 6), 16),
636
- result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
637
- return result;
638
- },
639
- debounce: function (callback, threshold) {
640
- var timeout;
641
- return function () {
642
- var context = this, params = arguments;
643
- window.clearTimeout(timeout);
644
- timeout = window.setTimeout(function () {
645
- callback.apply(context, params);
646
- }, threshold);
647
- };
648
- },
649
- throttle: function (callback, threshold) {
650
- var suppress = false,
651
- clear = function () {
652
- suppress = false;
653
- };
654
- return function () {
655
- if (!suppress) {
656
- callback.apply(this, arguments);
657
- window.setTimeout(clear, threshold);
658
- suppress = true;
659
- }
660
- };
661
- },
662
- getXPath: function (element) {
663
- var path = [],
664
- current,
665
- id,
666
- classes,
667
- tag,
668
- eq;
669
-
670
- jQuery.each(jQuery(element).parents(), function (index, value) {
671
- current = jQuery(value);
672
- id = current.attr("id") || '';
673
- classes = current.attr("class") || '';
674
- tag = current.get(0).tagName.toLowerCase();
675
- eq = current.parent().children(tag).index(current);
676
- if (tag === 'body') {
677
- return false;
678
- }
679
- if (classes.length > 0) {
680
- classes = classes.split(' ');
681
- classes = classes[0];
682
- }
683
- path.push(tag + (id.length > 0 ? "#" + id : (classes.length > 0 ? "." + classes.split(' ').join('.') : ':eq(' + eq + ')')));
684
- });
685
- return path.reverse().join(' > ');
686
- },
687
- strtotime: function (text, now) {
688
- // discuss at: http://phpjs.org/functions/strtotime/
689
- // version: 1109.2016
690
- // original by: Caio Ariede (http://caioariede.com)
691
- // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
692
- // improved by: Caio Ariede (http://caioariede.com)
693
- // improved by: A. Matías Quezada (http://amatiasq.com)
694
- // improved by: preuter
695
- // improved by: Brett Zamir (http://brett-zamir.me)
696
- // improved by: Mirko Faber
697
- // input by: David
698
- // bugfixed by: Wagner B. Soares
699
- // bugfixed by: Artur Tchernychev
700
- // note: Examples all have a fixed timestamp to prevent tests to fail because of variable time(zones)
701
- // example 1: strtotime('+1 day', 1129633200);
702
- // returns 1: 1129719600
703
- // example 2: strtotime('+1 week 2 days 4 hours 2 seconds', 1129633200);
704
- // returns 2: 1130425202
705
- // example 3: strtotime('last month', 1129633200);
706
- // returns 3: 1127041200
707
- // example 4: strtotime('2009-05-04 08:30:00 GMT');
708
- // returns 4: 1241425800
709
- var parsed, match, today, year, date, days, ranges, len, times, regex, i, fail = false;
710
- if (!text) {
711
- return fail;
712
- }
713
- // Unecessary spaces
714
- text = text.replace(/^\s+|\s+$/g, '')
715
- .replace(/\s{2,}/g, ' ')
716
- .replace(/[\t\r\n]/g, '')
717
- .toLowerCase();
718
- // in contrast to php, js Date.parse function interprets:
719
- // dates given as yyyy-mm-dd as in timezone: UTC,
720
- // dates with "." or "-" as MDY instead of DMY
721
- // dates with two-digit years differently
722
- // etc...etc...
723
- // ...therefore we manually parse lots of common date formats
724
- match = text.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/);
725
- if (match && match[2] === match[4]) {
726
- if (match[1] > 1901) {
727
- switch (match[2]) {
728
- case '-':
729
- // YYYY-M-D
730
- if (match[3] > 12 || match[5] > 31) {
731
- return fail;
732
- }
733
- return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
734
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
735
- case '.':
736
- // YYYY.M.D is not parsed by strtotime()
737
- return fail;
738
- case '/':
739
- // YYYY/M/D
740
- if (match[3] > 12 || match[5] > 31) {
741
- return fail;
742
- }
743
- return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
744
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
745
- }
746
- } else if (match[5] > 1901) {
747
- switch (match[2]) {
748
- case '-':
749
- // D-M-YYYY
750
- if (match[3] > 12 || match[1] > 31) {
751
- return fail;
752
- }
753
- return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
754
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
755
- case '.':
756
- // D.M.YYYY
757
- if (match[3] > 12 || match[1] > 31) {
758
- return fail;
759
- }
760
- return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
761
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
762
- case '/':
763
- // M/D/YYYY
764
- if (match[1] > 12 || match[3] > 31) {
765
- return fail;
766
- }
767
- return new Date(match[5], parseInt(match[1], 10) - 1, match[3],
768
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
769
- }
770
- } else {
771
- switch (match[2]) {
772
- case '-':
773
- // YY-M-D
774
- if (match[3] > 12 || match[5] > 31 || (match[1] < 70 && match[1] > 38)) {
775
- return fail;
776
- }
777
- year = match[1] >= 0 && match[1] <= 38 ? +match[1] + 2000 : match[1];
778
- return new Date(year, parseInt(match[3], 10) - 1, match[5],
779
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
780
- case '.':
781
- // D.M.YY or H.MM.SS
782
- if (match[5] >= 70) { // D.M.YY
783
- if (match[3] > 12 || match[1] > 31) {
784
- return fail;
785
- }
786
- return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
787
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
788
- }
789
- if (match[5] < 60 && !match[6]) { // H.MM.SS
790
- if (match[1] > 23 || match[3] > 59) {
791
- return fail;
792
- }
793
- today = new Date();
794
- return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
795
- match[1] || 0, match[3] || 0, match[5] || 0, match[9] || 0) / 1000;
796
- }
797
- return fail; // invalid format, cannot be parsed
798
- case '/':
799
- // M/D/YY
800
- if (match[1] > 12 || match[3] > 31 || (match[5] < 70 && match[5] > 38)) {
801
- return fail;
802
- }
803
- year = match[5] >= 0 && match[5] <= 38 ? +match[5] + 2000 : match[5];
804
- return new Date(year, parseInt(match[1], 10) - 1, match[3],
805
- match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
806
- case ':':
807
- // HH:MM:SS
808
- if (match[1] > 23 || match[3] > 59 || match[5] > 59) {
809
- return fail;
810
- }
811
- today = new Date();
812
- return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
813
- match[1] || 0, match[3] || 0, match[5] || 0) / 1000;
814
- }
815
- }
816
- }
817
- // other formats and "now" should be parsed by Date.parse()
818
- if (text === 'now') {
819
- return now === null || isNaN(now) ? new Date()
820
- .getTime() / 1000 || 0 : now || 0;
821
- }
822
- parsed = Date.parse(text);
823
- if (!isNaN(parsed)) {
824
- return parsed / 1000 || 0;
825
- }
826
- date = now ? new Date(now * 1000) : new Date();
827
- days = {
828
- 'sun': 0,
829
- 'mon': 1,
830
- 'tue': 2,
831
- 'wed': 3,
832
- 'thu': 4,
833
- 'fri': 5,
834
- 'sat': 6
835
- };
836
- ranges = {
837
- 'yea': 'FullYear',
838
- 'mon': 'Month',
839
- 'day': 'Date',
840
- 'hou': 'Hours',
841
- 'min': 'Minutes',
842
- 'sec': 'Seconds'
843
- };
844
-
845
- function lastNext(type, range, modifier) {
846
- var diff, day = days[range];
847
- if (day !== undefined) {
848
- diff = day - date.getDay();
849
- if (diff === 0) {
850
- diff = 7 * modifier;
851
- } else if (diff > 0 && type === 'last') {
852
- diff -= 7;
853
- } else if (diff < 0 && type === 'next') {
854
- diff += 7;
855
- }
856
- date.setDate(date.getDate() + diff);
857
- }
858
- }
859
-
860
- function process(val) {
861
- var splt = val.split(' '),
862
- type = splt[0],
863
- range = splt[1].substring(0, 3),
864
- typeIsNumber = /\d+/.test(type),
865
- ago = splt[2] === 'ago',
866
- num = (type === 'last' ? -1 : 1) * (ago ? -1 : 1);
867
- if (typeIsNumber) {
868
- num *= parseInt(type, 10);
869
- }
870
- if (ranges.hasOwnProperty(range) && !splt[1].match(/^mon(day|\.)?$/i)) {
871
- return date['set' + ranges[range]](date['get' + ranges[range]]() + num);
872
- }
873
- if (range === 'wee') {
874
- return date.setDate(date.getDate() + (num * 7));
875
- }
876
- if (type === 'next' || type === 'last') {
877
- lastNext(type, range, num);
878
- } else if (!typeIsNumber) {
879
- return false;
880
- }
881
- return true;
882
- }
883
-
884
- times = '(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec' +
885
- '|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?' +
886
- '|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)';
887
- regex = '([+-]?\\d+\\s' + times + '|' + '(last|next)\\s' + times + ')(\\sago)?';
888
- match = text.match(new RegExp(regex, 'gi'));
889
- if (!match) {
890
- return fail;
891
- }
892
- for (i = 0, len = match.length; i < len; i += 1) {
893
- if (!process(match[i])) {
894
- return fail;
895
- }
896
- }
897
- // ECMAScript 5 only
898
- // if (!match.every(process))
899
- // return false;
900
- return (date.getTime() / 1000);
901
- }
902
- };
903
- // Deprecated fix. utilies was renamed because of typo.
904
- jQuery.fn.popmake.utilies = jQuery.fn.popmake.utilities;
905
-
906
- jQuery.fn.popmake.defaults = {
907
- meta: {
908
- display: {
909
- stackable: 0,
910
- overlay_disabled: 0,
911
- size: 'medium',
912
- responsive_max_width: '',
913
- responsive_max_width_unit: '%',
914
- responsive_min_width: '',
915
- responsive_min_width_unit: '%',
916
- custom_width: '',
917
- custom_width_unit: '%',
918
- custom_height: '',
919
- custom_height_unit: 'em',
920
- custom_height_auto: 0,
921
- location: 'center top',
922
- position_top: 100,
923
- position_left: 0,
924
- position_bottom: 0,
925
- position_right: 0,
926
- position_fixed: 0,
927
- animation_type: 'fade',
928
- animation_speed: 350,
929
- animation_origin: 'center top'
930
- },
931
- close: {
932
- overlay_click: 0,
933
- esc_press: 0,
934
- f4_press: 0
935
- }
936
- },
937
- container: {
938
- active_class: 'active',
939
- attr: {
940
- class: "popmake"
941
- }
942
- },
943
- title: {
944
- attr: {
945
- class: "popmake-title"
946
- }
947
- },
948
- content: {
949
- attr: {
950
- class: "popmake-content"
951
- }
952
- },
953
- close: {
954
- close_speed: 0,
955
- attr: {
956
- class: "popmake-close"
957
- }
958
- },
959
- overlay: {
960
- attr: {
961
- id: "popmake-overlay",
962
- class: "popmake-overlay"
963
- }
964
- }
965
- };
966
-
967
- jQuery.fn.popmake.overlay_animations = {
968
- none: function (duration, callback) {
969
- jQuery('#popmake-overlay').show(duration, callback);
970
- },
971
- fade: function (duration, callback) {
972
- jQuery('#popmake-overlay').fadeIn(duration, callback);
973
- },
974
- slide: function (duration, callback) {
975
- jQuery('#popmake-overlay').slideDown(duration, callback);
976
- }
977
- };
978
-
979
- jQuery.fn.popmake.animations = {
980
- none: function (callback) {
981
- var $this = jQuery(this);
982
- $this.popmake('animate_overlay', 'none', 0, function () {
983
- $this.css({display: 'block'});
984
- if (callback !== undefined) {
985
- callback();
986
- }
987
- });
988
- return this;
989
- },
990
- slide: function (callback) {
991
- var $this = jQuery(this).show(0).css({opacity: 0}),
992
- settings = $this.data('popmake'),
993
- speed = settings.meta.display.animation_speed / 2,
994
- start = $this.popmake('animation_origin', settings.meta.display.animation_origin);
995
-
996
- if (!settings.meta.display.position_fixed && !isScrolling) {
997
- jQuery('html').css('overflow-x', 'hidden');
998
- }
999
-
1000
- $this
1001
- .position(start)
1002
- .css({opacity: 1})
1003
- .popmake('animate_overlay', 'fade', speed, function () {
1004
- $this.popmake('reposition', function (position) {
1005
-
1006
- $this.animate(position, speed, 'swing', function () {
1007
- if (!settings.meta.display.position_fixed) {
1008
- jQuery('html').css('overflow-x', 'inherit');
1009
- }
1010
- if (callback !== undefined) {
1011
- callback();
1012
- }
1013
- });
1014
-
1015
- });
1016
- });
1017
- return this;
1018
- },
1019
- fade: function (callback) {
1020
- var $this = jQuery(this).show(0).css({opacity: 0}),
1021
- settings = $this.data('popmake'),
1022
- speed = settings.meta.display.animation_speed / 2;
1023
-
1024
- $this
1025
- .popmake('animate_overlay', 'fade', speed, function () {
1026
-
1027
- $this.animate({opacity: 1}, speed, 'swing', function () {
1028
- if (callback !== undefined) {
1029
- callback();
1030
- }
1031
- });
1032
-
1033
- });
1034
- return this;
1035
- },
1036
- fadeAndSlide: function (callback) {
1037
- var $this = jQuery(this).show(0).css({opacity: 0}),
1038
- settings = $this.data('popmake'),
1039
- speed = settings.meta.display.animation_speed / 2,
1040
- start = $this.popmake('animation_origin', settings.meta.display.animation_origin);
1041
-
1042
- if (!settings.meta.display.position_fixed && !isScrolling) {
1043
- jQuery('html').css('overflow-x', 'hidden');
1044
- }
1045
-
1046
- $this
1047
- .position(start)
1048
- .popmake('animate_overlay', 'fade', speed, function () {
1049
- $this.popmake('reposition', function (position) {
1050
-
1051
- position.opacity = 1;
1052
- $this.animate(position, speed, 'swing', function () {
1053
- if (!settings.meta.display.position_fixed) {
1054
- jQuery('html').css('overflow-x', 'inherit');
1055
- }
1056
- if (callback !== undefined) {
1057
- callback();
1058
- }
1059
- });
1060
-
1061
- });
1062
- });
1063
- return this;
1064
- },
1065
- grow: function (callback) {
1066
- /* var $this = jQuery(this).show(0).css({ opacity: 0 }),
1067
- settings = $this.data('popmake'),
1068
- speed = settings.meta.display.animation_speed / 2,
1069
- origin = settings.meta.display.animation_origin,
1070
- original_size = {height: $this.height(), width: $this.width()};
1071
-
1072
- if (origin === 'top' || origin === 'bottom') {
1073
- origin = 'center ' + origin;
1074
- }
1075
- if (origin === 'left' || origin === 'right') {
1076
- origin = origin + ' center';
1077
- }
1078
-
1079
- $this.css({
1080
- opacity: 1
1081
- });
1082
-
1083
- $this.popmake('animate_overlay', 'fade', speed, function () {
1084
- // Reposition with callback. position returns default positioning.
1085
- $this.popmake('reposition', function (position) {
1086
-
1087
- position.height = original_size.height;
1088
- position.width = original_size.width;
1089
- $this.css({
1090
- height: 0,
1091
- width: 0
1092
- }).animate(position, speed, 'swing', function () {
1093
- if (callback !== undefined) {
1094
- callback();
1095
- }
1096
- });
1097
-
1098
- });
1099
- });
1100
- return this;
1101
- */
1102
- var $this = jQuery(this).show(0).css({opacity: 0}),
1103
- settings = $this.data('popmake'),
1104
- speed = settings.meta.display.animation_speed / 2,
1105
- start = $this.popmake('animation_origin', settings.meta.display.animation_origin);
1106
-
1107
- if (!settings.meta.display.position_fixed && !isScrolling) {
1108
- jQuery('html').css('overflow-x', 'hidden');
1109
- }
1110
-
1111
- $this
1112
- .position(start)
1113
- .css({opacity: 1})
1114
- .popmake('animate_overlay', 'fade', speed, function () {
1115
- $this.popmake('reposition', function (position) {
1116
-
1117
- $this.animate(position, speed, 'swing', function () {
1118
- if (!settings.meta.display.position_fixed) {
1119
- jQuery('html').css('overflow-x', 'inherit');
1120
- }
1121
- if (callback !== undefined) {
1122
- callback();
1123
- }
1124
- });
1125
-
1126
- });
1127
- });
1128
- return this;
1129
-
1130
- },
1131
- growAndSlide: function (callback) {
1132
- var $this = jQuery(this).show(0).css({opacity: 0}),
1133
- settings = $this.data('popmake'),
1134
- speed = settings.meta.display.animation_speed / 2,
1135
- start = $this.popmake('animation_origin', settings.meta.display.animation_origin);
1136
-
1137
- if (!settings.meta.display.position_fixed && !isScrolling) {
1138
- jQuery('html').css('overflow-x', 'hidden');
1139
- }
1140
-
1141
- $this
1142
- .position(start)
1143
- .css({opacity: 1})
1144
- .popmake('animate_overlay', 'fade', speed, function () {
1145
- $this.popmake('reposition', function (position) {
1146
-
1147
- $this.animate(position, speed, 'swing', function () {
1148
- if (!settings.meta.display.position_fixed) {
1149
- jQuery('html').css('overflow-x', 'inherit');
1150
- }
1151
- if (callback !== undefined) {
1152
- callback();
1153
- }
1154
- });
1155
-
1156
- });
1157
- });
1158
- return this;
1159
- /*
1160
- var $this = jQuery(this).show(0).css({ opacity: 0 }),
1161
- settings = $this.data('popmake'),
1162
- speed = settings.meta.display.animation_speed / 2000,
1163
- origin = settings.meta.display.animation_origin,
1164
- start = $this.popmake('animation_origin', origin);
1165
-
1166
- if (!settings.meta.display.position_fixed && !isScrolling) {
1167
- jQuery('html').css('overflow-x', 'hidden');
1168
- }
1169
-
1170
- $this.position(start);
1171
-
1172
- TweenLite.to($this, 0, { scale: 0, opacity: 1, transformOrigin: '0 0' });
1173
-
1174
- $this.popmake('animate_overlay', 'fade', speed * 1000, function () {
1175
- $this.popmake('reposition', function (position) {
1176
-
1177
- TweenLite.to($this, speed, jQuery.extend(position, {
1178
- scale: 1,
1179
- transformOrigin: '50% 50%',
1180
- onComplete: function () {
1181
- if (!settings.meta.display.position_fixed) {
1182
- jQuery('html').css('overflow-x', 'inherit');
1183
- }
1184
- if (callback !== undefined) {
1185
- callback();
1186
- }
1187
- }
1188
- }));
1189
-
1190
- });
1191
- });
1192
- return this;
1193
- */
1194
- }
1195
- };
1196
-
1197
- jQuery('.popmake').css({visibility: "visible"}).hide();
1198
-
1199
- jQuery(document).ready(function () {
1200
- jQuery('.popmake')
1201
- .popmake()
1202
- .each(function () {
1203
- var $this = jQuery(this),
1204
- settings = $this.data('popmake'),
1205
- click_open = settings.meta.click_open,
1206
- trigger_selector = '.popmake-' + settings.id + ', .popmake-' + settings.slug,
1207
- admin_debug = settings.meta.admin_debug,
1208
- auto_open = settings.meta.auto_open,
1209
- cookie_name = "popmake-auto-open-" + settings.id,
1210
- noCookieCheck;
1211
-
1212
- if (click_open !== undefined && click_open.extra_selectors !== '') {
1213
- trigger_selector += ', ' + click_open.extra_selectors;
1214
- }
1215
-
1216
- jQuery(trigger_selector).css({cursor: "pointer"});
1217
- jQuery(document).on('click.popmakeOpen', trigger_selector, function (event) {
1218
- if (!jQuery(event.target).hasClass('do-default')) {
1219
- event.preventDefault();
1220
- event.stopPropagation();
1221
- }
1222
- jQuery.fn.popmake.last_open_trigger = this; //jQuery.fn.popmake.utilities.getXPath(this);
1223
- $this.popmake('open');
1224
- });
1225
-
1226
- if (admin_debug !== undefined && admin_debug.enabled) {
1227
- $this.popmake('open');
1228
- return;
1229
- }
1230
-
1231
- if (auto_open !== undefined && auto_open.enabled) {
1232
-
1233
- if (auto_open.cookie_key !== undefined && auto_open.cookie_key !== '') {
1234
- cookie_name = cookie_name + "-" + auto_open.cookie_key;
1235
- }
1236
-
1237
- noCookieCheck = function () {
1238
- return jQuery.pm_cookie(cookie_name) === undefined;
1239
- };
1240
-
1241
- $this.on('popmakeSetCookie.auto-open', function () {
1242
- if (auto_open.cookie_time !== '' && noCookieCheck()) {
1243
- jQuery.pm_cookie(
1244
- cookie_name,
1245
- true,
1246
- auto_open.session_cookie ? null : auto_open.cookie_time,
1247
- auto_open.cookie_path
1248
- );
1249
- }
1250
- });
1251
-
1252
- switch (auto_open.cookie_trigger) {
1253
- case "open":
1254
- $this.on('popmakeAfterOpen', function () {
1255
- $this.trigger('popmakeSetCookie');
1256
- });
1257
- break;
1258
- case "close":
1259
- $this.on('popmakeBeforeClose', function () {
1260
- $this.trigger('popmakeSetCookie');
1261
- });
1262
- break;
1263
- }
1264
-
1265
- setTimeout(function () {
1266
- if (noCookieCheck()) {
1267
- if (!$this.hasClass('active')) {
1268
- jQuery.fn.popmake.last_open_trigger = 'Auto Open Popups ID-' + settings.id;
1269
- $this.popmake('open');
1270
- }
1271
- }
1272
- }, auto_open.delay);
1273
- }
1274
- });
1275
- });
1276
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/popup-maker-site.min.js DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * Popup Maker v1.3.6
3
- */
4
- !function(e){"use strict";var t=!1;e(window).on("scroll",function(){t=!0}).on("scrollstop",function(){t=!1}),e.isFunction(e.fn.on)||(e.fn.on=function(e,t,o){return this.delegate(t,e,o)},e.fn.off=function(e,t,o){return this.undelegate(t,e,o)}),e.fn.popmake=function(t){return e.fn.popmake.methods[t]?e.fn.popmake.methods[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.fn.popmake"):e.fn.popmake.methods.init.apply(this,arguments)},e.fn.popmake.version=1.3,e.fn.popmake.last_open_popup=null,e.fn.popmake.last_open_trigger=null,e.fn.popmake.last_close_trigger=null,e.fn.popmake.methods={init:function(t){return this.each(function(){var o=e(this),i=e.extend(!0,{},e.fn.popmake.defaults,o.data("popmake"),t);return i.theme_id>0||(i.theme_id=popmake_default_theme),e("#"+i.overlay.attr.id).length||e("<div>").attr(i.overlay.attr).appendTo("body"),e(window).on("resize",function(){o.hasClass("active")&&e.fn.popmake.utilities.throttle(setTimeout(function(){o.popmake("reposition")},25),500,!1)}),"string"==typeof popmake_powered_by&&""!==popmake_powered_by&&e(".popmake-content",o).append(e(popmake_powered_by)),o.data("popmake",i).trigger("popmakeInit"),this})},setup_close:function(){var t=e(this),o=t.data("popmake"),i=e("#popmake-overlay"),a=e(".popmake-close",t);return a.off("click.popmake").on("click.popmake",function(o){o.preventDefault(),o.stopPropagation(),e.fn.popmake.last_close_trigger="Close Button",t.popmake("close")}),(o.meta.close.esc_press||o.meta.close.f4_press)&&e(window).off("keyup.popmake").on("keyup.popmake",function(i){27===i.keyCode&&o.meta.close.esc_press&&(e.fn.popmake.last_close_trigger="ESC Key",t.popmake("close")),115===i.keyCode&&o.meta.close.f4_press&&(e.fn.popmake.last_close_trigger="F4 Key",t.popmake("close"))}),o.meta.close.overlay_click&&i.off("click.popmake").on("click.popmake",function(o){o.preventDefault(),o.stopPropagation(),e.fn.popmake.last_close_trigger="Overlay Click",t.popmake("close")}),t.trigger("popmakeSetupClose"),this},open:function(t){var o=e(this),i=o.data("popmake");return i.meta.display.stackable||o.popmake("close_all"),o.css({visibility:"visible"}).hide().addClass("active").popmake("setup_close").popmake("reposition").trigger("popmakeBeforeOpen"),i.meta.close.button_delay>0&&o.find(".popmake-content + .popmake-close").fadeOut(0),o.hasClass("preventOpen")?(o.removeClass("preventOpen").removeClass("active"),this):(e("#popmake-overlay").prop("class","popmake-overlay theme-"+i.theme_id).css({"z-index":i.meta.display.overlay_zindex||1999999998}),o.css({"z-index":i.meta.display.zindex||1999999999}).popmake("animate",i.meta.display.animation_type,function(){i.meta.close.button_delay>0&&setTimeout(function(){o.find(".popmake-content + .popmake-close").fadeIn()},i.meta.close.button_delay),o.trigger("popmakeAfterOpen"),e.fn.popmake.last_open_popup=o,void 0!==t&&t()}),this)},close:function(t){return this.each(function(){var o=e(this),i=e("#popmake-overlay"),a=e(".popmake-close",o),n=o.data("popmake");return o.trigger("popmakeBeforeClose").fadeOut(n.close.close_speed,function(){i.length&&i.is(":visible")&&i.fadeOut(n.close.close_speed),e(window).off("keyup.popmake"),i.off("click.popmake"),a.off("click.popmake"),o.removeClass("active").trigger("popmakeAfterClose"),e("iframe",o).filter('[src*="youtube"],[src*="vimeo"]').each(function(){var t=e(this),o=t.attr("src").replace("autoplay=1","1=1");t.attr("src","").attr("src",o)}),e("video",o).each(function(){this.pause()}),void 0!==t&&t()}),this})},close_all:function(){return e(".popmake.active").popmake("close"),this},reposition:function(t){e(this).trigger("popmakeBeforeReposition");var o=e(this),i=o.data("popmake"),a=i.meta.display,n=a.location,s={my:"",at:""},p=!1;return n.indexOf("left")>=0&&(s={my:s.my+" left"+(0!==a.position_left?"+"+a.position_left:""),at:s.at+" left"}),n.indexOf("right")>=0&&(s={my:s.my+" right"+(0!==a.position_right?"-"+a.position_right:""),at:s.at+" right"}),n.indexOf("center")>=0&&(s="center"===n?{my:"center",at:"center"}:{my:s.my+" center",at:s.at+" center"}),n.indexOf("top")>=0&&(s={my:s.my+" top"+(0!==a.position_top?"+"+(e("body").hasClass("admin-bar")?parseInt(a.position_top,10)+32:a.position_top):""),at:s.at+" top"}),n.indexOf("bottom")>=0&&(s={my:s.my+" bottom"+(0!==a.position_bottom?"-"+a.position_bottom:""),at:s.at+" bottom"}),s.my=e.trim(s.my),s.at=e.trim(s.at),s.of=window,s.collision="none",s.using="function"==typeof t?t:e.fn.popmake.callbacks.reposition_using,o.is(":hidden")&&(p=o.css("opacity"),o.css({opacity:0}).show()),o.removeClass("responsive size-nano size-micro size-tiny size-small size-medium size-normal size-large size-xlarge fixed custom-position").addClass("size-"+i.meta.display.size),a.position_fixed&&o.addClass("fixed"),"custom"===i.meta.display.size?o.css({width:i.meta.display.custom_width+i.meta.display.custom_width_unit,height:i.meta.display.custom_height_auto?"auto":i.meta.display.custom_height+i.meta.display.custom_height_unit}):"auto"!==i.meta.display.size&&o.addClass("responsive").css({minWidth:""!==i.meta.display.responsive_min_width?i.meta.display.responsive_min_width+i.meta.display.responsive_min_width_unit:"auto",maxWidth:""!==i.meta.display.responsive_max_width?i.meta.display.responsive_max_width+i.meta.display.responsive_max_width_unit:"auto"}),o.addClass("custom-position").position(s).trigger("popmakeAfterReposition"),p&&o.css({opacity:p}).hide(),this},retheme:function(t){e(this).trigger("popmakeBeforeRetheme");var o,i,a=e(this),n=a.data("popmake"),s=e("#"+n.overlay.attr.id),p=a,r=e("."+n.title.attr["class"],p),c=e("> ."+n.content.attr["class"],p),l=e("> ."+n.close.attr["class"],p);switch(void 0===t&&(t=e.fn.popmake.themes[n.theme_id],void 0===t&&(t=e.fn.popmake.themes[1])),o="yes"===t.container.boxshadow_inset?"inset ":"",i="yes"===t.close.boxshadow_inset?"inset ":"",s.removeAttr("style").css({backgroundColor:e.fn.popmake.utilities.convert_hex(t.overlay.background_color,t.overlay.background_opacity),zIndex:n.meta.display.overlay_zindex||998}),p.css({padding:t.container.padding+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.container.background_color,t.container.background_opacity),borderStyle:t.container.border_style,borderColor:t.container.border_color,borderWidth:t.container.border_width+"px",borderRadius:t.container.border_radius+"px",boxShadow:o+t.container.boxshadow_horizontal+"px "+t.container.boxshadow_vertical+"px "+t.container.boxshadow_blur+"px "+t.container.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.container.boxshadow_color,t.container.boxshadow_opacity),zIndex:n.meta.display.zindex||999}),r.css({color:t.title.font_color,lineHeight:t.title.line_height+"px",fontSize:t.title.font_size+"px",fontFamily:t.title.font_family,fontWeight:t.title.font_weight,fontStyle:t.title.font_style,textAlign:t.title.text_align,textShadow:t.title.textshadow_horizontal+"px "+t.title.textshadow_vertical+"px "+t.title.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.title.textshadow_color,t.title.textshadow_opacity)}),c.css({color:t.content.font_color,fontFamily:t.content.font_family,fontWeight:t.content.font_weight,fontStyle:t.content.font_style}),e("p, label",c).css({color:t.content.font_color,fontFamily:t.content.font_family}),l.html(t.close.text).css({padding:t.close.padding+"px",height:t.close.height+"px",width:t.close.width+"px",backgroundColor:e.fn.popmake.utilities.convert_hex(t.close.background_color,t.close.background_opacity),color:t.close.font_color,lineHeight:t.close.line_height+"px",fontSize:t.close.font_size+"px",fontWeight:t.close.font_weight,fontStyle:t.close.font_style,fontFamily:t.close.font_family,borderStyle:t.close.border_style,borderColor:t.close.border_color,borderWidth:t.close.border_width+"px",borderRadius:t.close.border_radius+"px",boxShadow:i+t.close.boxshadow_horizontal+"px "+t.close.boxshadow_vertical+"px "+t.close.boxshadow_blur+"px "+t.close.boxshadow_spread+"px "+e.fn.popmake.utilities.convert_hex(t.close.boxshadow_color,t.close.boxshadow_opacity),textShadow:t.close.textshadow_horizontal+"px "+t.close.textshadow_vertical+"px "+t.close.textshadow_blur+"px "+e.fn.popmake.utilities.convert_hex(t.close.textshadow_color,t.close.textshadow_opacity),left:"auto",right:"auto",bottom:"auto",top:"auto"}),t.close.location){case"topleft":l.css({top:t.close.position_top+"px",left:t.close.position_left+"px"});break;case"topright":l.css({top:t.close.position_top+"px",right:t.close.position_right+"px"});break;case"bottomleft":l.css({bottom:t.close.position_bottom+"px",left:t.close.position_left+"px"});break;case"bottomright":l.css({bottom:t.close.position_bottom+"px",right:t.close.position_right+"px"})}return a.trigger("popmakeAfterRetheme",[t]),this},animate_overlay:function(t,o,i){var a=e(this),n=a.data("popmake");if(n.meta.display.overlay_disabled)i();else{if(e.fn.popmake.overlay_animations[t])return e.fn.popmake.overlay_animations[t].apply(this,Array.prototype.slice.call(arguments,1));e.error("Animation style "+e.fn.popmake.overlay_animations+" does not exist.")}return this},animate:function(t){return e.fn.popmake.animations[t]?e.fn.popmake.animations[t].apply(this,Array.prototype.slice.call(arguments,1)):(e.error("Animation style "+e.fn.popmake.animations+" does not exist."),this)},animation_origin:function(t){var o=e(this),i={my:"",at:""};switch(t){case"top":i={my:"left+"+o.offset().left+" bottom-100",at:"left top"};break;case"bottom":i={my:"left+"+o.offset().left+" top+100",at:"left bottom"};break;case"left":i={my:"right top+"+o.offset().top,at:"left top"};break;case"right":i={my:"left top+"+o.offset().top,at:"right top"};break;default:t.indexOf("left")>=0&&(i={my:i.my+" right",at:i.at+" left"}),t.indexOf("right")>=0&&(i={my:i.my+" left",at:i.at+" right"}),t.indexOf("center")>=0&&(i={my:i.my+" center",at:i.at+" center"}),t.indexOf("top")>=0&&(i={my:i.my+" bottom-100",at:i.at+" top"}),t.indexOf("bottom")>=0&&(i={my:i.my+" top+100",at:i.at+" bottom"}),i.my=e.trim(i.my),i.at=e.trim(i.at)}return i.of=window,i.collision="none",i}},e.fn.popmake.callbacks={reposition_using:function(t){e(this).css(t)}},e.fn.popmake.cookie={defaults:{},raw:!1,json:!0,pluses:/\+/g,encode:function(t){return e.fn.popmake.cookie.raw?t:encodeURIComponent(t)},decode:function(t){return e.fn.popmake.cookie.raw?t:decodeURIComponent(t)},stringifyCookieValue:function(t){return e.fn.popmake.cookie.encode(e.fn.popmake.cookie.json?JSON.stringify(t):String(t))},parseCookieValue:function(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return t=decodeURIComponent(t.replace(e.fn.popmake.cookie.pluses," ")),e.fn.popmake.cookie.json?JSON.parse(t):t}catch(o){}},read:function(t,o){var i=e.fn.popmake.cookie.raw?t:e.fn.popmake.cookie.parseCookieValue(t);return e.isFunction(o)?o(i):i},process:function(t,o,i,a){var n,s,p,r,c,l=t?void 0:{},m=new Date,d=document.cookie?document.cookie.split("; "):[];if(void 0!==o&&!e.isFunction(o)){switch(typeof i){case"number":m.setTime(+m+864e5*i),i=m;break;case"string":m.setTime(1e3*e.fn.popmake.utilities.strtotime("+"+i)),i=m}return void(document.cookie=[e.fn.popmake.cookie.encode(t),"=",e.fn.popmake.cookie.stringifyCookieValue(o),i?"; expires="+i.toUTCString():"",a?"; path="+a:""].join(""))}for(r=0,c=d.length;c>r;r+=1){if(n=d[r].split("="),s=e.fn.popmake.cookie.decode(n.shift()),p=n.join("="),t&&t===s){l=e.fn.popmake.cookie.read(p,o);break}p=e.fn.popmake.cookie.read(p),t||void 0===p||(l[s]=p)}return l},remove:function(t){return void 0===e.pm_cookie(t)?!1:(e.pm_cookie(t,"",-1),!e.pm_cookie(t))}},e.pm_cookie=e.fn.popmake.cookie.process,e.pm_remove_cookie=e.fn.popmake.cookie.remove,e.fn.popmake.utilities={convert_hex:function(e,t){e=e.replace("#","");var o=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),a=parseInt(e.substring(4,6),16),n="rgba("+o+","+i+","+a+","+t/100+")";return n},debounce:function(e,t){var o;return function(){var i=this,a=arguments;window.clearTimeout(o),o=window.setTimeout(function(){e.apply(i,a)},t)}},throttle:function(e,t){var o=!1,i=function(){o=!1};return function(){o||(e.apply(this,arguments),window.setTimeout(i,t),o=!0)}},getXPath:function(t){var o,i,a,n,s,p=[];return e.each(e(t).parents(),function(t,r){return o=e(r),i=o.attr("id")||"",a=o.attr("class")||"",n=o.get(0).tagName.toLowerCase(),s=o.parent().children(n).index(o),"body"===n?!1:(a.length>0&&(a=a.split(" "),a=a[0]),void p.push(n+(i.length>0?"#"+i:a.length>0?"."+a.split(" ").join("."):":eq("+s+")")))}),p.reverse().join(" > ")},strtotime:function(e,t){function o(e,t,o){var i,a=c[t];void 0!==a&&(i=a-r.getDay(),0===i?i=7*o:i>0&&"last"===e?i-=7:0>i&&"next"===e&&(i+=7),r.setDate(r.getDate()+i))}function i(e){var t=e.split(" "),i=t[0],a=t[1].substring(0,3),n=/\d+/.test(i),s="ago"===t[2],p=("last"===i?-1:1)*(s?-1:1);if(n&&(p*=parseInt(i,10)),l.hasOwnProperty(a)&&!t[1].match(/^mon(day|\.)?$/i))return r["set"+l[a]](r["get"+l[a]]()+p);if("wee"===a)return r.setDate(r.getDate()+7*p);if("next"===i||"last"===i)o(i,a,p);else if(!n)return!1;return!0}var a,n,s,p,r,c,l,m,d,f,u,h=!1;if(!e)return h;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),n=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),n&&n[2]===n[4])if(n[1]>1901)switch(n[2]){case"-":return n[3]>12||n[5]>31?h:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return h;case"/":return n[3]>12||n[5]>31?h:new Date(n[1],parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else if(n[5]>1901)switch(n[2]){case"-":return n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case".":return n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3;case"/":return n[1]>12||n[3]>31?h:new Date(n[5],parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3}else switch(n[2]){case"-":return n[3]>12||n[5]>31||n[1]<70&&n[1]>38?h:(p=n[1]>=0&&n[1]<=38?+n[1]+2e3:n[1],new Date(p,parseInt(n[3],10)-1,n[5],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case".":return n[5]>=70?n[3]>12||n[1]>31?h:new Date(n[5],parseInt(n[3],10)-1,n[1],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3:n[5]<60&&!n[6]?n[1]>23||n[3]>59?h:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),n[1]||0,n[3]||0,n[5]||0,n[9]||0)/1e3):h;case"/":return n[1]>12||n[3]>31||n[5]<70&&n[5]>38?h:(p=n[5]>=0&&n[5]<=38?+n[5]+2e3:n[5],new Date(p,parseInt(n[1],10)-1,n[3],n[6]||0,n[7]||0,n[8]||0,n[9]||0)/1e3);case":":return n[1]>23||n[3]>59||n[5]>59?h:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),n[1]||0,n[3]||0,n[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3||0:t||0;if(a=Date.parse(e),!isNaN(a))return a/1e3||0;if(r=t?new Date(1e3*t):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},l={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},d="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+d+"|(last|next)\\s"+d+")(\\sago)?",n=e.match(new RegExp(f,"gi")),!n)return h;for(u=0,m=n.length;m>u;u+=1)if(!i(n[u]))return h;return r.getTime()/1e3}},e.fn.popmake.utilies=e.fn.popmake.utilities,e.fn.popmake.defaults={meta:{display:{stackable:0,overlay_disabled:0,size:"medium",responsive_max_width:"",responsive_max_width_unit:"%",responsive_min_width:"",responsive_min_width_unit:"%",custom_width:"",custom_width_unit:"%",custom_height:"",custom_height_unit:"em",custom_height_auto:0,location:"center top",position_top:100,position_left:0,position_bottom:0,position_right:0,position_fixed:0,animation_type:"fade",animation_speed:350,animation_origin:"center top"},close:{overlay_click:0,esc_press:0,f4_press:0}},container:{active_class:"active",attr:{"class":"popmake"}},title:{attr:{"class":"popmake-title"}},content:{attr:{"class":"popmake-content"}},close:{close_speed:0,attr:{"class":"popmake-close"}},overlay:{attr:{id:"popmake-overlay","class":"popmake-overlay"}}},e.fn.popmake.overlay_animations={none:function(t,o){e("#popmake-overlay").show(t,o)},fade:function(t,o){e("#popmake-overlay").fadeIn(t,o)},slide:function(t,o){e("#popmake-overlay").slideDown(t,o)}},e.fn.popmake.animations={none:function(t){var o=e(this);return o.popmake("animate_overlay","none",0,function(){o.css({display:"block"}),void 0!==t&&t()}),this},slide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},fade:function(t){var o=e(this).show(0).css({opacity:0}),i=o.data("popmake"),a=i.meta.display.animation_speed/2;return o.popmake("animate_overlay","fade",a,function(){o.animate({opacity:1},a,"swing",function(){void 0!==t&&t()})}),this},fadeAndSlide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){t.opacity=1,i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},grow:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this},growAndSlide:function(o){var i=e(this).show(0).css({opacity:0}),a=i.data("popmake"),n=a.meta.display.animation_speed/2,s=i.popmake("animation_origin",a.meta.display.animation_origin);return a.meta.display.position_fixed||t||e("html").css("overflow-x","hidden"),i.position(s).css({opacity:1}).popmake("animate_overlay","fade",n,function(){i.popmake("reposition",function(t){i.animate(t,n,"swing",function(){a.meta.display.position_fixed||e("html").css("overflow-x","inherit"),void 0!==o&&o()})})}),this}},e(".popmake").css({visibility:"visible"}).hide(),e(document).ready(function(){e(".popmake").popmake().each(function(){var t,o=e(this),i=o.data("popmake"),a=i.meta.click_open,n=".popmake-"+i.id+", .popmake-"+i.slug,s=i.meta.admin_debug,p=i.meta.auto_open,r="popmake-auto-open-"+i.id;if(void 0!==a&&""!==a.extra_selectors&&(n+=", "+a.extra_selectors),e(n).css({cursor:"pointer"}),e(document).on("click.popmakeOpen",n,function(t){e(t.target).hasClass("do-default")||(t.preventDefault(),t.stopPropagation()),e.fn.popmake.last_open_trigger=this,o.popmake("open")}),void 0!==s&&s.enabled)return void o.popmake("open");if(void 0!==p&&p.enabled){switch(void 0!==p.cookie_key&&""!==p.cookie_key&&(r=r+"-"+p.cookie_key),t=function(){return void 0===e.pm_cookie(r)},o.on("popmakeSetCookie.auto-open",function(){""!==p.cookie_time&&t()&&e.pm_cookie(r,!0,p.session_cookie?null:p.cookie_time,p.cookie_path)}),p.cookie_trigger){case"open":o.on("popmakeAfterOpen",function(){o.trigger("popmakeSetCookie")});break;case"close":o.on("popmakeBeforeClose",function(){o.trigger("popmakeSetCookie")})}setTimeout(function(){t()&&(o.hasClass("active")||(e.fn.popmake.last_open_trigger="Auto Open Popups ID-"+i.id,o.popmake("open")))},p.delay)}})})}(jQuery);
 
 
 
 
includes/admin/metabox-share.php DELETED
@@ -1,78 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- /**
9
- * Popup Maker Support Metabox
10
- *
11
- * Extensions (as well as the core plugin) can add items to the popup support
12
- * metabox via the `popmake_support_meta_box_fields` action.
13
- *
14
- * @since 1.0
15
- * @return void
16
- */
17
- function popmake_render_share_meta_box() { ?>
18
- <div id="popmake_share_fields" class="popmake_meta_table_wrap">
19
- <?php do_action( 'popmake_share_meta_box_fields' ); ?>
20
- </div><?php
21
- }
22
-
23
-
24
- add_action( 'popmake_share_meta_box_fields', 'popmake_share_meta_box_links', 10 );
25
- function popmake_share_meta_box_links() { ?>
26
- <h3 class="loveit-shareit" style="text-align:center">Love It? <span>Share It!</span></h3>
27
- <ul class="share-buttons">
28
- <li>
29
- <div class="fb-like" data-href="https://wppopupmaker.com" data-width="100" data-ref="true" data-layout="box_count" data-action="like" data-show-faces="false" data-send="true"></div>
30
- </li>
31
- <li>
32
- <a href="https://twitter.com/intent/tweet" class="twitter-share-button" data-text="<?php _e( 'Want to destroy your old conversion rates? Create high performing popups now! #WPPopupMaker', 'popup-maker' ); ?>" data-count="vertical" data-url="https://wppopupmaker.com" data-via="wppopupmaker" data-related="wppopupmaker"><?php _e( 'Tweet', 'popup-maker' ); ?></a>
33
- </li>
34
- <li>
35
- <div class="g-plusone" data-href="https://wppopupmaker.com" data-size="tall"></div>
36
- </li>
37
- </ul>
38
- <br class="clear"/>
39
- <br class="clear"/>
40
- <div style="text-align:center">
41
- <a class="button button-primary rounded" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/popup-maker#postform"><?php _e( 'Rate Popup Maker on WP!', 'popup-maker' ); ?></a>
42
- </div><?php
43
- }
44
-
45
-
46
- add_action( 'popmake_admin_footer', 'popmake_admin_footer_social_scripts' );
47
- function popmake_admin_footer_social_scripts() { ?>
48
- <div id="fb-root"></div>
49
- <script>
50
- jQuery(document).ready(function () {
51
- (function (d, s, id) {
52
- var js, fjs = d.getElementsByTagName(s)[0];
53
- if (d.getElementById(id)) return;
54
- js = d.createElement(s);
55
- js.id = id;
56
- js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=191746824208314";
57
- fjs.parentNode.insertBefore(js, fjs);
58
- }(document, 'script', 'facebook-jssdk'));
59
- (function () {
60
- var po = document.createElement('script');
61
- po.type = 'text/javascript';
62
- po.async = true;
63
- po.src = 'https://apis.google.com/js/plusone.js';
64
- var s = document.getElementsByTagName('script')[0];
65
- s.parentNode.insertBefore(po, s);
66
- })();
67
- !function (d, s, id) {
68
- var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
69
- if (!d.getElementById(id)) {
70
- js = d.createElement(s);
71
- js.id = id;
72
- js.src = p + '://platform.twitter.com/widgets.js';
73
- fjs.parentNode.insertBefore(js, fjs);
74
- }
75
- }(document, 'script', 'twitter-wjs');
76
- });
77
- </script><?php
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/popups/metabox-admin-debug-fields.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- /**
9
- * Renders popup click open fields
10
- * @since 1.0
11
- *
12
- * @param $post_id
13
- */
14
-
15
- add_action( 'popmake_popup_admin_debug_meta_box_fields', 'popmake_popup_admin_debug_meta_box_field_extra_selectors', 10 );
16
- function popmake_popup_admin_debug_meta_box_field_extra_selectors( $popup_id ) { ?>
17
- <tr>
18
- <th scope="row"><?php _e( 'Enable Admin Debug', 'popup-maker' ); ?></th>
19
- <td>
20
- <input type="checkbox" value="true" name="popup_admin_debug_enabled" id="popup_admin_debug_enabled" <?php echo popmake_get_popup_admin_debug( $popup_id, 'enabled' ) ? 'checked="checked" ' : ''; ?>/>
21
- <label for="popup_admin_debug_enabled" class="description"><?php _e( 'When Enabled, the popup will show immediately on the given page for admins.', 'popup-maker' ); ?></label>
22
- </td>
23
- </tr><?php
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/popups/metabox-auto-open-popups-fields.php DELETED
@@ -1,131 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- /**
9
- * Renders popup auto open fields
10
- * @since 1.0
11
- *
12
- * @param $post_id
13
- */
14
- add_action( 'popmake_popup_auto_open_meta_box_fields', 'popmake_popup_auto_open_meta_box_field_enabled', 10 );
15
- function popmake_popup_auto_open_meta_box_field_enabled( $popup_id ) { ?>
16
- <tr>
17
- <th scope="row"><?php _e( 'Enable Auto Open Popups', 'popup-maker' ); ?></th>
18
- <td>
19
- <input type="checkbox" value="true" name="popup_auto_open_enabled" id="popup_auto_open_enabled" <?php echo popmake_get_popup_auto_open( $popup_id, 'enabled' ) ? 'checked="checked" ' : ''; ?>/>
20
- <label for="popup_auto_open_enabled" class="description"><?php _e( 'Checking this will cause popup to open automatically.', 'popup-maker' ); ?></label>
21
- </td>
22
- </tr><?php
23
- }
24
-
25
-
26
- add_action( 'popmake_popup_auto_open_meta_box_fields', 'popmake_popup_auto_open_meta_box_field_delay', 20 );
27
- function popmake_popup_auto_open_meta_box_field_delay( $popup_id ) { ?>
28
- <tr class="auto-open-enabled">
29
- <th scope="row">
30
- <label for="popup_auto_open_delay"><?php _e( 'Delay', 'popup-maker' ); ?></label>
31
- </th>
32
- <td>
33
- <input type="text" readonly
34
- value="<?php esc_attr_e( popmake_get_popup_auto_open( $popup_id, 'delay' ) ) ?>"
35
- name="popup_auto_open_delay"
36
- id="popup_auto_open_delay"
37
- class="popmake-range-manual"
38
- step="<?php esc_attr_e( apply_filters( 'popmake_popup_auto_open_delay_step', 500 ) ); ?>"
39
- min="<?php esc_attr_e( apply_filters( 'popmake_popup_auto_open_delay_min', 0 ) ); ?>"
40
- max="<?php esc_attr_e( apply_filters( 'popmake_popup_auto_open_delay_max', 10000 ) ); ?>"
41
- />
42
- <span class="range-value-unit regular-text">ms</span>
43
-
44
- <p class="description"><?php _e( 'The delay before the popup will open in milliseconds.', 'popup-maker' ); ?></p>
45
- </td>
46
- </tr><?php
47
- }
48
-
49
-
50
- add_action( 'popmake_popup_auto_open_meta_box_fields', 'popmake_popup_auto_open_meta_box_field_cookie_trigger', 30 );
51
- function popmake_popup_auto_open_meta_box_field_cookie_trigger( $popup_id ) { ?>
52
- <tr class="auto-open-enabled">
53
- <th scope="row">
54
- <label for="popup_auto_open_cookie_trigger">
55
- <?php _e( 'Cookie Trigger', 'popup-maker' ); ?>
56
- </label>
57
- </th>
58
- <td>
59
- <select name="popup_auto_open_cookie_trigger" id="popup_auto_open_cookie_trigger">
60
- <?php foreach ( apply_filters( 'popmake_cookie_trigger_options', array() ) as $option => $value ) : ?>
61
- <option
62
- value="<?php echo $value; ?>"
63
- <?php echo $value == popmake_get_popup_auto_open( $popup_id, 'cookie_trigger' ) ? ' selected="selected"' : ''; ?>
64
- ><?php echo $option; ?></option>
65
- <?php endforeach ?>
66
- </select>
67
-
68
- <p class="description"><?php _e( 'When do you want to create the cookie.', 'popup-maker' ) ?></p>
69
- </td>
70
- </tr><?php
71
- }
72
-
73
-
74
- add_action( 'popmake_popup_auto_open_meta_box_fields', 'popmake_popup_auto_open_meta_box_field_session_cookie', 40 );
75
- function popmake_popup_auto_open_meta_box_field_session_cookie( $popup_id ) { ?>
76
- <tr class="auto-open-enabled">
77
- <th scope="row">
78
- <label for="popup_auto_open_session_cookie">
79
- <?php _e( 'Use Session Cookie?', 'popup-maker' ); ?>
80
- </label>
81
- </th>
82
- <td>
83
- <input type="checkbox" value="true" name="popup_auto_open_session_cookie" id="popup_auto_open_session_cookie" <?php checked( popmake_get_popup_auto_open( $popup_id, 'session_cookie' ), 'true' ); ?>/>
84
- <label class="description" for="popup_auto_open_session_cookie"><?php _e( 'Session cookies expire when the user closes their browser.', 'popup-maker' ) ?></label>
85
- </td>
86
- </tr><?php
87
- }
88
-
89
- add_action( 'popmake_popup_auto_open_meta_box_fields', 'popmake_popup_auto_open_meta_box_field_cookie_time', 50 );
90
- function popmake_popup_auto_open_meta_box_field_cookie_time( $popup_id ) { ?>
91
- <tr class="auto-open-enabled not-session-cookie">
92
- <th scope="row">
93
- <label for="popup_auto_open_cookie_time">
94
- <?php _e( 'Cookie Time', 'popup-maker' ); ?>
95
- </label>
96
- </th>
97
- <td>
98
- <input type="text" class="regular-text" name="popup_auto_open_cookie_time" id="popup_auto_open_cookie_time" value="<?php esc_attr_e( popmake_get_popup_auto_open( $popup_id, 'cookie_time' ) ) ?>"/>
99
-
100
- <p class="description"><?php _e( 'Enter a plain english time before cookie expires. <br/>Example "364 days 23 hours 59 minutes 59 seconds" will reset just before 1 year exactly.', 'popup-maker' ) ?></p>
101
- </td>
102
- </tr><?php
103
- }
104
-
105
-
106
- add_action( 'popmake_popup_auto_open_meta_box_fields', 'popmake_popup_auto_open_meta_box_field_cookie_path', 60 );
107
- function popmake_popup_auto_open_meta_box_field_cookie_path( $popup_id ) { ?>
108
- <tr class="auto-open-enabled">
109
- <th scope="row"><?php _e( 'Sitewide Cookie', 'popup-maker' ); ?></th>
110
- <td>
111
- <input type="checkbox" value="/" name="popup_auto_open_cookie_path" id="popup_auto_open_cookie_path" <?php checked( popmake_get_popup_auto_open( $popup_id, 'cookie_path' ), '/' ); ?>/>
112
- <label for="popup_auto_open_cookie_path" class="description"><?php _e( 'This will prevent the popup from auto opening on any page until the cookie expires.', 'popup-maker' ); ?></label>
113
- </td>
114
- </tr><?php
115
- }
116
-
117
-
118
- add_action( 'popmake_popup_auto_open_meta_box_fields', 'popmake_popup_auto_open_meta_box_field_cookie_key', 70 );
119
- function popmake_popup_auto_open_meta_box_field_cookie_key( $popup_id ) { ?>
120
- <tr class="auto-open-enabled">
121
- <th scope="row">
122
- <label for="popup_auto_open_cookie_key">
123
- <?php _e( 'Cookie Key', 'popup-maker' ); ?>
124
- </label>
125
- <td>
126
- <input type="text" value="<?php esc_attr_e( popmake_get_popup_auto_open( $popup_id, 'cookie_key' ) ) ?>" name="popup_auto_open_cookie_key" id="popup_auto_open_cookie_key"/>
127
- <button type="button" class="popmake-reset-cookie-key popmake-reset-auto-open-cookie-key button large-button"><?php _e( 'Reset', 'popup-maker' ); ?></button>
128
- <p class="description"><?php _e( 'This changes the key used when setting and checking cookies. Resetting this will cause all existing cookies to be invalid.', 'popup-maker' ); ?></p>
129
- </td>
130
- </tr><?php
131
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/popups/metabox-click-open-fields.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- /**
9
- * Renders popup click open fields
10
- * @since 1.0
11
- *
12
- * @param $post_id
13
- */
14
-
15
- add_action( 'popmake_popup_click_open_meta_box_fields', 'popmake_popup_click_open_meta_box_field_extra_selectors', 10 );
16
- function popmake_popup_click_open_meta_box_field_extra_selectors( $popup_id ) { ?>
17
- <tr>
18
- <th scope="row">
19
- <label for="popup_click_open_extra_selectors">
20
- <?php _e( 'Extra CSS Selectors', 'popup-maker' ); ?>
21
- </label>
22
- </th>
23
- <td>
24
- <input type="text" placeholder="<?php _e( '.my-class, #button2', 'popup-maker' ); ?>" name="popup_click_open_extra_selectors" id="popup_click_open_extra_selectors" value="<?php esc_attr_e( popmake_get_popup_click_open( $popup_id, 'extra_selectors' ) ); ?>"/>
25
-
26
- <p class="description"><?php _e( 'This allows custom css classes, ids or selector strings to trigger the popup when clicked. Seperate multiple selectors using commas.', 'popup-maker' ); ?></p>
27
- </td>
28
- </tr><?php
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/popups/metabox-targeting-condition-fields.php DELETED
@@ -1,261 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- /**
9
- * Renders popup load settings fields
10
- * @since 1.0
11
- *
12
- * @param $post_id
13
- */
14
-
15
- if ( ! function_exists( 'get_term_name' ) ) {
16
- function get_term_name( $term_id, $taxonomy ) {
17
- $term = get_term_by( 'id', absint( $term_id ), $taxonomy );
18
-
19
- return $term->name;
20
- }
21
- }
22
-
23
-
24
- add_action( 'popmake_popup_targeting_condition_meta_box_fields', 'popmake_popup_targeting_condition_meta_box_fields', 10 );
25
- function popmake_popup_targeting_condition_meta_box_fields( $popup_id ) {
26
- $targeting_condition = popmake_get_popup_targeting_condition( $popup_id );
27
- /**
28
- * Create nonce used for post type and taxonomy ajax searches. Copied from wp-admin/includes/nav-menu.php
29
- */
30
- wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' );
31
-
32
- /**
33
- * Render Load on entire site toggle.
34
- */ ?>
35
- <div id="targeting_condition-on_entire_site" class="targeting_condition form-table">
36
- <input type="checkbox"
37
- id="popup_targeting_condition_on_entire_site"
38
- name="popup_targeting_condition_on_entire_site"
39
- value="true"
40
- <?php if ( ! empty( $targeting_condition['on_entire_site'] ) ) {
41
- echo 'checked="checked" ';
42
- } ?>
43
- />
44
- <label for="popup_targeting_condition_on_entire_site"><?php _e( 'On Entire Site', 'popup-maker' ); ?></label>
45
-
46
- <div class="options">
47
- <?php do_action( "popmake_popup_targeting_condition_on_entire_site_options", $targeting_condition ); ?>
48
- </div>
49
- </div>
50
- <div id="targeting_condition-on_home" class="targeting_condition form-table">
51
- <input type="checkbox"
52
- id="popup_targeting_condition_on_home"
53
- name="popup_targeting_condition_on_home"
54
- value="true"
55
- <?php if ( ! empty( $targeting_condition['on_home'] ) ) {
56
- echo 'checked="checked" ';
57
- } ?>
58
- />
59
- <label for="popup_targeting_condition_on_home"><?php _e( 'On Home Page', 'popup-maker' ); ?></label>
60
-
61
- <div class="options">
62
- <?php do_action( "popmake_popup_targeting_condition_on_home_options", $targeting_condition ); ?>
63
- </div>
64
- </div>
65
- <div id="targeting_condition-exclude_on_home" class="targeting_condition form-table">
66
- <input type="checkbox"
67
- id="popup_targeting_condition_exclude_on_home"
68
- name="popup_targeting_condition_exclude_on_home"
69
- value="true"
70
- <?php if ( ! empty( $targeting_condition['exclude_on_home'] ) ) {
71
- echo 'checked="checked" ';
72
- } ?>
73
- />
74
- <label for="popup_targeting_condition_exclude_on_home"><?php _e( 'Exclude on Home Page', 'popup-maker' ); ?></label>
75
-
76
- <div class="options">
77
- <?php do_action( "popmake_popup_targeting_condition_exclude_on_home_options", $targeting_condition ); ?>
78
- </div>
79
- </div>
80
- <div id="targeting_condition-on_blog" class="targeting_condition form-table">
81
- <input type="checkbox"
82
- id="popup_targeting_condition_on_blog"
83
- name="popup_targeting_condition_on_blog"
84
- value="true"
85
- <?php if ( ! empty( $targeting_condition['on_blog'] ) ) {
86
- echo 'checked="checked" ';
87
- } ?>
88
- />
89
- <label for="popup_targeting_condition_on_blog"><?php _e( 'On Blog Index', 'popup-maker' ); ?></label>
90
-
91
- <div class="options">
92
- <?php do_action( "popmake_popup_targeting_condition_on_blog_options", $targeting_condition ); ?>
93
- </div>
94
- </div>
95
- <div id="targeting_condition-exclude_on_blog" class="targeting_condition form-table">
96
- <input type="checkbox"
97
- id="popup_targeting_condition_exclude_on_blog"
98
- name="popup_targeting_condition_exclude_on_blog"
99
- value="true"
100
- <?php if ( ! empty( $targeting_condition['exclude_on_blog'] ) ) {
101
- echo 'checked="checked" ';
102
- } ?>
103
- />
104
- <label for="popup_targeting_condition_exclude_on_blog"><?php _e( 'Exclude on Blog Index', 'popup-maker' ); ?></label>
105
-
106
- <div class="options">
107
- <?php do_action( "popmake_popup_targeting_condition_exclude_on_blog_options", $targeting_condition ); ?>
108
- </div>
109
- </div><?php
110
-
111
- do_action( 'popmake_before_post_type_targeting_conditions', $targeting_condition );
112
-
113
- $includes = popmake_get_popup_targeting_condition_includes( $popup_id );
114
- $excludes = popmake_get_popup_targeting_condition_excludes( $popup_id );
115
-
116
- foreach ( popmake_get_supported_types() as $pt ) {
117
- $is_post_type = get_post_type_object( $pt );
118
- $labels = $is_post_type ? $is_post_type : get_taxonomy( $pt );
119
- if ( ! $labels ) {
120
- continue;
121
- }
122
- $plural = esc_attr( strtolower( $labels->labels->name ) );
123
-
124
- foreach ( array( 'include', 'exclude' ) as $include_exclude ) {
125
- $key = ( $include_exclude != 'include' ? 'exclude_' : '' ) . "on_{$pt}s";
126
- $current = $include_exclude == 'include' ?
127
- ( ! empty( $includes[ $pt ] ) ? $includes[ $pt ] : array() ) :
128
- ( ! empty( $excludes[ $pt ] ) ? $excludes[ $pt ] : array() ); ?>
129
- <div id="targeting_condition-<?php echo $key; ?>" class="targeting_condition form-table">
130
- <input type="checkbox"
131
- id="popup_targeting_condition_<?php echo $key; ?>"
132
- name="popup_targeting_condition_<?php echo $key; ?>"
133
- value="true"
134
- <?php if ( ! empty( $targeting_condition[ $key ] ) ) {
135
- echo 'checked="checked" ';
136
- } ?>
137
- /><?php
138
- $label = ( $include_exclude != 'include' ? 'Exclude ' : '' ) . 'On '; ?>
139
- <label for="popup_targeting_condition_<?php echo $key; ?>"><?php echo __( $label, 'popup-maker' ) . $labels->labels->name; ?></label>
140
-
141
- <div class="options">
142
- <p style="margin:0;"><?php
143
- $key = ( $include_exclude != 'include' ? 'exclude_' : '' ) . "on_specific_{$pt}s"; ?>
144
- <input type="checkbox" style="display:none" name="popup_targeting_condition_<?php echo $key; ?>" value="true" <?php if ( isset( $targeting_condition[ $key ] ) ) {
145
- echo 'checked';
146
- } ?>/>
147
- <label><?php
148
- $label = ( $include_exclude == 'include' ? 'Load' : 'Exclude' ) . ' on All ';
149
- echo __( $label, 'popup-maker' ) . $labels->labels->name; ?>
150
- <input type="radio"
151
- name="<?php echo $key; ?>"
152
- id="popup_targeting_condition_<?php echo $key; ?>"
153
- value=""
154
- <?php if ( ! isset( $targeting_condition[ $key ] ) ) {
155
- echo 'checked';
156
- } ?>
157
- />
158
- </label><br/>
159
- <label><?php
160
- $label = ( $include_exclude == 'include' ? 'Load' : 'Exclude' ) . ' on Specific ';
161
- echo __( $label, 'popup-maker' ) . $labels->labels->name; ?>
162
- <input type="radio"
163
- name="<?php echo $key; ?>"
164
- id="popup_targeting_condition_<?php echo $key; ?>"
165
- value="true"
166
- <?php if ( isset( $targeting_condition[ $key ] ) ) {
167
- echo 'checked';
168
- } ?>
169
- />
170
- </label>
171
- </p>
172
-
173
- <div id="<?php echo $key; ?>">
174
- <div class="nojs-tags hide-if-js">
175
- <textarea
176
- name="popup_targeting_condition_<?php echo $include_exclude == 'exclude' ? 'exclude_' : ''; ?>on_<?php echo $pt; ?>"
177
- rows="3" cols="20"
178
- id="popup_targeting_condition_<?php echo $include_exclude == 'exclude' ? 'exclude_' : ''; ?>on_<?php echo $pt; ?>"
179
- ><?php esc_html_e( trim( implode( ',', $current ) ) ); ?></textarea>
180
- </div>
181
- <div class="hide-if-no-js"><?php
182
- if ( $is_post_type ) {
183
- popmake_post_type_item_metabox( $pt );
184
- } else {
185
- popmake_taxonomy_item_metabox( $pt );
186
- } ?>
187
- <div class="tagchecklist"><?php
188
- foreach ( $current as $post_id ) { ?>
189
- <span><a class="ntdelbutton" data-id="<?php echo $post_id; ?>">X</a>
190
- <?php echo $is_post_type ? get_the_title( $post_id ) : get_term_name( $post_id, $pt ); ?>
191
- </span><?php
192
- } ?>
193
- </div>
194
- </div>
195
- <hr/>
196
- </div>
197
- </div>
198
- </div><?php
199
- }
200
- } ?>
201
- <div id="targeting_condition-on_search" class="targeting_condition form-table">
202
- <input type="checkbox"
203
- id="popup_targeting_condition_on_search"
204
- name="popup_targeting_condition_on_search"
205
- value="true"
206
- <?php if ( ! empty( $targeting_condition['on_search'] ) ) {
207
- echo 'checked="checked" ';
208
- } ?>
209
- />
210
- <label for="popup_targeting_condition_on_search"><?php _e( 'On Search Pages', 'popup-maker' ); ?></label>
211
-
212
- <div class="options">
213
- <?php do_action( "popmake_popup_targeting_condition_on_search_options", $targeting_condition ); ?>
214
- </div>
215
- </div>
216
- <div id="targeting_condition-exclude_on_search" class="targeting_condition form-table">
217
- <input type="checkbox"
218
- id="popup_targeting_condition_exclude_on_search"
219
- name="popup_targeting_condition_exclude_on_search"
220
- value="true"
221
- <?php if ( ! empty( $targeting_condition['exclude_on_search'] ) ) {
222
- echo 'checked="checked" ';
223
- } ?>
224
- />
225
- <label for="popup_targeting_condition_exclude_on_search"><?php _e( 'Exclude on Search Pages', 'popup-maker' ); ?></label>
226
-
227
- <div class="options">
228
- <?php do_action( "popmake_popup_targeting_condition_exclude_on_search_options", $targeting_condition ); ?>
229
- </div>
230
- </div>
231
- <div id="targeting_condition-on_404" class="targeting_condition form-table">
232
- <input type="checkbox"
233
- id="popup_targeting_condition_on_404"
234
- name="popup_targeting_condition_on_404"
235
- value="true"
236
- <?php if ( ! empty( $targeting_condition['on_404'] ) ) {
237
- echo 'checked="checked" ';
238
- } ?>
239
- />
240
- <label for="popup_targeting_condition_on_404"><?php _e( 'On 404 Pages', 'popup-maker' ); ?></label>
241
-
242
- <div class="options">
243
- <?php do_action( "popmake_popup_targeting_condition_on_404_options", $targeting_condition ); ?>
244
- </div>
245
- </div>
246
- <div id="targeting_condition-exclude_on_404" class="targeting_condition form-table">
247
- <input type="checkbox"
248
- id="popup_targeting_condition_exclude_on_404"
249
- name="popup_targeting_condition_exclude_on_404"
250
- value="true"
251
- <?php if ( ! empty( $targeting_condition['exclude_on_404'] ) ) {
252
- echo 'checked="checked" ';
253
- } ?>
254
- />
255
- <label for="popup_targeting_condition_exclude_on_404"><?php _e( 'Exclude on 404 Pages', 'popup-maker' ); ?></label>
256
-
257
- <div class="options">
258
- <?php do_action( "popmake_popup_targeting_condition_exclude_on_404_options", $targeting_condition ); ?>
259
- </div>
260
- </div><?php
261
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/popups/post-type-item-metaboxes.php DELETED
@@ -1,499 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- /**
9
- * Displays a metabox for a post type menu item.
10
- *
11
- * @since 1.0.0
12
- *
13
- * @param string $object Not used.
14
- * @param string $post_type The post type object.
15
- */
16
- function popmake_post_type_item_metabox( $post_type_name ) {
17
- if ( ! function_exists( 'wp_nav_menu_item_post_type_meta_box' ) ) {
18
- include ABSPATH . 'wp-admin/includes/nav-menu.php';
19
- }
20
- global $_nav_menu_placeholder, $nav_menu_selected_id;
21
-
22
- $post_type = get_post_type_object( $post_type_name );
23
-
24
-
25
- // Paginate browsing for large numbers of post objects.
26
- $per_page = 50;
27
- $pagenum = isset( $_REQUEST[ $post_type_name . '-tab' ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
28
- $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
29
-
30
- $args = array(
31
- 'offset' => $offset,
32
- 'order' => 'ASC',
33
- 'orderby' => 'title',
34
- 'posts_per_page' => $per_page,
35
- 'post_type' => $post_type_name,
36
- 'suppress_filters' => true,
37
- 'update_post_term_cache' => false,
38
- 'update_post_meta_cache' => false
39
- );
40
-
41
- if ( isset( $post_type->_default_query ) ) {
42
- $args = array_merge( $args, (array) $post_type->_default_query );
43
- }
44
-
45
- // @todo transient caching of these results with proper invalidation on updating of a post of this type
46
- $get_posts = new WP_Query;
47
- $posts = $get_posts->query( $args );
48
- if ( ! $get_posts->post_count ) {
49
- echo '<p>' . __( 'No items.' ) . '</p>';
50
-
51
- return;
52
- }
53
-
54
- $num_pages = $get_posts->max_num_pages;
55
-
56
- $page_links = paginate_links( array(
57
- 'base' => add_query_arg(
58
- array(
59
- $post_type_name . '-tab' => 'all',
60
- 'paged' => '%#%',
61
- 'item-type' => 'post_type',
62
- 'item-object' => $post_type_name,
63
- )
64
- ),
65
- 'format' => '',
66
- 'prev_text' => __( '&laquo;' ),
67
- 'next_text' => __( '&raquo;' ),
68
- 'total' => $num_pages,
69
- 'current' => $pagenum
70
- ) );
71
-
72
- $db_fields = false;
73
- if ( is_post_type_hierarchical( $post_type_name ) ) {
74
- $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
75
- }
76
-
77
- $walker = new Walker_Nav_Menu_Checklist( $db_fields );
78
-
79
- $current_tab = 'most-recent';
80
- if ( isset( $_REQUEST[ $post_type_name . '-tab' ] ) && in_array( $_REQUEST[ $post_type_name . '-tab' ], array(
81
- 'all',
82
- 'search'
83
- ) )
84
- ) {
85
- $current_tab = $_REQUEST[ $post_type_name . '-tab' ];
86
- }
87
-
88
- if ( ! empty( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {
89
- $current_tab = 'search';
90
- }
91
-
92
- $removed_args = array(
93
- 'action',
94
- 'customlink-tab',
95
- 'edit-menu-item',
96
- 'menu-item',
97
- 'page-tab',
98
- '_wpnonce',
99
- );
100
-
101
- ?>
102
- <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
103
- <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs category-tabs add-menu-item-tabs">
104
- <li <?php echo( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
105
- <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php if ( $nav_menu_selected_id ) {
106
- echo esc_url( add_query_arg( $post_type_name . '-tab', 'most-recent', remove_query_arg( $removed_args ) ) );
107
- } ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
108
- <?php _e( 'Most Recent' ); ?>
109
- </a>
110
- </li>
111
- <li <?php echo( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
112
- <a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) {
113
- echo esc_url( add_query_arg( $post_type_name . '-tab', 'all', remove_query_arg( $removed_args ) ) );
114
- } ?>#<?php echo $post_type_name; ?>-all">
115
- <?php _e( 'View All' ); ?>
116
- </a>
117
- </li>
118
- <li <?php echo( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
119
- <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php if ( $nav_menu_selected_id ) {
120
- echo esc_url( add_query_arg( $post_type_name . '-tab', 'search', remove_query_arg( $removed_args ) ) );
121
- } ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
122
- <?php _e( 'Search' ); ?>
123
- </a>
124
- </li>
125
- </ul>
126
- <!-- .posttype-tabs -->
127
-
128
- <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
129
- echo( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
130
- ?>">
131
- <ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
132
- <?php
133
- $recent_args = array_merge( $args, array(
134
- 'orderby' => 'post_date',
135
- 'order' => 'DESC',
136
- 'posts_per_page' => 15
137
- ) );
138
- $most_recent = $get_posts->query( $recent_args );
139
- $args['walker'] = $walker;
140
- echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $most_recent ), 0, (object) $args );
141
- ?>
142
- </ul>
143
- </div>
144
- <!-- /.tabs-panel -->
145
-
146
- <div class="tabs-panel <?php
147
- echo( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
148
- ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
149
- <?php
150
- if ( isset( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {
151
- $searched = esc_attr( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] );
152
- $search_results = get_posts( array(
153
- 's' => $searched,
154
- 'post_type' => $post_type_name,
155
- 'fields' => 'all',
156
- 'order' => 'DESC',
157
- ) );
158
- } else {
159
- $searched = '';
160
- $search_results = array();
161
- }
162
- ?>
163
- <p class="quick-search-wrap">
164
- <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e( 'Search' ); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>"/>
165
- <span class="spinner"></span>
166
- <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?>
167
- </p>
168
-
169
- <ul id="<?php echo $post_type_name; ?>-search-checklist" data-wp-lists="list:<?php echo $post_type_name ?>" class="categorychecklist form-no-clear">
170
- <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
171
- <?php
172
- $args['walker'] = $walker;
173
- echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $search_results ), 0, (object) $args );
174
- ?>
175
- <?php elseif ( is_wp_error( $search_results ) ) : ?>
176
- <li><?php echo $search_results->get_error_message(); ?></li>
177
- <?php elseif ( ! empty( $searched ) ) : ?>
178
- <li><?php _e( 'No results found.' ); ?></li>
179
- <?php endif; ?>
180
- </ul>
181
- </div>
182
- <!-- /.tabs-panel -->
183
-
184
- <div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
185
- echo( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
186
- ?>">
187
- <?php if ( ! empty( $page_links ) ) : ?>
188
- <div class="add-menu-item-pagelinks">
189
- <?php echo $page_links; ?>
190
- </div>
191
- <?php endif; ?>
192
- <ul id="<?php echo $post_type_name; ?>checklist" data-wp-lists="list:<?php echo $post_type_name ?>" class="categorychecklist form-no-clear">
193
- <?php
194
- $args['walker'] = $walker;
195
-
196
- /*
197
- * If we're dealing with pages, let's put a checkbox for the front
198
- * page at the top of the list.
199
- */
200
- if ( 'page' == $post_type_name ) {
201
- $front_page = 'page' == get_option( 'show_on_front' ) ? (int) get_option( 'page_on_front' ) : 0;
202
- if ( ! empty( $front_page ) ) {
203
- $front_page_obj = get_post( $front_page );
204
- $front_page_obj->front_or_home = true;
205
- array_unshift( $posts, $front_page_obj );
206
- } else {
207
- $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : - 1;
208
- array_unshift( $posts, (object) array(
209
- 'front_or_home' => true,
210
- 'ID' => 0,
211
- 'object_id' => $_nav_menu_placeholder,
212
- 'post_content' => '',
213
- 'post_excerpt' => '',
214
- 'post_parent' => '',
215
- 'post_title' => _x( 'Home', 'nav menu home label' ),
216
- 'post_type' => 'nav_menu_item',
217
- 'type' => 'custom',
218
- 'url' => home_url( '/' ),
219
- ) );
220
- }
221
- }
222
-
223
- /**
224
- * Filter the posts displayed in the 'View All' tab of the current
225
- * post type's menu items meta box.
226
- *
227
- * The dynamic portion of the hook name, $post_type_name,
228
- * refers to the slug of the current post type.
229
- *
230
- * @since 3.2.0
231
- *
232
- * @see WP_Query::query()
233
- *
234
- * @param array $posts The posts for the current post type.
235
- * @param array $args An array of WP_Query arguments.
236
- * @param object $post_type The current post type object for this menu item meta box.
237
- */
238
- $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type );
239
- $checkbox_items = walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $posts ), 0, (object) $args );
240
-
241
- if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
242
- $checkbox_items = preg_replace( '/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items );
243
-
244
- }
245
-
246
- echo $checkbox_items;
247
- ?>
248
- </ul>
249
- <?php if ( ! empty( $page_links ) ) : ?>
250
- <div class="add-menu-item-pagelinks">
251
- <?php echo $page_links; ?>
252
- </div>
253
- <?php endif; ?>
254
- </div>
255
- <!-- /.tabs-panel -->
256
-
257
- <p class="button-controls">
258
- <span class="list-controls">
259
- <a href="<?php
260
- echo esc_url( add_query_arg(
261
- array(
262
- $post_type_name . '-tab' => 'all',
263
- 'selectall' => 1,
264
- ),
265
- remove_query_arg( $removed_args )
266
- ) );
267
- ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e( 'Select All' ); ?></a>
268
- </span>
269
-
270
- <span class="add-to-list">
271
- <button type="button" <?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" id="<?php echo esc_attr( 'submit-posttype-' . $post_type_name ); ?>"><?php esc_attr_e( 'Add Selected' ); ?></button>
272
- <span class="spinner"></span>
273
- </span>
274
- </p>
275
-
276
- </div><!-- /.posttypediv -->
277
- <?php
278
- }
279
-
280
- /**
281
- * Displays a metabox for a taxonomy menu item.
282
- *
283
- * @since 1.0.0
284
- *
285
- * @param string $taxonomy The taxonomy object.
286
- */
287
- function popmake_taxonomy_item_metabox( $taxonomy_name ) {
288
- if ( ! function_exists( 'wp_nav_menu_item_post_type_meta_box' ) ) {
289
- include ABSPATH . 'wp-admin/includes/nav-menu.php';
290
- }
291
- global $nav_menu_selected_id;
292
-
293
- $taxonomy = get_taxonomy( $taxonomy_name );
294
-
295
- // Paginate browsing for large numbers of objects.
296
- $per_page = 50;
297
- $pagenum = isset( $_REQUEST[ $taxonomy_name . '-tab' ] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1;
298
- $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0;
299
-
300
- $args = array(
301
- 'child_of' => 0,
302
- 'exclude' => '',
303
- 'hide_empty' => false,
304
- 'hierarchical' => 1,
305
- 'include' => '',
306
- 'number' => $per_page,
307
- 'offset' => $offset,
308
- 'order' => 'ASC',
309
- 'orderby' => 'name',
310
- 'pad_counts' => false,
311
- );
312
-
313
- $terms = get_terms( $taxonomy_name, $args );
314
-
315
- if ( ! $terms || is_wp_error( $terms ) ) {
316
- echo '<p>' . __( 'No items.' ) . '</p>';
317
-
318
- return;
319
- }
320
-
321
- $num_pages = ceil( wp_count_terms( $taxonomy_name, array_merge( $args, array(
322
- 'number' => '',
323
- 'offset' => ''
324
- ) ) ) / $per_page );
325
-
326
- $page_links = paginate_links( array(
327
- 'base' => add_query_arg(
328
- array(
329
- $taxonomy_name . '-tab' => 'all',
330
- 'paged' => '%#%',
331
- 'item-type' => 'taxonomy',
332
- 'item-object' => $taxonomy_name,
333
- )
334
- ),
335
- 'format' => '',
336
- 'prev_text' => __( '&laquo;' ),
337
- 'next_text' => __( '&raquo;' ),
338
- 'total' => $num_pages,
339
- 'current' => $pagenum
340
- ) );
341
-
342
- $db_fields = false;
343
- if ( is_taxonomy_hierarchical( $taxonomy_name ) ) {
344
- $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' );
345
- }
346
-
347
- $walker = new Walker_Nav_Menu_Checklist( $db_fields );
348
-
349
- $current_tab = 'most-used';
350
- if ( isset( $_REQUEST[ $taxonomy_name . '-tab' ] ) && in_array( $_REQUEST[ $taxonomy_name . '-tab' ], array(
351
- 'all',
352
- 'most-used',
353
- 'search'
354
- ) )
355
- ) {
356
- $current_tab = $_REQUEST[ $taxonomy_name . '-tab' ];
357
- }
358
-
359
- if ( ! empty( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
360
- $current_tab = 'search';
361
- }
362
-
363
- $removed_args = array(
364
- 'action',
365
- 'customlink-tab',
366
- 'edit-menu-item',
367
- 'menu-item',
368
- 'page-tab',
369
- '_wpnonce',
370
- );
371
-
372
- ?>
373
- <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
374
- <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
375
- <li <?php echo( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
376
- <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php if ( $nav_menu_selected_id ) {
377
- echo esc_url( add_query_arg( $taxonomy_name . '-tab', 'most-used', remove_query_arg( $removed_args ) ) );
378
- } ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
379
- <?php _e( 'Most Used' ); ?>
380
- </a>
381
- </li>
382
- <li <?php echo( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
383
- <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) {
384
- echo esc_url( add_query_arg( $taxonomy_name . '-tab', 'all', remove_query_arg( $removed_args ) ) );
385
- } ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all">
386
- <?php _e( 'View All' ); ?>
387
- </a>
388
- </li>
389
- <li <?php echo( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
390
- <a class="nav-tab-link" data-type="tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>" href="<?php if ( $nav_menu_selected_id ) {
391
- echo esc_url( add_query_arg( $taxonomy_name . '-tab', 'search', remove_query_arg( $removed_args ) ) );
392
- } ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
393
- <?php _e( 'Search' ); ?>
394
- </a>
395
- </li>
396
- </ul>
397
- <!-- .taxonomy-tabs -->
398
-
399
- <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
400
- echo( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
401
- ?>">
402
- <ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear">
403
- <?php
404
- $popular_terms = get_terms( $taxonomy_name, array(
405
- 'orderby' => 'count',
406
- 'order' => 'DESC',
407
- 'number' => 10,
408
- 'hierarchical' => false
409
- ) );
410
- $args['walker'] = $walker;
411
- echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $popular_terms ), 0, (object) $args );
412
- ?>
413
- </ul>
414
- </div>
415
- <!-- /.tabs-panel -->
416
-
417
- <div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php
418
- echo( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
419
- ?>">
420
- <?php if ( ! empty( $page_links ) ) : ?>
421
- <div class="add-menu-item-pagelinks">
422
- <?php echo $page_links; ?>
423
- </div>
424
- <?php endif; ?>
425
- <ul id="<?php echo $taxonomy_name; ?>checklist" data-wp-lists="list:<?php echo $taxonomy_name ?>" class="categorychecklist form-no-clear">
426
- <?php
427
- $args['walker'] = $walker;
428
- echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $terms ), 0, (object) $args );
429
- ?>
430
- </ul>
431
- <?php if ( ! empty( $page_links ) ) : ?>
432
- <div class="add-menu-item-pagelinks">
433
- <?php echo $page_links; ?>
434
- </div>
435
- <?php endif; ?>
436
- </div>
437
- <!-- /.tabs-panel -->
438
-
439
- <div class="tabs-panel <?php
440
- echo( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
441
- ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
442
- <?php
443
- if ( isset( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
444
- $searched = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] );
445
- $search_results = get_terms( $taxonomy_name, array(
446
- 'name__like' => $searched,
447
- 'fields' => 'all',
448
- 'orderby' => 'count',
449
- 'order' => 'DESC',
450
- 'hierarchical' => false
451
- ) );
452
- } else {
453
- $searched = '';
454
- $search_results = array();
455
- }
456
- ?>
457
- <p class="quick-search-wrap">
458
- <input type="search" class="quick-search input-with-default-title" title="<?php esc_attr_e( 'Search' ); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>"/>
459
- <span class="spinner"></span>
460
- <?php submit_button( __( 'Search' ), 'button-small quick-search-submit button-secondary hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-taxonomy-' . $taxonomy_name ) ); ?>
461
- </p>
462
-
463
- <ul id="<?php echo $taxonomy_name; ?>-search-checklist" data-wp-lists="list:<?php echo $taxonomy_name ?>" class="categorychecklist form-no-clear">
464
- <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?>
465
- <?php
466
- $args['walker'] = $walker;
467
- echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $search_results ), 0, (object) $args );
468
- ?>
469
- <?php elseif ( is_wp_error( $search_results ) ) : ?>
470
- <li><?php echo $search_results->get_error_message(); ?></li>
471
- <?php elseif ( ! empty( $searched ) ) : ?>
472
- <li><?php _e( 'No results found.' ); ?></li>
473
- <?php endif; ?>
474
- </ul>
475
- </div>
476
- <!-- /.tabs-panel -->
477
-
478
- <p class="button-controls">
479
- <span class="list-controls">
480
- <a href="<?php
481
- echo esc_url( add_query_arg(
482
- array(
483
- $taxonomy_name . '-tab' => 'all',
484
- 'selectall' => 1,
485
- ),
486
- remove_query_arg( $removed_args )
487
- ) );
488
- ?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e( 'Select All' ); ?></a>
489
- </span>
490
-
491
- <span class="add-to-menu">
492
- <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-taxonomy-menu-item" id="<?php echo esc_attr( 'submit-taxonomy-' . $taxonomy_name ); ?>"/>
493
- <span class="spinner"></span>
494
- </span>
495
- </p>
496
-
497
- </div><!-- /.taxonomydiv -->
498
- <?php
499
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/tracking.php DELETED
@@ -1,275 +0,0 @@
1
- <?php
2
- /**
3
- * Tracking functions for reporting plugin usage to the Popup Maker site for users that have opted in
4
- *
5
- * @package Popup Maker
6
- * @subpackage Admin
7
- * @copyright Copyright (c) 2015, Daniel Iser
8
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since 1.3.0
10
- */
11
-
12
- // Exit if accessed directly
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
-
18
- /**
19
- * Usage tracking
20
- *
21
- * @access public
22
- * @since 1.3.0
23
- * @return void
24
- */
25
- class Popmake_Tracking {
26
-
27
- /**
28
- * The data to send to the Popup Maker site
29
- *
30
- * @access private
31
- */
32
- private $data;
33
-
34
- /**
35
- * Get things going
36
- *
37
- * @access public
38
- */
39
- public function __construct() {
40
-
41
- $this->schedule_send();
42
-
43
- add_action( 'popmake_settings_general_sanitize', array( $this, 'check_for_settings_optin' ) );
44
- add_action( 'popmake_opt_into_tracking', array( $this, 'check_for_optin' ) );
45
- add_action( 'popmake_opt_out_of_tracking', array( $this, 'check_for_optout' ) );
46
- add_action( 'admin_notices', array( $this, 'admin_notice' ) );
47
-
48
- }
49
-
50
- /**
51
- * Check if the user has opted into tracking
52
- *
53
- * @access private
54
- * @return bool
55
- */
56
- private function tracking_allowed() {
57
- $allow_tracking = popmake_get_option( 'allow_tracking', false );
58
-
59
- return isset( $allow_tracking );
60
- }
61
-
62
- /**
63
- * Setup the data that is going to be tracked
64
- *
65
- * @access private
66
- * @return void
67
- */
68
- private function setup_data() {
69
- global $wpdb;
70
-
71
- $data = array();
72
-
73
- // Retrieve current theme info
74
- if ( get_bloginfo( 'version' ) < '3.4' ) {
75
- $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
76
- $theme = $theme_data['Name'] . ' ' . $theme_data['Version'];
77
- } else {
78
- $theme_data = wp_get_theme();
79
- $theme = $theme_data->Name . ' ' . $theme_data->Version;
80
- }
81
-
82
- $data['url'] = home_url();
83
- $data['wp_version'] = get_bloginfo( 'version' );
84
- $data['version'] = POPMAKE_VERSION;
85
- $data['theme'] = $theme;
86
- $data['email'] = get_bloginfo( 'admin_email' );
87
- $data["mysql_version"] = $wpdb->db_version();
88
- $data['php_version'] = PHP_VERSION;
89
-
90
- // Retrieve current plugin information
91
- if ( ! function_exists( 'get_plugins' ) ) {
92
- include ABSPATH . '/wp-admin/includes/plugin.php';
93
- }
94
-
95
- $plugins = array_keys( get_plugins() );
96
- $active_plugins = get_option( 'active_plugins', array() );
97
-
98
- foreach ( $plugins as $key => $plugin ) {
99
- if ( in_array( $plugin, $active_plugins ) ) {
100
- // Remove active plugins from list so we can show active and inactive separately
101
- unset( $plugins[ $key ] );
102
- }
103
- }
104
-
105
-
106
- $data['active_plugins'] = $active_plugins;
107
- $data['inactive_plugins'] = array_values( $plugins );
108
- $data['popups'] = wp_count_posts( 'popup' )->publish;
109
- $data['popup_themes'] = wp_count_posts( 'popup_theme' )->publish;
110
-
111
- $this->data = $data;
112
- }
113
-
114
- /**
115
- * Send the data to the Popup Maker server
116
- *
117
- * @access private
118
- *
119
- * @param bool $override
120
- */
121
- public function send_checkin( $override = false ) {
122
-
123
- if ( ! $this->tracking_allowed() && ! $override ) {
124
- return;
125
- }
126
-
127
- // Send a maximum of once per week
128
- $last_send = $this->get_last_send();
129
- if ( $last_send && $last_send > strtotime( '-1 week' ) ) {
130
- return;
131
- }
132
-
133
- $this->setup_data();
134
-
135
- wp_remote_post( 'https://wppopupmaker.com/?edd_action=checkin', array(
136
- 'method' => 'POST',
137
- 'timeout' => 20,
138
- 'redirection' => 5,
139
- 'httpversion' => '1.1',
140
- 'blocking' => true,
141
- 'body' => $this->data,
142
- 'user-agent' => 'POPMAKE/' . POPMAKE_VERSION . '; ' . get_bloginfo( 'url' )
143
- ) );
144
-
145
- update_option( 'popmake_tracking_last_send', time() );
146
-
147
- }
148
-
149
- /**
150
- * Check for a new opt-in on settings save
151
- *
152
- * This runs during the sanitation of General settings, thus the return
153
- *
154
- * @access public
155
- *
156
- * @param $input
157
- *
158
- * @return array
159
- */
160
- public function check_for_settings_optin( $input ) {
161
- // Send an initial check in on settings save
162
-
163
- if ( isset( $input['allow_tracking'] ) ) {
164
- $this->send_checkin( true );
165
- }
166
-
167
- return $input;
168
-
169
- }
170
-
171
- /**
172
- * Check for a new opt-in via the admin notice
173
- *
174
- * @access public
175
- * @return void
176
- */
177
- public function check_for_optin() {
178
-
179
- global $popmake_options;
180
-
181
- $popmake_options['allow_tracking'] = '1';
182
-
183
- update_option( 'popmake_settings', $popmake_options );
184
-
185
- $this->send_checkin( true );
186
-
187
- update_option( 'popmake_tracking_notice', '1' );
188
-
189
- }
190
-
191
- /**
192
- * Check for a new opt-in via the admin notice
193
- *
194
- * @access public
195
- * @return void
196
- */
197
- public function check_for_optout() {
198
-
199
- global $popmake_options;
200
- if ( isset( $popmake_options['allow_tracking'] ) ) {
201
- unset( $popmake_options['allow_tracking'] );
202
- update_option( 'popmake_settings', $popmake_options );
203
- }
204
-
205
- update_option( 'popmake_tracking_notice', '1' );
206
-
207
- wp_redirect( remove_query_arg( 'popmake_action' ) );
208
- exit;
209
-
210
- }
211
-
212
- /**
213
- * Get the last time a checkin was sent
214
- *
215
- * @access private
216
- * @return false|string
217
- */
218
- private function get_last_send() {
219
- return get_option( 'popmake_tracking_last_send' );
220
- }
221
-
222
- /**
223
- * Schedule a weekly checkin
224
- *
225
- * @access private
226
- * @return void
227
- */
228
- private function schedule_send() {
229
- // We send once a week (while tracking is allowed) to check in, which can be used to determine active sites
230
- add_action( 'popmake_weekly_scheduled_events', array( $this, 'send_checkin' ) );
231
- }
232
-
233
- /**
234
- * Display the admin notice to users that have not opted-in or out
235
- *
236
- * @access public
237
- * @return void
238
- */
239
- public function admin_notice() {
240
- $hide_notice = get_option( 'popmake_tracking_notice' );
241
-
242
- if ( $hide_notice ) {
243
- return;
244
- }
245
-
246
- if ( popmake_get_option( 'allow_tracking', false ) ) {
247
- return;
248
- }
249
-
250
- if ( ! current_user_can( 'manage_options' ) ) {
251
- return;
252
- }
253
-
254
- if (
255
- stristr( network_site_url( '/' ), 'dev' ) !== false ||
256
- stristr( network_site_url( '/' ), 'localhost' ) !== false ||
257
- stristr( network_site_url( '/' ), ':8888' ) !== false // This is common with MAMP on OS X
258
- ) {
259
- update_option( 'popmake_tracking_notice', '1' );
260
- } else {
261
- $optin_url = add_query_arg( 'popmake_action', 'opt_into_tracking' );
262
- $optout_url = add_query_arg( 'popmake_action', 'opt_out_of_tracking' );
263
-
264
- echo '<div class="updated"><p>';
265
- echo __( 'Allow Popup Maker to track plugin usage? Opt-in to tracking and our newsletter and we will immediately e-mail you a 20% discount which you can use on any of our extensions. No sensitive data is tracked.', 'popup-maker' );
266
- echo '</p><p>';
267
- echo '&nbsp;<a href="' . esc_url( $optin_url ) . '" class="button-primary">' . __( 'Allow tracking', 'popup-maker' ) . '</a>';
268
- echo '&nbsp;<a style="opacity:0.7;" href="' . esc_url( $optout_url ) . '" class="button-secondary">' . __( 'Do not allow tracking', 'popup-maker' ) . '</a>';
269
- echo '</p></div>';
270
- }
271
- }
272
-
273
- }
274
-
275
- $popmake_tracking = new Popmake_Tracking;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/upgrades/v1_3.php DELETED
@@ -1,129 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- class Popmake_Upgrade_v1_3 {
9
-
10
- public function __construct() {
11
- add_action( 'popmake_process_upgrade', array( $this, 'process' ), 10, 2 );
12
- }
13
-
14
- public function process( $new, $old ) {
15
-
16
- global $wpdb;
17
-
18
- // Return if upgrade is not needed.
19
- if ( ! version_compare( $old, '1.2.2', '<=' ) ) {
20
- return;
21
- }
22
-
23
- $this->process_popups();
24
- $this->process_popup_themes();
25
-
26
- }
27
-
28
- public function process_popups() {
29
-
30
- $popups = get_posts( array(
31
- 'post_type' => 'popup',
32
- 'post_status' => 'all',
33
- 'posts_per_page' => - 1,
34
- ) );
35
-
36
- $popup_groups = array(
37
- 'display' => popmake_popup_display_defaults(),
38
- 'close' => popmake_popup_close_defaults(),
39
- 'click_open' => popmake_popup_click_open_defaults(),
40
- 'auto_open' => popmake_popup_auto_open_defaults(),
41
- 'admin_debug' => popmake_popup_admin_debug_defaults()
42
- );
43
-
44
- foreach ( $popups as $popup ) {
45
-
46
- foreach ( $popup_groups as $group => $defaults ) {
47
- $values = array_merge( $defaults, popmake_get_popup_meta_group( $group, $popup->ID ) );
48
- update_post_meta( $popup->ID, "popup_{$group}", $values );
49
- }
50
-
51
- }
52
-
53
- }
54
-
55
- public function process_popup_themes() {
56
-
57
- $themes = get_posts( array(
58
- 'post_type' => 'popup_theme',
59
- 'post_status' => 'all',
60
- 'posts_per_page' => - 1,
61
- ) );
62
-
63
- $theme_groups = array(
64
- 'overlay' => popmake_popup_theme_overlay_defaults(),
65
- 'container' => popmake_popup_theme_container_defaults(),
66
- 'title' => popmake_popup_theme_title_defaults(),
67
- 'content' => popmake_popup_theme_content_defaults(),
68
- 'close' => popmake_popup_theme_close_defaults(),
69
- );
70
-
71
- foreach ( $themes as $theme ) {
72
-
73
- foreach ( $theme_groups as $group => $defaults ) {
74
- $values = array_merge( $defaults, popmake_get_popup_theme_meta_group( $group, $theme->ID ) );
75
- update_post_meta( $theme->ID, "popup_theme_{$group}", $values );
76
- }
77
-
78
- }
79
-
80
- }
81
-
82
- public function cleanup_old_data() {
83
- global $wpdb;
84
-
85
- $popup_groups = array(
86
- 'display',
87
- 'close',
88
- 'click_open',
89
- 'auto_open',
90
- 'admin_debug'
91
- );
92
-
93
- $popup_fields = array();
94
-
95
- foreach ( $popup_groups as $group ) {
96
- foreach ( apply_filters( 'popmake_popup_meta_field_group_' . $group, array() ) as $field ) {
97
- $popup_fields[] = 'popup_' . $group . '_' . $field;
98
- }
99
- }
100
-
101
- $popup_fields = implode( "','", $popup_fields );
102
-
103
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN('$popup_fields');" );
104
-
105
-
106
- $theme_groups = array(
107
- 'overlay',
108
- 'container',
109
- 'title',
110
- 'content',
111
- 'close',
112
- );
113
-
114
- $theme_fields = array();
115
-
116
- foreach ( $theme_groups as $group ) {
117
- foreach ( apply_filters( 'popmake_popup_theme_meta_field_group_' . $group, array() ) as $field ) {
118
- $theme_fields[] = 'popup_theme_' . $group . '_' . $field;
119
- }
120
- }
121
-
122
- $theme_fields = implode( "','", $theme_fields );
123
-
124
- $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN('$theme_fields');" );
125
-
126
- }
127
- }
128
-
129
- new Popmake_Upgrade_v1_3();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/integrations/class-popmake-woocommerce-integration.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
 
3
  // Exit if accessed directly
4
  if ( ! defined( 'ABSPATH' ) ) {
1
+ <?php
2
 
3
  // Exit if accessed directly
4
  if ( ! defined( 'ABSPATH' ) ) {
includes/integrations/woocommerce.php DELETED
@@ -1,131 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- final class Popmake_Woocommerce_Integration {
9
- public function __construct() {
10
- add_action( 'popmake_before_post_type_targeting_conditions', array( $this, 'targeting_conditions' ) );
11
- add_filter( 'popmake_supported_post_types', array( $this, 'post_types' ) );
12
- add_filter( 'popmake_supported_taxonomies', array( $this, 'taxonomies' ) );
13
- add_filter( 'popmake_popup_meta_fields', array( $this, 'popup_meta_fields' ) );
14
- add_filter( 'popmake_popup_is_loadable', array( $this, 'popup_is_loadable' ), 10, 4 );
15
- }
16
-
17
- public function targeting_conditions( $targeting_condition ) { ?>
18
- <div id="targeting_condition-on_woocommerce" class="targeting_condition form-table">
19
- <input type="checkbox"
20
- id="popup_targeting_condition_on_woocommerce"
21
- name="popup_targeting_condition_on_woocommerce"
22
- value="true"
23
- <?php if ( ! empty( $targeting_condition['on_woocommerce'] ) ) {
24
- echo 'checked="checked" ';
25
- } ?>
26
- />
27
- <label for="popup_targeting_condition_on_woocommerce"><?php _e( 'On All WooCommerce', 'popup-maker' ); ?></label>
28
-
29
- <div class="options">
30
- <?php do_action( "popmake_popup_targeting_condition_on_woocommerce_options", $targeting_condition ); ?>
31
- </div>
32
- </div>
33
- <div id="targeting_condition-exclude_on_woocommerce" class="targeting_condition form-table">
34
- <input type="checkbox"
35
- id="popup_targeting_condition_exclude_on_woocommerce"
36
- name="popup_targeting_condition_exclude_on_woocommerce"
37
- value="true"
38
- <?php if ( ! empty( $targeting_condition['exclude_on_woocommerce'] ) ) {
39
- echo 'checked="checked" ';
40
- } ?>
41
- />
42
- <label for="popup_targeting_condition_exclude_on_woocommerce"><?php _e( 'Exclude on All WooCommerce', 'popup-maker' ); ?></label>
43
-
44
- <div class="options">
45
- <?php do_action( "popmake_popup_targeting_condition_exclude_on_woocommerce_options", $targeting_condition ); ?>
46
- </div>
47
- </div>
48
- <div id="targeting_condition-on_shop" class="targeting_condition form-table">
49
- <input type="checkbox"
50
- id="popup_targeting_condition_on_shop"
51
- name="popup_targeting_condition_on_shop"
52
- value="true"
53
- <?php if ( ! empty( $targeting_condition['on_shop'] ) ) {
54
- echo 'checked="checked" ';
55
- } ?>
56
- />
57
- <label for="popup_targeting_condition_on_shop"><?php _e( 'On Shop Page', 'popup-maker' ); ?></label>
58
-
59
- <div class="options">
60
- <?php do_action( "popmake_popup_targeting_condition_on_shop_options", $targeting_condition ); ?>
61
- </div>
62
- </div>
63
- <div id="targeting_condition-exclude_on_shop" class="targeting_condition form-table">
64
- <input type="checkbox"
65
- id="popup_targeting_condition_exclude_on_shop"
66
- name="popup_targeting_condition_exclude_on_shop"
67
- value="true"
68
- <?php if ( ! empty( $targeting_condition['exclude_on_shop'] ) ) {
69
- echo 'checked="checked" ';
70
- } ?>
71
- />
72
- <label for="popup_targeting_condition_exclude_on_shop"><?php _e( 'Exclude on Shop Page', 'popup-maker' ); ?></label>
73
-
74
- <div class="options">
75
- <?php do_action( "popmake_popup_targeting_condition_exclude_on_shop_options", $targeting_condition ); ?>
76
- </div>
77
- </div><?php
78
- }
79
-
80
- public function post_types( $post_types ) {
81
- return array_merge( $post_types, array(
82
- 'product'
83
- ) );
84
- }
85
-
86
- public function taxonomies( $taxonomies ) {
87
- return array_merge( $taxonomies, array(
88
- 'product_cat',
89
- 'product_tag'
90
- ) );
91
- }
92
-
93
- public function popup_meta_fields( $fields ) {
94
- return array_merge( $fields, array(
95
- 'popup_targeting_condition_on_woocommerce',
96
- 'popup_targeting_condition_exclude_on_woocommerce',
97
- 'popup_targeting_condition_on_shop',
98
- 'popup_targeting_condition_exclude_on_shop',
99
- ) );
100
- }
101
-
102
- public function popup_is_loadable( $is_loadable, $popup_id, $conditions, $sitewide ) {
103
-
104
- /**
105
- * WooCommerce Page Checks
106
- */
107
- if ( is_woocommerce() ) {
108
- if ( ! $sitewide && array_key_exists( 'on_woocommerce', $conditions ) ) {
109
- $is_loadable = true;
110
- } elseif ( $sitewide && array_key_exists( 'exclude_on_woocommerce', $conditions ) ) {
111
- $is_loadable = false;
112
- }
113
- }
114
-
115
- /**
116
- * Shop Page Checks
117
- */
118
- if ( is_shop() ) {
119
- if ( ! $sitewide && array_key_exists( 'on_shop', $conditions ) ) {
120
- $is_loadable = true;
121
- } elseif ( $sitewide && array_key_exists( 'exclude_on_shop', $conditions ) ) {
122
- $is_loadable = false;
123
- }
124
- }
125
-
126
- return $is_loadable;
127
- }
128
-
129
- }
130
-
131
- new Popmake_Woocommerce_Integration();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libraries/browser.php DELETED
@@ -1,1103 +0,0 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) exit;
5
-
6
- /**
7
- * Modified to remove var
8
- * Chris Christoff on 12/26/2012
9
- * Changes: Changes vars to publics
10
- *
11
- * Modified to work for EDD by
12
- * Chris Christoff on 12/23/2012
13
- * Changes: Removed the browser string return and added spacing. Also removed return HTML formatting.
14
- *
15
- * Modified to add formatted User Agent string for EDD System Info by
16
- * Chris Christoff on 12/23/2012
17
- * Changes: Split user string and add formatting so we can print a nicely
18
- * formatted user agent string on the EDD System Info
19
- *
20
- * File: Browser.php
21
- * Author: Chris Schuld (http://chrisschuld.com/)
22
- * Last Modified: August 20th, 2010
23
- *
24
- * @version 1.9
25
- * @package PegasusPHP
26
- *
27
- * Copyright (C) 2008-2010 Chris Schuld (chris@chrisschuld.com)
28
- *
29
- * This program is free software; you can redistribute it and/or
30
- * modify it under the terms of the GNU General Public License as
31
- * published by the Free Software Foundation; either version 2 of
32
- * the License, or (at your option) any later version.
33
- *
34
- * This program is distributed in the hope that it will be useful,
35
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
36
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37
- * GNU General Public License for more details at:
38
- * http://www.gnu.org/copyleft/gpl.html
39
- *
40
- *
41
- * Typical Usage:
42
- *
43
- * $browser = new Browser();
44
- * if( $browser->getBrowser() == Browser::BROWSER_FIREFOX && $browser->getVersion() >= 2 ) {
45
- * echo 'You have FireFox version 2 or greater';
46
- * }
47
- *
48
- * User Agents Sampled from: http://www.useragentstring.com/
49
- *
50
- * This implementation is based on the original work from Gary White
51
- * http://apptools.com/phptools/browser/
52
- *
53
- * UPDATES:
54
- *
55
- * 2010-08-20 (v1.9):
56
- * + Added MSN Explorer Browser (legacy)
57
- * + Added Bing/MSN Robot (Thanks Rob MacDonald)
58
- * + Added the Android Platform (PLATFORM_ANDROID)
59
- * + Fixed issue with Android 1.6/2.2 (Thanks Tom Hirashima)
60
- *
61
- * 2010-04-27 (v1.8):
62
- * + Added iPad Support
63
- *
64
- * 2010-03-07 (v1.7):
65
- * + *MAJOR* Rebuild (preg_match and other "slow" routine removal(s))
66
- * + Almost allof Gary's original code has been replaced
67
- * + Large PHPUNIT testing environment created to validate new releases and additions
68
- * + Added FreeBSD Platform
69
- * + Added OpenBSD Platform
70
- * + Added NetBSD Platform
71
- * + Added SunOS Platform
72
- * + Added OpenSolaris Platform
73
- * + Added support of the Iceweazel Browser
74
- * + Added isChromeFrame() call to check if chromeframe is in use
75
- * + Moved the Opera check in front of the Firefox check due to legacy Opera User Agents
76
- * + Added the __toString() method (Thanks Deano)
77
- *
78
- * 2009-11-15:
79
- * + Updated the checkes for Firefox
80
- * + Added the NOKIA platform
81
- * + Added Checks for the NOKIA brower(s)
82
- *
83
- * 2009-11-08:
84
- * + PHP 5.3 Support
85
- * + Added support for BlackBerry OS and BlackBerry browser
86
- * + Added support for the Opera Mini browser
87
- * + Added additional documenation
88
- * + Added support for isRobot() and isMobile()
89
- * + Added support for Opera version 10
90
- * + Added support for deprecated Netscape Navigator version 9
91
- * + Added support for IceCat
92
- * + Added support for Shiretoko
93
- *
94
- * 2010-04-27 (v1.8):
95
- * + Added iPad Support
96
- *
97
- * 2009-08-18:
98
- * + Updated to support PHP 5.3 - removed all deprecated function calls
99
- * + Updated to remove all double quotes (") -- converted to single quotes (')
100
- *
101
- * 2009-04-27:
102
- * + Updated the IE check to remove a typo and bug (thanks John)
103
- *
104
- * 2009-04-22:
105
- * + Added detection for GoogleBot
106
- * + Added detection for the W3C Validator.
107
- * + Added detection for Yahoo! Slurp
108
- *
109
- * 2009-03-14:
110
- * + Added detection for iPods.
111
- * + Added Platform detection for iPhones
112
- * + Added Platform detection for iPods
113
- *
114
- * 2009-02-16: (Rick Hale)
115
- * + Added version detection for Android phones.
116
- *
117
- * 2008-12-09:
118
- * + Removed unused constant
119
- *
120
- * 2008-11-07:
121
- * + Added Google's Chrome to the detection list
122
- * + Added isBrowser(string) to the list of functions special thanks to
123
- * Daniel 'mavrick' Lang for the function concept (http://mavrick.id.au)
124
- *
125
- *
126
- * Gary White noted: "Since browser detection is so unreliable, I am
127
- * no longer maintaining this script. You are free to use and or
128
- * modify/update it as you want, however the author assumes no
129
- * responsibility for the accuracy of the detected values."
130
- *
131
- * Anyone experienced with Gary's script might be interested in these notes:
132
- *
133
- * Added class constants
134
- * Added detection and version detection for Google's Chrome
135
- * Updated the version detection for Amaya
136
- * Updated the version detection for Firefox
137
- * Updated the version detection for Lynx
138
- * Updated the version detection for WebTV
139
- * Updated the version detection for NetPositive
140
- * Updated the version detection for IE
141
- * Updated the version detection for OmniWeb
142
- * Updated the version detection for iCab
143
- * Updated the version detection for Safari
144
- * Updated Safari to remove mobile devices (iPhone)
145
- * Added detection for iPhone
146
- * Added detection for robots
147
- * Added detection for mobile devices
148
- * Added detection for BlackBerry
149
- * Removed Netscape checks (matches heavily with firefox & mozilla)
150
- *
151
- */
152
-
153
- class Browser {
154
- public $_agent = '';
155
- public $_browser_name = '';
156
- public $_version = '';
157
- public $_platform = '';
158
- public $_os = '';
159
- public $_is_aol = false;
160
- public $_is_mobile = false;
161
- public $_is_robot = false;
162
- public $_aol_version = '';
163
-
164
- public $BROWSER_UNKNOWN = 'unknown';
165
- public $VERSION_UNKNOWN = 'unknown';
166
-
167
- public $BROWSER_OPERA = 'Opera'; // Http://www.opera.com/
168
- public $BROWSER_OPERA_MINI = 'Opera Mini'; // Http://www.opera.com/mini/
169
- public $BROWSER_WEBTV = 'WebTV'; // Http://www.webtv.net/pc/
170
- public $BROWSER_IE = 'Internet Explorer'; // Http://www.microsoft.com/ie/
171
- public $BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // Http://en.wikipedia.org/wiki/Internet_Explorer_Mobile
172
- public $BROWSER_KONQUEROR = 'Konqueror'; // Http://www.konqueror.org/
173
- public $BROWSER_ICAB = 'iCab'; // Http://www.icab.de/
174
- public $BROWSER_OMNIWEB = 'OmniWeb'; // Http://www.omnigroup.com/applications/omniweb/
175
- public $BROWSER_FIREBIRD = 'Firebird'; // Http://www.ibphoenix.com/
176
- public $BROWSER_FIREFOX = 'Firefox'; // Http://www.mozilla.com/en-US/firefox/firefox.html
177
- public $BROWSER_ICEWEASEL = 'Iceweasel'; // Http://www.geticeweasel.org/
178
- public $BROWSER_SHIRETOKO = 'Shiretoko'; // Http://wiki.mozilla.org/Projects/shiretoko
179
- public $BROWSER_MOZILLA = 'Mozilla'; // Http://www.mozilla.com/en-US/
180
- public $BROWSER_AMAYA = 'Amaya'; // Http://www.w3.org/Amaya/
181
- public $BROWSER_LYNX = 'Lynx'; // Http://en.wikipedia.org/wiki/Lynx
182
- public $BROWSER_SAFARI = 'Safari'; // Http://apple.com
183
- public $BROWSER_IPHONE = 'iPhone'; // Http://apple.com
184
- public $BROWSER_IPOD = 'iPod'; // Http://apple.com
185
- public $BROWSER_IPAD = 'iPad'; // Http://apple.com
186
- public $BROWSER_CHROME = 'Chrome'; // Http://www.google.com/chrome
187
- public $BROWSER_ANDROID = 'Android'; // Http://www.android.com/
188
- public $BROWSER_GOOGLEBOT = 'GoogleBot'; // Http://en.wikipedia.org/wiki/Googlebot
189
- public $BROWSER_SLURP = 'Yahoo! Slurp'; // Http://en.wikipedia.org/wiki/Yahoo!_Slurp
190
- public $BROWSER_W3CVALIDATOR = 'W3C Validator'; // Http://validator.w3.org/
191
- public $BROWSER_BLACKBERRY = 'BlackBerry'; // Http://www.blackberry.com/
192
- public $BROWSER_ICECAT = 'IceCat'; // Http://en.wikipedia.org/wiki/GNU_IceCat
193
- public $BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // Http://en.wikipedia.org/wiki/Web_Browser_for_S60
194
- public $BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform
195
- public $BROWSER_MSN = 'MSN Browser'; // Http://explorer.msn.com/
196
- public $BROWSER_MSNBOT = 'MSN Bot'; // Http://search.msn.com/msnbot.htm
197
- // Http://en.wikipedia.org/wiki/Msnbot (used for Bing as well)
198
-
199
- public $BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // Http://browser.netscape.com/ (DEPRECATED)
200
- public $BROWSER_GALEON = 'Galeon'; // Http://galeon.sourceforge.net/ (DEPRECATED)
201
- public $BROWSER_NETPOSITIVE = 'NetPositive'; // Http://en.wikipedia.org/wiki/NetPositive (DEPRECATED)
202
- public $BROWSER_PHOENIX = 'Phoenix'; // Http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED)
203
-
204
- public $PLATFORM_UNKNOWN = 'unknown';
205
- public $PLATFORM_WINDOWS = 'Windows';
206
- public $PLATFORM_WINDOWS_CE = 'Windows CE';
207
- public $PLATFORM_APPLE = 'Apple';
208
- public $PLATFORM_LINUX = 'Linux';
209
- public $PLATFORM_OS2 = 'OS/2';
210
- public $PLATFORM_BEOS = 'BeOS';
211
- public $PLATFORM_IPHONE = 'iPhone';
212
- public $PLATFORM_IPOD = 'iPod';
213
- public $PLATFORM_IPAD = 'iPad';
214
- public $PLATFORM_BLACKBERRY = 'BlackBerry';
215
- public $PLATFORM_NOKIA = 'Nokia';
216
- public $PLATFORM_FREEBSD = 'FreeBSD';
217
- public $PLATFORM_OPENBSD = 'OpenBSD';
218
- public $PLATFORM_NETBSD = 'NetBSD';
219
- public $PLATFORM_SUNOS = 'SunOS';
220
- public $PLATFORM_OPENSOLARIS = 'OpenSolaris';
221
- public $PLATFORM_ANDROID = 'Android';
222
-
223
- public $OPERATING_SYSTEM_UNKNOWN = 'unknown';
224
-
225
- function Browser( $useragent="" ) {
226
- $this->reset();
227
- if ( $useragent != "" ) {
228
- $this->setUserAgent( $useragent );
229
- } else {
230
- $this->determine();
231
- }
232
- }
233
-
234
- /**
235
- * Reset all properties
236
- */
237
- function reset() {
238
- $this->_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : "";
239
- $this->_browser_name = $this->BROWSER_UNKNOWN;
240
- $this->_version = $this->VERSION_UNKNOWN;
241
- $this->_platform = $this->PLATFORM_UNKNOWN;
242
- $this->_os = $this->OPERATING_SYSTEM_UNKNOWN;
243
- $this->_is_aol = false;
244
- $this->_is_mobile = false;
245
- $this->_is_robot = false;
246
- $this->_aol_version = $this->VERSION_UNKNOWN;
247
- }
248
-
249
- /**
250
- * Check to see if the specific browser is valid
251
- *
252
- * @param string $browserName
253
- * @return True if the browser is the specified browser
254
- */
255
- function isBrowser( $browserName ) { return 0 == strcasecmp( $this->_browser_name, trim( $browserName ) ); }
256
-
257
- /**
258
- * The name of the browser. All return types are from the class contants
259
- *
260
- * @return string Name of the browser
261
- */
262
- function getBrowser() { return $this->_browser_name; }
263
- /**
264
- * Set the name of the browser
265
- *
266
- * @param unknown $browser The name of the Browser
267
- */
268
- function setBrowser( $browser ) { return $this->_browser_name = $browser; }
269
- /**
270
- * The name of the platform. All return types are from the class contants
271
- *
272
- * @return string Name of the browser
273
- */
274
- function getPlatform() { return $this->_platform; }
275
- /**
276
- * Set the name of the platform
277
- *
278
- * @param unknown $platform The name of the Platform
279
- */
280
- function setPlatform( $platform ) { return $this->_platform = $platform; }
281
- /**
282
- * The version of the browser.
283
- *
284
- * @return string Version of the browser (will only contain alpha-numeric characters and a period)
285
- */
286
- function getVersion() { return $this->_version; }
287
- /**
288
- * Set the version of the browser
289
- *
290
- * @param unknown $version The version of the Browser
291
- */
292
- function setVersion( $version ) { $this->_version = preg_replace( '/[^0-9,.,a-z,A-Z-]/', '', $version ); }
293
- /**
294
- * The version of AOL.
295
- *
296
- * @return string Version of AOL (will only contain alpha-numeric characters and a period)
297
- */
298
- function getAolVersion() { return $this->_aol_version; }
299
- /**
300
- * Set the version of AOL
301
- *
302
- * @param unknown $version The version of AOL
303
- */
304
- function setAolVersion( $version ) { $this->_aol_version = preg_replace( '/[^0-9,.,a-z,A-Z]/', '', $version ); }
305
- /**
306
- * Is the browser from AOL?
307
- *
308
- * @return boolean True if the browser is from AOL otherwise false
309
- */
310
- function isAol() { return $this->_is_aol; }
311
- /**
312
- * Is the browser from a mobile device?
313
- *
314
- * @return boolean True if the browser is from a mobile device otherwise false
315
- */
316
- function isMobile() { return $this->_is_mobile; }
317
- /**
318
- * Is the browser from a robot (ex Slurp,GoogleBot)?
319
- *
320
- * @return boolean True if the browser is from a robot otherwise false
321
- */
322
- function isRobot() { return $this->_is_robot; }
323
- /**
324
- * Set the browser to be from AOL
325
- *
326
- * @param unknown $isAol
327
- */
328
- function setAol( $isAol ) { $this->_is_aol = $isAol; }
329
- /**
330
- * Set the Browser to be mobile
331
- *
332
- * @param boolean $value is the browser a mobile brower or not
333
- */
334
- function setMobile( $value=true ) { $this->_is_mobile = $value; }
335
- /**
336
- * Set the Browser to be a robot
337
- *
338
- * @param boolean $value is the browser a robot or not
339
- */
340
- function setRobot( $value=true ) { $this->_is_robot = $value; }
341
- /**
342
- * Get the user agent value in use to determine the browser
343
- *
344
- * @return string The user agent from the HTTP header
345
- */
346
- function getUserAgent() { return $this->_agent; }
347
- /**
348
- * Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
349
- *
350
- * @param unknown $agent_string The value for the User Agent
351
- */
352
- function setUserAgent( $agent_string ) {
353
- $this->reset();
354
- $this->_agent = $agent_string;
355
- $this->determine();
356
- }
357
- /**
358
- * Used to determine if the browser is actually "chromeframe"
359
- *
360
- * @since 1.7
361
- * @return boolean True if the browser is using chromeframe
362
- */
363
- function isChromeFrame() {
364
- return strpos( $this->_agent, "chromeframe" ) !== false;
365
- }
366
- /**
367
- * Returns a formatted string with a summary of the details of the browser.
368
- *
369
- * @return string formatted string with a summary of the browser
370
- */
371
- function __toString() {
372
- $text1 = $this->getUserAgent(); //grabs the UA (user agent) string
373
- $UAline1 = substr( $text1, 0, 32 ); //the first line we print should only be the first 32 characters of the UA string
374
- $text2 = $this->getUserAgent();//now we grab it again and save it to a string
375
- $towrapUA = str_replace( $UAline1, '', $text2 );//the rest of the printoff (other than first line) is equivolent
376
- // To the whole string minus the part we printed off. IE
377
- // User Agent: thefirst32charactersfromUAline1
378
- // the rest of it is now stored in
379
- // $text2 to be printed off
380
- // But we need to add spaces before each line that is split other than line 1
381
- $space = '';
382
- for ( $i = 0; $i < 25; $i++ ) {
383
- $space .= ' ';
384
- }
385
- // Now we split the remaining string of UA ($text2) into lines that are prefixed by spaces for formatting
386
- $wordwrapped = chunk_split( $towrapUA, 32, "\n $space" );
387
- return "Platform: {$this->getPlatform()} \n".
388
- "Browser Name: {$this->getBrowser()} \n" .
389
- "Browser Version: {$this->getVersion()} \n" .
390
- "User Agent String: $UAline1 \n\t\t\t " .
391
- "$wordwrapped";
392
- }
393
- /**
394
- * Protected routine to calculate and determine what the browser is in use (including platform)
395
- */
396
- function determine() {
397
- $this->checkPlatform();
398
- $this->checkBrowsers();
399
- $this->checkForAol();
400
- }
401
- /**
402
- * Protected routine to determine the browser type
403
- *
404
- * @return boolean True if the browser was detected otherwise false
405
- */
406
- function checkBrowsers() {
407
- return (
408
- // Well-known, well-used
409
- // Special Notes:
410
- // (1) Opera must be checked before FireFox due to the odd
411
- // user agents used in some older versions of Opera
412
- // (2) WebTV is strapped onto Internet Explorer so we must
413
- // check for WebTV before IE
414
- // (3) (deprecated) Galeon is based on Firefox and needs to be
415
- // tested before Firefox is tested
416
- // (4) OmniWeb is based on Safari so OmniWeb check must occur
417
- // before Safari
418
- // (5) Netscape 9+ is based on Firefox so Netscape checks
419
- // before FireFox are necessary
420
- $this->checkBrowserWebTv() ||
421
- $this->checkBrowserInternetExplorer() ||
422
- $this->checkBrowserOpera() ||
423
- $this->checkBrowserGaleon() ||
424
- $this->checkBrowserNetscapeNavigator9Plus() ||
425
- $this->checkBrowserFirefox() ||
426
- $this->checkBrowserChrome() ||
427
- $this->checkBrowserOmniWeb() ||
428
-
429
- // Common mobile
430
- $this->checkBrowserAndroid() ||
431
- $this->checkBrowseriPad() ||
432
- $this->checkBrowseriPod() ||
433
- $this->checkBrowseriPhone() ||
434
- $this->checkBrowserBlackBerry() ||
435
- $this->checkBrowserNokia() ||
436
-
437
- // Common bots
438
- $this->checkBrowserGoogleBot() ||
439
- $this->checkBrowserMSNBot() ||
440
- $this->checkBrowserSlurp() ||
441
-
442
- // WebKit base check (post mobile and others)
443
- $this->checkBrowserSafari() ||
444
-
445
- // Everyone else
446
- $this->checkBrowserNetPositive() ||
447
- $this->checkBrowserFirebird() ||
448
- $this->checkBrowserKonqueror() ||
449
- $this->checkBrowserIcab() ||
450
- $this->checkBrowserPhoenix() ||
451
- $this->checkBrowserAmaya() ||
452
- $this->checkBrowserLynx() ||
453
-
454
- $this->checkBrowserShiretoko() ||
455
- $this->checkBrowserIceCat() ||
456
- $this->checkBrowserW3CValidator() ||
457
- $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
458
- );
459
- }
460
-
461
- /**
462
- * Determine if the user is using a BlackBerry (last updated 1.7)
463
- *
464
- * @return boolean True if the browser is the BlackBerry browser otherwise false
465
- */
466
- function checkBrowserBlackBerry() {
467
- if ( stripos( $this->_agent, 'blackberry' ) !== false ) {
468
- $aresult = explode( "/", stristr( $this->_agent, "BlackBerry" ) );
469
- $aversion = explode( ' ', $aresult[1] );
470
- $this->setVersion( $aversion[0] );
471
- $this->_browser_name = $this->BROWSER_BLACKBERRY;
472
- $this->setMobile( true );
473
- return true;
474
- }
475
- return false;
476
- }
477
-
478
- /**
479
- * Determine if the user is using an AOL User Agent (last updated 1.7)
480
- *
481
- * @return boolean True if the browser is from AOL otherwise false
482
- */
483
- function checkForAol() {
484
- $this->setAol( false );
485
- $this->setAolVersion( $this->VERSION_UNKNOWN );
486
-
487
- if ( stripos( $this->_agent, 'aol' ) !== false ) {
488
- $aversion = explode( ' ', stristr( $this->_agent, 'AOL' ) );
489
- $this->setAol( true );
490
- $this->setAolVersion( preg_replace( '/[^0-9\.a-z]/i', '', $aversion[1] ) );
491
- return true;
492
- }
493
- return false;
494
- }
495
-
496
- /**
497
- * Determine if the browser is the GoogleBot or not (last updated 1.7)
498
- *
499
- * @return boolean True if the browser is the GoogletBot otherwise false
500
- */
501
- function checkBrowserGoogleBot() {
502
- if ( stripos( $this->_agent, 'googlebot' ) !== false ) {
503
- $aresult = explode( '/', stristr( $this->_agent, 'googlebot' ) );
504
- $aversion = explode( ' ', $aresult[1] );
505
- $this->setVersion( str_replace( ';', '', $aversion[0] ) );
506
- $this->_browser_name = $this->BROWSER_GOOGLEBOT;
507
- $this->setRobot( true );
508
- return true;
509
- }
510
- return false;
511
- }
512
-
513
- /**
514
- * Determine if the browser is the MSNBot or not (last updated 1.9)
515
- *
516
- * @return boolean True if the browser is the MSNBot otherwise false
517
- */
518
- function checkBrowserMSNBot() {
519
- if ( stripos( $this->_agent, "msnbot" ) !== false ) {
520
- $aresult = explode( "/", stristr( $this->_agent, "msnbot" ) );
521
- $aversion = explode( " ", $aresult[1] );
522
- $this->setVersion( str_replace( ";", "", $aversion[0] ) );
523
- $this->_browser_name = $this->BROWSER_MSNBOT;
524
- $this->setRobot( true );
525
- return true;
526
- }
527
- return false;
528
- }
529
-
530
- /**
531
- * Determine if the browser is the W3C Validator or not (last updated 1.7)
532
- *
533
- * @return boolean True if the browser is the W3C Validator otherwise false
534
- */
535
- function checkBrowserW3CValidator() {
536
- if ( stripos( $this->_agent, 'W3C-checklink' ) !== false ) {
537
- $aresult = explode( '/', stristr( $this->_agent, 'W3C-checklink' ) );
538
- $aversion = explode( ' ', $aresult[1] );
539
- $this->setVersion( $aversion[0] );
540
- $this->_browser_name = $this->BROWSER_W3CVALIDATOR;
541
- return true;
542
- } else if ( stripos( $this->_agent, 'W3C_Validator' ) !== false ) {
543
- // Some of the Validator versions do not delineate w/ a slash - add it back in
544
- $ua = str_replace( "W3C_Validator ", "W3C_Validator/", $this->_agent );
545
- $aresult = explode( '/', stristr( $ua, 'W3C_Validator' ) );
546
- $aversion = explode( ' ', $aresult[1] );
547
- $this->setVersion( $aversion[0] );
548
- $this->_browser_name = $this->BROWSER_W3CVALIDATOR;
549
- return true;
550
- }
551
- return false;
552
- }
553
-
554
- /**
555
- * Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
556
- *
557
- * @return boolean True if the browser is the Yahoo! Slurp Robot otherwise false
558
- */
559
- function checkBrowserSlurp() {
560
- if ( stripos( $this->_agent, 'slurp' ) !== false ) {
561
- $aresult = explode( '/', stristr( $this->_agent, 'Slurp' ) );
562
- $aversion = explode( ' ', $aresult[1] );
563
- $this->setVersion( $aversion[0] );
564
- $this->_browser_name = $this->BROWSER_SLURP;
565
- $this->setRobot( true );
566
- $this->setMobile( false );
567
- return true;
568
- }
569
- return false;
570
- }
571
-
572
- /**
573
- * Determine if the browser is Internet Explorer or not (last updated 1.7)
574
- *
575
- * @return boolean True if the browser is Internet Explorer otherwise false
576
- */
577
- function checkBrowserInternetExplorer() {
578
-
579
- // Test for v1 - v1.5 IE
580
- if ( stripos( $this->_agent, 'microsoft internet explorer' ) !== false ) {
581
- $this->setBrowser( $this->BROWSER_IE );
582
- $this->setVersion( '1.0' );
583
- $aresult = stristr( $this->_agent, '/' );
584
- if ( preg_match( '/308|425|426|474|0b1/i', $aresult ) ) {
585
- $this->setVersion( '1.5' );
586
- }
587
- return true;
588
- }
589
- // Test for versions > 1.5
590
- else if ( stripos( $this->_agent, 'msie' ) !== false && stripos( $this->_agent, 'opera' ) === false ) {
591
- // See if the browser is the odd MSN Explorer
592
- if ( stripos( $this->_agent, 'msnb' ) !== false ) {
593
- $aresult = explode( ' ', stristr( str_replace( ';', '; ', $this->_agent ), 'MSN' ) );
594
- $this->setBrowser( $this->BROWSER_MSN );
595
- $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aresult[1] ) );
596
- return true;
597
- }
598
- $aresult = explode( ' ', stristr( str_replace( ';', '; ', $this->_agent ), 'msie' ) );
599
- $this->setBrowser( $this->BROWSER_IE );
600
- $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aresult[1] ) );
601
- return true;
602
- }
603
- // Test for Pocket IE
604
- else if ( stripos( $this->_agent, 'mspie' ) !== false || stripos( $this->_agent, 'pocket' ) !== false ) {
605
- $aresult = explode( ' ', stristr( $this->_agent, 'mspie' ) );
606
- $this->setPlatform( $this->PLATFORM_WINDOWS_CE );
607
- $this->setBrowser( $this->BROWSER_POCKET_IE );
608
- $this->setMobile( true );
609
-
610
- if ( stripos( $this->_agent, 'mspie' ) !== false ) {
611
- $this->setVersion( $aresult[1] );
612
- } else {
613
- $aversion = explode( '/', $this->_agent );
614
- $this->setVersion( $aversion[1] );
615
- }
616
- return true;
617
- }
618
- return false;
619
- }
620
-
621
- /**
622
- * Determine if the browser is Opera or not (last updated 1.7)
623
- *
624
- * @return boolean True if the browser is Opera otherwise false
625
- */
626
- function checkBrowserOpera() {
627
- if ( stripos( $this->_agent, 'opera mini' ) !== false ) {
628
- $resultant = stristr( $this->_agent, 'opera mini' );
629
- if ( preg_match( '/\//', $resultant ) ) {
630
- $aresult = explode( '/', $resultant );
631
- $aversion = explode( ' ', $aresult[1] );
632
- $this->setVersion( $aversion[0] );
633
- } else {
634
- $aversion = explode( ' ', stristr( $resultant, 'opera mini' ) );
635
- $this->setVersion( $aversion[1] );
636
- }
637
- $this->_browser_name = $this->BROWSER_OPERA_MINI;
638
- $this->setMobile( true );
639
- return true;
640
- } else if ( stripos( $this->_agent, 'opera' ) !== false ) {
641
- $resultant = stristr( $this->_agent, 'opera' );
642
- if ( preg_match( '/Version\/(10.*)$/', $resultant, $matches ) ) {
643
- $this->setVersion( $matches[1] );
644
- } else if ( preg_match( '/\//', $resultant ) ) {
645
- $aresult = explode( '/', str_replace( "(", " ", $resultant ) );
646
- $aversion = explode( ' ', $aresult[1] );
647
- $this->setVersion( $aversion[0] );
648
- } else {
649
- $aversion = explode( ' ', stristr( $resultant, 'opera' ) );
650
- $this->setVersion( isset( $aversion[1] )?$aversion[1]:"" );
651
- }
652
- $this->_browser_name = $this->BROWSER_OPERA;
653
- return true;
654
- }
655
- return false;
656
- }
657
-
658
- /**
659
- * Determine if the browser is Chrome or not (last updated 1.7)
660
- *
661
- * @return boolean True if the browser is Chrome otherwise false
662
- */
663
- function checkBrowserChrome() {
664
- if ( stripos( $this->_agent, 'Chrome' ) !== false ) {
665
- $aresult = explode( '/', stristr( $this->_agent, 'Chrome' ) );
666
- $aversion = explode( ' ', $aresult[1] );
667
- $this->setVersion( $aversion[0] );
668
- $this->setBrowser( $this->BROWSER_CHROME );
669
- return true;
670
- }
671
- return false;
672
- }
673
-
674
-
675
- /**
676
- * Determine if the browser is WebTv or not (last updated 1.7)
677
- *
678
- * @return boolean True if the browser is WebTv otherwise false
679
- */
680
- function checkBrowserWebTv() {
681
- if ( stripos( $this->_agent, 'webtv' ) !== false ) {
682
- $aresult = explode( '/', stristr( $this->_agent, 'webtv' ) );
683
- $aversion = explode( ' ', $aresult[1] );
684
- $this->setVersion( $aversion[0] );
685
- $this->setBrowser( $this->BROWSER_WEBTV );
686
- return true;
687
- }
688
- return false;
689
- }
690
-
691
- /**
692
- * Determine if the browser is NetPositive or not (last updated 1.7)
693
- *
694
- * @return boolean True if the browser is NetPositive otherwise false
695
- */
696
- function checkBrowserNetPositive() {
697
- if ( stripos( $this->_agent, 'NetPositive' ) !== false ) {
698
- $aresult = explode( '/', stristr( $this->_agent, 'NetPositive' ) );
699
- $aversion = explode( ' ', $aresult[1] );
700
- $this->setVersion( str_replace( array( '(', ')', ';' ), '', $aversion[0] ) );
701
- $this->setBrowser( $this->BROWSER_NETPOSITIVE );
702
- return true;
703
- }
704
- return false;
705
- }
706
-
707
- /**
708
- * Determine if the browser is Galeon or not (last updated 1.7)
709
- *
710
- * @return boolean True if the browser is Galeon otherwise false
711
- */
712
- function checkBrowserGaleon() {
713
- if ( stripos( $this->_agent, 'galeon' ) !== false ) {
714
- $aresult = explode( ' ', stristr( $this->_agent, 'galeon' ) );
715
- $aversion = explode( '/', $aresult[0] );
716
- $this->setVersion( $aversion[1] );
717
- $this->setBrowser( $this->BROWSER_GALEON );
718
- return true;
719
- }
720
- return false;
721
- }
722
-
723
- /**
724
- * Determine if the browser is Konqueror or not (last updated 1.7)
725
- *
726
- * @return boolean True if the browser is Konqueror otherwise false
727
- */
728
- function checkBrowserKonqueror() {
729
- if ( stripos( $this->_agent, 'Konqueror' ) !== false ) {
730
- $aresult = explode( ' ', stristr( $this->_agent, 'Konqueror' ) );
731
- $aversion = explode( '/', $aresult[0] );
732
- $this->setVersion( $aversion[1] );
733
- $this->setBrowser( $this->BROWSER_KONQUEROR );
734
- return true;
735
- }
736
- return false;
737
- }
738
-
739
- /**
740
- * Determine if the browser is iCab or not (last updated 1.7)
741
- *
742
- * @return boolean True if the browser is iCab otherwise false
743
- */
744
- function checkBrowserIcab() {
745
- if ( stripos( $this->_agent, 'icab' ) !== false ) {
746
- $aversion = explode( ' ', stristr( str_replace( '/', ' ', $this->_agent ), 'icab' ) );
747
- $this->setVersion( $aversion[1] );
748
- $this->setBrowser( $this->BROWSER_ICAB );
749
- return true;
750
- }
751
- return false;
752
- }
753
-
754
- /**
755
- * Determine if the browser is OmniWeb or not (last updated 1.7)
756
- *
757
- * @return boolean True if the browser is OmniWeb otherwise false
758
- */
759
- function checkBrowserOmniWeb() {
760
- if ( stripos( $this->_agent, 'omniweb' ) !== false ) {
761
- $aresult = explode( '/', stristr( $this->_agent, 'omniweb' ) );
762
- $aversion = explode( ' ', isset( $aresult[1] )?$aresult[1]:"" );
763
- $this->setVersion( $aversion[0] );
764
- $this->setBrowser( $this->BROWSER_OMNIWEB );
765
- return true;
766
- }
767
- return false;
768
- }
769
-
770
- /**
771
- * Determine if the browser is Phoenix or not (last updated 1.7)
772
- *
773
- * @return boolean True if the browser is Phoenix otherwise false
774
- */
775
- function checkBrowserPhoenix() {
776
- if ( stripos( $this->_agent, 'Phoenix' ) !== false ) {
777
- $aversion = explode( '/', stristr( $this->_agent, 'Phoenix' ) );
778
- $this->setVersion( $aversion[1] );
779
- $this->setBrowser( $this->BROWSER_PHOENIX );
780
- return true;
781
- }
782
- return false;
783
- }
784
-
785
- /**
786
- * Determine if the browser is Firebird or not (last updated 1.7)
787
- *
788
- * @return boolean True if the browser is Firebird otherwise false
789
- */
790
- function checkBrowserFirebird() {
791
- if ( stripos( $this->_agent, 'Firebird' ) !== false ) {
792
- $aversion = explode( '/', stristr( $this->_agent, 'Firebird' ) );
793
- $this->setVersion( $aversion[1] );
794
- $this->setBrowser( $this->BROWSER_FIREBIRD );
795
- return true;
796
- }
797
- return false;
798
- }
799
-
800
- /**
801
- * Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7)
802
- * NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)
803
- *
804
- * @return boolean True if the browser is Netscape Navigator 9+ otherwise false
805
- */
806
- function checkBrowserNetscapeNavigator9Plus() {
807
- if ( stripos( $this->_agent, 'Firefox' ) !== false && preg_match( '/Navigator\/([^ ]*)/i', $this->_agent, $matches ) ) {
808
- $this->setVersion( $matches[1] );
809
- $this->setBrowser( $this->BROWSER_NETSCAPE_NAVIGATOR );
810
- return true;
811
- } else if ( stripos( $this->_agent, 'Firefox' ) === false && preg_match( '/Netscape6?\/([^ ]*)/i', $this->_agent, $matches ) ) {
812
- $this->setVersion( $matches[1] );
813
- $this->setBrowser( $this->BROWSER_NETSCAPE_NAVIGATOR );
814
- return true;
815
- }
816
- return false;
817
- }
818
-
819
- /**
820
- * Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
821
- *
822
- * @return boolean True if the browser is Shiretoko otherwise false
823
- */
824
- function checkBrowserShiretoko() {
825
- if ( stripos( $this->_agent, 'Mozilla' ) !== false && preg_match( '/Shiretoko\/([^ ]*)/i', $this->_agent, $matches ) ) {
826
- $this->setVersion( $matches[1] );
827
- $this->setBrowser( $this->BROWSER_SHIRETOKO );
828
- return true;
829
- }
830
- return false;
831
- }
832
-
833
- /**
834
- * Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
835
- *
836
- * @return boolean True if the browser is Ice Cat otherwise false
837
- */
838
- function checkBrowserIceCat() {
839
- if ( stripos( $this->_agent, 'Mozilla' ) !== false && preg_match( '/IceCat\/([^ ]*)/i', $this->_agent, $matches ) ) {
840
- $this->setVersion( $matches[1] );
841
- $this->setBrowser( $this->BROWSER_ICECAT );
842
- return true;
843
- }
844
- return false;
845
- }
846
-
847
- /**
848
- * Determine if the browser is Nokia or not (last updated 1.7)
849
- *
850
- * @return boolean True if the browser is Nokia otherwise false
851
- */
852
- function checkBrowserNokia() {
853
- if ( preg_match( "/Nokia([^\/]+)\/([^ SP]+)/i", $this->_agent, $matches ) ) {
854
- $this->setVersion( $matches[2] );
855
- if ( stripos( $this->_agent, 'Series60' ) !== false || strpos( $this->_agent, 'S60' ) !== false ) {
856
- $this->setBrowser( $this->BROWSER_NOKIA_S60 );
857
- } else {
858
- $this->setBrowser( $this->BROWSER_NOKIA );
859
- }
860
- $this->setMobile( true );
861
- return true;
862
- }
863
- return false;
864
- }
865
-
866
- /**
867
- * Determine if the browser is Firefox or not (last updated 1.7)
868
- *
869
- * @return boolean True if the browser is Firefox otherwise false
870
- */
871
- function checkBrowserFirefox() {
872
- if ( stripos( $this->_agent, 'safari' ) === false ) {
873
- if ( preg_match( "/Firefox[\/ \(]([^ ;\)]+)/i", $this->_agent, $matches ) ) {
874
- $this->setVersion( $matches[1] );
875
- $this->setBrowser( $this->BROWSER_FIREFOX );
876
- return true;
877
- } else if ( preg_match( "/Firefox$/i", $this->_agent, $matches ) ) {
878
- $this->setVersion( "" );
879
- $this->setBrowser( $this->BROWSER_FIREFOX );
880
- return true;
881
- }
882
- }
883
- return false;
884
- }
885
-
886
- /**
887
- * Determine if the browser is Firefox or not (last updated 1.7)
888
- *
889
- * @return boolean True if the browser is Firefox otherwise false
890
- */
891
- function checkBrowserIceweasel() {
892
- if ( stripos( $this->_agent, 'Iceweasel' ) !== false ) {
893
- $aresult = explode( '/', stristr( $this->_agent, 'Iceweasel' ) );
894
- $aversion = explode( ' ', $aresult[1] );
895
- $this->setVersion( $aversion[0] );
896
- $this->setBrowser( $this->BROWSER_ICEWEASEL );
897
- return true;
898
- }
899
- return false;
900
- }
901
- /**
902
- * Determine if the browser is Mozilla or not (last updated 1.7)
903
- *
904
- * @return boolean True if the browser is Mozilla otherwise false
905
- */
906
- function checkBrowserMozilla() {
907
- if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/rv:[0-9].[0-9][a-b]?/i', $this->_agent ) && stripos( $this->_agent, 'netscape' ) === false ) {
908
- $aversion = explode( ' ', stristr( $this->_agent, 'rv:' ) );
909
- preg_match( '/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion );
910
- $this->setVersion( str_replace( 'rv:', '', $aversion[0] ) );
911
- $this->setBrowser( $this->BROWSER_MOZILLA );
912
- return true;
913
- } else if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/rv:[0-9]\.[0-9]/i', $this->_agent ) && stripos( $this->_agent, 'netscape' ) === false ) {
914
- $aversion = explode( '', stristr( $this->_agent, 'rv:' ) );
915
- $this->setVersion( str_replace( 'rv:', '', $aversion[0] ) );
916
- $this->setBrowser( $this->BROWSER_MOZILLA );
917
- return true;
918
- } else if ( stripos( $this->_agent, 'mozilla' ) !== false && preg_match( '/mozilla\/([^ ]*)/i', $this->_agent, $matches ) && stripos( $this->_agent, 'netscape' ) === false ) {
919
- $this->setVersion( $matches[1] );
920
- $this->setBrowser( $this->BROWSER_MOZILLA );
921
- return true;
922
- }
923
- return false;
924
- }
925
-
926
- /**
927
- * Determine if the browser is Lynx or not (last updated 1.7)
928
- *
929
- * @return boolean True if the browser is Lynx otherwise false
930
- */
931
- function checkBrowserLynx() {
932
- if ( stripos( $this->_agent, 'lynx' ) !== false ) {
933
- $aresult = explode( '/', stristr( $this->_agent, 'Lynx' ) );
934
- $aversion = explode( ' ', ( isset( $aresult[1] )?$aresult[1]:"" ) );
935
- $this->setVersion( $aversion[0] );
936
- $this->setBrowser( $this->BROWSER_LYNX );
937
- return true;
938
- }
939
- return false;
940
- }
941
-
942
- /**
943
- * Determine if the browser is Amaya or not (last updated 1.7)
944
- *
945
- * @return boolean True if the browser is Amaya otherwise false
946
- */
947
- function checkBrowserAmaya() {
948
- if ( stripos( $this->_agent, 'amaya' ) !== false ) {
949
- $aresult = explode( '/', stristr( $this->_agent, 'Amaya' ) );
950
- $aversion = explode( ' ', $aresult[1] );
951
- $this->setVersion( $aversion[0] );
952
- $this->setBrowser( $this->BROWSER_AMAYA );
953
- return true;
954
- }
955
- return false;
956
- }
957
-
958
- /**
959
- * Determine if the browser is Safari or not (last updated 1.7)
960
- *
961
- * @return boolean True if the browser is Safari otherwise false
962
- */
963
- function checkBrowserSafari() {
964
- if ( stripos( $this->_agent, 'Safari' ) !== false && stripos( $this->_agent, 'iPhone' ) === false && stripos( $this->_agent, 'iPod' ) === false ) {
965
- $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
966
- if ( isset( $aresult[1] ) ) {
967
- $aversion = explode( ' ', $aresult[1] );
968
- $this->setVersion( $aversion[0] );
969
- } else {
970
- $this->setVersion( $this->VERSION_UNKNOWN );
971
- }
972
- $this->setBrowser( $this->BROWSER_SAFARI );
973
- return true;
974
- }
975
- return false;
976
- }
977
-
978
- /**
979
- * Determine if the browser is iPhone or not (last updated 1.7)
980
- *
981
- * @return boolean True if the browser is iPhone otherwise false
982
- */
983
- function checkBrowseriPhone() {
984
- if ( stripos( $this->_agent, 'iPhone' ) !== false ) {
985
- $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
986
- if ( isset( $aresult[1] ) ) {
987
- $aversion = explode( ' ', $aresult[1] );
988
- $this->setVersion( $aversion[0] );
989
- } else {
990
- $this->setVersion( $this->VERSION_UNKNOWN );
991
- }
992
- $this->setMobile( true );
993
- $this->setBrowser( $this->BROWSER_IPHONE );
994
- return true;
995
- }
996
- return false;
997
- }
998
-
999
- /**
1000
- * Determine if the browser is iPod or not (last updated 1.7)
1001
- *
1002
- * @return boolean True if the browser is iPod otherwise false
1003
- */
1004
- function checkBrowseriPad() {
1005
- if ( stripos( $this->_agent, 'iPad' ) !== false ) {
1006
- $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
1007
- if ( isset( $aresult[1] ) ) {
1008
- $aversion = explode( ' ', $aresult[1] );
1009
- $this->setVersion( $aversion[0] );
1010
- } else {
1011
- $this->setVersion( $this->VERSION_UNKNOWN );
1012
- }
1013
- $this->setMobile( true );
1014
- $this->setBrowser( $this->BROWSER_IPAD );
1015
- return true;
1016
- }
1017
- return false;
1018
- }
1019
-
1020
- /**
1021
- * Determine if the browser is iPod or not (last updated 1.7)
1022
- *
1023
- * @return boolean True if the browser is iPod otherwise false
1024
- */
1025
- function checkBrowseriPod() {
1026
- if ( stripos( $this->_agent, 'iPod' ) !== false ) {
1027
- $aresult = explode( '/', stristr( $this->_agent, 'Version' ) );
1028
- if ( isset( $aresult[1] ) ) {
1029
- $aversion = explode( ' ', $aresult[1] );
1030
- $this->setVersion( $aversion[0] );
1031
- } else {
1032
- $this->setVersion( $this->VERSION_UNKNOWN );
1033
- }
1034
- $this->setMobile( true );
1035
- $this->setBrowser( $this->BROWSER_IPOD );
1036
- return true;
1037
- }
1038
- return false;
1039
- }
1040
-
1041
- /**
1042
- * Determine if the browser is Android or not (last updated 1.7)
1043
- *
1044
- * @return boolean True if the browser is Android otherwise false
1045
- */
1046
- function checkBrowserAndroid() {
1047
- if ( stripos( $this->_agent, 'Android' ) !== false ) {
1048
- $aresult = explode( ' ', stristr( $this->_agent, 'Android' ) );
1049
- if ( isset( $aresult[1] ) ) {
1050
- $aversion = explode( ' ', $aresult[1] );
1051
- $this->setVersion( $aversion[0] );
1052
- } else {
1053
- $this->setVersion( $this->VERSION_UNKNOWN );
1054
- }
1055
- $this->setMobile( true );
1056
- $this->setBrowser( $this->BROWSER_ANDROID );
1057
- return true;
1058
- }
1059
- return false;
1060
- }
1061
-
1062
- /**
1063
- * Determine the user's platform (last updated 1.7)
1064
- */
1065
- function checkPlatform() {
1066
- if ( stripos( $this->_agent, 'windows' ) !== false ) {
1067
- $this->_platform = $this->PLATFORM_WINDOWS;
1068
- } else if ( stripos( $this->_agent, 'iPad' ) !== false ) {
1069
- $this->_platform = $this->PLATFORM_IPAD;
1070
- } else if ( stripos( $this->_agent, 'iPod' ) !== false ) {
1071
- $this->_platform = $this->PLATFORM_IPOD;
1072
- } else if ( stripos( $this->_agent, 'iPhone' ) !== false ) {
1073
- $this->_platform = $this->PLATFORM_IPHONE;
1074
- } elseif ( stripos( $this->_agent, 'mac' ) !== false ) {
1075
- $this->_platform = $this->PLATFORM_APPLE;
1076
- } elseif ( stripos( $this->_agent, 'android' ) !== false ) {
1077
- $this->_platform = $this->PLATFORM_ANDROID;
1078
- } elseif ( stripos( $this->_agent, 'linux' ) !== false ) {
1079
- $this->_platform = $this->PLATFORM_LINUX;
1080
- } else if ( stripos( $this->_agent, 'Nokia' ) !== false ) {
1081
- $this->_platform = $this->PLATFORM_NOKIA;
1082
- } else if ( stripos( $this->_agent, 'BlackBerry' ) !== false ) {
1083
- $this->_platform = $this->PLATFORM_BLACKBERRY;
1084
- } elseif ( stripos( $this->_agent, 'FreeBSD' ) !== false ) {
1085
- $this->_platform = $this->PLATFORM_FREEBSD;
1086
- } elseif ( stripos( $this->_agent, 'OpenBSD' ) !== false ) {
1087
- $this->_platform = $this->PLATFORM_OPENBSD;
1088
- } elseif ( stripos( $this->_agent, 'NetBSD' ) !== false ) {
1089
- $this->_platform = $this->PLATFORM_NETBSD;
1090
- } elseif ( stripos( $this->_agent, 'OpenSolaris' ) !== false ) {
1091
- $this->_platform = $this->PLATFORM_OPENSOLARIS;
1092
- } elseif ( stripos( $this->_agent, 'SunOS' ) !== false ) {
1093
- $this->_platform = $this->PLATFORM_SUNOS;
1094
- } elseif ( stripos( $this->_agent, 'OS\/2' ) !== false ) {
1095
- $this->_platform = $this->PLATFORM_OS2;
1096
- } elseif ( stripos( $this->_agent, 'BeOS' ) !== false ) {
1097
- $this->_platform = $this->PLATFORM_BEOS;
1098
- } elseif ( stripos( $this->_agent, 'win' ) !== false ) {
1099
- $this->_platform = $this->PLATFORM_WINDOWS;
1100
- }
1101
-
1102
- }
1103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/freemius/includes/fs-plugin-functions.php DELETED
@@ -1,413 +0,0 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.0.6
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Display plugin information in dialog box form.
15
- *
16
- * @since 2.7.0
17
- */
18
- function fs_install_plugin_information() {
19
- global $tab;
20
-
21
- if ( empty( $_REQUEST['plugin'] ) ) {
22
- return;
23
- }
24
-
25
- $args = array(
26
- 'slug' => wp_unslash( $_REQUEST['plugin'] ),
27
- 'is_ssl' => is_ssl(),
28
- 'fields' => array( 'banners' => true, 'reviews' => true )
29
- );
30
-
31
- if ( is_array( $args ) ) {
32
- $args = (object) $args;
33
- }
34
-
35
- if ( ! isset( $args->per_page ) ) {
36
- $args->per_page = 24;
37
- }
38
-
39
- if ( ! isset( $args->locale ) ) {
40
- $args->locale = get_locale();
41
- }
42
-
43
- $api = apply_filters( 'fs_plugins_api', false, 'plugin_information', $args );
44
-
45
- if ( is_wp_error( $api ) ) {
46
- wp_die( $api );
47
- }
48
-
49
- $plugins_allowedtags = array(
50
- 'a' => array(
51
- 'href' => array(),
52
- 'title' => array(),
53
- 'target' => array(),
54
- // Add image style for screenshots.
55
- 'class' => array()
56
- ),
57
- 'style' => array(),
58
- 'abbr' => array( 'title' => array() ),
59
- 'acronym' => array( 'title' => array() ),
60
- 'code' => array(),
61
- 'pre' => array(),
62
- 'em' => array(),
63
- 'strong' => array(),
64
- 'div' => array( 'class' => array() ),
65
- 'span' => array( 'class' => array() ),
66
- 'p' => array(),
67
- 'ul' => array(),
68
- 'ol' => array(),
69
- 'li' => array( 'class' => array() ),
70
- 'i' => array( 'class' => array() ),
71
- 'h1' => array(),
72
- 'h2' => array(),
73
- 'h3' => array(),
74
- 'h4' => array(),
75
- 'h5' => array(),
76
- 'h6' => array(),
77
- 'img' => array( 'src' => array(), 'class' => array(), 'alt' => array() ),
78
- // 'table' => array(),
79
- // 'td' => array(),
80
- // 'tr' => array(),
81
- // 'th' => array(),
82
- // 'thead' => array(),
83
- // 'tbody' => array(),
84
- );
85
-
86
- $plugins_section_titles = array(
87
- 'description' => _x( 'Description', 'Plugin installer section title' ),
88
- 'installation' => _x( 'Installation', 'Plugin installer section title' ),
89
- 'faq' => _x( 'FAQ', 'Plugin installer section title' ),
90
- 'screenshots' => _x( 'Screenshots', 'Plugin installer section title' ),
91
- 'changelog' => _x( 'Changelog', 'Plugin installer section title' ),
92
- 'reviews' => _x( 'Reviews', 'Plugin installer section title' ),
93
- 'other_notes' => _x( 'Other Notes', 'Plugin installer section title' ),
94
- );
95
-
96
- // Sanitize HTML
97
- // foreach ( (array) $api->sections as $section_name => $content ) {
98
- // $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags );
99
- // }
100
-
101
- foreach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) {
102
- if ( isset( $api->$key ) ) {
103
- $api->$key = wp_kses( $api->$key, $plugins_allowedtags );
104
- }
105
- }
106
-
107
- // Add after $api->slug is ready.
108
- $plugins_section_titles['features'] = __fs( 'features-and-pricing', $api->slug );
109
-
110
- $_tab = esc_attr( $tab );
111
-
112
- $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English.
113
- if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) {
114
- $section_titles = array_keys( (array) $api->sections );
115
- $section = array_shift( $section_titles );
116
- }
117
-
118
- iframe_header( __( 'Plugin Install' ) );
119
-
120
- $_with_banner = '';
121
-
122
- // var_dump($api->banners);
123
- if ( ! empty( $api->banners ) && ( ! empty( $api->banners['low'] ) || ! empty( $api->banners['high'] ) ) ) {
124
- $_with_banner = 'with-banner';
125
- $low = empty( $api->banners['low'] ) ? $api->banners['high'] : $api->banners['low'];
126
- $high = empty( $api->banners['high'] ) ? $api->banners['low'] : $api->banners['high'];
127
- ?>
128
- <style type="text/css">
129
- #plugin-information-title.with-banner
130
- {
131
- background-image: url( <?php echo esc_url( $low ); ?> );
132
- }
133
-
134
- @media only screen and ( -webkit-min-device-pixel-ratio: 1.5 )
135
- {
136
- #plugin-information-title.with-banner
137
- {
138
- background-image: url( <?php echo esc_url( $high ); ?> );
139
- }
140
- }
141
- </style>
142
- <?php
143
- }
144
-
145
- echo '<div id="plugin-information-scrollable">';
146
- echo "<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>";
147
- echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n";
148
-
149
- foreach ( (array) $api->sections as $section_name => $content ) {
150
- if ( 'reviews' === $section_name && ( empty( $api->ratings ) || 0 === array_sum( (array) $api->ratings ) ) ) {
151
- continue;
152
- }
153
-
154
- if ( isset( $plugins_section_titles[ $section_name ] ) ) {
155
- $title = $plugins_section_titles[ $section_name ];
156
- } else {
157
- $title = ucwords( str_replace( '_', ' ', $section_name ) );
158
- }
159
-
160
- $class = ( $section_name === $section ) ? ' class="current"' : '';
161
- $href = add_query_arg( array( 'tab' => $tab, 'section' => $section_name ) );
162
- $href = esc_url( $href );
163
- $san_section = esc_attr( $section_name );
164
- echo "\t<a name='$san_section' href='$href' $class>$title</a>\n";
165
- }
166
-
167
- echo "</div>\n";
168
-
169
- ?>
170
- <div id="<?php echo $_tab; ?>-content" class='<?php echo $_with_banner; ?>'>
171
- <div class="fyi">
172
- <?php if ( isset( $api->plans ) ) : ?>
173
- <div class="plugin-information-pricing">
174
- <?php foreach ($api->plans as $plan) : ?>
175
- <h3 data-plan="<?php echo $plan->id ?>"><?php printf( __fs( 'x-plan', $api->slug ), $plan->title ) ?></h3>
176
- <ul>
177
- <?php $billing_cycle = 'annual' ?>
178
- <?php if ( 1 === count( $plan->pricing ) && 1 == $plan->pricing[0]->licenses ) : ?>
179
- <?php $pricing = $plan->pricing[0] ?>
180
- <li><label><?php _efs( 'price', $api->slug ) ?>: $<?php
181
- if ( isset( $pricing->annual_price ) ) {
182
- echo $pricing->annual_price . ( $plan->is_block_features ? ' / year' : '' );
183
- $billing_cycle = 'annual';
184
- } else if ( isset( $pricing->monthly_price ) ) {
185
- echo $pricing->monthly_price . ' / mo';
186
- $billing_cycle = 'monthly';
187
- } else if ( isset( $pricing->lifetime_price ) ) {
188
- echo $pricing->lifetime_price;
189
- $billing_cycle = 'lifetime';
190
- }
191
- ?></label></li>
192
- <?php else : ?>
193
- <?php $first = true;
194
- foreach ( $plan->pricing as $pricing ) : ?>
195
- <li><label><input name="pricing-<?php echo $plan->id ?>" type="radio"
196
- value="<?php echo $pricing->id ?>"<?php checked( $first, true ) ?>><?php
197
- switch ( $pricing->licenses ) {
198
- case '1':
199
- _efs( 'license-single-site', $api->slug );
200
- break;
201
- case null:
202
- _efs( 'license-unlimited', $api->slug );
203
- break;
204
- default:
205
- printf( __fs( 'license-x-sites', $api->slug ), $pricing->licenses );
206
- break;
207
- }
208
- ?> - $<?php
209
- if ( isset( $pricing->annual_price ) ) {
210
- echo $pricing->annual_price . ( $plan->is_block_features ? ' / year' : '' );
211
- $billing_cycle = 'annual';
212
- } else if ( isset( $pricing->monthly_price ) ) {
213
- echo $pricing->monthly_price . ' / mo';
214
- $billing_cycle = 'monthly';
215
- } else if ( isset( $pricing->lifetime_price ) ) {
216
- echo $pricing->lifetime_price;
217
- $billing_cycle = 'lifetime';
218
- }
219
- ?></label></li>
220
- <?php $first = false; endforeach ?>
221
- <?php endif ?>
222
- </ul>
223
- <?php echo ' <a class="button button-primary right" href="' . esc_url( add_query_arg( array(
224
- 'plugin_id' => $plan->plugin_id,
225
- 'plan_id' => $plan->id,
226
- 'pricing_id' => $plan->pricing[0]->id,
227
- 'billing_cycle' => $billing_cycle,
228
- ), $api->checkout_link ) ) . '" target="_parent">' . __fs( 'purchase', $api->slug ) . '</a>' ?>
229
- </div>
230
- <?php endforeach ?>
231
- <?php wp_enqueue_script( 'jquery' ); ?>
232
- <script type="text/javascript">
233
- (function ($) {
234
- $('.plugin-information-pricing input[type=radio]').click(function () {
235
- var checkout_url = '<?php echo esc_url_raw(add_query_arg(array(
236
- 'plugin_id' => $plan->plugin_id,
237
- 'billing_cycle' => $billing_cycle,
238
- ), $api->checkout_link)) ?>&plan_id=' +
239
- $(this).parents('.plugin-information-pricing').find('h3').attr('data-plan') +
240
- '&pricing_id=' + $(this).val();
241
-
242
- $('.plugin-information-pricing .button, #plugin-information-footer .button').attr('href', checkout_url);
243
- });
244
- })(jQuery);
245
- </script>
246
- <?php endif ?>
247
- <div>
248
- <h3><?php _efs( 'details', $api->slug ) ?></h3>
249
- <ul>
250
- <?php if ( ! empty( $api->version ) ) { ?>
251
- <li><strong><?php _e( 'Version:' ); ?></strong> <?php echo $api->version; ?></li>
252
- <?php }
253
- if ( ! empty( $api->author ) ) { ?>
254
- <li>
255
- <strong><?php _e( 'Author:' ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?>
256
- </li>
257
- <?php }
258
- if ( ! empty( $api->last_updated ) ) { ?>
259
- <li><strong><?php _e( 'Last Updated:' ); ?></strong> <span
260
- title="<?php echo $api->last_updated; ?>">
261
- <?php printf( __( '%s ago' ), human_time_diff( strtotime( $api->last_updated ) ) ); ?>
262
- </span></li>
263
- <?php }
264
- if ( ! empty( $api->requires ) ) { ?>
265
- <li>
266
- <strong><?php _e( 'Requires WordPress Version:' ); ?></strong> <?php printf( __( '%s or higher' ), $api->requires ); ?>
267
- </li>
268
- <?php }
269
- if ( ! empty( $api->tested ) ) { ?>
270
- <li><strong><?php _e( 'Compatible up to:' ); ?></strong> <?php echo $api->tested; ?></li>
271
- <?php }
272
- if ( ! empty( $api->downloaded ) ) { ?>
273
- <li>
274
- <strong><?php _e( 'Downloaded:' ); ?></strong> <?php printf( _n( '%s time', '%s times', $api->downloaded ), number_format_i18n( $api->downloaded ) ); ?>
275
- </li>
276
- <?php }
277
- if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?>
278
- <li><a target="_blank"
279
- href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php _e( 'WordPress.org Plugin Page &#187;' ); ?></a>
280
- </li>
281
- <?php }
282
- if ( ! empty( $api->homepage ) ) { ?>
283
- <li><a target="_blank"
284
- href="<?php echo esc_url( $api->homepage ); ?>"><?php _e( 'Plugin Homepage &#187;' ); ?></a>
285
- </li>
286
- <?php }
287
- if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) { ?>
288
- <li><a target="_blank"
289
- href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin &#187;' ); ?></a>
290
- </li>
291
- <?php } ?>
292
- </ul>
293
- </div>
294
- <?php if ( ! empty( $api->rating ) ) { ?>
295
- <h3><?php _e( 'Average Rating' ); ?></h3>
296
- <?php wp_star_rating( array(
297
- 'rating' => $api->rating,
298
- 'type' => 'percent',
299
- 'number' => $api->num_ratings
300
- ) ); ?>
301
- <small><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></small>
302
- <?php
303
- }
304
-
305
- if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
306
- foreach ( $api->ratings as $key => $ratecount ) {
307
- // Avoid div-by-zero.
308
- $_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
309
- ?>
310
- <div class="counter-container">
311
- <span class="counter-label"><a
312
- href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
313
- target="_blank"
314
- title="<?php echo esc_attr( sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key ), $key ) ); ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a></span>
315
- <span class="counter-back">
316
- <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
317
- </span>
318
- <span class="counter-count"><?php echo number_format_i18n( $ratecount ); ?></span>
319
- </div>
320
- <?php
321
- }
322
- }
323
- if ( ! empty( $api->contributors ) ) {
324
- ?>
325
- <h3><?php _e( 'Contributors' ); ?></h3>
326
- <ul class="contributors">
327
- <?php
328
- foreach ( (array) $api->contributors as $contrib_username => $contrib_profile ) {
329
- if ( empty( $contrib_username ) && empty( $contrib_profile ) ) {
330
- continue;
331
- }
332
- if ( empty( $contrib_username ) ) {
333
- $contrib_username = preg_replace( '/^.+\/(.+)\/?$/', '\1', $contrib_profile );
334
- }
335
- $contrib_username = sanitize_user( $contrib_username );
336
- if ( empty( $contrib_profile ) ) {
337
- echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
338
- } else {
339
- echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
340
- }
341
- }
342
- ?>
343
- </ul>
344
- <?php if ( ! empty( $api->donate_link ) ) { ?>
345
- <a target="_blank"
346
- href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin &#187;' ); ?></a>
347
- <?php } ?>
348
- <?php } ?>
349
- </div>
350
- <div id="section-holder" class="wrap">
351
- <?php
352
- if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
353
- echo '<div class="notice notice-warning"><p>' . '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'This plugin has not been tested with your current version of WordPress.' ) . '</p></div>';
354
- } else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
355
- echo '<div class="notice notice-warning"><p>' . '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'This plugin has not been marked as compatible with your version of WordPress.' ) . '</p></div>';
356
- }
357
-
358
- foreach ( (array) $api->sections as $section_name => $content ) {
359
- $content = links_add_base_url( $content, 'https://wordpress.org/plugins/' . $api->slug . '/' );
360
- $content = links_add_target( $content, '_blank' );
361
-
362
- $san_section = esc_attr( $section_name );
363
-
364
- $display = ( $section_name === $section ) ? 'block' : 'none';
365
-
366
- echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
367
- echo $content;
368
- echo "\t</div>\n";
369
- }
370
- echo "</div>\n";
371
- echo "</div>\n";
372
- echo "</div>\n"; // #plugin-information-scrollable
373
- echo "<div id='$tab-footer'>\n";
374
- if ( ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) ) {
375
-
376
- if ( ! empty( $api->checkout_link ) && isset( $api->plans ) && 0 < is_array( $api->plans ) ) {
377
- echo ' <a class="button button-primary right" href="' . esc_url( add_query_arg( array(
378
- 'plugin_id' => $plan->plugin_id,
379
- 'plan_id' => $plan->id,
380
- 'pricing_id' => $plan->pricing[0]->id,
381
- 'billing_cycle' => $billing_cycle,
382
- ), $api->checkout_link ) ) . '" target="_parent">' . __fs( 'purchase', $api->slug ) . '</a>';
383
-
384
- // @todo Add Cart concept.
385
- // echo ' <a class="button right" href="' . $status['url'] . '" target="_parent">' . __( 'Add to Cart' ) . '</a>';
386
-
387
- } else if ( ! empty( $api->download_link ) ) {
388
- $status = install_plugin_install_status( $api );
389
- switch ( $status['status'] ) {
390
- case 'install':
391
- if ( $status['url'] ) {
392
- echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Now' ) . '</a>';
393
- }
394
- break;
395
- case 'update_available':
396
- if ( $status['url'] ) {
397
- echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) . '</a>';
398
- }
399
- break;
400
- case 'newer_installed':
401
- echo '<a class="button button-primary right disabled">' . sprintf( __( 'Newer Version (%s) Installed' ), $status['version'] ) . '</a>';
402
- break;
403
- case 'latest_installed':
404
- echo '<a class="button button-primary right disabled">' . __( 'Latest Version Installed' ) . '</a>';
405
- break;
406
- }
407
- }
408
- }
409
- echo "</div>\n";
410
-
411
- iframe_footer();
412
- exit;
413
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/libs/freemius/templates/pending-activation.php DELETED
@@ -1,174 +0,0 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.0.9
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- wp_enqueue_script( 'jquery' );
14
- wp_enqueue_script( 'json2' );
15
- fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' );
16
- fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
17
-
18
- fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' );
19
-
20
- $slug = $VARS['slug'];
21
- $fs = freemius( $slug );
22
- $current_user = wp_get_current_user();
23
-
24
- $first_name = $current_user->user_firstname;
25
- if ( empty( $first_name ) ) {
26
- $first_name = $current_user->nickname;
27
- }
28
-
29
- $site_url = get_site_url();
30
- $protocol_pos = strpos( $site_url, '://' );
31
- if ( false !== $protocol_pos ) {
32
- $site_url = substr( $site_url, $protocol_pos + 3 );
33
- }
34
- ?>
35
- <div id="fs_connect" class="wrap fs-anonymous-disabled">
36
- <div class="fs-visual">
37
- <b class="fs-site-icon"><i class="dashicons dashicons-wordpress"></i></b>
38
- <i class="dashicons dashicons-plus fs-first"></i>
39
-
40
- <div class="fs-plugin-icon">
41
- <object data="//plugins.svn.wordpress.org/<?php echo $slug ?>/assets/icon-128x128.png" type="image/png">
42
- <object data="//plugins.svn.wordpress.org/<?php echo $slug ?>/assets/icon-128x128.jpg" type="image/png">
43
- <object data="//plugins.svn.wordpress.org/<?php echo $slug ?>/assets/icon-256x256.png"
44
- type="image/png">
45
- <object data="//plugins.svn.wordpress.org/<?php echo $slug ?>/assets/icon-256x256.jpg"
46
- type="image/png">
47
- <img src="//wimg.freemius.com/plugin-icon.png"/>
48
- </object>
49
- </object>
50
- </object>
51
- </object>
52
- </div>
53
- <i class="dashicons dashicons-plus fs-second"></i>
54
- <img class="fs-connect-logo" width="80" height="80" src="//img.freemius.com/connect-logo.png"/>
55
- </div>
56
- <div class="fs-content">
57
- <p><?php
58
- echo $fs->apply_filters( 'pending_activation_message', sprintf(
59
- __fs( 'thanks-x', $slug ) . '<br>' .
60
- __fs( 'pending-activation-message', $slug ),
61
- $first_name,
62
- '<b>' . $fs->get_plugin_name() . '</b>',
63
- '<b>' . $current_user->user_email . '</b>'
64
- ) )
65
- ?></p>
66
- </div>
67
- <div class="fs-actions">
68
- <?php $fs_user = Freemius::_get_user_by_email( $current_user->user_email ) ?>
69
- <form method="post" action="<?php echo WP_FS__ADDRESS ?>/action/service/user/install/">
70
- <?php
71
- $params = array(
72
- 'user_firstname' => $current_user->user_firstname,
73
- 'user_lastname' => $current_user->user_lastname,
74
- 'user_nickname' => $current_user->user_nicename,
75
- 'user_email' => $current_user->user_email,
76
- 'plugin_slug' => $slug,
77
- 'plugin_id' => $fs->get_id(),
78
- 'plugin_public_key' => $fs->get_public_key(),
79
- 'plugin_version' => $fs->get_plugin_version(),
80
- 'return_url' => wp_nonce_url( $fs->_get_admin_page_url(
81
- '',
82
- array( 'fs_action' => $slug . '_activate_new' )
83
- ), $slug . '_activate_new' ),
84
- 'account_url' => wp_nonce_url( $fs->_get_admin_page_url(
85
- 'account',
86
- array( 'fs_action' => 'sync_user' )
87
- ), 'sync_user' ),
88
- 'site_url' => get_site_url(),
89
- 'site_name' => get_bloginfo( 'name' ),
90
- 'platform_version' => get_bloginfo( 'version' ),
91
- 'language' => get_bloginfo( 'language' ),
92
- 'charset' => get_bloginfo( 'charset' ),
93
- );
94
- ?>
95
- <?php foreach ( $params as $name => $value ) : ?>
96
- <input type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>">
97
- <?php endforeach ?>
98
- <button class="button button-primary" tabindex="1"
99
- type="submit"><?php _efs( 'resend-activation-email', $slug ) ?></button>
100
- </form>
101
- </div><?php
102
-
103
- // Set core permission list items.
104
- $permissions = array(
105
- 'profile' => array(
106
- 'icon-class' => 'dashicons dashicons-admin-users',
107
- 'label' => __fs( 'permissions-profile' ),
108
- 'desc' => __fs( 'permissions-profile_desc' ),
109
- 'priority' => 5,
110
- ),
111
- 'site' => array(
112
- 'icon-class' => 'dashicons dashicons-wordpress',
113
- 'label' => __fs( 'permissions-site' ),
114
- 'desc' => __fs( 'permissions-site_desc' ),
115
- 'priority' => 10,
116
- ),
117
- 'events' => array(
118
- 'icon-class' => 'dashicons dashicons-admin-plugins',
119
- 'label' => __fs( 'permissions-events' ),
120
- 'desc' => __fs( 'permissions-events_desc' ),
121
- 'priority' => 20,
122
- ),
123
- );
124
-
125
- // Add newsletter permissions if enabled.
126
- if ( $fs->is_permission_requested( 'newsletter' ) ) {
127
- $permissions['newsletter'] = array(
128
- 'icon-class' => 'dashicons dashicons-email-alt',
129
- 'label' => __fs( 'permissions-newsletter' ),
130
- 'desc' => __fs( 'permissions-newsletter_desc' ),
131
- 'priority' => 15,
132
- );
133
- }
134
-
135
- // Allow filtering of the permissions list.
136
- $permissions = $fs->apply_filters( 'permission_list', $permissions );
137
-
138
- // Sort by priority.
139
- uasort( $permissions, 'fs_sort_by_priority' );
140
-
141
- if ( ! empty( $permissions ) ) : ?>
142
- <div class="fs-permissions">
143
- <a class="fs-trigger" href="#"><?php _efs( 'what-permissions', $slug ) ?></a>
144
- <ul><?php
145
- foreach( $permissions as $id => $permission ) : ?>
146
- <li id="fs-permission-<?php esc_attr_e( $id ); ?>" class="fs-permission fs-<?php esc_attr_e( $id ); ?>">
147
- <i class="<?php esc_attr_e( $permission['icon-class'] ); ?>"></i>
148
- <div>
149
- <span><?php esc_html_e( $permission['label'] ); ?></span>
150
- <p><?php esc_html_e( $permission['desc'] ); ?></p>
151
- </div>
152
- </li>
153
- <?php endforeach; ?>
154
- </ul>
155
- </div>
156
- <?php endif; ?>
157
-
158
- <div class="fs-terms">
159
- <a href="https://freemius.com/privacy/" target="_blank"><?php _efs( 'privacy-policy', $slug ) ?></a>
160
- &nbsp;&nbsp;-&nbsp;&nbsp;
161
- <a href="https://freemius.com/terms/" target="_blank"><?php _efs( 'tos', $slug ) ?></a>
162
- </div>
163
- </div>
164
- <script type="text/javascript">
165
- (function ($) {
166
- $('.button.button-primary').on('click', function () {
167
- $(document.body).css({'cursor': 'wait'});
168
- $(this).html('Sending email...').css({'cursor': 'wait'});
169
- });
170
- $('.fs-permissions .fs-trigger').on('click', function () {
171
- $('.fs-permissions').toggleClass('fs-open');
172
- });
173
- })(jQuery);
174
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
  Tags: responsive popup, promotion, popover, pop-up, pop over, marketing, lightbox, advertising, conversion, modal, popup, popups
7
  Requires at least: 3.4
8
  Tested up to: 4.5
9
- Stable tag: 1.4.1
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Easily create attractive popups with no coding skills. Customize nearly every aspect of your popups, from theme & position, to targeting & cookies.
@@ -82,15 +82,15 @@ Find out more about [Popup Maker](https://wppopupmaker.com?utm_source=WordPress+
82
 
83
  = Languages =
84
 
85
- * French (France) 87.00%
86
- * Hungarian 84.00%
87
- * Arabic 84.00%
88
- * Italian 84.00%
89
- * Swedish 84.00%
90
- * Danish 84.00%
91
- * Spanish (Spain) 72.00%
92
- * Russian 68.00%
93
- * German 52.00%
94
 
95
  Would you like to help translate the plugin into more languages? [Join our WP-Translations Community](https://translate.wordpress.org/projects/wp-plugins/popup-maker).
96
 
@@ -115,6 +115,9 @@ There are several common causes for this which include:
115
 
116
  == Changelog ==
117
 
 
 
 
118
  = v1.4.2 - 4/20/2016 =
119
  * Fix: Bug in popup maker deprecated filter caused by no defaults passed.
120
 
6
  Tags: responsive popup, promotion, popover, pop-up, pop over, marketing, lightbox, advertising, conversion, modal, popup, popups
7
  Requires at least: 3.4
8
  Tested up to: 4.5
9
+ Stable tag: 1.4.3
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Easily create attractive popups with no coding skills. Customize nearly every aspect of your popups, from theme & position, to targeting & cookies.
82
 
83
  = Languages =
84
 
85
+ * French (France) 87%
86
+ * Hungarian 84%
87
+ * Arabic 84%
88
+ * Italian 84%
89
+ * Swedish 84%
90
+ * Danish 84%
91
+ * Spanish (Spain) 72%
92
+ * Russian 68%
93
+ * German 52%
94
 
95
  Would you like to help translate the plugin into more languages? [Join our WP-Translations Community](https://translate.wordpress.org/projects/wp-plugins/popup-maker).
96
 
115
 
116
  == Changelog ==
117
 
118
+ = v1.4.3 - 4/20/2016 =
119
+ * Fix: Removed extra whitespace before opening php tags.
120
+
121
  = v1.4.2 - 4/20/2016 =
122
  * Fix: Bug in popup maker deprecated filter caused by no defaults passed.
123