Easy Modal - Version 2.0.15

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Easy Modal
Version 2.0.15
Comparing to
See all releases

Code changes from version 2.0.14 to 2.0.15

assets/scripts/easy-modal-site.js CHANGED
@@ -35,7 +35,7 @@
35
 
36
  jQuery(window).on('resize', function () {
37
  if ($this.hasClass('active'))
38
- jQuery.fn.emodal.utilies.debounce(setTimeout(function () {
39
  $this.emodal('reposition');
40
  }, 25), 500, false);
41
  });
@@ -116,14 +116,16 @@
116
  })
117
  .trigger('emodalSetupClose');
118
  },
119
- open: function () {
120
  var $this = jQuery(this);
121
  var settings = $this.data('emodal');
122
 
123
  $this
124
  .trigger('emodalBeforeOpen')
125
- .emodal('animate', settings.meta.display.animation.type)
126
- .trigger('emodalAfterOpen');
 
 
127
  return this;
128
  },
129
  close: function () {
@@ -242,24 +244,24 @@
242
  }
243
 
244
  $overlay.removeAttr('style').css({
245
- backgroundColor: jQuery.fn.emodal.utilies.convert_hex(theme.overlay.background.color, theme.overlay.background.opacity)
246
  });
247
  var container_inset = theme.container.boxshadow.inset == 'yes' ? 'inset ' : '';
248
  $container.css({
249
  padding: theme.container.padding + 'px',
250
- backgroundColor: jQuery.fn.emodal.utilies.convert_hex(theme.container.background.color, theme.container.background.opacity),
251
  borderStyle: theme.container.border.style,
252
  borderColor: theme.container.border.color,
253
  borderWidth: theme.container.border.width + 'px',
254
  borderRadius: theme.container.border.radius + 'px',
255
- 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.emodal.utilies.convert_hex(theme.container.boxshadow.color, theme.container.boxshadow.opacity)
256
  });
257
  $title.css({
258
  color: theme.title.font.color,
259
  fontSize: theme.title.font.size + 'px',
260
  fontFamily: theme.title.font.family,
261
  textAlign: theme.title.text.align,
262
- textShadow: theme.title.textshadow.horizontal + 'px ' + theme.title.textshadow.vertical + 'px ' + theme.title.textshadow.blur + 'px ' + jQuery.fn.emodal.utilies.convert_hex(theme.title.textshadow.color, theme.title.textshadow.opacity)
263
  });
264
  $content.css({
265
  color: theme.content.font.color,
@@ -274,7 +276,7 @@
274
  var close_inset = theme.close.boxshadow.inset == 'yes' ? 'inset ' : '';
275
  $close.html(theme.close.text).css({
276
  padding: theme.close.padding + 'px',
277
- backgroundColor: jQuery.fn.emodal.utilies.convert_hex(theme.close.background.color, theme.close.background.opacity),
278
  color: theme.close.font.color,
279
  fontSize: theme.close.font.size + 'px',
280
  fontFamily: theme.close.font.family,
@@ -282,8 +284,8 @@
282
  borderColor: theme.close.border.color,
283
  borderWidth: theme.close.border.width + 'px',
284
  borderRadius: theme.close.border.radius + 'px',
285
- 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.emodal.utilies.convert_hex(theme.close.boxshadow.color, theme.close.boxshadow.opacity),
286
- textShadow: theme.close.textshadow.horizontal + 'px ' + theme.close.textshadow.vertical + 'px ' + theme.close.textshadow.blur + 'px ' + jQuery.fn.emodal.utilies.convert_hex(theme.close.textshadow.color, theme.close.textshadow.opacity)
287
  });
288
  switch (theme.close.location) {
289
  case "topleft":
@@ -331,7 +333,7 @@
331
  }
332
  return this;
333
  },
334
- animate: function (style) {
335
  // Method calling logic
336
  if (jQuery.fn.emodal.animations[style])
337
  return jQuery.fn.emodal.animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
@@ -347,7 +349,7 @@
347
  }
348
  };
349
 
350
- jQuery.fn.emodal.utilies = {
351
  convert_hex: function (hex, opacity) {
352
  hex = hex.replace('#', '');
353
  r = parseInt(hex.substring(0, 2), 16);
@@ -356,30 +358,29 @@
356
  result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
357
  return result;
358
  },
359
- debounce: function (func, wait, immediate) {
360
- var timeout, result;
361
- return function () {
362
- var context = this,
363
- args = arguments,
364
- later,
365
- callNow;
366
-
367
- later = function () {
368
- timeout = null;
369
- if (!immediate) {
370
- result = func.apply(context, args);
371
- }
372
- };
373
-
374
- callNow = immediate && !timeout;
375
- clearTimeout(timeout);
376
- timeout = setTimeout(later, wait);
377
- if (callNow) {
378
- result = func.apply(context, args);
379
- }
380
- return result;
381
- };
382
- }
383
  };
384
 
385
  jQuery.fn.emodal.defaults = {
@@ -466,15 +467,16 @@
466
  };
467
 
468
  jQuery.fn.emodal.animations = {
469
- none: function () {
470
  var $this = jQuery(this);
471
  var settings = $this.data('emodal');
472
  $this.emodal('animate_overlay', 'none', 0, function(){
473
  $this.show();
 
474
  });
475
  return this;
476
  },
477
- slide: function () {
478
  var $this = jQuery(this).show(0).css({
479
  opacity: 0
480
  });
@@ -547,21 +549,24 @@
547
  position.opacity = 1;
548
  $this.transition(position, speed * 0.75, function () {
549
  jQuery('html').css('overflow-x', 'inherit');
 
550
  });
551
  });
552
  });
553
  return this;
554
  },
555
- fade: function () {
556
  var $this = jQuery(this);
557
  var settings = $this.data('emodal');
558
  var speed = settings.meta.display.animation.speed / 2;
559
  $this.emodal('animate_overlay', 'fade', speed, function () {
560
- $this.fadeIn(speed);
 
 
561
  });
562
  return this;
563
  },
564
- fadeAndSlide: function () {
565
  var $this = jQuery(this).show(0).css({
566
  opacity: 0
567
  });
@@ -635,12 +640,13 @@
635
  position.opacity = 1;
636
  $this.transition(position, speed * 0.75, function () {
637
  jQuery('html').css('overflow-x', 'inherit');
 
638
  });
639
  });
640
  });
641
  return this;
642
  },
643
- grow: function () {
644
  var $this = jQuery(this);
645
  var settings = $this.data('emodal');
646
  var speed = settings.meta.display.animation.speed;
@@ -664,11 +670,12 @@
664
  opacity: 1
665
  })
666
  .transition(position);
 
667
  });
668
  });
669
  return this;
670
  },
671
- growAndSlide: function () {
672
  var $this = jQuery(this).css({
673
  opacity: 0
674
  }).show();
@@ -748,6 +755,7 @@
748
  .transition(position, function () {
749
  jQuery('html').css('overflow-x', 'inherit');
750
  });
 
751
  });
752
  });
753
  return this;
35
 
36
  jQuery(window).on('resize', function () {
37
  if ($this.hasClass('active'))
38
+ jQuery.fn.emodal.utilities.throttle(setTimeout(function () {
39
  $this.emodal('reposition');
40
  }, 25), 500, false);
41
  });
116
  })
117
  .trigger('emodalSetupClose');
118
  },
119
+ open: function (callback) {
120
  var $this = jQuery(this);
121
  var settings = $this.data('emodal');
122
 
123
  $this
124
  .trigger('emodalBeforeOpen')
125
+ .emodal('animate', settings.meta.display.animation.type, function() {
126
+ $this.trigger('emodalAfterOpen');
127
+ if(callback !== undefined) callback();
128
+ });
129
  return this;
130
  },
131
  close: function () {
244
  }
245
 
246
  $overlay.removeAttr('style').css({
247
+ backgroundColor: jQuery.fn.emodal.utilities.convert_hex(theme.overlay.background.color, theme.overlay.background.opacity)
248
  });
249
  var container_inset = theme.container.boxshadow.inset == 'yes' ? 'inset ' : '';
250
  $container.css({
251
  padding: theme.container.padding + 'px',
252
+ backgroundColor: jQuery.fn.emodal.utilities.convert_hex(theme.container.background.color, theme.container.background.opacity),
253
  borderStyle: theme.container.border.style,
254
  borderColor: theme.container.border.color,
255
  borderWidth: theme.container.border.width + 'px',
256
  borderRadius: theme.container.border.radius + 'px',
257
+ 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.emodal.utilities.convert_hex(theme.container.boxshadow.color, theme.container.boxshadow.opacity)
258
  });
259
  $title.css({
260
  color: theme.title.font.color,
261
  fontSize: theme.title.font.size + 'px',
262
  fontFamily: theme.title.font.family,
263
  textAlign: theme.title.text.align,
264
+ textShadow: theme.title.textshadow.horizontal + 'px ' + theme.title.textshadow.vertical + 'px ' + theme.title.textshadow.blur + 'px ' + jQuery.fn.emodal.utilities.convert_hex(theme.title.textshadow.color, theme.title.textshadow.opacity)
265
  });
266
  $content.css({
267
  color: theme.content.font.color,
276
  var close_inset = theme.close.boxshadow.inset == 'yes' ? 'inset ' : '';
277
  $close.html(theme.close.text).css({
278
  padding: theme.close.padding + 'px',
279
+ backgroundColor: jQuery.fn.emodal.utilities.convert_hex(theme.close.background.color, theme.close.background.opacity),
280
  color: theme.close.font.color,
281
  fontSize: theme.close.font.size + 'px',
282
  fontFamily: theme.close.font.family,
284
  borderColor: theme.close.border.color,
285
  borderWidth: theme.close.border.width + 'px',
286
  borderRadius: theme.close.border.radius + 'px',
287
+ 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.emodal.utilities.convert_hex(theme.close.boxshadow.color, theme.close.boxshadow.opacity),
288
+ textShadow: theme.close.textshadow.horizontal + 'px ' + theme.close.textshadow.vertical + 'px ' + theme.close.textshadow.blur + 'px ' + jQuery.fn.emodal.utilities.convert_hex(theme.close.textshadow.color, theme.close.textshadow.opacity)
289
  });
290
  switch (theme.close.location) {
291
  case "topleft":
333
  }
334
  return this;
335
  },
336
+ animate: function (style, callback) {
337
  // Method calling logic
338
  if (jQuery.fn.emodal.animations[style])
339
  return jQuery.fn.emodal.animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
349
  }
350
  };
351
 
352
+ jQuery.fn.emodal.utilities = {
353
  convert_hex: function (hex, opacity) {
354
  hex = hex.replace('#', '');
355
  r = parseInt(hex.substring(0, 2), 16);
358
  result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
359
  return result;
360
  },
361
+ debounce: function (callback, threshold) {
362
+ var timeout;
363
+ return function() {
364
+ var context = this, params = arguments;
365
+ window.clearTimeout(timeout);
366
+ timeout = window.setTimeout(function() {
367
+ callback.apply(context, params);
368
+ }, threshold);
369
+ };
370
+ },
371
+ throttle: function (callback, threshold) {
372
+ var suppress = false;
373
+ var clear = function() {
374
+ suppress = false;
375
+ };
376
+ return function() {
377
+ if (!suppress) {
378
+ callback.apply(this, arguments);
379
+ window.setTimeout(clear, threshold);
380
+ suppress = true;
381
+ };
382
+ }
383
+ }
 
384
  };
385
 
386
  jQuery.fn.emodal.defaults = {
467
  };
468
 
469
  jQuery.fn.emodal.animations = {
470
+ none: function (callback) {
471
  var $this = jQuery(this);
472
  var settings = $this.data('emodal');
473
  $this.emodal('animate_overlay', 'none', 0, function(){
474
  $this.show();
475
+ if(callback !== undefined) callback();
476
  });
477
  return this;
478
  },
479
+ slide: function (callback) {
480
  var $this = jQuery(this).show(0).css({
481
  opacity: 0
482
  });
549
  position.opacity = 1;
550
  $this.transition(position, speed * 0.75, function () {
551
  jQuery('html').css('overflow-x', 'inherit');
552
+ if(callback !== undefined) callback();
553
  });
554
  });
555
  });
556
  return this;
557
  },
558
+ fade: function (callback) {
559
  var $this = jQuery(this);
560
  var settings = $this.data('emodal');
561
  var speed = settings.meta.display.animation.speed / 2;
562
  $this.emodal('animate_overlay', 'fade', speed, function () {
563
+ $this.fadeIn(speed, function(){
564
+ if(callback !== undefined) callback();
565
+ });
566
  });
567
  return this;
568
  },
569
+ fadeAndSlide: function (callback) {
570
  var $this = jQuery(this).show(0).css({
571
  opacity: 0
572
  });
640
  position.opacity = 1;
641
  $this.transition(position, speed * 0.75, function () {
642
  jQuery('html').css('overflow-x', 'inherit');
643
+ if(callback !== undefined) callback();
644
  });
645
  });
646
  });
647
  return this;
648
  },
649
+ grow: function (callback) {
650
  var $this = jQuery(this);
651
  var settings = $this.data('emodal');
652
  var speed = settings.meta.display.animation.speed;
670
  opacity: 1
671
  })
672
  .transition(position);
673
+ if(callback !== undefined) callback();
674
  });
675
  });
676
  return this;
677
  },
678
+ growAndSlide: function (callback) {
679
  var $this = jQuery(this).css({
680
  opacity: 0
681
  }).show();
755
  .transition(position, function () {
756
  jQuery('html').css('overflow-x', 'inherit');
757
  });
758
+ if(callback !== undefined) callback();
759
  });
760
  });
761
  return this;
assets/scripts/emodal-utilities-strtotime.js ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery.fn.emodal.utilities.strtotime = function (text, now) {
2
+ // discuss at: http://phpjs.org/functions/strtotime/
3
+ // version: 1109.2016
4
+ // original by: Caio Ariede (http://caioariede.com)
5
+ // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
6
+ // improved by: Caio Ariede (http://caioariede.com)
7
+ // improved by: A. Matías Quezada (http://amatiasq.com)
8
+ // improved by: preuter
9
+ // improved by: Brett Zamir (http://brett-zamir.me)
10
+ // improved by: Mirko Faber
11
+ // input by: David
12
+ // bugfixed by: Wagner B. Soares
13
+ // bugfixed by: Artur Tchernychev
14
+ // note: Examples all have a fixed timestamp to prevent tests to fail because of variable time(zones)
15
+ // example 1: strtotime('+1 day', 1129633200);
16
+ // returns 1: 1129719600
17
+ // example 2: strtotime('+1 week 2 days 4 hours 2 seconds', 1129633200);
18
+ // returns 2: 1130425202
19
+ // example 3: strtotime('last month', 1129633200);
20
+ // returns 3: 1127041200
21
+ // example 4: strtotime('2009-05-04 08:30:00 GMT');
22
+ // returns 4: 1241425800
23
+ var parsed, match, today, year, date, days, ranges, len, times, regex, i, fail = false;
24
+ if (!text) {
25
+ return fail;
26
+ }
27
+ // Unecessary spaces
28
+ text = text.replace(/^\s+|\s+$/g, '')
29
+ .replace(/\s{2,}/g, ' ')
30
+ .replace(/[\t\r\n]/g, '')
31
+ .toLowerCase();
32
+ // in contrast to php, js Date.parse function interprets:
33
+ // dates given as yyyy-mm-dd as in timezone: UTC,
34
+ // dates with "." or "-" as MDY instead of DMY
35
+ // dates with two-digit years differently
36
+ // etc...etc...
37
+ // ...therefore we manually parse lots of common date formats
38
+ match = text.match(
39
+ /^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/);
40
+ if (match && match[2] === match[4]) {
41
+ if (match[1] > 1901) {
42
+ switch (match[2]) {
43
+ case '-':
44
+ { // YYYY-M-D
45
+ if (match[3] > 12 || match[5] > 31) {
46
+ return fail;
47
+ }
48
+ return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
49
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
50
+ }
51
+ case '.':
52
+ { // YYYY.M.D is not parsed by strtotime()
53
+ return fail;
54
+ }
55
+ case '/':
56
+ { // YYYY/M/D
57
+ if (match[3] > 12 || match[5] > 31) {
58
+ return fail;
59
+ }
60
+ return new Date(match[1], parseInt(match[3], 10) - 1, match[5],
61
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
62
+ }
63
+ }
64
+ } else if (match[5] > 1901) {
65
+ switch (match[2]) {
66
+ case '-':
67
+ { // D-M-YYYY
68
+ if (match[3] > 12 || match[1] > 31) {
69
+ return fail;
70
+ }
71
+ return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
72
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
73
+ }
74
+ case '.':
75
+ { // D.M.YYYY
76
+ if (match[3] > 12 || match[1] > 31) {
77
+ return fail;
78
+ }
79
+ return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
80
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
81
+ }
82
+ case '/':
83
+ { // M/D/YYYY
84
+ if (match[1] > 12 || match[3] > 31) {
85
+ return fail;
86
+ }
87
+ return new Date(match[5], parseInt(match[1], 10) - 1, match[3],
88
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
89
+ }
90
+ }
91
+ } else {
92
+ switch (match[2]) {
93
+ case '-':
94
+ { // YY-M-D
95
+ if (match[3] > 12 || match[5] > 31 || (match[1] < 70 && match[1] > 38)) {
96
+ return fail;
97
+ }
98
+ year = match[1] >= 0 && match[1] <= 38 ? +match[1] + 2000 : match[1];
99
+ return new Date(year, parseInt(match[3], 10) - 1, match[5],
100
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
101
+ }
102
+ case '.':
103
+ { // D.M.YY or H.MM.SS
104
+ if (match[5] >= 70) { // D.M.YY
105
+ if (match[3] > 12 || match[1] > 31) {
106
+ return fail;
107
+ }
108
+ return new Date(match[5], parseInt(match[3], 10) - 1, match[1],
109
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
110
+ }
111
+ if (match[5] < 60 && !match[6]) { // H.MM.SS
112
+ if (match[1] > 23 || match[3] > 59) {
113
+ return fail;
114
+ }
115
+ today = new Date();
116
+ return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
117
+ match[1] || 0, match[3] || 0, match[5] || 0, match[9] || 0) / 1000;
118
+ }
119
+ return fail; // invalid format, cannot be parsed
120
+ }
121
+ case '/':
122
+ { // M/D/YY
123
+ if (match[1] > 12 || match[3] > 31 || (match[5] < 70 && match[5] > 38)) {
124
+ return fail;
125
+ }
126
+ year = match[5] >= 0 && match[5] <= 38 ? +match[5] + 2000 : match[5];
127
+ return new Date(year, parseInt(match[1], 10) - 1, match[3],
128
+ match[6] || 0, match[7] || 0, match[8] || 0, match[9] || 0) / 1000;
129
+ }
130
+ case ':':
131
+ { // HH:MM:SS
132
+ if (match[1] > 23 || match[3] > 59 || match[5] > 59) {
133
+ return fail;
134
+ }
135
+ today = new Date();
136
+ return new Date(today.getFullYear(), today.getMonth(), today.getDate(),
137
+ match[1] || 0, match[3] || 0, match[5] || 0) / 1000;
138
+ }
139
+ }
140
+ }
141
+ }
142
+ // other formats and "now" should be parsed by Date.parse()
143
+ if (text === 'now') {
144
+ return now === null || isNaN(now) ? new Date()
145
+ .getTime() / 1000 | 0 : now | 0;
146
+ }
147
+ if (!isNaN(parsed = Date.parse(text))) {
148
+ return parsed / 1000 | 0;
149
+ }
150
+ date = now ? new Date(now * 1000) : new Date();
151
+ days = {
152
+ 'sun': 0,
153
+ 'mon': 1,
154
+ 'tue': 2,
155
+ 'wed': 3,
156
+ 'thu': 4,
157
+ 'fri': 5,
158
+ 'sat': 6
159
+ };
160
+ ranges = {
161
+ 'yea': 'FullYear',
162
+ 'mon': 'Month',
163
+ 'day': 'Date',
164
+ 'hou': 'Hours',
165
+ 'min': 'Minutes',
166
+ 'sec': 'Seconds'
167
+ };
168
+
169
+ function lastNext(type, range, modifier) {
170
+ var diff, day = days[range];
171
+ if (typeof day !== 'undefined') {
172
+ diff = day - date.getDay();
173
+ if (diff === 0) {
174
+ diff = 7 * modifier;
175
+ } else if (diff > 0 && type === 'last') {
176
+ diff -= 7;
177
+ } else if (diff < 0 && type === 'next') {
178
+ diff += 7;
179
+ }
180
+ date.setDate(date.getDate() + diff);
181
+ }
182
+ }
183
+
184
+ function process(val) {
185
+ var splt = val.split(' '), // Todo: Reconcile this with regex using \s, taking into account browser issues with split and regexes
186
+ type = splt[0],
187
+ range = splt[1].substring(0, 3),
188
+ typeIsNumber = /\d+/.test(type),
189
+ ago = splt[2] === 'ago',
190
+ num = (type === 'last' ? -1 : 1) * (ago ? -1 : 1);
191
+ if (typeIsNumber) {
192
+ num *= parseInt(type, 10);
193
+ }
194
+ if (ranges.hasOwnProperty(range) && !splt[1].match(/^mon(day|\.)?$/i)) {
195
+ return date['set' + ranges[range]](date['get' + ranges[range]]() + num);
196
+ }
197
+ if (range === 'wee') {
198
+ return date.setDate(date.getDate() + (num * 7));
199
+ }
200
+ if (type === 'next' || type === 'last') {
201
+ lastNext(type, range, num);
202
+ } else if (!typeIsNumber) {
203
+ return false;
204
+ }
205
+ return true;
206
+ }
207
+ times = '(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec' +
208
+ '|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?' +
209
+ '|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)';
210
+ regex = '([+-]?\\d+\\s' + times + '|' + '(last|next)\\s' + times + ')(\\sago)?';
211
+ match = text.match(new RegExp(regex, 'gi'));
212
+ if (!match) {
213
+ return fail;
214
+ }
215
+ for (i = 0, len = match.length; i < len; i++) {
216
+ if (!process(match[i])) {
217
+ return fail;
218
+ }
219
+ }
220
+ // ECMAScript 5 only
221
+ // if (!match.every(process))
222
+ // return false;
223
+ return (date.getTime() / 1000);
224
+ }
assets/scripts/jquery.cookie.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.4.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD
11
+ define(['jquery'], factory);
12
+ } else if (typeof exports === 'object') {
13
+ // CommonJS
14
+ factory(require('jquery'));
15
+ } else {
16
+ // Browser globals
17
+ factory(jQuery);
18
+ }
19
+ }(function ($) {
20
+
21
+ var pluses = /\+/g;
22
+
23
+ function encode(s) {
24
+ return config.raw ? s : encodeURIComponent(s);
25
+ }
26
+
27
+ function decode(s) {
28
+ return config.raw ? s : decodeURIComponent(s);
29
+ }
30
+
31
+ function stringifyCookieValue(value) {
32
+ return encode(config.json ? JSON.stringify(value) : String(value));
33
+ }
34
+
35
+ function parseCookieValue(s) {
36
+ if (s.indexOf('"') === 0) {
37
+ // This is a quoted cookie as according to RFC2068, unescape...
38
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
39
+ }
40
+
41
+ try {
42
+ // Replace server-side written pluses with spaces.
43
+ // If we can't decode the cookie, ignore it, it's unusable.
44
+ // If we can't parse the cookie, ignore it, it's unusable.
45
+ s = decodeURIComponent(s.replace(pluses, ' '));
46
+ return config.json ? JSON.parse(s) : s;
47
+ } catch(e) {}
48
+ }
49
+
50
+ function read(s, converter) {
51
+ var value = config.raw ? s : parseCookieValue(s);
52
+ return $.isFunction(converter) ? converter(value) : value;
53
+ }
54
+
55
+ var config = $.cookie = function (key, value, options) {
56
+
57
+ // Write
58
+
59
+ if (value !== undefined && !$.isFunction(value)) {
60
+ options = $.extend({}, config.defaults, options);
61
+
62
+ if (typeof options.expires === 'number') {
63
+ var days = options.expires, t = options.expires = new Date();
64
+ t.setTime(+t + days * 864e+5);
65
+ }
66
+
67
+ return (document.cookie = [
68
+ encode(key), '=', stringifyCookieValue(value),
69
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
70
+ options.path ? '; path=' + options.path : '',
71
+ options.domain ? '; domain=' + options.domain : '',
72
+ options.secure ? '; secure' : ''
73
+ ].join(''));
74
+ }
75
+
76
+ // Read
77
+
78
+ var result = key ? undefined : {};
79
+
80
+ // To prevent the for loop in the first place assign an empty array
81
+ // in case there are no cookies at all. Also prevents odd result when
82
+ // calling $.cookie().
83
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
84
+
85
+ for (var i = 0, l = cookies.length; i < l; i++) {
86
+ var parts = cookies[i].split('=');
87
+ var name = decode(parts.shift());
88
+ var cookie = parts.join('=');
89
+
90
+ if (key && key === name) {
91
+ // If second argument (value) is a function it's a converter...
92
+ result = read(cookie, value);
93
+ break;
94
+ }
95
+
96
+ // Prevent storing a cookie that we couldn't decode.
97
+ if (!key && (cookie = read(cookie)) !== undefined) {
98
+ result[name] = cookie;
99
+ }
100
+ }
101
+
102
+ return result;
103
+ };
104
+
105
+ config.defaults = {};
106
+
107
+ $.removeCookie = function (key, options) {
108
+ if ($.cookie(key) === undefined) {
109
+ return false;
110
+ }
111
+
112
+ // Must not alter options, thus extending a fresh object...
113
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
114
+ return !$.cookie(key);
115
+ };
116
+
117
+ }));
assets/styles/easy-modal-site.css CHANGED
@@ -15,6 +15,7 @@
15
  top:100px;
16
  visibility: hidden;
17
  position: absolute;
 
18
  z-index: 999!important;
19
  }
20
 
15
  top:100px;
16
  visibility: hidden;
17
  position: absolute;
18
+ display:none;
19
  z-index: 999!important;
20
  }
21
 
classes/site.php CHANGED
@@ -6,6 +6,7 @@ class EModal_Site {
6
  add_action('wp_footer', array('EModal_Modals', 'print_modals'), 1);
7
  add_action('wp_enqueue_scripts', array($this, 'styles'), 0);
8
  add_action('wp_enqueue_scripts', array($this, 'scripts'), 0);
 
9
  }
10
  public function styles()
11
  {
@@ -13,8 +14,10 @@ class EModal_Site {
13
  }
14
  public function scripts()
15
  {
16
- wp_register_script( 'jquery-transit', EMCORE_URL.'/assets/scripts/jquery.transit.min.js', array('jquery'), '0.9.11', true );
17
- wp_enqueue_script(EMCORE_SLUG.'-site', EMCORE_URL.'/assets/scripts/'.EMCORE_SLUG.'-site.js', array('jquery', 'jquery-ui-core', 'jquery-ui-position', 'jquery-transit'), '2', true);
 
 
18
  $themes = array();
19
  foreach(get_all_modal_themes() as $theme)
20
  {
@@ -24,4 +27,13 @@ class EModal_Site {
24
  }
25
  wp_localize_script(EMCORE_SLUG.'-site', 'emodal_themes', array('l10n_print_after' => 'emodal_themes = ' . json_encode($themes) . ';'));
26
  }
 
 
 
 
 
 
 
 
 
27
  }
6
  add_action('wp_footer', array('EModal_Modals', 'print_modals'), 1);
7
  add_action('wp_enqueue_scripts', array($this, 'styles'), 0);
8
  add_action('wp_enqueue_scripts', array($this, 'scripts'), 0);
9
+ add_filter( 'clean_url', array($this, 'clean_url'), 11, 1 );
10
  }
11
  public function styles()
12
  {
14
  }
15
  public function scripts()
16
  {
17
+ wp_register_script('jquery-transit', EMCORE_URL.'/assets/scripts/jquery.transit.min.js', array('jquery'), '0.9.11', true);
18
+ wp_register_script('jquery-cookie', EMCORE_URL.'/assets/scripts/jquery.cookie.js', array('jquery'), '1.4.1', true);
19
+ wp_register_script(EMCORE_SLUG.'-utilities-strtotime', EMCORE_URL.'/assets/scripts/emodal-utilities-strtotime.js?defer', array('jquery', EMCORE_SLUG.'-site'), '1', true );
20
+ wp_enqueue_script(EMCORE_SLUG.'-site', EMCORE_URL.'/assets/scripts/'.EMCORE_SLUG.'-site.js?defer', array('jquery', 'jquery-ui-core', 'jquery-ui-position', 'jquery-transit'), '2', true);
21
  $themes = array();
22
  foreach(get_all_modal_themes() as $theme)
23
  {
27
  }
28
  wp_localize_script(EMCORE_SLUG.'-site', 'emodal_themes', array('l10n_print_after' => 'emodal_themes = ' . json_encode($themes) . ';'));
29
  }
30
+ public function clean_url( $url )
31
+ {
32
+ if ( FALSE === strpos( $url, '.js?defer' ) )
33
+ { // not our file
34
+ return $url;
35
+ }
36
+ // Must be a ', not "!
37
+ return "$url' defer='defer";
38
+ }
39
  }
easy-modal.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Modal
4
  Plugin URI: http://easy-modal.com
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Wizard Internet Solutions
7
- Version: 2.0.14
8
  Author URI: http://wizardinternetsolutions.com
9
  Text Domain: easy-modal
10
  */
@@ -21,7 +21,7 @@ if (!defined('EMCORE_URL'))
21
  if (!defined('EMCORE_NONCE'))
22
  define('EMCORE_NONCE', EMCORE_SLUG.'_nonce' );
23
  if (!defined('EMCORE_VERSION'))
24
- define('EMCORE_VERSION', '2.0.14' );
25
  if (!defined('EMCORE_DB_VERSION'))
26
  define('EMCORE_DB_VERSION', '1.1' );
27
  if (!defined('EMCORE_API_URL'))
4
  Plugin URI: http://easy-modal.com
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Wizard Internet Solutions
7
+ Version: 2.0.15
8
  Author URI: http://wizardinternetsolutions.com
9
  Text Domain: easy-modal
10
  */
21
  if (!defined('EMCORE_NONCE'))
22
  define('EMCORE_NONCE', EMCORE_SLUG.'_nonce' );
23
  if (!defined('EMCORE_VERSION'))
24
+ define('EMCORE_VERSION', '2.0.15' );
25
  if (!defined('EMCORE_DB_VERSION'))
26
  define('EMCORE_DB_VERSION', '1.1' );
27
  if (!defined('EMCORE_API_URL'))
readme.txt CHANGED
@@ -1,25 +1,23 @@
1
  === Easy Modal ===
2
  Contributors: danieliser, waltmesser
3
  Author URI: http://wizardinternetsolutions.com
4
- Plugin URI: http://easy-modal.com
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PQTG2JYUKSLFW
6
- Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms
7
  Requires at least: 3.4
8
  Tested up to: 4.0
9
- Stable tag: 2.0.14
10
- The #1 WordPress Popup Plugin! Make glorious & powerful: Login, Auto Exit, Auto Open, Scroll, Age Verification & Force User Action Popups - all in minutes.
11
 
12
  == Description ==
13
- Make any popup in minutes. Login Modals, Auto Exit Popups, Auto Open Popups, Scroll Popups, Age Verification Modals & Force User Action Popups.
14
-
15
- Use EasyModal's ultimate theme capabilities and customization options to make glorious pop ups that increase your site's usability, conversion rates & leads generated. Easy Modal gives you the ability to stream line and transform your website, plus promote and market your content like never before!
16
 
17
  All in minutes.
18
 
19
- Check out our [Getting Started Guide](http://easy-modal.com/documentation/easy-modal/getting-started "Getting Started Guide") to see how.
20
 
21
  * If you like the plugin please rate & review it! If you love the plugin and want news & updates, follow us on [Twitter](https://twitter.com/EasyModal "Easy Modal on Twitter"), [Facebook](https://www.facebook.com/EasyModal "Easy Modal on Facebook") & [G+](https://plus.google.com/+Easy-modal/posts "Easy Modal on G+")!
22
- * Check out the [Easy Modal Website](http://easy-modal.com "Easy Modal Website") for everything Easy Modal.
23
 
24
  = Core Features =
25
  * Unlimited Customizable Modals
@@ -38,25 +36,26 @@ Check out our [Getting Started Guide](http://easy-modal.com/documentation/easy-m
38
  * Hooks & Filters for Ultimate Customization
39
  * WordPress Support Forum Access
40
 
41
- = Add Ons =
42
  * Auto Open Modals
43
- * Open modals automatically when users visit your site or a specific page.
44
  * Exit Modals
45
- * This add on allows you to create modals and popups that appear when a user attempts to leave or exit your site
46
  * Login Modals
47
- * This add on gives you the ability to have ajax login forms appear in a popup. Also includes registration and forgot your password modals.
48
  * Age Verification
49
- * This add on will popup and prompt users to verify their age by inputting the information in a form (or drop down), or use a simple button (click to proceed) format
50
  * Unlimited Themes
51
- * Create as many themes as you need. Choose which theme each modal uses.
52
  * Scroll Pops
53
- * Popup modals when the user scrolls down the page.
54
  * Force User Action
55
- * Disable the close button, forcing the user to fill out your form or do another action.
56
  * Advanced Theme Editor
57
- * Add background images to the overlay, container and close button.
58
 
59
 
 
60
 
61
  [Plugin Developers Site](http://wizardinternetsolutions.com "Web & Plugin Development") - Wizard Internet Solutions
62
 
@@ -66,6 +65,16 @@ Check out our [Getting Started Guide](http://easy-modal.com/documentation/easy-m
66
  4. Theme, customize, and make a popup in minutes.
67
 
68
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
69
  = v2.0.14 =
70
  * Bug
71
  * Fixed a bug with visibility that happened before a modal is opened.
1
  === Easy Modal ===
2
  Contributors: danieliser, waltmesser
3
  Author URI: http://wizardinternetsolutions.com
4
+ Plugin URI: https://easy-modal.com
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PQTG2JYUKSLFW
6
+ Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms, lightbox
7
  Requires at least: 3.4
8
  Tested up to: 4.0
9
+ Stable tag: 2.0.15
10
+ The #1 WordPress Popup Plugin! Make glorious & powerful popups and market your content like never before - all in minutes!
11
 
12
  == Description ==
13
+ Increase your site's leads generated, usability & conversion rates using Easy Modal's ultimate theme capabilities and customization options. Easy Modal gives you the ability to stream line and transform your website, plus promote and market your content like never before!
 
 
14
 
15
  All in minutes.
16
 
17
+ Check out our [Getting Started Guide](https://easy-modal.com/documentation/easy-modal/getting-started "Getting Started Guide") to see how.
18
 
19
  * If you like the plugin please rate & review it! If you love the plugin and want news & updates, follow us on [Twitter](https://twitter.com/EasyModal "Easy Modal on Twitter"), [Facebook](https://www.facebook.com/EasyModal "Easy Modal on Facebook") & [G+](https://plus.google.com/+Easy-modal/posts "Easy Modal on G+")!
20
+ * Check out the [Easy Modal Website](https://easy-modal.com "Easy Modal Website") for everything Easy Modal.
21
 
22
  = Core Features =
23
  * Unlimited Customizable Modals
36
  * Hooks & Filters for Ultimate Customization
37
  * WordPress Support Forum Access
38
 
39
+ = Use Add Ons to Make Advanced Modals, Popups & Lightboxes - in minutes! =
40
  * Auto Open Modals
41
+ * Make popups that automatically open when users visit your site or a specific page.
42
  * Exit Modals
43
+ * This add on allows you to create modals and popups that appear when a user attempts to leave or exit your site using our Soft Exit Technology.
44
  * Login Modals
45
+ * This add on gives you the ability to create out-of-the-box Login Modals, Forgot Your Password & Registration in minutes - no coding, no setup.
46
  * Age Verification
47
+ * This add on creates out-of-the-box popups that open automatically and prompt users to verify their age using using your choice of: birth date drop downs or click to proceed buttons. No coding, no setup.
48
  * Unlimited Themes
49
+ * Create an infinite amount of themes. Choose which theme each modal uses.
50
  * Scroll Pops
51
+ * Popup modals automatically when the user scrolls down the page. Set the scroll distance (in %, PX, EM, REM) to your preference.
52
  * Force User Action
53
+ * Disable the close button, forcing the user to fill out your form or do another action. Great for funneling users.
54
  * Advanced Theme Editor
55
+ * Add background images to the overlay, container and close button. Produce unique & professional popups with this add on.
56
 
57
 
58
+ [Read More About our Add Ons](https://easy-modal.com/addons "Easy Modal Add Ons") - Easy Modal Add Ons
59
 
60
  [Plugin Developers Site](http://wizardinternetsolutions.com "Web & Plugin Development") - Wizard Internet Solutions
61
 
65
  4. Theme, customize, and make a popup in minutes.
66
 
67
  == Changelog ==
68
+ = v2.0.15 =
69
+ * Bug
70
+ * Changed misspelled function name in site js.
71
+ * Included jQuery cookie and emodal utilities - strtotime JS function
72
+ * Improvement
73
+ * Added callbacks to open and animation.
74
+ * Added display:none to modals by default.
75
+ * Added script deference.
76
+ * Registered jquery cookies and emodal utilities strtotime js.
77
+
78
  = v2.0.14 =
79
  * Bug
80
  * Fixed a bug with visibility that happened before a modal is opened.