Version Description
Download this release
Release Info
Developer | danieliser |
Plugin | 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 +381 -383
- assets/scripts/easy-modal-site.js +772 -745
- assets/styles/easy-modal-site.css +3 -3
- classes/modals.php +2 -2
- classes/model/modal.php +1 -2
- classes/model/theme.php +1 -2
- classes/site.php +1 -1
- classes/view/admin/modal/index.php +1 -1
- classes/view/modal.php +0 -1
- easy-modal.php +3 -5
- includes/admin/options.php +3 -3
- includes/admin/postmeta.php +1 -1
- includes/admin/theme-form-close-tab.php +4 -1
- includes/admin/theme-form-container-tab.php +4 -1
- includes/plugin-updater.php +1 -4
- readme.txt +43 -18
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.
|
177 |
-
var theme = self.serialize_form('#emodal-theme-editor').theme;
|
178 |
-
self.retheme_modal(theme.meta);
|
179 |
-
}, 5),
|
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 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
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 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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("
|
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("
|
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 = "
|
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 = "
|
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 =
|
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.
|
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.
|
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'] =
|
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'] =
|
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'] =
|
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("
|
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(
|
|
|
|
|
|
|
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(
|
|
|
|
|
|
|
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:
|
9 |
-
Stable tag: 2.0.
|
10 |
-
Make
|
|
|
11 |
== Description ==
|
12 |
-
Make
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
36 |
* Login Modals
|
37 |
-
* This add on gives you the ability to have ajax login forms appear in a
|
38 |
* Age Verification
|
39 |
-
* This add on will
|
40 |
* Unlimited Themes
|
41 |
* Create as many themes as you need. Choose which theme each modal uses.
|
42 |
* Scroll Pops
|
43 |
-
*
|
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.
|
62 |
-
|
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
|