Easy Modal - Version 2.0.14

Version Description

Download this release

Release Info

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

Code changes from version 2.0.13 to 2.0.14

assets/scripts/easy-modal-admin.js CHANGED
@@ -1,384 +1,382 @@
1
- "use strict";
2
- var EModalAdmin = {
3
- init: function () {
4
- EModalAdmin.initialize_tabs();
5
- if (jQuery('#emodal-modal-editor').length) {
6
- EModalAdmin.initialize_modal_page();
7
- }
8
- if (jQuery('#emodal-theme-editor').length) {
9
- EModalAdmin.initialize_theme_page();
10
- }
11
- EModalAdmin.initialize_color_pickers();
12
- EModalAdmin.initialize_range_sliders();
13
-
14
- jQuery(document).keydown(function (e) {
15
- if ((e.which === '115' || e.which === '83') && (e.ctrlKey || e.metaKey)) {
16
- e.preventDefault();
17
- jQuery('#emodal-theme-editor, #emodal-modal-editor').submit();
18
- return false;
19
- }
20
- return true;
21
- });
22
-
23
- },
24
- initialize_color_pickers: function () {
25
- var self = this;
26
- jQuery('.color-picker').wpColorPicker({
27
- clear: function (event, ui) {
28
- self.debounce(setTimeout(function () {
29
- var theme = self.serialize_form('#emodal-theme-editor').theme;
30
- self.retheme_modal(theme.meta);
31
- }, 5), 10000);
32
- var $input = jQuery(event.currentTarget).prev();
33
- if ($input.hasClass('background-color')) {
34
- $input.parents('table').find('.background-opacity').hide();
35
- }
36
- }
37
- });
38
-
39
- },
40
- initialize_range_sliders: function () {
41
- jQuery('input[type="range"]').on('input', function () {
42
- jQuery(this).next('.range-value').find('.value').text(jQuery(this).val());
43
- });
44
- var input = document.createElement('input'),
45
- $input,
46
- $slider;
47
- input.setAttribute('type', 'range');
48
- if (input.type === 'text') {
49
- jQuery('input[type=range]').each(function (index, input) {
50
- $input = jQuery(input);
51
- $slider = jQuery('<div />').slider({
52
- min: parseInt($input.attr('min'), 10) || 0,
53
- max: parseInt($input.attr('max'), 10) || 100,
54
- value: parseInt($input.attr('value'), 10) || 0,
55
- step: parseInt($input.attr('step'), 10) || 1,
56
- slide: function (event, ui) {
57
- jQuery(this).prev('input').val(ui.value);
58
- }
59
- });
60
- $input.after($slider).hide();
61
- });
62
- }
63
- },
64
- initialize_tabs: function () {
65
- //var active_tab = window.location.hash.replace('#top#','');
66
- var active_tab = window.location.hash;
67
- if (active_tab === '') {
68
- active_tab = '#' + jQuery('.emodal-tab-content').eq(0).attr('id');
69
- }
70
-
71
- jQuery('.emodal-tab-content').hide();
72
- jQuery(active_tab).show();
73
- jQuery(active_tab + '-tab').addClass('nav-tab-active');
74
- jQuery(window).scrollTop(0);
75
-
76
-
77
- jQuery('#emodal-tabs .nav-tab').click(function (e) {
78
- e.preventDefault();
79
-
80
- jQuery('.emodal-tab-content').hide();
81
- jQuery('.emodal-tab').removeClass('nav-tab-active');
82
-
83
- var id = jQuery(this).attr('href');
84
- jQuery(id).show();
85
- jQuery(this).addClass('nav-tab-active');
86
-
87
- if (history.pushState) {
88
- history.pushState(null, null, id);
89
- } else {
90
- location.hash = id;
91
- jQuery(window).scrollTop(0);
92
- }
93
- });
94
- },
95
- initialize_modal_page: function () {
96
- var update_size = function () {
97
- if (jQuery("#size").val() !== 'custom') {
98
- jQuery('.custom-size-only').hide();
99
- } else {
100
- jQuery('.custom-size-only').show();
101
- if (jQuery('#custom_height_auto').is(':checked')) {
102
- jQuery('.custom-size-height-only').hide();
103
- } else {
104
- jQuery('.custom-size-height-only').show();
105
- }
106
- }
107
- },
108
- update_animation = function () {
109
- jQuery('.animation-speed, .animation-origin').hide();
110
- if (jQuery("#animation_type").val() === 'fade') {
111
- jQuery('.animation-speed').show();
112
- } else if (jQuery("#animation_type").val() === 'none') {
113
-
114
- } else {
115
- jQuery('.animation-speed, .animation-origin').show();
116
- }
117
-
118
- },
119
- update_location = function () {
120
- var $this = jQuery('#display_location'),
121
- table = $this.parents('table'),
122
- val = $this.val();
123
- jQuery('tr.top, tr.right, tr.left, tr.bottom', table).hide();
124
- if (val.indexOf("top") >= 0) {
125
- jQuery('tr.top').show();
126
- }
127
- if (val.indexOf("left") >= 0) {
128
- jQuery('tr.left').show();
129
- }
130
- if (val.indexOf("bottom") >= 0) {
131
- jQuery('tr.bottom').show();
132
- }
133
- if (val.indexOf("right") >= 0) {
134
- jQuery('tr.right').show();
135
- }
136
- };
137
- jQuery("#size").on('change', function () {
138
- update_size();
139
- });
140
- jQuery('#custom_height_auto').on('click', function () {
141
- update_size();
142
- });
143
- jQuery("#animation_type").on('change', function () {
144
- update_animation();
145
- });
146
- jQuery("#animation_speed").on('input', function () {
147
- jQuery(this).next('.range-value').text(jQuery(this).val() + 'ms');
148
- });
149
- jQuery('#display_location').on('change', function () {
150
- update_location();
151
- });
152
- update_size();
153
- update_animation();
154
- update_location();
155
- },
156
- theme_page_listeners: function () {
157
- var self = this;
158
- jQuery('select, input:not(.color-picker)').on('change input focusout', function () {
159
- self.update_theme();
160
- });
161
- jQuery('select.border-style').on('change', function () {
162
- var $this = jQuery(this);
163
- if ($this.val() === 'none') {
164
- $this.parents('table').find('.border-options').hide();
165
- } else {
166
- $this.parents('table').find('.border-options').show();
167
- }
168
- });
169
- jQuery('#close_location').on('change', function () {
170
- var $this = jQuery(this),
171
- table = $this.parents('table');
172
- jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
173
- jQuery('tr.' + $this.val(), table).show();
174
- });
175
- jQuery('.color-picker').on('irischange', function (event, ui) {
176
- self.debounce(setTimeout(function () {
177
- var theme = self.serialize_form('#emodal-theme-editor').theme;
178
- self.retheme_modal(theme.meta);
179
- }, 5), 10000);
180
- var $input = jQuery(event.currentTarget);
181
- if ($input.hasClass('background-color')) {
182
- $input.parents('table').find('.background-opacity').show();
183
- }
184
- });
185
-
186
- },
187
- update_theme: function () {
188
- var theme = this.serialize_form('#emodal-theme-editor').theme;
189
- this.retheme_modal(theme.meta);
190
- },
191
- theme_preview_scroll: function () {
192
- var $preview = jQuery('#emodal-theme-editor .empreview'),
193
- startscroll = $preview.offset().top - 50;
194
- jQuery(window).on('scroll', function () {
195
- if (jQuery(window).scrollTop() >= startscroll) {
196
- $preview.css({
197
- left: $preview.offset().left,
198
- width: $preview.width(),
199
- height: $preview.height(),
200
- position: 'fixed',
201
- top: 50
202
- });
203
- } else {
204
- $preview.removeAttr('style');
205
- }
206
- });
207
- },
208
- initialize_theme_page: function () {
209
- var self = this,
210
- table = jQuery('#close_location').parents('table');
211
- self.update_theme();
212
- self.theme_page_listeners();
213
- self.theme_preview_scroll();
214
-
215
- jQuery('select.border-style').each(function () {
216
- var $this = jQuery(this);
217
- if ($this.val() === 'none') {
218
- $this.parents('table').find('.border-options').hide();
219
- } else {
220
- $this.parents('table').find('.border-options').show();
221
- }
222
- });
223
-
224
- jQuery('.color-picker.background-color').each(function () {
225
- var $this = jQuery(this);
226
- if ($this.val() === '') {
227
- $this.parents('table').find('.background-opacity').hide();
228
- } else {
229
- $this.parents('table').find('.background-opacity').show();
230
- }
231
- });
232
-
233
- jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
234
- switch (jQuery('#close_location').val()) {
235
- case "topleft":
236
- jQuery('tr.topleft', table).show();
237
- break;
238
- case "topright":
239
- jQuery('tr.topright', table).show();
240
- break;
241
- case "bottomleft":
242
- jQuery('tr.bottomleft', table).show();
243
- break;
244
- case "bottomright":
245
- jQuery('tr.bottomright', table).show();
246
- break;
247
- }
248
-
249
- },
250
- retheme_modal: function (theme) {
251
- var $overlay = jQuery('.empreview .example-modal-overlay'),
252
- $container = jQuery('.empreview .example-modal'),
253
- $title = jQuery('.title', $container),
254
- $content = jQuery('.content', $container),
255
- $close = jQuery('.close-modal', $container),
256
- container_inset = theme.container.boxshadow.inset === 'yes' ? 'inset ' : '',
257
- close_inset = theme.close.boxshadow.inset === 'yes' ? 'inset ' : '';
258
-
259
- $overlay.removeAttr('style').css({
260
- backgroundColor: this.convert_hex(theme.overlay.background.color, theme.overlay.background.opacity)
261
- });
262
- $container.removeAttr('style').css({
263
- padding: theme.container.padding + 'px',
264
- backgroundColor: this.convert_hex(theme.container.background.color, theme.container.background.opacity),
265
- borderStyle: theme.container.border.style,
266
- borderColor: theme.container.border.color,
267
- borderWidth: theme.container.border.width + 'px',
268
- borderRadius: theme.container.border.radius + 'px',
269
- 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)
270
- });
271
- $title.removeAttr('style').css({
272
- color: theme.title.font.color,
273
- fontSize: theme.title.font.size + 'px',
274
- fontFamily: theme.title.font.family,
275
- textAlign: theme.title.text.align,
276
- 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)
277
- });
278
- $content.removeAttr('style').css({
279
- color: theme.content.font.color,
280
- //fontSize: theme.content.font.size+'px',
281
- fontFamily: theme.content.font.family
282
- });
283
- $close.html(theme.close.text).removeAttr('style').css({
284
- padding: theme.close.padding + 'px',
285
- backgroundColor: this.convert_hex(theme.close.background.color, theme.close.background.opacity),
286
- color: theme.close.font.color,
287
- fontSize: theme.close.font.size + 'px',
288
- fontFamily: theme.close.font.family,
289
- borderStyle: theme.close.border.style,
290
- borderColor: theme.close.border.color,
291
- borderWidth: theme.close.border.width + 'px',
292
- borderRadius: theme.close.border.radius + 'px',
293
- 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),
294
- 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)
295
- });
296
- switch (theme.close.location) {
297
- case "topleft":
298
- $close.css({
299
- top: theme.close.position.top + 'px',
300
- left: theme.close.position.left + 'px'
301
- });
302
- break;
303
- case "topright":
304
- $close.css({
305
- top: theme.close.position.top + 'px',
306
- right: theme.close.position.right + 'px'
307
- });
308
- break;
309
- case "bottomleft":
310
- $close.css({
311
- bottom: theme.close.position.bottom + 'px',
312
- left: theme.close.position.left + 'px'
313
- });
314
- break;
315
- case "bottomright":
316
- $close.css({
317
- bottom: theme.close.position.bottom + 'px',
318
- right: theme.close.position.right + 'px'
319
- });
320
- break;
321
- }
322
- jQuery(document).trigger('emodal-admin-retheme', [theme]);
323
- },
324
- serialize_form: function ($form) {
325
- var serialized = {};
326
- jQuery("[name]", $form).each(function () {
327
- var name = jQuery(this).attr('name'),
328
- value = jQuery(this).val(),
329
- nameBits = name.split('['),
330
- previousRef = serialized,
331
- i = 0,
332
- l = nameBits.length,
333
- nameBit;
334
- for (i; i < l; i += 1) {
335
- nameBit = nameBits[i].replace(']', '');
336
- if (!previousRef[nameBit]) {
337
- previousRef[nameBit] = {};
338
- }
339
- if (i !== nameBits.length - 1) {
340
- previousRef = previousRef[nameBit];
341
- } else if (i === nameBits.length - 1) {
342
- previousRef[nameBit] = value;
343
- }
344
- }
345
- });
346
- return serialized;
347
- },
348
- convert_hex: function (hex, opacity) {
349
- hex = hex.replace('#', '');
350
- var r = parseInt(hex.substring(0, 2), 16),
351
- g = parseInt(hex.substring(2, 4), 16),
352
- b = parseInt(hex.substring(4, 6), 16),
353
- result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
354
- return result;
355
- },
356
- // taken from underscore.js _.debounce method
357
- debounce: function (func, wait, immediate) {
358
- var timeout, result;
359
- return function () {
360
- var context = this,
361
- args = arguments,
362
- later,
363
- callNow;
364
-
365
- later = function () {
366
- timeout = null;
367
- if (!immediate) {
368
- result = func.apply(context, args);
369
- }
370
- };
371
-
372
- callNow = immediate && !timeout;
373
- clearTimeout(timeout);
374
- timeout = setTimeout(later, wait);
375
- if (callNow) {
376
- result = func.apply(context, args);
377
- }
378
- return result;
379
- };
380
- }
381
- };
382
- jQuery(document).ready(function () {
383
- EModalAdmin.init();
384
  });
1
+ "use strict";
2
+ var EModalAdmin = {
3
+ init: function () {
4
+ EModalAdmin.initialize_tabs();
5
+ if (jQuery('#emodal-modal-editor').length) {
6
+ EModalAdmin.initialize_modal_page();
7
+ }
8
+ if (jQuery('#emodal-theme-editor').length) {
9
+ EModalAdmin.initialize_theme_page();
10
+ }
11
+ EModalAdmin.initialize_color_pickers();
12
+ EModalAdmin.initialize_range_sliders();
13
+
14
+ jQuery(document).keydown(function (e) {
15
+ if ((e.which === '115' || e.which === '83') && (e.ctrlKey || e.metaKey)) {
16
+ e.preventDefault();
17
+ jQuery('#emodal-theme-editor, #emodal-modal-editor').submit();
18
+ return false;
19
+ }
20
+ return true;
21
+ });
22
+
23
+ },
24
+ initialize_color_pickers: function () {
25
+ var self = this;
26
+ jQuery('.color-picker').wpColorPicker({
27
+ clear: function (event, ui) {
28
+ self.debounce(setTimeout(function () {
29
+ var theme = self.serialize_form('#emodal-theme-editor').theme;
30
+ self.retheme_modal(theme.meta);
31
+ }, 5), 10000);
32
+ var $input = jQuery(event.currentTarget).prev();
33
+ if ($input.hasClass('background-color')) {
34
+ $input.parents('table').find('.background-opacity').hide();
35
+ }
36
+ }
37
+ });
38
+
39
+ },
40
+ initialize_range_sliders: function () {
41
+ jQuery('input[type="range"]').on('input', function () {
42
+ jQuery(this).next('.range-value').find('.value').text(jQuery(this).val());
43
+ });
44
+ var input = document.createElement('input'),
45
+ $input,
46
+ $slider;
47
+ input.setAttribute('type', 'range');
48
+ if (input.type === 'text') {
49
+ jQuery('input[type=range]').each(function (index, input) {
50
+ $input = jQuery(input);
51
+ $slider = jQuery('<div />').slider({
52
+ min: parseInt($input.attr('min'), 10) || 0,
53
+ max: parseInt($input.attr('max'), 10) || 100,
54
+ value: parseInt($input.attr('value'), 10) || 0,
55
+ step: parseInt($input.attr('step'), 10) || 1,
56
+ slide: function (event, ui) {
57
+ jQuery(this).prev('input').val(ui.value);
58
+ }
59
+ });
60
+ $input.after($slider).hide();
61
+ });
62
+ }
63
+ },
64
+ initialize_tabs: function () {
65
+ //var active_tab = window.location.hash.replace('#top#','');
66
+ var active_tab = window.location.hash;
67
+ if (active_tab === '') {
68
+ active_tab = '#' + jQuery('.emodal-tab-content').eq(0).attr('id');
69
+ }
70
+
71
+ jQuery('.emodal-tab-content').hide();
72
+ jQuery(active_tab).show();
73
+ jQuery(active_tab + '-tab').addClass('nav-tab-active');
74
+ jQuery(window).scrollTop(0);
75
+
76
+
77
+ jQuery('#emodal-tabs .nav-tab').click(function (e) {
78
+ e.preventDefault();
79
+
80
+ jQuery('.emodal-tab-content').hide();
81
+ jQuery('.emodal-tab').removeClass('nav-tab-active');
82
+
83
+ var id = jQuery(this).attr('href');
84
+ jQuery(id).show();
85
+ jQuery(this).addClass('nav-tab-active');
86
+
87
+ if (history.pushState) {
88
+ history.pushState(null, null, id);
89
+ } else {
90
+ location.hash = id;
91
+ jQuery(window).scrollTop(0);
92
+ }
93
+ });
94
+ },
95
+ initialize_modal_page: function () {
96
+ var update_size = function () {
97
+ if (jQuery("#size").val() !== 'custom') {
98
+ jQuery('.custom-size-only').hide();
99
+ } else {
100
+ jQuery('.custom-size-only').show();
101
+ if (jQuery('#custom_height_auto').is(':checked')) {
102
+ jQuery('.custom-size-height-only').hide();
103
+ } else {
104
+ jQuery('.custom-size-height-only').show();
105
+ }
106
+ }
107
+ },
108
+ update_animation = function () {
109
+ jQuery('.animation-speed, .animation-origin').hide();
110
+ if (jQuery("#animation_type").val() === 'fade') {
111
+ jQuery('.animation-speed').show();
112
+ } else if (jQuery("#animation_type").val() === 'none') {
113
+
114
+ } else {
115
+ jQuery('.animation-speed, .animation-origin').show();
116
+ }
117
+
118
+ },
119
+ update_location = function () {
120
+ var $this = jQuery('#display_location'),
121
+ table = $this.parents('table'),
122
+ val = $this.val();
123
+ jQuery('tr.top, tr.right, tr.left, tr.bottom', table).hide();
124
+ if (val.indexOf("top") >= 0) {
125
+ jQuery('tr.top').show();
126
+ }
127
+ if (val.indexOf("left") >= 0) {
128
+ jQuery('tr.left').show();
129
+ }
130
+ if (val.indexOf("bottom") >= 0) {
131
+ jQuery('tr.bottom').show();
132
+ }
133
+ if (val.indexOf("right") >= 0) {
134
+ jQuery('tr.right').show();
135
+ }
136
+ };
137
+ jQuery("#size").on('change', function () {
138
+ update_size();
139
+ });
140
+ jQuery('#custom_height_auto').on('click', function () {
141
+ update_size();
142
+ });
143
+ jQuery("#animation_type").on('change', function () {
144
+ update_animation();
145
+ });
146
+ jQuery("#animation_speed").on('input', function () {
147
+ jQuery(this).next('.range-value').text(jQuery(this).val() + 'ms');
148
+ });
149
+ jQuery('#display_location').on('change', function () {
150
+ update_location();
151
+ });
152
+ update_size();
153
+ update_animation();
154
+ update_location();
155
+ },
156
+ theme_page_listeners: function () {
157
+ var self = this;
158
+ jQuery('select, input:not(.color-picker)').on('change input focusout', function () {
159
+ self.update_theme();
160
+ });
161
+ jQuery('select.border-style').on('change', function () {
162
+ var $this = jQuery(this);
163
+ if ($this.val() === 'none') {
164
+ $this.parents('table').find('.border-options').hide();
165
+ } else {
166
+ $this.parents('table').find('.border-options').show();
167
+ }
168
+ });
169
+ jQuery('#close_location').on('change', function () {
170
+ var $this = jQuery(this),
171
+ table = $this.parents('table');
172
+ jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
173
+ jQuery('tr.' + $this.val(), table).show();
174
+ });
175
+ jQuery('.color-picker').on('irischange', function (event, ui) {
176
+ self.throttle(setTimeout(function () {
177
+ var theme = self.serialize_form('#emodal-theme-editor').theme;
178
+ self.retheme_modal(theme.meta);
179
+ }, 5), 250);
180
+ var $input = jQuery(event.currentTarget);
181
+ if ($input.hasClass('background-color')) {
182
+ $input.parents('table').find('.background-opacity').show();
183
+ }
184
+ });
185
+
186
+ },
187
+ update_theme: function () {
188
+ var theme = this.serialize_form('#emodal-theme-editor').theme;
189
+ this.retheme_modal(theme.meta);
190
+ },
191
+ theme_preview_scroll: function () {
192
+ var $preview = jQuery('#emodal-theme-editor .empreview'),
193
+ startscroll = $preview.offset().top - 50;
194
+ jQuery(window).on('scroll', function () {
195
+ if (jQuery(window).scrollTop() >= startscroll) {
196
+ $preview.css({
197
+ left: $preview.offset().left,
198
+ width: $preview.width(),
199
+ height: $preview.height(),
200
+ position: 'fixed',
201
+ top: 50
202
+ });
203
+ } else {
204
+ $preview.removeAttr('style');
205
+ }
206
+ });
207
+ },
208
+ initialize_theme_page: function () {
209
+ var self = this,
210
+ table = jQuery('#close_location').parents('table');
211
+ self.update_theme();
212
+ self.theme_page_listeners();
213
+ self.theme_preview_scroll();
214
+
215
+ jQuery('select.border-style').each(function () {
216
+ var $this = jQuery(this);
217
+ if ($this.val() === 'none') {
218
+ $this.parents('table').find('.border-options').hide();
219
+ } else {
220
+ $this.parents('table').find('.border-options').show();
221
+ }
222
+ });
223
+
224
+ jQuery('.color-picker.background-color').each(function () {
225
+ var $this = jQuery(this);
226
+ if ($this.val() === '') {
227
+ $this.parents('table').find('.background-opacity').hide();
228
+ } else {
229
+ $this.parents('table').find('.background-opacity').show();
230
+ }
231
+ });
232
+
233
+ jQuery('tr.topleft, tr.topright, tr.bottomleft, tr.bottomright', table).hide();
234
+ switch (jQuery('#close_location').val()) {
235
+ case "topleft":
236
+ jQuery('tr.topleft', table).show();
237
+ break;
238
+ case "topright":
239
+ jQuery('tr.topright', table).show();
240
+ break;
241
+ case "bottomleft":
242
+ jQuery('tr.bottomleft', table).show();
243
+ break;
244
+ case "bottomright":
245
+ jQuery('tr.bottomright', table).show();
246
+ break;
247
+ }
248
+
249
+ },
250
+ retheme_modal: function (theme) {
251
+ var $overlay = jQuery('.empreview .example-modal-overlay'),
252
+ $container = jQuery('.empreview .example-modal'),
253
+ $title = jQuery('.title', $container),
254
+ $content = jQuery('.content', $container),
255
+ $close = jQuery('.close-modal', $container),
256
+ container_inset = theme.container.boxshadow.inset === 'yes' ? 'inset ' : '',
257
+ close_inset = theme.close.boxshadow.inset === 'yes' ? 'inset ' : '';
258
+
259
+ $overlay.removeAttr('style').css({
260
+ backgroundColor: this.convert_hex(theme.overlay.background.color, theme.overlay.background.opacity)
261
+ });
262
+ $container.removeAttr('style').css({
263
+ padding: theme.container.padding + 'px',
264
+ backgroundColor: this.convert_hex(theme.container.background.color, theme.container.background.opacity),
265
+ borderStyle: theme.container.border.style,
266
+ borderColor: theme.container.border.color,
267
+ borderWidth: theme.container.border.width + 'px',
268
+ borderRadius: theme.container.border.radius + 'px',
269
+ 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)
270
+ });
271
+ $title.removeAttr('style').css({
272
+ color: theme.title.font.color,
273
+ fontSize: theme.title.font.size + 'px',
274
+ fontFamily: theme.title.font.family,
275
+ textAlign: theme.title.text.align,
276
+ 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)
277
+ });
278
+ $content.removeAttr('style').css({
279
+ color: theme.content.font.color,
280
+ //fontSize: theme.content.font.size+'px',
281
+ fontFamily: theme.content.font.family
282
+ });
283
+ $close.html(theme.close.text).removeAttr('style').css({
284
+ padding: theme.close.padding + 'px',
285
+ backgroundColor: this.convert_hex(theme.close.background.color, theme.close.background.opacity),
286
+ color: theme.close.font.color,
287
+ fontSize: theme.close.font.size + 'px',
288
+ fontFamily: theme.close.font.family,
289
+ borderStyle: theme.close.border.style,
290
+ borderColor: theme.close.border.color,
291
+ borderWidth: theme.close.border.width + 'px',
292
+ borderRadius: theme.close.border.radius + 'px',
293
+ 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),
294
+ 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)
295
+ });
296
+ switch (theme.close.location) {
297
+ case "topleft":
298
+ $close.css({
299
+ top: theme.close.position.top + 'px',
300
+ left: theme.close.position.left + 'px'
301
+ });
302
+ break;
303
+ case "topright":
304
+ $close.css({
305
+ top: theme.close.position.top + 'px',
306
+ right: theme.close.position.right + 'px'
307
+ });
308
+ break;
309
+ case "bottomleft":
310
+ $close.css({
311
+ bottom: theme.close.position.bottom + 'px',
312
+ left: theme.close.position.left + 'px'
313
+ });
314
+ break;
315
+ case "bottomright":
316
+ $close.css({
317
+ bottom: theme.close.position.bottom + 'px',
318
+ right: theme.close.position.right + 'px'
319
+ });
320
+ break;
321
+ }
322
+ jQuery(document).trigger('emodal-admin-retheme', [theme]);
323
+ },
324
+ serialize_form: function ($form) {
325
+ var serialized = {};
326
+ jQuery("[name]", $form).each(function () {
327
+ var name = jQuery(this).attr('name'),
328
+ value = jQuery(this).val(),
329
+ nameBits = name.split('['),
330
+ previousRef = serialized,
331
+ i = 0,
332
+ l = nameBits.length,
333
+ nameBit;
334
+ for (i; i < l; i += 1) {
335
+ nameBit = nameBits[i].replace(']', '');
336
+ if (!previousRef[nameBit]) {
337
+ previousRef[nameBit] = {};
338
+ }
339
+ if (i !== nameBits.length - 1) {
340
+ previousRef = previousRef[nameBit];
341
+ } else if (i === nameBits.length - 1) {
342
+ previousRef[nameBit] = value;
343
+ }
344
+ }
345
+ });
346
+ return serialized;
347
+ },
348
+ convert_hex: function (hex, opacity) {
349
+ hex = hex.replace('#', '');
350
+ var r = parseInt(hex.substring(0, 2), 16),
351
+ g = parseInt(hex.substring(2, 4), 16),
352
+ b = parseInt(hex.substring(4, 6), 16),
353
+ result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
354
+ return result;
355
+ },
356
+ debounce: function (callback, threshold) {
357
+ var timeout;
358
+ return function() {
359
+ var context = this, params = arguments;
360
+ window.clearTimeout(timeout);
361
+ timeout = window.setTimeout(function() {
362
+ callback.apply(context, params);
363
+ }, threshold);
364
+ };
365
+ },
366
+ throttle: function (callback, threshold) {
367
+ var suppress = false;
368
+ var clear = function() {
369
+ suppress = false;
370
+ };
371
+ return function() {
372
+ if (!suppress) {
373
+ callback.apply(this, arguments);
374
+ window.setTimeout(clear, threshold);
375
+ suppress = true;
376
+ };
377
+ }
378
+ }
379
+ };
380
+ jQuery(document).ready(function () {
381
+ EModalAdmin.init();
 
 
382
  });
assets/scripts/easy-modal-site.js CHANGED
@@ -1,745 +1,772 @@
1
- (function (jQuery) {
2
- if (!jQuery.isFunction(jQuery.fn.on)) {
3
- jQuery.fn.on = function(types, sel, fn) {
4
- return this.delegate(sel, types, fn);
5
- };
6
- jQuery.fn.off = function(types, sel, fn) {
7
- return this.undelegate(sel, types, fn);
8
- };
9
- }
10
-
11
- if (!jQuery.support.transition)
12
- jQuery.fn.transition = jQuery.fn.animate;
13
-
14
- jQuery.fn.emodal = function (method) {
15
- // Method calling logic
16
- if (jQuery.fn.emodal.methods[method]) {
17
- return jQuery.fn.emodal.methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
18
- } else if (typeof method === 'object' || !method) {
19
- return jQuery.fn.emodal.methods.init.apply(this, arguments);
20
- } else {
21
- jQuery.error('Method ' + method + ' does not exist on jQuery.fn.emodal');
22
- }
23
- };
24
- jQuery.fn.emodal.methods = {
25
- init: function (options) {
26
- return this.each(function () {
27
- var $this = jQuery(this);
28
- var settings = jQuery.extend(true, {}, jQuery.fn.emodal.defaults, $this.data('emodal'), options);
29
-
30
- if (!$this.parent().is('body'))
31
- $this.appendTo('body');
32
-
33
- if (!jQuery('#' + settings.overlay.attr.id).length)
34
- jQuery('<div>').attr(settings.overlay.attr).appendTo('body');
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
- });
42
-
43
- $this
44
- .data('emodal', settings)
45
- .on('emodalBeforeOpen.setup_close', function () {
46
- $this.emodal('setup_close');
47
- })
48
- .on('emodalBeforeOpen.retheme', function () {
49
- $this.emodal('retheme');
50
- })
51
- .on('emodalBeforeOpen.reposition', function () {
52
- $this.emodal('reposition');
53
- })
54
- .trigger('emodalInit');
55
- return this;
56
- });
57
- },
58
- setup_close: function () {
59
- var $this = jQuery(this),
60
- settings = $this.data('emodal'),
61
- $overlay = jQuery('#' + settings.overlay.attr.id),
62
- $close = jQuery('.' + settings.close.attr.class, $this);
63
-
64
- $close
65
- .off('click.emodal')
66
- .on("click.emodal", function (e) {
67
- e.preventDefault();
68
- e.stopPropagation();
69
- $this.emodal('close');
70
-
71
- });
72
- if (settings.meta.close.esc_press)
73
- jQuery(window)
74
- .off('keyup.emodal')
75
- .on('keyup.emodal', function (e) {
76
- if (e.keyCode == 27)
77
- $this.emodal('close');
78
- });
79
-
80
- if (settings.meta.close.overlay_click)
81
- $overlay
82
- .off('click.emodal')
83
- .on('click.emodal', function (e) {
84
- e.preventDefault();
85
- e.stopPropagation();
86
- $this.emodal('close');
87
- });
88
-
89
- $this
90
- .on('emodalAfterClose', function () {
91
- jQuery(window).off('keyup.emodal');
92
- $overlay.off('click.emodal');
93
- $close.off('click.emodal');
94
- })
95
- .trigger('emodalSetupClose');
96
- },
97
- open: function () {
98
- var $this = jQuery(this);
99
- $this
100
- .emodal('close_all')
101
- .trigger('emodalBeforeOpen');
102
- var settings = $this.data('emodal');
103
- $this
104
-
105
- .css({
106
- visibility: "visible"
107
- })
108
- .hide()
109
- .addClass(settings.container.active_class)
110
- .emodal('animate', settings.meta.display.animation.type)
111
- .trigger('emodalAfterOpen');
112
- return this;
113
- },
114
- close: function () {
115
- return this.each(function () {
116
- var $this = jQuery(this),
117
- settings = $this.data('emodal');
118
- $this
119
- .trigger('emodalBeforeClose')
120
- .removeClass('active')
121
- .fadeOut(settings.close.close_speed, function () {
122
- $this.trigger('emodalAfterClose');
123
- });
124
- return this;
125
- });
126
- },
127
- close_all: function () {
128
- var settings = jQuery(this).data('emodal');
129
- jQuery('.' + settings.container.attr.class).removeClass('active').hide(0);
130
- return this;
131
- },
132
- reposition: function (callback) {
133
- var $this = jQuery(this);
134
- $this.trigger('emodalBeforeReposition');
135
- var settings = $this.data('emodal');
136
- var location = settings.meta.display.location;
137
- var position = settings.meta.display.position;
138
-
139
- var reposition = {
140
- my: "",
141
- at: ""
142
- };
143
-
144
- if (location.indexOf('left') >= 0) reposition = {
145
- my: reposition.my + " left" + (position.left !== 0 ? "+" + position.left : ""),
146
- at: reposition.at + " left"
147
- };
148
- if (location.indexOf('right') >= 0) reposition = {
149
- my: reposition.my + " right" + (position.right !== 0 ? "-" + position.right : ""),
150
- at: reposition.at + " right"
151
- };
152
-
153
- if (location.indexOf('center') >= 0)
154
- if (location == 'center') reposition = {
155
- my: "center",
156
- at: "center"
157
- };
158
- else reposition = {
159
- my: reposition.my + " center",
160
- at: reposition.at + " center"
161
- };
162
-
163
- if (location.indexOf('top') >= 0) reposition = {
164
- my: reposition.my + " top" + (position.top !== 0 ? "+" + position.top : ""),
165
- at: reposition.at + " top"
166
- };
167
- if (location.indexOf('bottom') >= 0) reposition = {
168
- my: reposition.my + " bottom" + (position.bottom !== 0 ? "-" + position.bottom : ""),
169
- at: reposition.at + " bottom"
170
- };
171
-
172
-
173
- reposition.my = jQuery.trim(reposition.my);
174
- reposition.at = jQuery.trim(reposition.at);
175
- reposition.of = window;
176
- reposition.collision = 'fit';
177
- reposition.using = typeof (callback) == "function" ? callback : jQuery.fn.emodal.callbacks.reposition_using;
178
- var opacity = false;
179
- if ($this.is(':hidden')) {
180
- opacity = $this.css("opacity");
181
- $this.css({
182
- opacity: 0
183
- }).show();
184
- }
185
-
186
- if (position.fixed)
187
- $this.addClass('fixed');
188
- else
189
- $this.removeClass('fixed');
190
-
191
- if (settings.meta.display.size == 'custom') {
192
- $this.css({
193
- width: settings.meta.display.custom_width + settings.meta.display.custom_width_unit,
194
- height: settings.meta.display.custom_height_auto ? 'auto' : settings.meta.display.custom_height + settings.meta.display.custom_height_unit
195
- });
196
- }
197
-
198
- $this
199
- .addClass('custom-position')
200
- .position(reposition)
201
- .trigger('emodalAfterReposition');
202
-
203
- if (opacity) {
204
- $this.css({
205
- opacity: opacity
206
- }).hide();
207
- }
208
- return this;
209
- },
210
- retheme: function (theme) {
211
- var $this = jQuery(this);
212
- $this.trigger('emodalBeforeRetheme');
213
- var settings = $this.data('emodal'),
214
- $overlay = jQuery('#' + settings.overlay.attr.id),
215
- $container = $this,
216
- $title = jQuery('> .' + settings.title.attr.class, $container),
217
- $content = jQuery('> .' + settings.content.attr.class, $container),
218
- $close = jQuery('> .' + settings.close.attr.class, $container);
219
-
220
- if (theme === undefined) {
221
- theme = jQuery.fn.emodal.themes[settings.theme_id];
222
- if (theme === undefined) {
223
- theme = jQuery.fn.emodal.themes[1];
224
- }
225
- }
226
-
227
- $overlay.removeAttr('style').css({
228
- backgroundColor: convert_hex(theme.overlay.background.color, theme.overlay.background.opacity)
229
- });
230
- var container_inset = theme.container.boxshadow.inset == 'yes' ? 'inset ' : '';
231
- $container.css({
232
- padding: theme.container.padding + 'px',
233
- backgroundColor: convert_hex(theme.container.background.color, theme.container.background.opacity),
234
- borderStyle: theme.container.border.style,
235
- borderColor: theme.container.border.color,
236
- borderWidth: theme.container.border.width + 'px',
237
- borderRadius: theme.container.border.radius + 'px',
238
- boxShadow: container_inset + theme.container.boxshadow.horizontal + 'px ' + theme.container.boxshadow.vertical + 'px ' + theme.container.boxshadow.blur + 'px ' + theme.container.boxshadow.spread + 'px ' + convert_hex(theme.container.boxshadow.color, theme.container.boxshadow.opacity)
239
- });
240
- $title.css({
241
- color: theme.title.font.color,
242
- fontSize: theme.title.font.size + 'px',
243
- fontFamily: theme.title.font.family,
244
- textAlign: theme.title.text.align,
245
- textShadow: theme.title.textshadow.horizontal + 'px ' + theme.title.textshadow.vertical + 'px ' + theme.title.textshadow.blur + 'px ' + convert_hex(theme.title.textshadow.color, theme.title.textshadow.opacity)
246
- });
247
- $content.css({
248
- color: theme.content.font.color,
249
- //fontSize: theme.content.font.size+'px',
250
- fontFamily: theme.content.font.family
251
- });
252
- jQuery('p, label', $content).css({
253
- color: theme.content.font.color,
254
- //fontSize: theme.content.font.size+'px',
255
- fontFamily: theme.content.font.family
256
- });
257
- var close_inset = theme.close.boxshadow.inset == 'yes' ? 'inset ' : '';
258
- $close.html(theme.close.text).css({
259
- padding: theme.close.padding + 'px',
260
- backgroundColor: convert_hex(theme.close.background.color, theme.close.background.opacity),
261
- color: theme.close.font.color,
262
- fontSize: theme.close.font.size + 'px',
263
- fontFamily: theme.close.font.family,
264
- borderStyle: theme.close.border.style,
265
- borderColor: theme.close.border.color,
266
- borderWidth: theme.close.border.width + 'px',
267
- borderRadius: theme.close.border.radius + 'px',
268
- boxShadow: close_inset + theme.close.boxshadow.horizontal + 'px ' + theme.close.boxshadow.vertical + 'px ' + theme.close.boxshadow.blur + 'px ' + theme.close.boxshadow.spread + 'px ' + convert_hex(theme.close.boxshadow.color, theme.close.boxshadow.opacity),
269
- textShadow: theme.close.textshadow.horizontal + 'px ' + theme.close.textshadow.vertical + 'px ' + theme.close.textshadow.blur + 'px ' + convert_hex(theme.close.textshadow.color, theme.close.textshadow.opacity)
270
- });
271
- switch (theme.close.location) {
272
- case "topleft":
273
- $close.css({
274
- top: theme.close.position.top + 'px',
275
- left: theme.close.position.left + 'px'
276
- });
277
- break;
278
- case "topright":
279
- $close.css({
280
- top: theme.close.position.top + 'px',
281
- right: theme.close.position.right + 'px'
282
- });
283
- break;
284
- case "bottomleft":
285
- $close.css({
286
- bottom: theme.close.position.bottom + 'px',
287
- left: theme.close.position.left + 'px'
288
- });
289
- break;
290
- case "bottomright":
291
- $close.css({
292
- bottom: theme.close.position.bottom + 'px',
293
- right: theme.close.position.right + 'px'
294
- });
295
- break;
296
- }
297
- $this.trigger('emodalAfterRetheme', [theme]);
298
- return this;
299
- },
300
- animate_overlay: function (style, duration, callback) {
301
- // Method calling logic
302
- var $this = jQuery(this);
303
- var settings = $this.data('emodal');
304
- if(settings.meta.display.overlay_disabled)
305
- {
306
- callback();
307
- }
308
- else
309
- {
310
- if (jQuery.fn.emodal.overlay_animations[style])
311
- return jQuery.fn.emodal.overlay_animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
312
- else
313
- jQuery.error('Animation style ' + jQuery.fn.emodal.overlay_animations + ' does not exist.');
314
- }
315
- return this;
316
- },
317
- animate: function (style) {
318
- // Method calling logic
319
- if (jQuery.fn.emodal.animations[style])
320
- return jQuery.fn.emodal.animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
321
- else
322
- jQuery.error('Animation style ' + jQuery.fn.emodal.animations + ' does not exist.');
323
- return this;
324
- }
325
- };
326
-
327
- jQuery.fn.emodal.callbacks = {
328
- reposition_using: function (position) {
329
- jQuery(this).css(position);
330
- }
331
- };
332
-
333
- jQuery.fn.emodal.utilies = {
334
- debounce: function (func, wait, immediate) {
335
- var timeout, result;
336
- return function () {
337
- var context = this,
338
- args = arguments,
339
- later,
340
- callNow;
341
-
342
- later = function () {
343
- timeout = null;
344
- if (!immediate) {
345
- result = func.apply(context, args);
346
- }
347
- };
348
-
349
- callNow = immediate && !timeout;
350
- clearTimeout(timeout);
351
- timeout = setTimeout(later, wait);
352
- if (callNow) {
353
- result = func.apply(context, args);
354
- }
355
- return result;
356
- };
357
- }
358
- };
359
-
360
- jQuery.fn.emodal.defaults = {
361
- stackable: false,
362
- container: {
363
- active_class: 'active',
364
- attr: {
365
- class: "emodal"
366
- }
367
- },
368
- title: {
369
- attr: {
370
- class: "emodal-title"
371
- }
372
- },
373
- content: {
374
- attr: {
375
- class: "emodal-content"
376
- }
377
- },
378
- close: {
379
- close_speed: 0,
380
- attr: {
381
- class: "emodal-close"
382
- }
383
- },
384
- overlay: {
385
- attr: {
386
- id: "emodal-overlay",
387
- class: "emodal-overlay"
388
- }
389
- }
390
- };
391
-
392
- jQuery.fn.emodal.themes = emodal_themes;
393
-
394
- jQuery.fn.emodal.overlay_animations = {
395
- none: function (duration, callback) {
396
- var $this = jQuery(this);
397
- var settings = $this.data('emodal');
398
- jQuery('#' + settings.overlay.attr.id).show(duration, callback);
399
- },
400
- fade: function (duration, callback) {
401
- var $this = jQuery(this);
402
- var settings = $this.data('emodal');
403
- jQuery('#' + settings.overlay.attr.id).fadeIn(duration, callback);
404
- },
405
- slide: function (duration, callback) {
406
- var $this = jQuery(this);
407
- var settings = $this.data('emodal');
408
- jQuery('#' + settings.overlay.attr.id).slideDown(duration, callback);
409
- }
410
- };
411
-
412
- jQuery.fn.emodal.animations = {
413
- none: function () {
414
- var $this = jQuery(this);
415
- var settings = $this.data('emodal');
416
- $this.emodal('animate_overlay', 'none', 0, function(){
417
- $this.show();
418
- });
419
- return this;
420
- },
421
- slide: function () {
422
- var $this = jQuery(this).show(0).css({
423
- opacity: 0
424
- });
425
- var settings = $this.data('emodal');
426
- var speed = settings.meta.display.animation.speed;
427
- var origin = settings.meta.display.animation.origin;
428
- var start = {
429
- my: "",
430
- at: ""
431
- };
432
- switch (origin) {
433
- case 'top':
434
- start = {
435
- my: "left+" + $this.offset().left + " bottom",
436
- at: "left top"
437
- };
438
- break;
439
- case 'bottom':
440
- start = {
441
- my: "left+" + $this.offset().left + " top",
442
- at: "left bottom"
443
- };
444
- break;
445
- case 'left':
446
- start = {
447
- my: "right top+" + $this.offset().top,
448
- at: "left top"
449
- };
450
- break;
451
- case 'right':
452
- start = {
453
- my: "left top+" + $this.offset().top,
454
- at: "right top"
455
- };
456
- break;
457
- default:
458
- if (origin.indexOf('left') >= 0) start = {
459
- my: start.my + " right",
460
- at: start.at + " left"
461
- };
462
- if (origin.indexOf('right') >= 0) start = {
463
- my: start.my + " left",
464
- at: start.at + " right"
465
- };
466
- if (origin.indexOf('center') >= 0) start = {
467
- my: start.my + " center",
468
- at: start.at + " center"
469
- };
470
- if (origin.indexOf('top') >= 0) start = {
471
- my: start.my + " bottom",
472
- at: start.at + " top"
473
- };
474
- if (origin.indexOf('bottom') >= 0) start = {
475
- my: start.my + " top",
476
- at: start.at + " bottom"
477
- };
478
- start.my = jQuery.trim(start.my);
479
- start.at = jQuery.trim(start.at);
480
- break;
481
- }
482
- start.of = window;
483
- start.collision = 'none';
484
- jQuery('html').css('overflow-x', 'hidden');
485
- $this.position(start).css({
486
- opacity: 1
487
- });
488
-
489
- $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
490
- $this.emodal('reposition', function (position) {
491
- position.opacity = 1;
492
- $this.transition(position, speed * 0.75, function () {
493
- jQuery('html').css('overflow-x', 'inherit');
494
- });
495
- });
496
- });
497
- return this;
498
- },
499
- fade: function () {
500
- var $this = jQuery(this);
501
- var settings = $this.data('emodal');
502
- var speed = settings.meta.display.animation.speed / 2;
503
- $this.emodal('animate_overlay', 'fade', speed, function () {
504
- $this.fadeIn(speed);
505
- });
506
- return this;
507
- },
508
- fadeAndSlide: function () {
509
- var $this = jQuery(this).show(0).css({
510
- opacity: 0
511
- });
512
- var settings = $this.data('emodal');
513
- var speed = settings.meta.display.animation.speed;
514
- var origin = settings.meta.display.animation.origin;
515
- var start = {
516
- my: "",
517
- at: ""
518
- };
519
- switch (origin) {
520
- case 'top':
521
- start = {
522
- my: "left+" + $this.offset().left + " bottom",
523
- at: "left top"
524
- };
525
- break;
526
-
527
- case 'bottom':
528
- start = {
529
- my: "left+" + $this.offset().left + " top",
530
- at: "left bottom"
531
- };
532
- break;
533
-
534
- case 'left':
535
- start = {
536
- my: "right top+" + $this.offset().top,
537
- at: "left top"
538
- };
539
- break;
540
-
541
- case 'right':
542
- start = {
543
- my: "left top+" + $this.offset().top,
544
- at: "right top"
545
- };
546
- break;
547
-
548
- default:
549
- if (origin.indexOf('left') >= 0) start = {
550
- my: start.my + " right",
551
- at: start.at + " left"
552
- };
553
- if (origin.indexOf('right') >= 0) start = {
554
- my: start.my + " left",
555
- at: start.at + " right"
556
- };
557
- if (origin.indexOf('center') >= 0) start = {
558
- my: start.my + " center",
559
- at: start.at + " center"
560
- };
561
- if (origin.indexOf('top') >= 0) start = {
562
- my: start.my + " bottom",
563
- at: start.at + " top"
564
- };
565
- if (origin.indexOf('bottom') >= 0) start = {
566
- my: start.my + " top",
567
- at: start.at + " bottom"
568
- };
569
- start.my = jQuery.trim(start.my);
570
- start.at = jQuery.trim(start.at);
571
- break;
572
- }
573
- start.of = window;
574
- start.collision = 'none';
575
- jQuery('html').css('overflow-x', 'hidden');
576
- $this.position(start);
577
- $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
578
- $this.emodal('reposition', function (position) {
579
- position.opacity = 1;
580
- $this.transition(position, speed * 0.75, function () {
581
- jQuery('html').css('overflow-x', 'inherit');
582
- });
583
- });
584
- });
585
- return this;
586
- },
587
- grow: function () {
588
- var $this = jQuery(this);
589
- var settings = $this.data('emodal');
590
- var speed = settings.meta.display.animation.speed;
591
- var origin = settings.meta.display.animation.origin;
592
-
593
- // Set css for animation start.
594
- $this.css({
595
- transformOrigin: origin,
596
- opacity: 0
597
- }).show();
598
-
599
- // Begin Animation with overlay fade in then grow animation.
600
- $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
601
- // Reposition with callback. position returns default positioning.
602
- $this.emodal('reposition', function (position) {
603
- position.scale = 1;
604
- position.duration = speed * 0.75;
605
- $this
606
- .css({
607
- scale: 0,
608
- opacity: 1
609
- })
610
- .transition(position);
611
- });
612
- });
613
- return this;
614
- },
615
- growAndSlide: function () {
616
- var $this = jQuery(this).css({
617
- opacity: 0
618
- }).show();
619
- var settings = $this.data('emodal');
620
- var speed = settings.meta.display.animation.speed;
621
- var origin = settings.meta.display.animation.origin;
622
- var start = {
623
- my: "",
624
- at: ""
625
- };
626
- switch (origin) {
627
- case 'top':
628
- start = {
629
- my: "left+" + $this.offset().left + " bottom",
630
- at: "left top"
631
- };
632
- break;
633
- case 'bottom':
634
- start = {
635
- my: "left+" + $this.offset().left + " top",
636
- at: "left bottom"
637
- };
638
- break;
639
- case 'left':
640
- start = {
641
- my: "right top+" + $this.offset().top,
642
- at: "left top"
643
- };
644
- break;
645
- case 'right':
646
- start = {
647
- my: "left top+" + $this.offset().top,
648
- at: "right top"
649
- };
650
- break;
651
- default:
652
- if (origin.indexOf('left') >= 0) start = {
653
- my: start.my + " right",
654
- at: start.at + " left"
655
- };
656
- if (origin.indexOf('right') >= 0) start = {
657
- my: start.my + " left",
658
- at: start.at + " right"
659
- };
660
- if (origin.indexOf('center') >= 0) start = {
661
- my: start.my + " center",
662
- at: start.at + " center"
663
- };
664
- if (origin.indexOf('top') >= 0) start = {
665
- my: start.my + " bottom",
666
- at: start.at + " top"
667
- };
668
- if (origin.indexOf('bottom') >= 0) start = {
669
- my: start.my + " top",
670
- at: start.at + " bottom"
671
- };
672
- start.my = jQuery.trim(start.my);
673
- start.at = jQuery.trim(start.at);
674
- break;
675
- }
676
- start.of = window;
677
- start.collision = 'none';
678
- jQuery('html').css('overflow-x', 'hidden');
679
- $this.position(start)
680
- .css({
681
- opacity: origin == 'center center' ? 0 : 1,
682
- transformOrigin: origin
683
- });
684
- $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
685
- $this.emodal('reposition', function (position) {
686
- position.scale = 1;
687
- position.opacity = 1;
688
- position.duration = speed * 0.75;
689
- $this.css({
690
- scale: 0
691
- })
692
- .transition(position, function () {
693
- jQuery('html').css('overflow-x', 'inherit');
694
- });
695
- });
696
- });
697
- return this;
698
- }
699
- };
700
-
701
- var convert_hex = function (hex, opacity) {
702
- hex = hex.replace('#', '');
703
- r = parseInt(hex.substring(0, 2), 16);
704
- g = parseInt(hex.substring(2, 4), 16);
705
- b = parseInt(hex.substring(4, 6), 16);
706
- result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
707
- return result;
708
- };
709
-
710
-
711
-
712
- jQuery(document).ready(function () {
713
- jQuery('.emodal')
714
- .emodal()
715
- .each(function () {
716
- var $this = jQuery(this);
717
- jQuery('.' + $this.attr('id')).on('click', function (e) {
718
- e.preventDefault();
719
- e.stopPropagation();
720
- $this.emodal('open');
721
- });
722
- jQuery('.' + $this.attr('id')).css('cursor', 'pointer');
723
- // Close Overlay
724
- $this.on('emodalBeforeClose', function (e) {
725
- var $this = jQuery(this),
726
- settings = $this.data('emodal'),
727
- $overlay = jQuery('#' + settings.overlay.attr.id);
728
- if ($overlay.length && $overlay.is(":visible")) {
729
- $overlay.fadeOut(settings.close.close_speed);
730
- }
731
- })
732
- // Reset Videos
733
- .on('emodalAfterClose', function (e) {
734
- var $this = jQuery(this),
735
- settings = $this.data('emodal');
736
-
737
- jQuery('iframe', $this).filter('[src*="youtube"],[src*="vimeo"]').each(function () {
738
- var src = jQuery(this).attr('src');
739
- jQuery(this).attr('src', '').attr('src', src);
740
- });
741
- });
742
-
743
- })
744
- });
745
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (jQuery) {
2
+ if (!jQuery.isFunction(jQuery.fn.on)) {
3
+ jQuery.fn.on = function(types, sel, fn) {
4
+ return this.delegate(sel, types, fn);
5
+ };
6
+ jQuery.fn.off = function(types, sel, fn) {
7
+ return this.undelegate(sel, types, fn);
8
+ };
9
+ }
10
+
11
+ if (!jQuery.support.transition)
12
+ jQuery.fn.transition = jQuery.fn.animate;
13
+
14
+ jQuery.fn.emodal = function (method) {
15
+ // Method calling logic
16
+ if (jQuery.fn.emodal.methods[method]) {
17
+ return jQuery.fn.emodal.methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
18
+ } else if (typeof method === 'object' || !method) {
19
+ return jQuery.fn.emodal.methods.init.apply(this, arguments);
20
+ } else {
21
+ jQuery.error('Method ' + method + ' does not exist on jQuery.fn.emodal');
22
+ }
23
+ };
24
+ jQuery.fn.emodal.methods = {
25
+ init: function (options) {
26
+ return this.each(function () {
27
+ var $this = jQuery(this);
28
+ var settings = jQuery.extend(true, {}, jQuery.fn.emodal.defaults, $this.data('emodal'), options);
29
+
30
+ if (!$this.parent().is('body'))
31
+ $this.appendTo('body');
32
+
33
+ if (!jQuery('#' + settings.overlay.attr.id).length)
34
+ jQuery('<div>').attr(settings.overlay.attr).appendTo('body');
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
+ });
42
+
43
+ $this
44
+ .data('emodal', settings)
45
+ .on('emodalBeforeOpen.hide_modal', function (e) {
46
+ jQuery(this)
47
+ .css({ visibility: "visible" })
48
+ .hide()
49
+ .addClass(settings.container.active_class);
50
+
51
+ if(!settings.meta.display.stackable) {
52
+ $this.emodal('close_all');
53
+ }
54
+ })
55
+ .on('emodalAfterClose.close_overlay', function (e) {
56
+ $overlay = jQuery('#' + settings.overlay.attr.id);
57
+ if ($overlay.length && $overlay.is(":visible")) {
58
+ $overlay.fadeOut(settings.close.close_speed);
59
+ }
60
+ })
61
+ .on('emodalAfterClose.reset_videos', function (e) {
62
+ jQuery('iframe', $this).filter('[src*="youtube"],[src*="vimeo"]').each(function () {
63
+ var src = jQuery(this).attr('src');
64
+ jQuery(this).attr('src', '').attr('src', src);
65
+ });
66
+ })
67
+ .on('emodalBeforeOpen.setup_close', function () {
68
+ $this.emodal('setup_close');
69
+ })
70
+ .on('emodalBeforeOpen.retheme', function () {
71
+ $this.emodal('retheme');
72
+ })
73
+ .on('emodalBeforeOpen.reposition', function () {
74
+ $this.emodal('reposition');
75
+ })
76
+ .trigger('emodalInit');
77
+ return this;
78
+ });
79
+ },
80
+ setup_close: function () {
81
+ var $this = jQuery(this),
82
+ settings = $this.data('emodal'),
83
+ $overlay = jQuery('#' + settings.overlay.attr.id),
84
+ $close = jQuery('.' + settings.close.attr.class, $this);
85
+
86
+ $close
87
+ .off('click.emodal')
88
+ .on("click.emodal", function (e) {
89
+ e.preventDefault();
90
+ e.stopPropagation();
91
+ $this.emodal('close');
92
+
93
+ });
94
+ if (settings.meta.close.esc_press)
95
+ jQuery(window)
96
+ .off('keyup.emodal')
97
+ .on('keyup.emodal', function (e) {
98
+ if (e.keyCode == 27)
99
+ $this.emodal('close');
100
+ });
101
+
102
+ if (settings.meta.close.overlay_click)
103
+ $overlay
104
+ .off('click.emodal')
105
+ .on('click.emodal', function (e) {
106
+ e.preventDefault();
107
+ e.stopPropagation();
108
+ $this.emodal('close');
109
+ });
110
+
111
+ $this
112
+ .on('emodalAfterClose', function () {
113
+ jQuery(window).off('keyup.emodal');
114
+ $overlay.off('click.emodal');
115
+ $close.off('click.emodal');
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 () {
130
+ return this.each(function () {
131
+ var $this = jQuery(this),
132
+ settings = $this.data('emodal');
133
+ $this
134
+ .trigger('emodalBeforeClose')
135
+ .removeClass('active')
136
+ .fadeOut(settings.close.close_speed, function () {
137
+ $this.trigger('emodalAfterClose');
138
+ });
139
+ return this;
140
+ });
141
+ },
142
+ close_all: function () {
143
+ var settings = jQuery(this).data('emodal');
144
+ jQuery('.' + settings.container.attr.class).removeClass('active').hide(0);
145
+ return this;
146
+ },
147
+ reposition: function (callback) {
148
+ var $this = jQuery(this);
149
+ $this.trigger('emodalBeforeReposition');
150
+ var settings = $this.data('emodal');
151
+ var location = settings.meta.display.location;
152
+ var position = settings.meta.display.position;
153
+
154
+ var reposition = {
155
+ my: "",
156
+ at: ""
157
+ };
158
+
159
+ if (location.indexOf('left') >= 0) reposition = {
160
+ my: reposition.my + " left" + (position.left !== 0 ? "+" + position.left : ""),
161
+ at: reposition.at + " left"
162
+ };
163
+ if (location.indexOf('right') >= 0) reposition = {
164
+ my: reposition.my + " right" + (position.right !== 0 ? "-" + position.right : ""),
165
+ at: reposition.at + " right"
166
+ };
167
+
168
+ if (location.indexOf('center') >= 0)
169
+ {
170
+ if (location == 'center') reposition = {
171
+ my: "center",
172
+ at: "center"
173
+ };
174
+ else reposition = {
175
+ my: reposition.my + " center",
176
+ at: reposition.at + " center"
177
+ };
178
+ }
179
+
180
+ if (location.indexOf('top') >= 0) reposition = {
181
+ my: reposition.my + " top" + (position.top !== 0 ? "+" + position.top : ""),
182
+ at: reposition.at + " top"
183
+ };
184
+ if (location.indexOf('bottom') >= 0) reposition = {
185
+ my: reposition.my + " bottom" + (position.bottom !== 0 ? "-" + position.bottom : ""),
186
+ at: reposition.at + " bottom"
187
+ };
188
+
189
+
190
+ reposition.my = jQuery.trim(reposition.my);
191
+ reposition.at = jQuery.trim(reposition.at);
192
+ reposition.of = window;
193
+ reposition.collision = 'fit';
194
+ reposition.using = typeof (callback) == "function" ? callback : jQuery.fn.emodal.callbacks.reposition_using;
195
+ var opacity = false;
196
+ if ($this.is(':hidden')) {
197
+ opacity = $this.css("opacity");
198
+ $this.css({
199
+ opacity: 0
200
+ }).show();
201
+ }
202
+
203
+ if (position.fixed)
204
+ $this.addClass('fixed');
205
+ else
206
+ $this.removeClass('fixed');
207
+
208
+ if (settings.meta.display.size == 'custom') {
209
+ $this.css({
210
+ width: settings.meta.display.custom_width + settings.meta.display.custom_width_unit,
211
+ height: settings.meta.display.custom_height_auto ? 'auto' : settings.meta.display.custom_height + settings.meta.display.custom_height_unit
212
+ });
213
+ }
214
+
215
+ $this
216
+ .addClass('custom-position')
217
+ .position(reposition)
218
+ .trigger('emodalAfterReposition');
219
+
220
+ if (opacity) {
221
+ $this.css({
222
+ opacity: opacity
223
+ }).hide();
224
+ }
225
+ return this;
226
+ },
227
+ retheme: function (theme) {
228
+ var $this = jQuery(this);
229
+ $this.trigger('emodalBeforeRetheme');
230
+ var settings = $this.data('emodal'),
231
+ $overlay = jQuery('#' + settings.overlay.attr.id),
232
+ $container = $this,
233
+ $title = jQuery('> .' + settings.title.attr.class, $container),
234
+ $content = jQuery('> .' + settings.content.attr.class, $container),
235
+ $close = jQuery('> .' + settings.close.attr.class, $container);
236
+
237
+ if (theme === undefined) {
238
+ theme = jQuery.fn.emodal.themes[settings.theme_id];
239
+ if (theme === undefined) {
240
+ theme = jQuery.fn.emodal.themes[1];
241
+ }
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,
266
+ //fontSize: theme.content.font.size+'px',
267
+ fontFamily: theme.content.font.family
268
+ });
269
+ jQuery('p, label', $content).css({
270
+ color: theme.content.font.color,
271
+ //fontSize: theme.content.font.size+'px',
272
+ fontFamily: theme.content.font.family
273
+ });
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,
281
+ borderStyle: theme.close.border.style,
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":
290
+ $close.css({
291
+ top: theme.close.position.top + 'px',
292
+ left: theme.close.position.left + 'px'
293
+ });
294
+ break;
295
+ case "topright":
296
+ $close.css({
297
+ top: theme.close.position.top + 'px',
298
+ right: theme.close.position.right + 'px'
299
+ });
300
+ break;
301
+ case "bottomleft":
302
+ $close.css({
303
+ bottom: theme.close.position.bottom + 'px',
304
+ left: theme.close.position.left + 'px'
305
+ });
306
+ break;
307
+ case "bottomright":
308
+ $close.css({
309
+ bottom: theme.close.position.bottom + 'px',
310
+ right: theme.close.position.right + 'px'
311
+ });
312
+ break;
313
+ }
314
+ $this.trigger('emodalAfterRetheme', [theme]);
315
+ return this;
316
+ },
317
+ animate_overlay: function (style, duration, callback) {
318
+ // Method calling logic
319
+ var $this = jQuery(this);
320
+ var settings = $this.data('emodal');
321
+ if(settings.meta.display.overlay_disabled)
322
+ {
323
+ callback();
324
+ }
325
+ else
326
+ {
327
+ if (jQuery.fn.emodal.overlay_animations[style])
328
+ return jQuery.fn.emodal.overlay_animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
329
+ else
330
+ jQuery.error('Animation style ' + jQuery.fn.emodal.overlay_animations + ' does not exist.');
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));
338
+ else
339
+ jQuery.error('Animation style ' + jQuery.fn.emodal.animations + ' does not exist.');
340
+ return this;
341
+ }
342
+ };
343
+
344
+ jQuery.fn.emodal.callbacks = {
345
+ reposition_using: function (position) {
346
+ jQuery(this).css(position);
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);
354
+ g = parseInt(hex.substring(2, 4), 16);
355
+ b = parseInt(hex.substring(4, 6), 16);
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 = {
386
+
387
+ meta: {
388
+ display: {
389
+ stackable: 0,
390
+ overlay_disabled: 0,
391
+ size: 'medium',
392
+ custom_width: '',
393
+ custom_width_unit: '%',
394
+ custom_height: '',
395
+ custom_height_unit: 'em',
396
+ custom_height_auto: 1,
397
+ location: 'center top',
398
+ position: {
399
+ top: 100,
400
+ left: 0,
401
+ bottom: 0,
402
+ right: 0,
403
+ fixed: 0
404
+ },
405
+ animation: {
406
+ type: 'fade',
407
+ speed: 350,
408
+ origin: 'center top'
409
+ }
410
+ },
411
+ close: {
412
+ overlay_click: 0,
413
+ esc_press: 1
414
+ }
415
+ },
416
+
417
+
418
+ container: {
419
+ active_class: 'active',
420
+ attr: {
421
+ class: "emodal"
422
+ }
423
+ },
424
+ title: {
425
+ attr: {
426
+ class: "emodal-title"
427
+ }
428
+ },
429
+ content: {
430
+ attr: {
431
+ class: "emodal-content"
432
+ }
433
+ },
434
+ close: {
435
+ close_speed: 0,
436
+ attr: {
437
+ class: "emodal-close"
438
+ }
439
+ },
440
+ overlay: {
441
+ attr: {
442
+ id: "emodal-overlay",
443
+ class: "emodal-overlay"
444
+ }
445
+ }
446
+ };
447
+
448
+ jQuery.fn.emodal.themes = emodal_themes;
449
+
450
+ jQuery.fn.emodal.overlay_animations = {
451
+ none: function (duration, callback) {
452
+ var $this = jQuery(this);
453
+ var settings = $this.data('emodal');
454
+ jQuery('#' + settings.overlay.attr.id).show(duration, callback);
455
+ },
456
+ fade: function (duration, callback) {
457
+ var $this = jQuery(this);
458
+ var settings = $this.data('emodal');
459
+ jQuery('#' + settings.overlay.attr.id).fadeIn(duration, callback);
460
+ },
461
+ slide: function (duration, callback) {
462
+ var $this = jQuery(this);
463
+ var settings = $this.data('emodal');
464
+ jQuery('#' + settings.overlay.attr.id).slideDown(duration, callback);
465
+ }
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
+ });
481
+ var settings = $this.data('emodal');
482
+ var speed = settings.meta.display.animation.speed;
483
+ var origin = settings.meta.display.animation.origin;
484
+ var start = {
485
+ my: "",
486
+ at: ""
487
+ };
488
+ switch (origin) {
489
+ case 'top':
490
+ start = {
491
+ my: "left+" + $this.offset().left + " bottom",
492
+ at: "left top"
493
+ };
494
+ break;
495
+ case 'bottom':
496
+ start = {
497
+ my: "left+" + $this.offset().left + " top",
498
+ at: "left bottom"
499
+ };
500
+ break;
501
+ case 'left':
502
+ start = {
503
+ my: "right top+" + $this.offset().top,
504
+ at: "left top"
505
+ };
506
+ break;
507
+ case 'right':
508
+ start = {
509
+ my: "left top+" + $this.offset().top,
510
+ at: "right top"
511
+ };
512
+ break;
513
+ default:
514
+ if (origin.indexOf('left') >= 0) start = {
515
+ my: start.my + " right",
516
+ at: start.at + " left"
517
+ };
518
+ if (origin.indexOf('right') >= 0) start = {
519
+ my: start.my + " left",
520
+ at: start.at + " right"
521
+ };
522
+ if (origin.indexOf('center') >= 0) start = {
523
+ my: start.my + " center",
524
+ at: start.at + " center"
525
+ };
526
+ if (origin.indexOf('top') >= 0) start = {
527
+ my: start.my + " bottom",
528
+ at: start.at + " top"
529
+ };
530
+ if (origin.indexOf('bottom') >= 0) start = {
531
+ my: start.my + " top",
532
+ at: start.at + " bottom"
533
+ };
534
+ start.my = jQuery.trim(start.my);
535
+ start.at = jQuery.trim(start.at);
536
+ break;
537
+ }
538
+ start.of = window;
539
+ start.collision = 'none';
540
+ jQuery('html').css('overflow-x', 'hidden');
541
+ $this.position(start).css({
542
+ opacity: 1
543
+ });
544
+
545
+ $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
546
+ $this.emodal('reposition', function (position) {
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
+ });
568
+ var settings = $this.data('emodal');
569
+ var speed = settings.meta.display.animation.speed;
570
+ var origin = settings.meta.display.animation.origin;
571
+ var start = {
572
+ my: "",
573
+ at: ""
574
+ };
575
+ switch (origin) {
576
+ case 'top':
577
+ start = {
578
+ my: "left+" + $this.offset().left + " bottom",
579
+ at: "left top"
580
+ };
581
+ break;
582
+
583
+ case 'bottom':
584
+ start = {
585
+ my: "left+" + $this.offset().left + " top",
586
+ at: "left bottom"
587
+ };
588
+ break;
589
+
590
+ case 'left':
591
+ start = {
592
+ my: "right top+" + $this.offset().top,
593
+ at: "left top"
594
+ };
595
+ break;
596
+
597
+ case 'right':
598
+ start = {
599
+ my: "left top+" + $this.offset().top,
600
+ at: "right top"
601
+ };
602
+ break;
603
+
604
+ default:
605
+ if (origin.indexOf('left') >= 0) start = {
606
+ my: start.my + " right",
607
+ at: start.at + " left"
608
+ };
609
+ if (origin.indexOf('right') >= 0) start = {
610
+ my: start.my + " left",
611
+ at: start.at + " right"
612
+ };
613
+ if (origin.indexOf('center') >= 0) start = {
614
+ my: start.my + " center",
615
+ at: start.at + " center"
616
+ };
617
+ if (origin.indexOf('top') >= 0) start = {
618
+ my: start.my + " bottom",
619
+ at: start.at + " top"
620
+ };
621
+ if (origin.indexOf('bottom') >= 0) start = {
622
+ my: start.my + " top",
623
+ at: start.at + " bottom"
624
+ };
625
+ start.my = jQuery.trim(start.my);
626
+ start.at = jQuery.trim(start.at);
627
+ break;
628
+ }
629
+ start.of = window;
630
+ start.collision = 'none';
631
+ jQuery('html').css('overflow-x', 'hidden');
632
+ $this.position(start);
633
+ $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
634
+ $this.emodal('reposition', function (position) {
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;
647
+ var origin = settings.meta.display.animation.origin;
648
+
649
+ // Set css for animation start.
650
+ $this.css({
651
+ transformOrigin: origin,
652
+ opacity: 0
653
+ }).show();
654
+
655
+ // Begin Animation with overlay fade in then grow animation.
656
+ $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
657
+ // Reposition with callback. position returns default positioning.
658
+ $this.emodal('reposition', function (position) {
659
+ position.scale = 1;
660
+ position.duration = speed * 0.75;
661
+ $this
662
+ .css({
663
+ scale: 0,
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();
675
+ var settings = $this.data('emodal');
676
+ var speed = settings.meta.display.animation.speed;
677
+ var origin = settings.meta.display.animation.origin;
678
+ var start = {
679
+ my: "",
680
+ at: ""
681
+ };
682
+ switch (origin) {
683
+ case 'top':
684
+ start = {
685
+ my: "left+" + $this.offset().left + " bottom",
686
+ at: "left top"
687
+ };
688
+ break;
689
+ case 'bottom':
690
+ start = {
691
+ my: "left+" + $this.offset().left + " top",
692
+ at: "left bottom"
693
+ };
694
+ break;
695
+ case 'left':
696
+ start = {
697
+ my: "right top+" + $this.offset().top,
698
+ at: "left top"
699
+ };
700
+ break;
701
+ case 'right':
702
+ start = {
703
+ my: "left top+" + $this.offset().top,
704
+ at: "right top"
705
+ };
706
+ break;
707
+ default:
708
+ if (origin.indexOf('left') >= 0) start = {
709
+ my: start.my + " right",
710
+ at: start.at + " left"
711
+ };
712
+ if (origin.indexOf('right') >= 0) start = {
713
+ my: start.my + " left",
714
+ at: start.at + " right"
715
+ };
716
+ if (origin.indexOf('center') >= 0) start = {
717
+ my: start.my + " center",
718
+ at: start.at + " center"
719
+ };
720
+ if (origin.indexOf('top') >= 0) start = {
721
+ my: start.my + " bottom",
722
+ at: start.at + " top"
723
+ };
724
+ if (origin.indexOf('bottom') >= 0) start = {
725
+ my: start.my + " top",
726
+ at: start.at + " bottom"
727
+ };
728
+ start.my = jQuery.trim(start.my);
729
+ start.at = jQuery.trim(start.at);
730
+ break;
731
+ }
732
+ start.of = window;
733
+ start.collision = 'none';
734
+ jQuery('html').css('overflow-x', 'hidden');
735
+ $this.position(start)
736
+ .css({
737
+ opacity: origin == 'center center' ? 0 : 1,
738
+ transformOrigin: origin
739
+ });
740
+ $this.emodal('animate_overlay', 'fade', speed * 0.25, function () {
741
+ $this.emodal('reposition', function (position) {
742
+ position.scale = 1;
743
+ position.opacity = 1;
744
+ position.duration = speed * 0.75;
745
+ $this.css({
746
+ scale: 0
747
+ })
748
+ .transition(position, function () {
749
+ jQuery('html').css('overflow-x', 'inherit');
750
+ });
751
+ });
752
+ });
753
+ return this;
754
+ }
755
+ };
756
+
757
+ jQuery('.emodal').css({ visibility: "visible" }).hide();
758
+
759
+ jQuery(document).ready(function () {
760
+ jQuery('.emodal')
761
+ .emodal()
762
+ .each(function () {
763
+ var $this = jQuery(this);
764
+ jQuery(document).on('click', '.' + $this.attr('id'), function (e) {
765
+ e.preventDefault();
766
+ e.stopPropagation();
767
+ $this.emodal('open');
768
+ });
769
+ jQuery('.' + $this.attr('id')).css('cursor', 'pointer');
770
+ });
771
+ });
772
+ }(jQuery));
assets/styles/easy-modal-site.css CHANGED
@@ -18,8 +18,6 @@
18
  z-index: 999!important;
19
  }
20
 
21
-
22
-
23
  .emodal > .emodal-close {
24
  text-decoration:none;
25
  text-align:center;
@@ -30,7 +28,6 @@
30
  min-width: 1em;
31
  }
32
 
33
- @media only screen and (min-width: 768px){
34
  .emodal.responsive {
35
  left: 50%;
36
  margin-left: -40%;
@@ -38,6 +35,8 @@
38
  height: auto;
39
  overflow:visible;
40
  }
 
 
41
  .emodal.nano {
42
  margin-left: -10%;
43
  width: 20%;
@@ -64,6 +63,7 @@
64
  }
65
  }
66
 
 
67
  .emodal.fixed {
68
  position:fixed;
69
  }
18
  z-index: 999!important;
19
  }
20
 
 
 
21
  .emodal > .emodal-close {
22
  text-decoration:none;
23
  text-align:center;
28
  min-width: 1em;
29
  }
30
 
 
31
  .emodal.responsive {
32
  left: 50%;
33
  margin-left: -40%;
35
  height: auto;
36
  overflow:visible;
37
  }
38
+
39
+ @media only screen and (min-width: 768px){
40
  .emodal.nano {
41
  margin-left: -10%;
42
  width: 20%;
63
  }
64
  }
65
 
66
+
67
  .emodal.fixed {
68
  position:fixed;
69
  }
classes/modals.php CHANGED
@@ -27,7 +27,7 @@ class EModal_Modals {
27
  public static function preload_modals()
28
  {
29
  $ids = implode(',', self::get_enqueued_modals());
30
- foreach(get_all_modals("is_active = 1 AND is_trash = 0 AND (is_sitewide = 1". (!empty($ids) ? " OR id IN ($ids)" : "") .")" ) as $modal)
31
  {
32
  self::$loaded_modals[$modal->id] = apply_filters('emodal_load_modal_settings', $modal->as_array());
33
  do_action('emodal_preload_modal', $modal);
@@ -39,7 +39,7 @@ class EModal_Modals {
39
  {
40
  if(!array_key_exists($id, self::$loaded_modals))
41
  {
42
- foreach(get_all_modals("is_active = 1 AND is_trash = 0 AND id IN ($ids)") as $modal)
43
  {
44
  self::$loaded_modals[$modal->id] = apply_filters('emodal_load_modal_settings', $modal->as_array());
45
  do_action('emodal_preload_modal', $modal);
27
  public static function preload_modals()
28
  {
29
  $ids = implode(',', self::get_enqueued_modals());
30
+ foreach(get_all_modals("is_trash != 1 AND (is_sitewide = 1". (!empty($ids) ? " OR id IN ($ids)" : "") .")" ) as $modal)
31
  {
32
  self::$loaded_modals[$modal->id] = apply_filters('emodal_load_modal_settings', $modal->as_array());
33
  do_action('emodal_preload_modal', $modal);
39
  {
40
  if(!array_key_exists($id, self::$loaded_modals))
41
  {
42
+ foreach(get_all_modals("is_trash != 1 AND id IN ($ids)") as $modal)
43
  {
44
  self::$loaded_modals[$modal->id] = apply_filters('emodal_load_modal_settings', $modal->as_array());
45
  do_action('emodal_preload_modal', $modal);
classes/model/modal.php CHANGED
@@ -12,7 +12,6 @@
12
  'modified' => '0000-00-00 00:00:00',
13
  'is_sitewide' => 0,
14
  'is_system' => 0,
15
- 'is_active' => 1,
16
  'is_trash' => 0
17
  );
18
  public function __construct($id = NULL)
@@ -58,7 +57,7 @@
58
  }
59
 
60
  if(!function_exists("get_all_modals")){
61
- function get_all_modals($where = "is_active = 1"){
62
  global $wpdb;
63
  $modals = array();
64
  $modal_ids = array();
12
  'modified' => '0000-00-00 00:00:00',
13
  'is_sitewide' => 0,
14
  'is_system' => 0,
 
15
  'is_trash' => 0
16
  );
17
  public function __construct($id = NULL)
57
  }
58
 
59
  if(!function_exists("get_all_modals")){
60
+ function get_all_modals($where = "is_trash != 1"){
61
  global $wpdb;
62
  $modals = array();
63
  $modal_ids = array();
classes/model/theme.php CHANGED
@@ -8,7 +8,6 @@
8
  'created' => '0000-00-00 00:00:00',
9
  'modified' => '0000-00-00 00:00:00',
10
  'is_system' => 0,
11
- 'is_active' => 1,
12
  'is_trash' => 0
13
  );
14
  public function __construct($id = NULL)
@@ -57,7 +56,7 @@
57
  }
58
 
59
  if(!function_exists("get_all_modal_themes")){
60
- function get_all_modal_themes($where = "is_active = 1"){
61
  global $wpdb;
62
 
63
  $themes = array();
8
  'created' => '0000-00-00 00:00:00',
9
  'modified' => '0000-00-00 00:00:00',
10
  'is_system' => 0,
 
11
  'is_trash' => 0
12
  );
13
  public function __construct($id = NULL)
56
  }
57
 
58
  if(!function_exists("get_all_modal_themes")){
59
+ function get_all_modal_themes($where = "is_trash != 1"){
60
  global $wpdb;
61
 
62
  $themes = array();
classes/site.php CHANGED
@@ -14,7 +14,7 @@ class EModal_Site {
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-position', 'jquery-transit'), '2', true);
18
  $themes = array();
19
  foreach(get_all_modal_themes() as $theme)
20
  {
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
  {
classes/view/admin/modal/index.php CHANGED
@@ -101,7 +101,7 @@ class EModal_Modal_List_Table extends WP_List_Table {
101
  //Number of elements in your table?
102
  $totalitems = $wpdb->query($query); //return the total number of affected rows
103
  //How many to display per page?
104
- $perpage = 5;
105
  //Which page is this?
106
  $paged = !empty($_GET["paged"]) && intval($_GET["paged"]) > 0 ? intval( $_GET["paged"] ) : 1;
107
  //How many pages do we have in total?
101
  //Number of elements in your table?
102
  $totalitems = $wpdb->query($query); //return the total number of affected rows
103
  //How many to display per page?
104
+ $perpage = !empty($_GET["per_page"]) && intval($_GET["per_page"]) > 0 ? intval( $_GET["per_page"] ) : 10;
105
  //Which page is this?
106
  $paged = !empty($_GET["paged"]) && intval($_GET["paged"]) > 0 ? intval( $_GET["paged"] ) : 1;
107
  //How many pages do we have in total?
classes/view/modal.php CHANGED
@@ -43,7 +43,6 @@ function emodal_modal_data_attr($modal)
43
  $modal['name'],
44
  $modal['title'],
45
  $modal['content'],
46
- $modal['is_active'],
47
  $modal['is_sitewide'],
48
  $modal['is_system'],
49
  $modal['is_trash'],
43
  $modal['name'],
44
  $modal['title'],
45
  $modal['content'],
 
46
  $modal['is_sitewide'],
47
  $modal['is_system'],
48
  $modal['is_trash'],
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.13
8
  Author URI: http://wizardinternetsolutions.com
9
  Text Domain: easy-modal
10
  */
@@ -21,9 +21,9 @@ 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.13' );
25
  if (!defined('EMCORE_DB_VERSION'))
26
- define('EMCORE_DB_VERSION', '1' );
27
  if (!defined('EMCORE_API_URL'))
28
  define('EMCORE_API_URL', 'http://easy-modal.com');
29
 
@@ -158,7 +158,6 @@ class EModal {
158
  created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
159
  modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
160
  is_system tinyint(1) NOT NULL DEFAULT '0',
161
- is_active tinyint(1) NOT NULL DEFAULT '1',
162
  is_trash tinyint(1) NOT NULL DEFAULT '0',
163
  PRIMARY KEY (id)
164
  )$charset_collate;";
@@ -188,7 +187,6 @@ class EModal {
188
  modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
189
  is_sitewide tinyint(1) NOT NULL DEFAULT '0',
190
  is_system tinyint(1) NOT NULL DEFAULT '0',
191
- is_active tinyint(1) NOT NULL DEFAULT '1',
192
  is_trash tinyint(1) NOT NULL DEFAULT '0',
193
  PRIMARY KEY (id)
194
  )$charset_collate;";
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
  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'))
28
  define('EMCORE_API_URL', 'http://easy-modal.com');
29
 
158
  created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
159
  modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
160
  is_system tinyint(1) NOT NULL DEFAULT '0',
 
161
  is_trash tinyint(1) NOT NULL DEFAULT '0',
162
  PRIMARY KEY (id)
163
  )$charset_collate;";
187
  modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
188
  is_sitewide tinyint(1) NOT NULL DEFAULT '0',
189
  is_system tinyint(1) NOT NULL DEFAULT '0',
 
190
  is_trash tinyint(1) NOT NULL DEFAULT '0',
191
  PRIMARY KEY (id)
192
  )$charset_collate;";
includes/admin/options.php CHANGED
@@ -75,7 +75,7 @@ function emodal_model_theme_meta_core_defaults($options){
75
  if(empty($options['title']['textshadow']['vertical'])) $options['title']['textshadow']['vertical'] = 0;
76
  if(empty($options['title']['textshadow']['blur'])) $options['title']['textshadow']['blur'] = 0;
77
  if(empty($options['title']['textshadow']['color'])) $options['title']['textshadow']['color'] = '#020202';
78
- if(empty($options['title']['textshadow']['opacity'])) $options['title']['textshadow']['opacity'] = 0;
79
 
80
  if(empty($options['content']['font']['color'])) $options['content']['font']['color'] = '#8c8c8c';
81
  if(empty($options['content']['font']['family'])) $options['content']['font']['family'] = 'Times New Roman';
@@ -102,12 +102,12 @@ function emodal_model_theme_meta_core_defaults($options){
102
  if(empty($options['close']['boxshadow']['blur'])) $options['close']['boxshadow']['blur'] = 0;
103
  if(empty($options['close']['boxshadow']['spread'])) $options['close']['boxshadow']['spread'] = 0;
104
  if(empty($options['close']['boxshadow']['color'])) $options['close']['boxshadow']['color'] = '#020202';
105
- if(empty($options['close']['boxshadow']['opacity'])) $options['close']['boxshadow']['opacity'] = 0;
106
  if(empty($options['close']['textshadow']['horizontal'])) $options['close']['textshadow']['horizontal'] = 0;
107
  if(empty($options['close']['textshadow']['vertical'])) $options['close']['textshadow']['vertical'] = 0;
108
  if(empty($options['close']['textshadow']['blur'])) $options['close']['textshadow']['blur'] = 0;
109
  if(empty($options['close']['textshadow']['color'])) $options['close']['textshadow']['color'] = '#000000';
110
- if(empty($options['close']['textshadow']['opacity'])) $options['close']['textshadow']['opacity'] = 0;
111
  return $options;
112
  }
113
 
75
  if(empty($options['title']['textshadow']['vertical'])) $options['title']['textshadow']['vertical'] = 0;
76
  if(empty($options['title']['textshadow']['blur'])) $options['title']['textshadow']['blur'] = 0;
77
  if(empty($options['title']['textshadow']['color'])) $options['title']['textshadow']['color'] = '#020202';
78
+ if(empty($options['title']['textshadow']['opacity'])) $options['title']['textshadow']['opacity'] = 23;
79
 
80
  if(empty($options['content']['font']['color'])) $options['content']['font']['color'] = '#8c8c8c';
81
  if(empty($options['content']['font']['family'])) $options['content']['font']['family'] = 'Times New Roman';
102
  if(empty($options['close']['boxshadow']['blur'])) $options['close']['boxshadow']['blur'] = 0;
103
  if(empty($options['close']['boxshadow']['spread'])) $options['close']['boxshadow']['spread'] = 0;
104
  if(empty($options['close']['boxshadow']['color'])) $options['close']['boxshadow']['color'] = '#020202';
105
+ if(empty($options['close']['boxshadow']['opacity'])) $options['close']['boxshadow']['opacity'] = 23;
106
  if(empty($options['close']['textshadow']['horizontal'])) $options['close']['textshadow']['horizontal'] = 0;
107
  if(empty($options['close']['textshadow']['vertical'])) $options['close']['textshadow']['vertical'] = 0;
108
  if(empty($options['close']['textshadow']['blur'])) $options['close']['textshadow']['blur'] = 0;
109
  if(empty($options['close']['textshadow']['color'])) $options['close']['textshadow']['color'] = '#000000';
110
+ if(empty($options['close']['textshadow']['opacity'])) $options['close']['textshadow']['opacity'] = 23;
111
  return $options;
112
  }
113
 
includes/admin/postmeta.php CHANGED
@@ -10,7 +10,7 @@ add_action('emodal_post_meta_box', 'emodal_post_meta_box_setting_load', 1);
10
  function emodal_post_meta_box_setting_load($object)
11
  {
12
  $current_modals = get_post_meta($object->ID, EMCORE_SLUG.'_post_modals', true);
13
- $modals = get_all_modals("is_active = 1 AND is_sitewide = 0");
14
  wp_nonce_field( EMCORE_NONCE, EMCORE_NONCE);?>
15
  <?php if(count($modals)):?>
16
  <tr>
10
  function emodal_post_meta_box_setting_load($object)
11
  {
12
  $current_modals = get_post_meta($object->ID, EMCORE_SLUG.'_post_modals', true);
13
+ $modals = get_all_modals("is_trash != 1 AND is_sitewide = 0");
14
  wp_nonce_field( EMCORE_NONCE, EMCORE_NONCE);?>
15
  <?php if(count($modals)):?>
16
  <tr>
includes/admin/theme-form-close-tab.php CHANGED
@@ -248,7 +248,10 @@ function emodal_admin_theme_form_close_tab_settings_boxshadow()
248
  </th>
249
  <td>
250
  <select name="theme[meta][close][boxshadow][inset]" id="close_boxshadow_inset">
251
- <?php foreach(array(__('Yes', EMCORE_SLUG) => 'yes', __('No', EMCORE_SLUG) => 'no') as $option => $value) : ?>
 
 
 
252
  <option
253
  value="<?php echo $value;?>"
254
  <?php echo $value == get_current_modal_theme('meta.close.boxshadow.inset') ? ' selected="selected"' : '';?>
248
  </th>
249
  <td>
250
  <select name="theme[meta][close][boxshadow][inset]" id="close_boxshadow_inset">
251
+ <?php foreach(array(
252
+ __('No', EMCORE_SLUG) => 'no',
253
+ __('Yes', EMCORE_SLUG) => 'yes'
254
+ ) as $option => $value) : ?>
255
  <option
256
  value="<?php echo $value;?>"
257
  <?php echo $value == get_current_modal_theme('meta.close.boxshadow.inset') ? ' selected="selected"' : '';?>
includes/admin/theme-form-container-tab.php CHANGED
@@ -127,7 +127,10 @@ function emodal_admin_theme_form_container_tab_settings_boxshadow()
127
  </th>
128
  <td>
129
  <select name="theme[meta][container][boxshadow][inset]" id="container_boxshadow_inset">
130
- <?php foreach(array(__('Yes', EMCORE_SLUG) => 'yes', __('No', EMCORE_SLUG) => 'no') as $option => $value) : ?>
 
 
 
131
  <option
132
  value="<?php echo $value;?>"
133
  <?php echo $value == get_current_modal_theme('meta.container.boxshadow.inset') ? ' selected="selected"' : '';?>
127
  </th>
128
  <td>
129
  <select name="theme[meta][container][boxshadow][inset]" id="container_boxshadow_inset">
130
+ <?php foreach(array(
131
+ __('No', EMCORE_SLUG) => 'no',
132
+ __('Yes', EMCORE_SLUG) => 'yes'
133
+ ) as $option => $value) : ?>
134
  <option
135
  value="<?php echo $value;?>"
136
  <?php echo $value == get_current_modal_theme('meta.container.boxshadow.inset') ? ' selected="selected"' : '';?>
includes/plugin-updater.php CHANGED
@@ -4,10 +4,7 @@
4
  *
5
  * @author Pippin Williamson
6
  * @version 1.2
7
- */
8
-
9
- /*
10
- Note for wp.org admins. This is not called in the free hosted version and is simply used for hooking in addons to one update system rather than including it in each plugin.
11
  */
12
 
13
  class EMCORE_Plugin_Updater {
4
  *
5
  * @author Pippin Williamson
6
  * @version 1.2
7
+ * Note for wordpress.org admins. This is not called in the free hosted version and is simply used for hooking in addons to one update system rather than including it in each plugin.
 
 
 
8
  */
9
 
10
  class EMCORE_Plugin_Updater {
readme.txt CHANGED
@@ -5,11 +5,21 @@ 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: 3.9.2
9
- Stable tag: 2.0.13
10
- Make a pop up in minutes. Logins, Auto Exits, Scroll Pops, Age Verification Pops. Theme, customize, stream line your GUI & market your content!
 
11
  == Description ==
12
- Make a pop up in minutes - Logins, Auto Exits, Scroll Pops, Age Verification Pops - use EasyModal's ultimate theme capabilities and customization options to make glorious pop ups that increase your site's usability, conversion rates and market your most precious content.
 
 
 
 
 
 
 
 
 
13
 
14
  = Core Features =
15
  * Unlimited Customizable Modals
@@ -32,15 +42,15 @@ Make a pop up in minutes - Logins, Auto Exits, Scroll Pops, Age Verification Pop
32
  * Auto Open Modals
33
  * Open modals automatically when users visit your site or a specific page.
34
  * Exit Modals
35
- * This add on allows you to create modals and pop-ups that appear when a user attempts to leave or exit your site
36
  * Login Modals
37
- * This add on gives you the ability to have ajax login forms appear in a pop-up. Also includes registration and forgot your password modals.
38
  * Age Verification
39
- * This add on will pop-up 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
40
  * Unlimited Themes
41
  * Create as many themes as you need. Choose which theme each modal uses.
42
  * Scroll Pops
43
- * Pop up modals when the user scrolls down the page.
44
  * Force User Action
45
  * Disable the close button, forcing the user to fill out your form or do another action.
46
  * Advanced Theme Editor
@@ -48,21 +58,36 @@ Make a pop up in minutes - Logins, Auto Exits, Scroll Pops, Age Verification Pop
48
 
49
 
50
 
51
- If you like the plugin please rate it.
52
-
53
- [Easy Modal Website](http://easy-modal.com "Easy Modal Website") - Examples, Documentation & Pricing
54
-
55
  [Plugin Developers Site](http://wizardinternetsolutions.com "Web & Plugin Development") - Wizard Internet Solutions
56
 
57
- To be notified of plugin updates, [follow us on Twitter](https://twitter.com/EasyModal "Easy Modal on Twitter")!
58
-
59
  == Installation ==
60
- 1. Login to WordPress and update to/install EasyModal version 2.0
61
- 2. Pro License Holders: Enter your license key on the settings page to activate your site. Then go to the Add Ons page under EasyModal - install the EasyModal Pro Add On, plus any other Add Ons you desire
62
- 3. For current users, settings from previously existing functionality will be imported to the appropriate Add Ons containing respective functionality automatically
63
- 4. Theme, customize, make a pop up.
64
 
65
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  = v2.0.11 =
68
  * Bug
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
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
58
 
59
 
60
 
 
 
 
 
61
  [Plugin Developers Site](http://wizardinternetsolutions.com "Web & Plugin Development") - Wizard Internet Solutions
62
 
 
 
63
  == Installation ==
64
+ 1. Login to WordPress and update to/install EasyModal version 2.0.13.
65
+ 2. For current users, settings from previously existing functionality will be imported to the appropriate Addons containing respective functionality automatically.
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.
72
+ * Fixed misconfiguration in admin javascript.
73
+ * Fixed bug in click even for modal links.
74
+ * Fixed an issue with responsive modals.
75
+ * Fixed issue with trashed modals appearing in drop downs.
76
+ * Fixed compatibility issues by adding jquery-ui-core.
77
+ * Improvement
78
+ * Updated the visuals for default theme options to make them more user friendly.
79
+ * Added per_page parameter and changed default to 10 per page.
80
+ * Moved convert_hex into emodal utitlities.
81
+ * Removed unused is_active column from tables.
82
+ * Reorganized some triggers.
83
+ * Added default modal settings.
84
+
85
+ = v2.0.13 =
86
+ * Bug
87
+ * Fixed bugs in the Update API and Addon API that were causing extremely high loading times.
88
+ * Fixed bug with Admin Notice.
89
+ * Fixed numerous issues with modal and theme defaults which caused problems in the Java Script.
90
+ * Fixed a bug with Existing Pro Addon causing compatibility issues.
91
 
92
  = v2.0.11 =
93
  * Bug