Version Description
Download this release
Release Info
Developer | niteo |
Plugin | CMP – Coming Soon & Maintenance Plugin by NiteoThemes |
Version | 3.9.3 |
Comparing to | |
See all releases |
Code changes from version 3.9.2 to 3.9.3
- img/thumbnails/saturn/screenshot1.jpg +0 -0
- img/thumbnails/saturn/screenshot2.jpg +0 -0
- img/thumbnails/saturn/screenshot3.jpg +0 -0
- img/thumbnails/saturn_thumbnail.jpg +0 -0
- inc/render/custom-css.php +16 -0
- inc/render/head-scripts.php +1 -15
- inc/render/javascripts.php +2 -2
- inc/render/social-icons.php +1 -1
- inc/settings/settings-background.php +2 -3
- inc/settings/settings-seo.php +1 -1
- js/cmp-advanced.js +249 -285
- js/settings.js +991 -1411
- js/settings.min.js +1 -1
- niteo-cmp.php +3 -2
- readme.txt +7 -1
- themes/saturn.txt +3 -0
img/thumbnails/saturn/screenshot1.jpg
ADDED
Binary file
|
img/thumbnails/saturn/screenshot2.jpg
ADDED
Binary file
|
img/thumbnails/saturn/screenshot3.jpg
ADDED
Binary file
|
img/thumbnails/saturn_thumbnail.jpg
ADDED
Binary file
|
inc/render/custom-css.php
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
|
2 |
<?php
|
|
|
|
|
|
|
|
|
|
|
3 |
$css = '';
|
4 |
$themeslug = $this->cmp_selectedTheme();
|
5 |
$countdown_action = get_option('niteoCS_countdown_action', 'no-action');
|
@@ -176,6 +181,17 @@ if ( class_exists('Cookie_Notice') && get_option('cmp_cookie_notice_comp', '1')
|
|
176 |
<?php
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
$css = ob_get_clean();
|
181 |
|
1 |
|
2 |
<?php
|
3 |
+
/**
|
4 |
+
* Detect plugin. For use on Front End only.
|
5 |
+
*/
|
6 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
7 |
+
|
8 |
$css = '';
|
9 |
$themeslug = $this->cmp_selectedTheme();
|
10 |
$countdown_action = get_option('niteoCS_countdown_action', 'no-action');
|
181 |
<?php
|
182 |
}
|
183 |
|
184 |
+
// Styles for Plugin Name Weglot
|
185 |
+
if ( is_plugin_active( 'weglot/weglot.php' ) && defined('WEGLOT_VERSION') ) { ?>
|
186 |
+
|
187 |
+
<link rel='stylesheet' id='weglot-css-css' href='https://cmp.weglot-translate.com/wp-content/plugins/weglot/dist/css/front-css.css?ver=<?php echo WEGLOT_VERSION;?>' media='' />
|
188 |
+
<style>
|
189 |
+
aside.country-selector.weglot-dropdown.weglot-default.weglot-invert span {
|
190 |
+
color: black!important;
|
191 |
+
}
|
192 |
+
</style>
|
193 |
+
<?php
|
194 |
+
}
|
195 |
|
196 |
$css = ob_get_clean();
|
197 |
|
inc/render/head-scripts.php
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
4 |
-
* Detect plugin. For use on Front End only.
|
5 |
-
*/
|
6 |
-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
7 |
|
8 |
$this->cmp_wp_head();
|
9 |
|
@@ -69,14 +66,3 @@ if ( ( function_exists('cn_cookies_accepted') && get_option('cmp_cookie_notice_c
|
|
69 |
}
|
70 |
}
|
71 |
|
72 |
-
// Styles for Plugin Name Weglot
|
73 |
-
if ( is_plugin_active( 'weglot/weglot.php' ) && defined('WEGLOT_VERSION') ) { ?>
|
74 |
-
|
75 |
-
<link rel='stylesheet' id='weglot-css-css' href='https://cmp.weglot-translate.com/wp-content/plugins/weglot/dist/css/front-css.css?ver=<?php echo WEGLOT_VERSION;?>' media='' />
|
76 |
-
<style>
|
77 |
-
aside.country-selector.weglot-dropdown.weglot-default.weglot-invert span {
|
78 |
-
color: black!important;
|
79 |
-
}
|
80 |
-
</style>
|
81 |
-
<?php
|
82 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
|
|
|
|
|
|
|
4 |
|
5 |
$this->cmp_wp_head();
|
6 |
|
66 |
}
|
67 |
}
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/render/javascripts.php
CHANGED
@@ -420,9 +420,9 @@ if ( isset( $theme_supports['counter_script']) && $theme_supports['counter_scrip
|
|
420 |
|
421 |
if ( $counter_script && get_option('niteoCS_counter', '1') == '1') {
|
422 |
$countdown_action = get_option('niteoCS_countdown_action', 'no-action');
|
423 |
-
|
424 |
// counter script for day only
|
425 |
-
if ( $themeslug
|
426 |
<script>
|
427 |
var countdown = document.getElementById('counter');
|
428 |
var count = parseInt(document.getElementById('counter-day').textContent);
|
420 |
|
421 |
if ( $counter_script && get_option('niteoCS_counter', '1') == '1') {
|
422 |
$countdown_action = get_option('niteoCS_countdown_action', 'no-action');
|
423 |
+
$days_counter = array('delta', 'mercury', 'libra', 'thor', 'headliner', 'mosaic', 'saturn');
|
424 |
// counter script for day only
|
425 |
+
if ( in_array($themeslug, $days_counter) ) { ?>
|
426 |
<script>
|
427 |
var countdown = document.getElementById('counter');
|
428 |
var count = parseInt(document.getElementById('counter-day').textContent);
|
inc/render/social-icons.php
CHANGED
@@ -11,7 +11,7 @@ if ( get_option('niteoCS_socialmedia') ) {
|
|
11 |
//sort social icons array by hidden, then order key
|
12 |
uasort( $socialmedia , array($this,'sort_social') );
|
13 |
|
14 |
-
$theme_html = ( $themeslug == 'stylo' || $themeslug == 'mosaic') ? '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="3em" height="3em" viewBox="0 0 80 80" xml:space="preserve"><circle transform="rotate(-90 40 40)" class="another-circle" cx="40" cy="40" r="36" /></svg>' : '';
|
15 |
|
16 |
if ( $title == true ) {
|
17 |
$soc_title = $this->cmp_wpml_translate_string( stripslashes( get_option('niteoCS_soc_title', 'GET SOCIAL WITH US') ), 'Social Icons Title' );;
|
11 |
//sort social icons array by hidden, then order key
|
12 |
uasort( $socialmedia , array($this,'sort_social') );
|
13 |
|
14 |
+
$theme_html = ( $themeslug == 'stylo' || $themeslug == 'mosaic' || $themeslug == 'saturn') ? '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="3em" height="3em" viewBox="0 0 80 80" xml:space="preserve"><circle transform="rotate(-90 40 40)" class="another-circle" cx="40" cy="40" r="36" /></svg>' : '';
|
15 |
|
16 |
if ( $title == true ) {
|
17 |
$soc_title = $this->cmp_wpml_translate_string( stripslashes( get_option('niteoCS_soc_title', 'GET SOCIAL WITH US') ), 'Social Icons Title' );;
|
inc/settings/settings-background.php
CHANGED
@@ -158,8 +158,8 @@ $mobile_banner_custom_id = get_option('niteoCS_mobile_banner_id', '');
|
|
158 |
|
159 |
$i = 0;
|
160 |
foreach ( $ids as $id ) {
|
161 |
-
|
162 |
-
|
163 |
<div class="big-thumb">
|
164 |
<div class="thumbnail-overlay"></div>
|
165 |
<?php
|
@@ -169,7 +169,6 @@ $mobile_banner_custom_id = get_option('niteoCS_mobile_banner_id', '');
|
|
169 |
</div>
|
170 |
<?php
|
171 |
} else {
|
172 |
-
$img = wp_get_attachment_image_src( $id, 'medium' );
|
173 |
if ( isset ($img[0] ) ) {
|
174 |
echo '<img src="' . $img[0] . '" alt="" class="no-blur">';
|
175 |
}
|
158 |
|
159 |
$i = 0;
|
160 |
foreach ( $ids as $id ) {
|
161 |
+
$img = wp_get_attachment_image_src( $id, 'large' );
|
162 |
+
if ( $i == 0 ) { ?>
|
163 |
<div class="big-thumb">
|
164 |
<div class="thumbnail-overlay"></div>
|
165 |
<?php
|
169 |
</div>
|
170 |
<?php
|
171 |
} else {
|
|
|
172 |
if ( isset ($img[0] ) ) {
|
173 |
echo '<img src="' . $img[0] . '" alt="" class="no-blur">';
|
174 |
}
|
inc/settings/settings-seo.php
CHANGED
@@ -60,7 +60,7 @@ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
|
60 |
echo '<img src="'.esc_url( $niteoCS_seo_img_url ).'" alt="">';
|
61 |
} ?>
|
62 |
</div>
|
63 |
-
<span class="cmp-hint">* <?php _e('By default
|
64 |
<br><br>
|
65 |
<input id="delete-seo_img" type="button" class="button" value="Remove Image" />
|
66 |
</fieldset>
|
60 |
echo '<img src="'.esc_url( $niteoCS_seo_img_url ).'" alt="">';
|
61 |
} ?>
|
62 |
</div>
|
63 |
+
<span class="cmp-hint">* <?php _e('By default selected Background image is displayed on Social Networks if your Website is shared. You can overwrite the image by selecting your custom image here.', 'cmp-coming-soon-maintenance');?></span>
|
64 |
<br><br>
|
65 |
<input id="delete-seo_img" type="button" class="button" value="Remove Image" />
|
66 |
</fieldset>
|
js/cmp-advanced.js
CHANGED
@@ -1,287 +1,251 @@
|
|
1 |
jQuery(document).ready(function ($) {
|
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 |
-
jQuery('#copy-bypass').click(function (e) {
|
254 |
-
e.preventDefault();
|
255 |
-
copyTextToClipboard(jQuery('#bypass-code').html());
|
256 |
-
|
257 |
-
});
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
function cmp_repeat_fields(field_id) {
|
263 |
-
jQuery('#add-' + field_id).click(function (e) {
|
264 |
-
e.preventDefault();
|
265 |
-
var $wrapper = jQuery('#wrapper-' + field_id);
|
266 |
-
var $target = jQuery('#wrapper-' + field_id + ' .target-repeater-fields');
|
267 |
-
var $fields = $wrapper.find('.source-repeater-fields').children().clone();
|
268 |
-
$($fields[0]).val('');
|
269 |
-
$($target).append($fields);
|
270 |
-
});
|
271 |
-
|
272 |
-
cmp_delete_field(field_id);
|
273 |
-
}
|
274 |
-
|
275 |
-
function cmp_delete_field(field_id) {
|
276 |
-
jQuery('#wrapper-' + field_id + ' .target-repeater-fields').on('click', '.delete-' + field_id, function (e) {
|
277 |
-
e.preventDefault();
|
278 |
-
$(this).prev().remove();
|
279 |
-
$(this).remove();
|
280 |
-
});
|
281 |
-
|
282 |
-
jQuery('#wrapper-' + field_id + ' .source-repeater-fields').on('click', '.delete-' + field_id, function (e) {
|
283 |
-
e.preventDefault();
|
284 |
-
$(this).prev().val('');
|
285 |
-
});
|
286 |
-
}
|
287 |
});
|
1 |
jQuery(document).ready(function ($) {
|
2 |
+
var tab = document.location.hash.substring(1);
|
3 |
+
var action = jQuery('#csoptions').attr('action');
|
4 |
+
var importing = false;
|
5 |
+
|
6 |
+
// function to tab navigation
|
7 |
+
navtab = function (tab) {
|
8 |
+
jQuery('.cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
|
9 |
+
|
10 |
+
jQuery('.nav-tab-wrapper .nav-tab[data-tab="' + tab + '"]').addClass('nav-tab-active');
|
11 |
+
|
12 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper.' + tab).css('display', 'block');
|
13 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper-css.' + tab).css('display', 'block');
|
14 |
+
jQuery('.cmp-coming-soon-maintenance .comingsoon.' + tab).css('display', 'block');
|
15 |
+
|
16 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper:not(.' + tab + ')').css('display', 'none');
|
17 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper-css:not(.' + tab).css('display', 'none');
|
18 |
+
jQuery('.cmp-coming-soon-maintenance .comingsoon:not(.' + tab + ')').css('display', 'none');
|
19 |
+
|
20 |
+
if (tab == 'install') {
|
21 |
+
jQuery('.cmp-coming-soon-maintenance .submit').css('display', 'none');
|
22 |
+
jQuery('.cmp-coming-soon-maintenance #csoptions').attr('action', action);
|
23 |
+
} else {
|
24 |
+
jQuery('.cmp-coming-soon-maintenance .submit').css('display', 'block');
|
25 |
+
// change form action to display current tab after save
|
26 |
+
jQuery('.cmp-coming-soon-maintenance #csoptions').attr('action', action + '#' + tab);
|
27 |
+
}
|
28 |
+
};
|
29 |
+
|
30 |
+
if (tab != '') {
|
31 |
+
navtab(tab);
|
32 |
+
} else {
|
33 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper-css').css('display', 'none');
|
34 |
+
}
|
35 |
+
|
36 |
+
window.onhashchange = function () {
|
37 |
+
tab = document.location.hash.substring(1);
|
38 |
+
navtab(tab);
|
39 |
+
};
|
40 |
+
|
41 |
+
jQuery('.cmp-coming-soon-maintenance .nav-tab').click(function (e) {
|
42 |
+
e.preventDefault();
|
43 |
+
tab = jQuery(this).data('tab');
|
44 |
+
document.location.hash = tab;
|
45 |
+
});
|
46 |
+
|
47 |
+
toggle_settings('page-whitelist');
|
48 |
+
toggle_settings('cmp-bypass');
|
49 |
+
toggle_settings('cmp-topbar-icon');
|
50 |
+
toggle_settings('countdown-toggle');
|
51 |
+
toggle_settings('mode-change-toggle');
|
52 |
+
toggle_settings('cmp-wpautop');
|
53 |
+
toggle_settings('cmp-cookienotice');
|
54 |
+
cmp_repeat_fields('head_scripts');
|
55 |
+
cmp_repeat_fields('footer_scripts');
|
56 |
+
|
57 |
+
// upload json file button
|
58 |
+
jQuery('#cmp-import-json').on('change', function (e) {
|
59 |
+
// change label
|
60 |
+
jQuery('.import-json-label').attr('data-default', e.target.files[0].name);
|
61 |
+
|
62 |
+
var reader = new FileReader();
|
63 |
+
reader.onload = function (e) {
|
64 |
+
jQuery('#cmp-import-input').val(e.target.result);
|
65 |
+
};
|
66 |
+
|
67 |
+
reader.readAsText(e.target.files[0]);
|
68 |
+
|
69 |
+
// enable import button
|
70 |
+
$('#cmp-import-settings').attr('disabled', false);
|
71 |
+
jQuery('.import-json-label').removeClass('import-fail');
|
72 |
+
|
73 |
+
importing = false;
|
74 |
+
});
|
75 |
+
|
76 |
+
// export button ajax call
|
77 |
+
jQuery('#cmp-export-json').click(function (e) {
|
78 |
+
e.preventDefault();
|
79 |
+
|
80 |
+
var data = {
|
81 |
+
action: 'cmp_ajax_export_settings',
|
82 |
+
security: jQuery(this).data('security'),
|
83 |
+
};
|
84 |
+
|
85 |
+
jQuery.post(ajaxurl, data, function (response) {
|
86 |
+
// if (response) {
|
87 |
+
jQuery('<iframe />')
|
88 |
+
.attr('src', ajaxurl + '?action=cmp_ajax_export_settings&security=' + jQuery('#cmp-export-json').data('security'))
|
89 |
+
.appendTo('body')
|
90 |
+
.hide();
|
91 |
+
// }
|
92 |
+
});
|
93 |
+
});
|
94 |
+
|
95 |
+
// import button ajax call
|
96 |
+
jQuery('#cmp-import-settings').click(function (e) {
|
97 |
+
e.preventDefault();
|
98 |
+
|
99 |
+
if (importing === true) {
|
100 |
+
return false;
|
101 |
+
}
|
102 |
+
|
103 |
+
var json = jQuery('#cmp-import-input').val();
|
104 |
+
var $label = jQuery('.import-json-label');
|
105 |
+
|
106 |
+
// remove settings keys with media if no media import
|
107 |
+
if (!jQuery('#cmp-import-media').is(':checked')) {
|
108 |
+
var settings = new Array('niteoCS_banner_id', 'niteoCS_logo_id', 'niteoCS_seo_img_id');
|
109 |
+
|
110 |
+
json = jQuery.parseJSON(json);
|
111 |
+
|
112 |
+
json.map(function (value, index) {
|
113 |
+
for (var key in value) {
|
114 |
+
if (settings.indexOf(key) > -1) {
|
115 |
+
json.splice(index, 1);
|
116 |
+
}
|
117 |
+
}
|
118 |
+
});
|
119 |
+
|
120 |
+
json = JSON.stringify(json);
|
121 |
+
}
|
122 |
+
|
123 |
+
var data = {
|
124 |
+
action: 'cmp_ajax_import_settings',
|
125 |
+
security: jQuery(this).data('security'),
|
126 |
+
json: json,
|
127 |
+
};
|
128 |
+
|
129 |
+
importing = true;
|
130 |
+
|
131 |
+
var ajaxTime = new Date().getTime();
|
132 |
+
|
133 |
+
// change label
|
134 |
+
$label.html('<i class="fa fa-cog fa-spin" aria-hidden="true"></i> importing..');
|
135 |
+
$label.attr('data-default', '');
|
136 |
+
|
137 |
+
jQuery.post(ajaxurl, data, function (response) {
|
138 |
+
if (response) {
|
139 |
+
var totalTime = new Date().getTime() - ajaxTime;
|
140 |
+
var result = jQuery.parseJSON(response);
|
141 |
+
|
142 |
+
if (totalTime > 2000) {
|
143 |
+
if (result.result == 'success') {
|
144 |
+
$label.addClass('import-success');
|
145 |
+
} else {
|
146 |
+
$label.addClass('import-fail');
|
147 |
+
}
|
148 |
+
|
149 |
+
$label.html('');
|
150 |
+
$label.attr('data-default', result.message);
|
151 |
+
} else {
|
152 |
+
setTimeout(function () {
|
153 |
+
if (result.result == 'success') {
|
154 |
+
$label.addClass('import-success');
|
155 |
+
} else {
|
156 |
+
$label.addClass('import-fail');
|
157 |
+
}
|
158 |
+
|
159 |
+
$label.html('');
|
160 |
+
$label.attr('data-default', result.message);
|
161 |
+
}, 2000 - totalTime);
|
162 |
+
}
|
163 |
+
}
|
164 |
+
});
|
165 |
+
});
|
166 |
+
|
167 |
+
function toggle_settings(classname) {
|
168 |
+
jQuery('.' + classname).change(function () {
|
169 |
+
var value = jQuery('.' + classname + ':checked').val();
|
170 |
+
value = jQuery.isNumeric(value) ? 'x' + value : value;
|
171 |
+
value = value === undefined ? 'x' + 0 : value;
|
172 |
+
|
173 |
+
jQuery('.' + classname + '-switch.' + value).css('display', 'block');
|
174 |
+
jQuery('.' + classname + '-switch:not(.' + value + ')').css('display', 'none');
|
175 |
+
});
|
176 |
+
|
177 |
+
jQuery('.' + classname)
|
178 |
+
.first()
|
179 |
+
.trigger('change');
|
180 |
+
}
|
181 |
+
|
182 |
+
jQuery('.cmp-whitelist-select, .cmp-blacklist, .cmp-user_roles').select2({
|
183 |
+
width: 'calc(100% - 1em)',
|
184 |
+
placeholder: 'Click to select..',
|
185 |
+
});
|
186 |
+
|
187 |
+
jQuery('select[name="niteoCS_topbar_version"]').select2({
|
188 |
+
width: 'calc(100% - 1em)',
|
189 |
+
minimumResultsForSearch: -1,
|
190 |
+
});
|
191 |
+
|
192 |
+
function copyTextToClipboard(text) {
|
193 |
+
var textArea = document.createElement('textarea');
|
194 |
+
textArea.style.position = 'fixed';
|
195 |
+
textArea.style.top = 0;
|
196 |
+
textArea.style.left = 0;
|
197 |
+
textArea.style.width = '2em';
|
198 |
+
textArea.style.height = '2em';
|
199 |
+
textArea.style.padding = 0;
|
200 |
+
textArea.style.border = 'none';
|
201 |
+
textArea.style.outline = 'none';
|
202 |
+
textArea.style.boxShadow = 'none';
|
203 |
+
textArea.style.background = 'transparent';
|
204 |
+
textArea.value = text;
|
205 |
+
|
206 |
+
document.body.appendChild(textArea);
|
207 |
+
textArea.focus();
|
208 |
+
textArea.select();
|
209 |
+
|
210 |
+
try {
|
211 |
+
var successful = document.execCommand('copy');
|
212 |
+
var msg = successful ? 'successful' : 'unsuccessful';
|
213 |
+
console.log('Copying text command was ' + msg);
|
214 |
+
} catch (err) {
|
215 |
+
console.log('Oops, unable to copy');
|
216 |
+
}
|
217 |
+
|
218 |
+
document.body.removeChild(textArea);
|
219 |
+
}
|
220 |
+
|
221 |
+
jQuery('#copy-bypass').click(function (e) {
|
222 |
+
e.preventDefault();
|
223 |
+
copyTextToClipboard(jQuery('#bypass-code').html());
|
224 |
+
});
|
225 |
+
|
226 |
+
function cmp_repeat_fields(field_id) {
|
227 |
+
jQuery('#add-' + field_id).click(function (e) {
|
228 |
+
e.preventDefault();
|
229 |
+
var $wrapper = jQuery('#wrapper-' + field_id);
|
230 |
+
var $target = jQuery('#wrapper-' + field_id + ' .target-repeater-fields');
|
231 |
+
var $fields = $wrapper.find('.source-repeater-fields').children().clone();
|
232 |
+
$($fields[0]).val('');
|
233 |
+
$($target).append($fields);
|
234 |
+
});
|
235 |
+
|
236 |
+
cmp_delete_field(field_id);
|
237 |
+
}
|
238 |
+
|
239 |
+
function cmp_delete_field(field_id) {
|
240 |
+
jQuery('#wrapper-' + field_id + ' .target-repeater-fields').on('click', '.delete-' + field_id, function (e) {
|
241 |
+
e.preventDefault();
|
242 |
+
$(this).prev().remove();
|
243 |
+
$(this).remove();
|
244 |
+
});
|
245 |
+
|
246 |
+
jQuery('#wrapper-' + field_id + ' .source-repeater-fields').on('click', '.delete-' + field_id, function (e) {
|
247 |
+
e.preventDefault();
|
248 |
+
$(this).prev().val('');
|
249 |
+
});
|
250 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
});
|
js/settings.js
CHANGED
@@ -1,1413 +1,993 @@
|
|
1 |
jQuery(document).ready(function ($) {
|
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 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
);
|
994 |
-
|
995 |
-
// display theme details overlay
|
996 |
-
jQuery(".cmp-coming-soon-maintenance .theme-details").click(function (e) {
|
997 |
-
e.preventDefault();
|
998 |
-
var $this = jQuery(this),
|
999 |
-
$wrapper = $this.closest(".theme-wrapper"),
|
1000 |
-
slug = $wrapper.data("slug"),
|
1001 |
-
version = $wrapper.data("version"),
|
1002 |
-
type = $wrapper.data("type"),
|
1003 |
-
purchased = $wrapper.data("purchased"),
|
1004 |
-
i = 0;
|
1005 |
-
|
1006 |
-
var data = {
|
1007 |
-
action: "niteo_themeinfo",
|
1008 |
-
security: jQuery(".theme-wrapper").data("security"),
|
1009 |
-
theme_slug: jQuery(this)
|
1010 |
-
.parents(".theme-wrapper")
|
1011 |
-
.data("slug")
|
1012 |
-
};
|
1013 |
-
|
1014 |
-
jQuery.post(ajaxurl, data, function (response) {
|
1015 |
-
var buyButton = "";
|
1016 |
-
var versionInfo = "";
|
1017 |
-
var noticeHtml = "";
|
1018 |
-
// parse JSON data to array
|
1019 |
-
response = jQuery.parseJSON(response);
|
1020 |
-
|
1021 |
-
if (response.result == "true") {
|
1022 |
-
// overflow body hidden
|
1023 |
-
jQuery("body").addClass("modal-open");
|
1024 |
-
|
1025 |
-
// if installed display version info
|
1026 |
-
if (purchased == "1") {
|
1027 |
-
versionInfo = '<span class="theme-version">Installed version: ' + version + "</span>";
|
1028 |
-
}
|
1029 |
-
|
1030 |
-
// if premium and not installed, display buy button
|
1031 |
-
if (purchased != "1" && type == "premium") {
|
1032 |
-
var buyURL = $wrapper.find('.cmp-purchase-theme').attr("href");
|
1033 |
-
var buyButton =
|
1034 |
-
'<button type="button" class="theme-purchase button hide"><a href="' +
|
1035 |
-
buyURL +
|
1036 |
-
'" target="_blank"><i class="fas fa-cart-arrow-down" aria-hidden="true"></i>Get Theme</a></button>';
|
1037 |
-
}
|
1038 |
-
|
1039 |
-
// get screenshots
|
1040 |
-
var screenshots = response.screenshots;
|
1041 |
-
var arrows = "";
|
1042 |
-
// if we have more screenshots, generate navigation arrows
|
1043 |
-
if (Object.keys(screenshots).length > 1) {
|
1044 |
-
arrows =
|
1045 |
-
'<div class="screenshots-nav"><div class="left"><i class="fas fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fas fa-chevron-right" aria-hidden="true"></i></div></div>';
|
1046 |
-
}
|
1047 |
-
|
1048 |
-
// generate html to append to theme-overlay
|
1049 |
-
var html = jQuery(
|
1050 |
-
[
|
1051 |
-
'<div class="theme-backdrop">',
|
1052 |
-
' <div class="theme-wrap">',
|
1053 |
-
' <div class="theme-header">',
|
1054 |
-
' <button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',
|
1055 |
-
" </div>",
|
1056 |
-
' <div class="theme-about">',
|
1057 |
-
' <div class="theme-screenshots">',
|
1058 |
-
' <div class="screenshot" style="background-image:url(\'' +
|
1059 |
-
screenshots["0"] +
|
1060 |
-
"')\">" +
|
1061 |
-
arrows +
|
1062 |
-
"</div>",
|
1063 |
-
" </div>",
|
1064 |
-
' <div class="theme-info">',
|
1065 |
-
' <h2 class="theme-name">' +
|
1066 |
-
response["name"] +
|
1067 |
-
versionInfo +
|
1068 |
-
"</h2>",
|
1069 |
-
' <p class="theme-author">By <a href="' +
|
1070 |
-
response["author_homepage"] +
|
1071 |
-
'" target="_blank">' +
|
1072 |
-
response["author"] +
|
1073 |
-
"</a></p>",
|
1074 |
-
noticeHtml,
|
1075 |
-
buyButton,
|
1076 |
-
' <div class="theme-description">' +
|
1077 |
-
response["description"] +
|
1078 |
-
"</div>",
|
1079 |
-
" </div>",
|
1080 |
-
" </div>",
|
1081 |
-
' <div class="theme-actions">',
|
1082 |
-
' <a href="https://niteothemes.com/cmp-coming-soon-maintenance/?theme=' +
|
1083 |
-
slug +
|
1084 |
-
"&utm_source=cmp&utm_medium=referral&utm_campaign=" +
|
1085 |
-
slug +
|
1086 |
-
'" class="button cmp-preview" target="_blank" aria-label="Preview ' +
|
1087 |
-
response["name"] +
|
1088 |
-
'">Live Preview</a>',
|
1089 |
-
" </div>",
|
1090 |
-
" </div>",
|
1091 |
-
"</div>"
|
1092 |
-
].join("\n")
|
1093 |
-
);
|
1094 |
-
|
1095 |
-
// append html to overlay
|
1096 |
-
jQuery(".theme-overlay.cmp").append(html);
|
1097 |
-
|
1098 |
-
// attach close button handler
|
1099 |
-
jQuery(".theme-overlay.cmp .close").click(function (e) {
|
1100 |
-
e.preventDefault();
|
1101 |
-
// overflow body hidden
|
1102 |
-
jQuery("body").removeClass("modal-open");
|
1103 |
-
jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast");
|
1104 |
-
});
|
1105 |
-
|
1106 |
-
// attach arrows navigation handler
|
1107 |
-
jQuery(".screenshots-nav .right").click(function () {
|
1108 |
-
i++;
|
1109 |
-
|
1110 |
-
if (i == Object.keys(screenshots).length) {
|
1111 |
-
i = 0;
|
1112 |
-
}
|
1113 |
-
|
1114 |
-
if (i in screenshots) {
|
1115 |
-
jQuery(".screenshot").css(
|
1116 |
-
"background-image",
|
1117 |
-
"url('" + screenshots[i] + "')"
|
1118 |
-
);
|
1119 |
-
}
|
1120 |
-
});
|
1121 |
-
|
1122 |
-
// attach arrows navigation handler
|
1123 |
-
jQuery(".screenshots-nav .left").click(function () {
|
1124 |
-
i--;
|
1125 |
-
|
1126 |
-
if (i < 0) {
|
1127 |
-
i = Object.keys(screenshots).length - 1;
|
1128 |
-
}
|
1129 |
-
|
1130 |
-
if (i in screenshots) {
|
1131 |
-
jQuery(".screenshot").css(
|
1132 |
-
"background-image",
|
1133 |
-
"url('" + screenshots[i] + "')"
|
1134 |
-
);
|
1135 |
-
}
|
1136 |
-
});
|
1137 |
-
}
|
1138 |
-
});
|
1139 |
-
});
|
1140 |
-
|
1141 |
-
function media_upload_button(name, multiple, type, element) {
|
1142 |
-
// define var
|
1143 |
-
var $container = jQuery("." + name + "-wrapper");
|
1144 |
-
var $add_button = jQuery("#add-" + name);
|
1145 |
-
var $delete_button = jQuery("#delete-" + name);
|
1146 |
-
var image;
|
1147 |
-
var imgID = "";
|
1148 |
-
var title = name.replace("-", " ");
|
1149 |
-
title = title[0].toUpperCase() + title.slice(1);
|
1150 |
-
|
1151 |
-
if (jQuery("#niteoCS-" + name + "-id").val() != "") {
|
1152 |
-
// Display Delete button
|
1153 |
-
$delete_button.css("display", "block");
|
1154 |
-
}
|
1155 |
-
|
1156 |
-
$add_button.click(function (e) {
|
1157 |
-
e.preventDefault();
|
1158 |
-
// If the media frame already exists, reopen it.
|
1159 |
-
if (media_uploader) {
|
1160 |
-
media_uploader.open();
|
1161 |
-
return;
|
1162 |
-
}
|
1163 |
-
|
1164 |
-
var media_uploader = wp
|
1165 |
-
.media({
|
1166 |
-
title: "Select " + title,
|
1167 |
-
button: {
|
1168 |
-
text: "Insert " + title
|
1169 |
-
},
|
1170 |
-
multiple: multiple, // Set this to true to allow multiple files to be selected
|
1171 |
-
library: {
|
1172 |
-
type: [type]
|
1173 |
-
}
|
1174 |
-
})
|
1175 |
-
.on("select", function () {
|
1176 |
-
// Get media attachment details from the frame state
|
1177 |
-
var attachment = media_uploader
|
1178 |
-
.state()
|
1179 |
-
.get("selection")
|
1180 |
-
.toJSON();
|
1181 |
-
|
1182 |
-
if (attachment.length > 0) {
|
1183 |
-
$container.find("img").remove();
|
1184 |
-
|
1185 |
-
// remove and add gallery count class
|
1186 |
-
$container.attr("class", name + "-wrapper custom-gallery");
|
1187 |
-
$container.addClass("gallery-" + attachment.length);
|
1188 |
-
|
1189 |
-
// get images ID, append thumbnail and store IDs in hidden input
|
1190 |
-
jQuery(attachment).each(function (i) {
|
1191 |
-
if (attachment[i].sizes && attachment[i].sizes.large) {
|
1192 |
-
image = attachment[i].sizes.large.url;
|
1193 |
-
} else {
|
1194 |
-
image = attachment[i].url;
|
1195 |
-
}
|
1196 |
-
|
1197 |
-
// add image ID and url to comma-separated variable
|
1198 |
-
var comma = i === 0 ? "" : ",";
|
1199 |
-
imgID += comma + attachment[i].id;
|
1200 |
-
|
1201 |
-
// Send the attachment URL to our custom image input field.
|
1202 |
-
switch (element) {
|
1203 |
-
case "video":
|
1204 |
-
$container.append(
|
1205 |
-
'<video width="600" height="400" controls><source src="' +
|
1206 |
-
image +
|
1207 |
-
'" type="video/mp4">Your browser does not support the video tag.</video>'
|
1208 |
-
);
|
1209 |
-
break;
|
1210 |
-
|
1211 |
-
case "background":
|
1212 |
-
$container.css("background-image", "url('" + image + "')");
|
1213 |
-
break;
|
1214 |
-
|
1215 |
-
case "img":
|
1216 |
-
default:
|
1217 |
-
// if gallery - more than one image, it must be a graphic background, attach the first image to big coontainer
|
1218 |
-
if (attachment.length > 1 && i == 0 && jQuery("." + name + "-wrapper .big-thumb").length) {
|
1219 |
-
jQuery("." + name + "-wrapper .big-thumb").append(
|
1220 |
-
'<img src="' + image + '" alt=""/>'
|
1221 |
-
);
|
1222 |
-
|
1223 |
-
// if gallery - more than one image, it must be a graphic background, attach all others images to normal wrapper
|
1224 |
-
} else if (attachment.length > 1 && i !== 0) {
|
1225 |
-
$container.append(
|
1226 |
-
'<img src="' + image + '" alt="" class="no-blur"/>'
|
1227 |
-
);
|
1228 |
-
|
1229 |
-
// if single image, and it is a background image, attach it to big container as well
|
1230 |
-
} else if ($container.find(".big-thumb").length) {
|
1231 |
-
jQuery("." + name + "-wrapper .big-thumb").append(
|
1232 |
-
'<img src="' + image + '" alt=""/>'
|
1233 |
-
);
|
1234 |
-
|
1235 |
-
// all others images
|
1236 |
-
} else {
|
1237 |
-
$container.append('<img src="' + image + '" alt=""/>');
|
1238 |
-
}
|
1239 |
-
|
1240 |
-
jQuery(".blur-range").trigger("input");
|
1241 |
-
break;
|
1242 |
-
}
|
1243 |
-
});
|
1244 |
-
|
1245 |
-
// Display Delete button
|
1246 |
-
$delete_button.css("display", "block");
|
1247 |
-
}
|
1248 |
-
// update hidden input with media id and trigger change
|
1249 |
-
jQuery("#niteoCS-" + name + "-id")
|
1250 |
-
.val(imgID)
|
1251 |
-
.trigger("change");
|
1252 |
-
})
|
1253 |
-
.open();
|
1254 |
-
});
|
1255 |
-
|
1256 |
-
$delete_button.click(function (e) {
|
1257 |
-
jQuery(this).css("display", "none");
|
1258 |
-
$container.find("img").remove();
|
1259 |
-
jQuery("#niteoCS-" + name + "-id").val("");
|
1260 |
-
jQuery("#niteoCS-" + name + "-id").trigger("change");
|
1261 |
-
});
|
1262 |
-
}
|
1263 |
-
|
1264 |
-
// Retrieve Mailchimp lists
|
1265 |
-
jQuery(".cmp-coming-soon-maintenance #connect-mailchimp").click(function (e) {
|
1266 |
-
e.preventDefault();
|
1267 |
-
|
1268 |
-
var apikey = jQuery(
|
1269 |
-
'.cmp-coming-soon-maintenance input[name="niteoCS_mailchimp_apikey"]'
|
1270 |
-
).val(),
|
1271 |
-
security = jQuery(this).data("security"),
|
1272 |
-
button = jQuery(this);
|
1273 |
-
|
1274 |
-
if (apikey != "") {
|
1275 |
-
var params = { apikey: apikey, security: security };
|
1276 |
-
|
1277 |
-
jQuery(this).prop("disabled", true);
|
1278 |
-
|
1279 |
-
jQuery(this).html(
|
1280 |
-
'<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span> retrieving lists..</span>'
|
1281 |
-
);
|
1282 |
-
|
1283 |
-
var data = {
|
1284 |
-
action: "cmp_mailchimp_list_ajax",
|
1285 |
-
security: security,
|
1286 |
-
params: params
|
1287 |
-
};
|
1288 |
-
|
1289 |
-
jQuery.post(ajaxurl, data, function (response) {
|
1290 |
-
var lists = JSON.parse(response);
|
1291 |
-
|
1292 |
-
if (lists.response == 200) {
|
1293 |
-
jQuery("#niteoCS_mailchimp_list")
|
1294 |
-
.empty()
|
1295 |
-
.prop("disabled", false);
|
1296 |
-
jQuery.each(lists.lists, function (i, val) {
|
1297 |
-
jQuery("#niteoCS_mailchimp_list").append(
|
1298 |
-
'<option value="' + val.id + '">' + val.name + "</option>"
|
1299 |
-
);
|
1300 |
-
});
|
1301 |
-
} else {
|
1302 |
-
jQuery("#niteoCS_mailchimp_list")
|
1303 |
-
.empty()
|
1304 |
-
.prop("disabled", true)
|
1305 |
-
.html('<option value="error">' + lists.message + "</option>")
|
1306 |
-
.trigger("change");
|
1307 |
-
}
|
1308 |
-
|
1309 |
-
button.html("Retrieve Lists");
|
1310 |
-
button.prop("disabled", false);
|
1311 |
-
}).fail(function () {
|
1312 |
-
button.html("Retrieve Lists");
|
1313 |
-
button.prop("disabled", false);
|
1314 |
-
});
|
1315 |
-
}
|
1316 |
-
});
|
1317 |
-
|
1318 |
-
function toggle_settings(classname) {
|
1319 |
-
// Logo type inputs
|
1320 |
-
jQuery(".cmp-coming-soon-maintenance ." + classname).change(function () {
|
1321 |
-
var value = jQuery(
|
1322 |
-
".cmp-coming-soon-maintenance ." + classname + ":checked"
|
1323 |
-
).val();
|
1324 |
-
value = jQuery.isNumeric(value) ? "x" + value : value;
|
1325 |
-
value = value === undefined ? "off" : value;
|
1326 |
-
|
1327 |
-
jQuery(
|
1328 |
-
".cmp-coming-soon-maintenance ." + classname + "-switch." + value
|
1329 |
-
).css("display", "block");
|
1330 |
-
jQuery(
|
1331 |
-
".cmp-coming-soon-maintenance ." +
|
1332 |
-
classname +
|
1333 |
-
"-switch:not(." +
|
1334 |
-
value +
|
1335 |
-
")"
|
1336 |
-
).css("display", "none");
|
1337 |
-
});
|
1338 |
-
|
1339 |
-
jQuery(".cmp-coming-soon-maintenance ." + classname)
|
1340 |
-
.first()
|
1341 |
-
.trigger("change");
|
1342 |
-
}
|
1343 |
-
|
1344 |
-
function toggle_select(classname) {
|
1345 |
-
jQuery(".cmp-coming-soon-maintenance ." + classname).change(function () {
|
1346 |
-
var value = jQuery("." + classname).val();
|
1347 |
-
value = jQuery.isNumeric(value) ? "x" + value : value;
|
1348 |
-
|
1349 |
-
jQuery(".cmp-coming-soon-maintenance ." + classname + "." + value).css(
|
1350 |
-
"display",
|
1351 |
-
"block"
|
1352 |
-
);
|
1353 |
-
jQuery(
|
1354 |
-
".cmp-coming-soon-maintenance ." + classname + ":not(." + value + ")"
|
1355 |
-
).css("display", "none");
|
1356 |
-
});
|
1357 |
-
|
1358 |
-
jQuery("." + classname)
|
1359 |
-
.first()
|
1360 |
-
.trigger("change");
|
1361 |
-
}
|
1362 |
-
|
1363 |
-
function update_range(selector, target, method) {
|
1364 |
-
jQuery(selector).on("input", function () {
|
1365 |
-
var value = jQuery(this).val();
|
1366 |
-
// change label value
|
1367 |
-
if (method === "html") {
|
1368 |
-
jQuery(this)
|
1369 |
-
.parent()
|
1370 |
-
.find(target)
|
1371 |
-
.html(value);
|
1372 |
-
}
|
1373 |
-
|
1374 |
-
if (method === "val") {
|
1375 |
-
jQuery(this)
|
1376 |
-
.parent()
|
1377 |
-
.find(target)
|
1378 |
-
.val(value);
|
1379 |
-
}
|
1380 |
-
});
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
// delete overlay color from premium themes after update 2.8
|
1384 |
-
jQuery(".cmp-coming-soon-maintenance .table-wrapper.theme-setup h4").each(
|
1385 |
-
function () {
|
1386 |
-
if (jQuery(this).html() == "Overlay Color") {
|
1387 |
-
jQuery(this)
|
1388 |
-
.parents("tr")
|
1389 |
-
.remove();
|
1390 |
-
return false;
|
1391 |
-
}
|
1392 |
-
}
|
1393 |
-
);
|
1394 |
-
|
1395 |
-
// warn users about unsaved changes for preview
|
1396 |
-
jQuery(".nav-tab-wrapper").on("click", ".theme-preview", function (e) {
|
1397 |
-
if (
|
1398 |
-
jQuery("#csoptions fieldset:not(.skip-preview-validation *)").serialize() !=
|
1399 |
-
settings
|
1400 |
-
) {
|
1401 |
-
if (
|
1402 |
-
!confirm(
|
1403 |
-
"You have made changes that will not be visible in the preview until you save them. Please save changes first.\nContinue anyway?"
|
1404 |
-
)
|
1405 |
-
) {
|
1406 |
-
e.preventDefault();
|
1407 |
-
return false;
|
1408 |
-
}
|
1409 |
-
}
|
1410 |
-
|
1411 |
-
return true;
|
1412 |
-
});
|
1413 |
});
|
1 |
jQuery(document).ready(function ($) {
|
2 |
+
var tab = document.location.hash.substring(1);
|
3 |
+
var action = jQuery('#csoptions').attr('action');
|
4 |
+
var settings = jQuery('#csoptions fieldset:not(.skip-preview-validation *)').serialize();
|
5 |
+
|
6 |
+
// ini custom css textarea to codeEditor
|
7 |
+
if (wp.codeEditor && jQuery('#niteoCS_custom_css').length) {
|
8 |
+
wp.codeEditor.initialize('niteoCS_custom_css');
|
9 |
+
}
|
10 |
+
|
11 |
+
// function to tab navigation
|
12 |
+
navtab = function (tab) {
|
13 |
+
jQuery('.cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
|
14 |
+
jQuery('.nav-tab-wrapper .' + tab).addClass('nav-tab-active');
|
15 |
+
|
16 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper.' + tab).css('display', 'block');
|
17 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper-css.' + tab).css('display', 'block');
|
18 |
+
jQuery('.cmp-coming-soon-maintenance .comingsoon.' + tab).css('display', 'block');
|
19 |
+
|
20 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper:not(.' + tab + ')').css('display', 'none');
|
21 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper-css:not(.' + tab).css('display', 'none');
|
22 |
+
jQuery('.cmp-coming-soon-maintenance .comingsoon:not(.' + tab + ')').css('display', 'none');
|
23 |
+
|
24 |
+
if (tab == 'install') {
|
25 |
+
jQuery('.cmp-coming-soon-maintenance .submit').css('display', 'none');
|
26 |
+
jQuery('.cmp-coming-soon-maintenance #csoptions').attr('action', action);
|
27 |
+
} else {
|
28 |
+
jQuery('.cmp-coming-soon-maintenance .submit').css('display', 'block');
|
29 |
+
// change form action to display current tab after save
|
30 |
+
jQuery('.cmp-coming-soon-maintenance #csoptions').attr('action', action + '#' + tab);
|
31 |
+
}
|
32 |
+
};
|
33 |
+
|
34 |
+
if (tab != '') {
|
35 |
+
navtab(tab);
|
36 |
+
} else {
|
37 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper-css').css('display', 'none');
|
38 |
+
}
|
39 |
+
|
40 |
+
window.onhashchange = function () {
|
41 |
+
tab = document.location.hash.substring(1);
|
42 |
+
navtab(tab);
|
43 |
+
};
|
44 |
+
|
45 |
+
jQuery('.cmp-coming-soon-maintenance .nav-tab:not(.theme-preview):not(.advanced)').click(function (e) {
|
46 |
+
e.preventDefault();
|
47 |
+
tab = jQuery(this).data('tab');
|
48 |
+
document.location.hash = tab;
|
49 |
+
});
|
50 |
+
|
51 |
+
// update range inputs on change
|
52 |
+
update_range('.cmp-coming-soon-maintenance .blur-range', 'span', 'html');
|
53 |
+
update_range('.cmp-coming-soon-maintenance .background-overlay-opacity', 'span', 'html');
|
54 |
+
update_range('#logo_size_slider', '#niteoCS_logo_size', 'val');
|
55 |
+
update_range('#niteoCS_logo_size', '#logo_size_slider', 'val');
|
56 |
+
|
57 |
+
// create media upload buttons
|
58 |
+
// selector, multipe, type, element to render
|
59 |
+
media_upload_button('logo', false, 'image', 'img');
|
60 |
+
media_upload_button('favicon', false, 'image', 'img');
|
61 |
+
media_upload_button('seo_img', false, 'image', 'img');
|
62 |
+
media_upload_button('images', true, 'image', 'img');
|
63 |
+
media_upload_button('mobile-images', true, 'image', 'img');
|
64 |
+
media_upload_button('pattern', false, 'image', 'background');
|
65 |
+
media_upload_button('video-thumb', false, 'image', 'img');
|
66 |
+
media_upload_button('video-local', false, 'video', 'video');
|
67 |
+
media_upload_button('subs-img', false, 'image', 'img');
|
68 |
+
media_upload_button('avatar', false, 'image', 'img');
|
69 |
+
media_upload_button('gallery', true, 'image', 'img');
|
70 |
+
|
71 |
+
// show / hide settings
|
72 |
+
toggle_settings('analytics');
|
73 |
+
toggle_settings('contact-form');
|
74 |
+
toggle_settings('subscribe');
|
75 |
+
toggle_settings('background-effect');
|
76 |
+
toggle_settings('special-effect');
|
77 |
+
toggle_settings('cmp-logo');
|
78 |
+
toggle_settings('background-type');
|
79 |
+
toggle_settings('counter');
|
80 |
+
toggle_settings('progress-bar');
|
81 |
+
toggle_settings('overlay-text');
|
82 |
+
toggle_settings('cmp-logo-size');
|
83 |
+
toggle_settings('recaptcha-toggle');
|
84 |
+
toggle_settings('login-icon');
|
85 |
+
toggle_settings('custom-mobile-imgs');
|
86 |
+
toggle_settings('lang-switcher');
|
87 |
+
|
88 |
+
toggle_select('counter-action');
|
89 |
+
toggle_select('subscribe-method');
|
90 |
+
toggle_select('background-overlay');
|
91 |
+
toggle_select('banner-video-source');
|
92 |
+
toggle_select('progress-bar-type');
|
93 |
+
|
94 |
+
// change all selects to select2
|
95 |
+
jQuery('.cmp-coming-soon-maintenance select:not(.headings-google-font):not(.content-google-font )').select2({
|
96 |
+
width: '100%',
|
97 |
+
minimumResultsForSearch: -1,
|
98 |
+
placeholder: 'Click to select..',
|
99 |
+
});
|
100 |
+
|
101 |
+
jQuery('.cmp-coming-soon-maintenance #cmp-status').click(function () {
|
102 |
+
jQuery('.cmp-coming-soon-maintenance .cmp-status input[type=radio]').prop('disabled', function (_, val) {
|
103 |
+
return !val;
|
104 |
+
});
|
105 |
+
jQuery('#cmp-toggle-adminbar').toggleClass('status-1');
|
106 |
+
jQuery('.cmp-status-pages').fadeToggle();
|
107 |
+
});
|
108 |
+
|
109 |
+
jQuery('.cmp-status-pages input[type=radio]').change(function () {
|
110 |
+
jQuery('.cmp-status-pages input[type=radio]').parent().removeClass('active');
|
111 |
+
jQuery(this).parent().addClass('active');
|
112 |
+
});
|
113 |
+
|
114 |
+
cmp_status_inputs();
|
115 |
+
|
116 |
+
function cmp_status_inputs() {
|
117 |
+
// Make clickable status radio buttons
|
118 |
+
jQuery('.cmp-coming-soon-maintenance .cmp-status.switch:not(.disabled)').click(function () {
|
119 |
+
if (jQuery('.cmp-coming-soon-maintenance #cmp-status').prop('checked') == false) {
|
120 |
+
return;
|
121 |
+
}
|
122 |
+
var $children = jQuery(this).children('input');
|
123 |
+
$children.prop('checked', true);
|
124 |
+
jQuery('.cmp-coming-soon-maintenance .cmp-status.switch').removeClass('active');
|
125 |
+
jQuery(this).addClass('active');
|
126 |
+
|
127 |
+
$children.trigger('change');
|
128 |
+
|
129 |
+
if ($children.val() == '3') {
|
130 |
+
jQuery('.cmp-coming-soon-maintenance .redirect-inputs').fadeIn('fast');
|
131 |
+
} else {
|
132 |
+
jQuery('.cmp-coming-soon-maintenance .redirect-inputs').fadeOut('fast');
|
133 |
+
}
|
134 |
+
});
|
135 |
+
}
|
136 |
+
|
137 |
+
// expandable tabs
|
138 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper h3').click(function () {
|
139 |
+
jQuery(this).parent().toggleClass('closed');
|
140 |
+
});
|
141 |
+
|
142 |
+
// test unsplash image
|
143 |
+
jQuery('.cmp-coming-soon-maintenance #test-unsplash').click(function (e) {
|
144 |
+
e.preventDefault();
|
145 |
+
|
146 |
+
var media_wrapper = jQuery('.cmp-coming-soon-maintenance #unsplash-media'),
|
147 |
+
unsplash_feed = jQuery('.cmp-coming-soon-maintenance .unsplash_banner select[name^="unsplash_feed"] option:selected').val(),
|
148 |
+
unsp_url = '',
|
149 |
+
feat = '',
|
150 |
+
custom_str = '',
|
151 |
+
security = jQuery(this).data('security');
|
152 |
+
|
153 |
+
// return if not specific unsplash photo selected - throttling due too much requests
|
154 |
+
if (unsplash_feed != 0) return;
|
155 |
+
|
156 |
+
switch (unsplash_feed) {
|
157 |
+
// specific photo
|
158 |
+
case '0':
|
159 |
+
unsp_url = jQuery('.cmp-coming-soon-maintenance #niteoCS-unsplash-0').val();
|
160 |
+
break;
|
161 |
+
|
162 |
+
default:
|
163 |
+
break;
|
164 |
+
}
|
165 |
+
|
166 |
+
if (unsplash_feed == 3 || unsp_url != '' || custom_str != '') {
|
167 |
+
var params = {
|
168 |
+
feed: unsplash_feed,
|
169 |
+
url: unsp_url,
|
170 |
+
feat: feat,
|
171 |
+
custom_str: custom_str,
|
172 |
+
};
|
173 |
+
|
174 |
+
jQuery(this).prop('disabled', true);
|
175 |
+
jQuery(this).html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>');
|
176 |
+
// media_wrapper.html('');
|
177 |
+
|
178 |
+
var data = {
|
179 |
+
action: 'niteo_unsplash',
|
180 |
+
security: security,
|
181 |
+
params: params,
|
182 |
+
};
|
183 |
+
|
184 |
+
jQuery.post(ajaxurl, data, function (response) {
|
185 |
+
var unsplash = JSON.parse(response);
|
186 |
+
|
187 |
+
jQuery('#unsplash_img').remove();
|
188 |
+
|
189 |
+
var loadingTimeout = setTimeout(function () {
|
190 |
+
jQuery('#test-unsplash').prop('disabled', false);
|
191 |
+
jQuery('#test-unsplash').text('Display Unsplash Photo');
|
192 |
+
jQuery('#unsplash-media').html('<p>It seems <a href="https://status.unsplash.com/" target="_blank">Unsplash API</a> is not responding. Please try again later.</p>');
|
193 |
+
}, 5000);
|
194 |
+
|
195 |
+
if (unsplash.response == '200') {
|
196 |
+
var unsplash = jQuery.parseJSON(unsplash.body);
|
197 |
+
|
198 |
+
if (unsplash[0]) {
|
199 |
+
var img = unsplash[0]['urls']['raw'] + '?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588';
|
200 |
+
var author = unsplash[0]['user']['name'];
|
201 |
+
var author_url = unsplash[0]['user']['links']['html'];
|
202 |
+
var img_url = unsplash[0]['links']['html'];
|
203 |
+
var img_id = unsplash[0]['id'];
|
204 |
+
} else {
|
205 |
+
var img = unsplash['urls']['raw'] + '?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588';
|
206 |
+
var author = unsplash['user']['name'];
|
207 |
+
var author_url = unsplash['user']['links']['html'];
|
208 |
+
var img_url = unsplash['links']['html'];
|
209 |
+
var img_id = unsplash['id'];
|
210 |
+
}
|
211 |
+
|
212 |
+
jQuery('<img />', { src: img, id: 'unsplash_img' }).one('load', function () {
|
213 |
+
//Set something to run when it finishes loading
|
214 |
+
jQuery(this).appendTo(media_wrapper);
|
215 |
+
jQuery(this).fadeIn();
|
216 |
+
jQuery('#test-unsplash').prop('disabled', false);
|
217 |
+
jQuery('#test-unsplash').text('Display Unsplash Photo');
|
218 |
+
jQuery('.unsplash-id').html('<a href="' + img_url + '" target="_blank">Photo</a> (ID: ' + img_id + ') by <a href="' + author_url + '" target="_blank">' + author + '</a> / <a href="https://unsplash.com/" target="_blank">Unsplash</a>');
|
219 |
+
jQuery('.blur-range').trigger('input');
|
220 |
+
clearTimeout(loadingTimeout);
|
221 |
+
});
|
222 |
+
} else {
|
223 |
+
jQuery('.cmp-coming-soon-maintenance #test-unsplash').prop('disabled', false);
|
224 |
+
jQuery('.cmp-coming-soon-maintenance #test-unsplash').text('Display Unsplash Photo');
|
225 |
+
jQuery('.cmp-coming-soon-maintenance #unsplash-media').html('<p>Error ' + unsplash.response + ': <span style="text-transform:lowercase;">' + JSON.parse(unsplash.body).errors + '</span></p>');
|
226 |
+
clearTimeout(loadingTimeout);
|
227 |
+
}
|
228 |
+
});
|
229 |
+
} else {
|
230 |
+
jQuery('.cmp-coming-soon-maintenance #unsplash_img').remove();
|
231 |
+
}
|
232 |
+
});
|
233 |
+
|
234 |
+
videoPreview = function () {
|
235 |
+
// return of video background is not selected
|
236 |
+
if (jQuery('.cmp-coming-soon-maintenance .background-type:checked').val() != '5') {
|
237 |
+
return;
|
238 |
+
}
|
239 |
+
|
240 |
+
var source = jQuery('.cmp-coming-soon-maintenance .banner-video-source').val();
|
241 |
+
|
242 |
+
if (source == 'youtube') {
|
243 |
+
var youtubeURL = jQuery('.cmp-coming-soon-maintenance #niteoCS-youtube-url').val();
|
244 |
+
|
245 |
+
// get YT thumbnail and append it to wrapper
|
246 |
+
if (youtubeURL != '') {
|
247 |
+
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
|
248 |
+
var ytID = youtubeURL.match(regExp);
|
249 |
+
|
250 |
+
if (ytID && ytID[7].length == 11) {
|
251 |
+
jQuery('.cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper').html('');
|
252 |
+
var ytThumb = 'https://img.youtube.com/vi/' + ytID[7] + '/maxresdefault.jpg';
|
253 |
+
jQuery('.cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper').append('<img src="' + ytThumb + '" alt=""/>');
|
254 |
+
jQuery('.cmp-coming-soon-maintenance .blur-range').trigger('input');
|
255 |
+
} else {
|
256 |
+
jQuery('.cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper').html('');
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
// append local video
|
262 |
+
if (source == 'local') {
|
263 |
+
var videoURL = jQuery('#niteoCS-video-local-id').data('url');
|
264 |
+
|
265 |
+
if (videoURL != '') {
|
266 |
+
jQuery('.cmp-coming-soon-maintenance .video-local-wrapper').html('<video width="600" height="400" controls><source src="' + videoURL + '" type="video/mp4">Your browser does not support the video tag.</video>');
|
267 |
+
}
|
268 |
+
}
|
269 |
+
};
|
270 |
+
|
271 |
+
// display video on load
|
272 |
+
videoPreview();
|
273 |
+
|
274 |
+
// display videos on background change to video type
|
275 |
+
jQuery('.cmp-coming-soon-maintenance .background-type').on('change', function () {
|
276 |
+
videoPreview();
|
277 |
+
});
|
278 |
+
|
279 |
+
// display YT video while inserting YT URL
|
280 |
+
jQuery('.cmp-coming-soon-maintenance #niteoCS-youtube-url').on('keyup', function () {
|
281 |
+
videoPreview();
|
282 |
+
});
|
283 |
+
|
284 |
+
jQuery('.cmp-coming-soon-maintenance .banner-video-source').on('change', function () {
|
285 |
+
videoPreview();
|
286 |
+
});
|
287 |
+
|
288 |
+
// display selected unsplash feed
|
289 |
+
var unsplashfeed = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val();
|
290 |
+
jQuery('.unsplash-feed-' + unsplashfeed).css('display', 'block');
|
291 |
+
|
292 |
+
jQuery('.unsplash_banner select[name^="unsplash_feed"]').on('change', function () {
|
293 |
+
unsplashfeed = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val();
|
294 |
+
jQuery('.unsplash-feed').css('display', 'none');
|
295 |
+
jQuery('.unsplash-feed-' + unsplashfeed).css('display', 'block');
|
296 |
+
jQuery('#test-unsplash').trigger('click');
|
297 |
+
});
|
298 |
+
|
299 |
+
// load unsplash upon load if unsplash is selected
|
300 |
+
if (jQuery('#csoptions .niteoCS_banner:checked').val() == 1) {
|
301 |
+
jQuery('#test-unsplash').trigger('click');
|
302 |
+
}
|
303 |
+
|
304 |
+
// preview gradient on select change
|
305 |
+
jQuery('.cmp-coming-soon-maintenance select.background-gradient')
|
306 |
+
.on('change', function () {
|
307 |
+
var gradient = jQuery('.cmp-coming-soon-maintenance select.background-gradient option:selected').val();
|
308 |
+
|
309 |
+
if (gradient == 'custom') {
|
310 |
+
jQuery('.cmp-coming-soon-maintenance .custom-gradient').css('display', 'block');
|
311 |
+
jQuery('.cmp-coming-soon-maintenance .gradient-preview').css({
|
312 |
+
background: '-moz-linear-gradient(-45deg, ' + jQuery('#niteoCS_gradient_one').val() + ' 0%, ' + jQuery('#niteoCS_gradient_two').val() + ' 100%)',
|
313 |
+
background: '-webkit-linear-gradient(-45deg, ' + jQuery('#niteoCS_gradient_one').val() + ' 0%, ' + jQuery('#niteoCS_gradient_two').val() + ' 100%)',
|
314 |
+
background: 'linear-gradient(135deg, ' + jQuery('#niteoCS_gradient_one').val() + ' 0%, ' + jQuery('#niteoCS_gradient_two').val() + ' 100%)',
|
315 |
+
});
|
316 |
+
} else {
|
317 |
+
colors = gradient.split(':');
|
318 |
+
jQuery('.cmp-coming-soon-maintenance .custom-gradient').css('display', 'none');
|
319 |
+
jQuery('.cmp-coming-soon-maintenance .gradient-preview').css({
|
320 |
+
background: '-moz-linear-gradient(-45deg, ' + colors[0] + ' 0%, ' + colors[1] + ' 100%)',
|
321 |
+
background: '-webkit-linear-gradient(-45deg, ' + colors[0] + ' 0%, ' + colors[1] + ' 100%)',
|
322 |
+
background: 'linear-gradient(135deg, ' + colors[0] + ' 0%, ' + colors[1] + ' 100%)',
|
323 |
+
});
|
324 |
+
}
|
325 |
+
})
|
326 |
+
.trigger('change');
|
327 |
+
|
328 |
+
// banner background colorpicker
|
329 |
+
jQuery('.cmp-coming-soon-maintenance #niteoCS_banner_color').wpColorPicker({
|
330 |
+
change: function (event, ui) {
|
331 |
+
jQuery('.color-preview').css('background-color', ui.color.toString());
|
332 |
+
},
|
333 |
+
});
|
334 |
+
|
335 |
+
// banner gradient background colorpicker one
|
336 |
+
jQuery('.cmp-coming-soon-maintenance #niteoCS_gradient_one').wpColorPicker({
|
337 |
+
change: function (event, ui) {
|
338 |
+
jQuery('.gradient-preview').css({
|
339 |
+
background: '-moz-linear-gradient(-45deg, ' + ui.color.toString() + ' 0%, ' + jQuery('#niteoCS_gradient_two').val() + ' 100%)',
|
340 |
+
background: '-webkit-linear-gradient(-45deg, ' + ui.color.toString() + ' 0%, ' + jQuery('#niteoCS_gradient_two').val() + ' 100%)',
|
341 |
+
background: 'linear-gradient(135deg, ' + ui.color.toString() + ' 0%, ' + jQuery('#niteoCS_gradient_two').val() + ' 100%)',
|
342 |
+
});
|
343 |
+
},
|
344 |
+
});
|
345 |
+
|
346 |
+
// banner gradient background colorpicker two
|
347 |
+
jQuery('.cmp-coming-soon-maintenance #niteoCS_gradient_two').wpColorPicker({
|
348 |
+
change: function (event, ui) {
|
349 |
+
jQuery('.gradient-preview').css({
|
350 |
+
background: '-moz-linear-gradient(-45deg, ' + jQuery('#niteoCS_gradient_one').val() + ' 0%, ' + ui.color.toString() + ' 100%)',
|
351 |
+
background: '-webkit-linear-gradient(-45deg, ' + jQuery('#niteoCS_gradient_one').val() + ' 0%, ' + ui.color.toString() + ' 100%)',
|
352 |
+
background: 'linear-gradient(135deg, ' + jQuery('#niteoCS_gradient_one').val() + ' 0%, ' + ui.color.toString() + ' 100%)',
|
353 |
+
});
|
354 |
+
},
|
355 |
+
});
|
356 |
+
|
357 |
+
// OVERLAY COLOR
|
358 |
+
jQuery('.cmp-coming-soon-maintenance #niteoCS_overlay_color').wpColorPicker({
|
359 |
+
change: function (event, ui) {
|
360 |
+
jQuery('.thumbnail-overlay').css('background', ui.color.toString());
|
361 |
+
},
|
362 |
+
});
|
363 |
+
|
364 |
+
// get overlay color and apply it to Background thumbnails
|
365 |
+
jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css('background', jQuery('#niteoCS_overlay_color').val());
|
366 |
+
|
367 |
+
// OVERLAY GRADIENT
|
368 |
+
jQuery('.cmp-coming-soon-maintenance select.overlay-gradient').on('change', function () {
|
369 |
+
var overlay_gradient = jQuery('select.overlay-gradient option:selected').val();
|
370 |
+
|
371 |
+
if (overlay_gradient == 'custom') {
|
372 |
+
jQuery('.cmp-coming-soon-maintenance .custom-overlay-gradient').css('display', 'block');
|
373 |
+
|
374 |
+
var gradient_one = jQuery('#niteoCS_overlay_gradient_one').val();
|
375 |
+
var gradient_two = jQuery('#niteoCS_overlay_gradient_two').val();
|
376 |
+
|
377 |
+
jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css({
|
378 |
+
background: '-moz-linear-gradient(-45deg, ' + gradient_one + ' 0%, ' + gradient_two + ' 100%)',
|
379 |
+
background: '-webkit-linear-gradient(-45deg, ' + gradient_one + ' 0%, ' + gradient_two + ' 100%)',
|
380 |
+
background: 'linear-gradient(135deg, ' + gradient_one + ' 0%, ' + gradient_two + ' 100%)',
|
381 |
+
});
|
382 |
+
} else {
|
383 |
+
colors = overlay_gradient.split(':');
|
384 |
+
jQuery('.cmp-coming-soon-maintenance .custom-overlay-gradient').css('display', 'none');
|
385 |
+
jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css({
|
386 |
+
background: '-moz-linear-gradient(-45deg, ' + colors[0] + ' 0%, ' + colors[1] + ' 100%)',
|
387 |
+
background: '-webkit-linear-gradient(-45deg, ' + colors[0] + ' 0%, ' + colors[1] + ' 100%)',
|
388 |
+
background: 'linear-gradient(135deg, ' + colors[0] + ' 0%, ' + colors[1] + ' 100%)',
|
389 |
+
});
|
390 |
+
}
|
391 |
+
});
|
392 |
+
|
393 |
+
// Overlay gradient colorpicker one
|
394 |
+
jQuery('#niteoCS_overlay_gradient_one').wpColorPicker({
|
395 |
+
change: function (event, ui) {
|
396 |
+
jQuery('.thumbnail-overlay').css({
|
397 |
+
background: '-moz-linear-gradient(-45deg, ' + ui.color.toString() + ' 0%, ' + jQuery('#niteoCS_overlay_gradient_two').val() + ' 100%)',
|
398 |
+
background: '-webkit-linear-gradient(-45deg, ' + ui.color.toString() + ' 0%, ' + jQuery('#niteoCS_overlay_gradient_two').val() + ' 100%)',
|
399 |
+
background: 'linear-gradient(135deg, ' + ui.color.toString() + ' 0%, ' + jQuery('#niteoCS_overlay_gradient_two').val() + ' 100%)',
|
400 |
+
});
|
401 |
+
},
|
402 |
+
});
|
403 |
+
|
404 |
+
// Overlay gradient colorpicker two
|
405 |
+
jQuery('#niteoCS_overlay_gradient_two').wpColorPicker({
|
406 |
+
change: function (event, ui) {
|
407 |
+
jQuery('.thumbnail-overlay').css({
|
408 |
+
background: '-moz-linear-gradient(-45deg, ' + jQuery('#niteoCS_overlay_gradient_one').val() + ' 0%, ' + ui.color.toString() + ' 100%)',
|
409 |
+
background: '-webkit-linear-gradient(-45deg, ' + jQuery('#niteoCS_overlay_gradient_one').val() + ' 0%, ' + ui.color.toString() + ' 100%)',
|
410 |
+
background: 'linear-gradient(135deg, ' + jQuery('#niteoCS_overlay_gradient_one').val() + ' 0%, ' + ui.color.toString() + ' 100%)',
|
411 |
+
});
|
412 |
+
},
|
413 |
+
});
|
414 |
+
|
415 |
+
// OVERLAY OPACITY
|
416 |
+
jQuery('.background-overlay-opacity')
|
417 |
+
.on('input', function () {
|
418 |
+
var value = jQuery(this).val();
|
419 |
+
jQuery('.thumbnail-overlay').css('opacity', value);
|
420 |
+
})
|
421 |
+
.trigger('input');
|
422 |
+
|
423 |
+
// OVERLAY SELECTION
|
424 |
+
gradientIni(jQuery('.cmp-coming-soon-maintenance .background-overlay').val());
|
425 |
+
|
426 |
+
jQuery('.cmp-coming-soon-maintenance .background-overlay').on('change', function () {
|
427 |
+
gradientIni(jQuery(this).val());
|
428 |
+
});
|
429 |
+
|
430 |
+
function gradientIni(gradient_type) {
|
431 |
+
switch (gradient_type) {
|
432 |
+
case 'solid-color':
|
433 |
+
jQuery('.thumbnail-overlay').css('background', jQuery('#niteoCS_overlay_color').val());
|
434 |
+
break;
|
435 |
+
|
436 |
+
case 'gradient':
|
437 |
+
jQuery('.cmp-coming-soon-maintenance select.overlay-gradient').trigger('change');
|
438 |
+
break;
|
439 |
+
|
440 |
+
case 'disabled':
|
441 |
+
jQuery('.cmp-coming-soon-maintenance .thumbnail-overlay').css('background', 'none');
|
442 |
+
break;
|
443 |
+
|
444 |
+
default:
|
445 |
+
break;
|
446 |
+
}
|
447 |
+
}
|
448 |
+
|
449 |
+
// BLUR PREVIEW
|
450 |
+
jQuery('.cmp-coming-soon-maintenance .blur-range')
|
451 |
+
.on('input', function () {
|
452 |
+
var value = jQuery(this).val();
|
453 |
+
jQuery('.cmp-coming-soon-maintenance .background-thumb-wrapper img:not(.no-blur)').css('filter', 'blur(' + value + 'px)');
|
454 |
+
})
|
455 |
+
.trigger('input');
|
456 |
+
|
457 |
+
// banner pattern on change image preview
|
458 |
+
jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"]').on('change', function () {
|
459 |
+
var pattern = jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"] option:selected').val();
|
460 |
+
|
461 |
+
if (pattern != 'custom') {
|
462 |
+
var pattern_url = jQuery(this).data('url');
|
463 |
+
jQuery('.cmp-coming-soon-maintenance #add-pattern').css('display', 'none');
|
464 |
+
jQuery('.cmp-coming-soon-maintenance .pattern-wrapper').css('background-image', "url('" + pattern_url + pattern + ".png')");
|
465 |
+
} else {
|
466 |
+
var pattern_url = jQuery('.cmp-coming-soon-maintenance #niteoCS_banner_pattern_custom').val();
|
467 |
+
jQuery('.cmp-coming-soon-maintenance #add-pattern').css('display', 'block');
|
468 |
+
jQuery('.cmp-coming-soon-maintenance .pattern-wrapper').css('background-image', "url('" + pattern_url + "')");
|
469 |
+
}
|
470 |
+
});
|
471 |
+
|
472 |
+
// preview animation
|
473 |
+
jQuery('.cmp-coming-soon-maintenance .heading-animation').on('change', function () {
|
474 |
+
heading_anim = jQuery('.cmp-coming-soon-maintenance .heading-animation option:selected').val();
|
475 |
+
jQuery('.cmp-coming-soon-maintenance #heading-example')
|
476 |
+
.removeClass()
|
477 |
+
.addClass('animated ' + heading_anim);
|
478 |
+
});
|
479 |
+
|
480 |
+
jQuery('.cmp-coming-soon-maintenance .content-animation').on('change', function () {
|
481 |
+
heading_anim = jQuery('.cmp-coming-soon-maintenance .content-animation option:selected').val();
|
482 |
+
jQuery('.cmp-coming-soon-maintenance #content-example')
|
483 |
+
.removeClass()
|
484 |
+
.addClass('animated ' + heading_anim);
|
485 |
+
});
|
486 |
+
|
487 |
+
// ----------------------- sortable social list -----------------------
|
488 |
+
// function to update social list
|
489 |
+
var update_social = function (name, key, val) {
|
490 |
+
var socialmedia = jQuery('.cmp-coming-soon-maintenance #niteoCS_socialmedia').attr('value');
|
491 |
+
socialmedia = jQuery.parseJSON(socialmedia);
|
492 |
+
|
493 |
+
jQuery.each(socialmedia, function (i, ele) {
|
494 |
+
if (ele['name'] == name) {
|
495 |
+
ele[key] = val;
|
496 |
+
}
|
497 |
+
});
|
498 |
+
|
499 |
+
jQuery('.cmp-coming-soon-maintenance #niteoCS_socialmedia').attr('value', JSON.stringify(socialmedia));
|
500 |
+
};
|
501 |
+
|
502 |
+
// sortable UI - disabled on Mobile phones - input elements where not clickable...
|
503 |
+
if (!/Mobi/.test(navigator.userAgent)) {
|
504 |
+
var $sortableList = jQuery('.cmp-coming-soon-maintenance .social-inputs');
|
505 |
+
|
506 |
+
var sortEventHandler = function (event, ui) {
|
507 |
+
var inputs = $sortableList.find('input[type="text"]');
|
508 |
+
|
509 |
+
var order = ui.item.index();
|
510 |
+
|
511 |
+
inputs.each(function (i, ele) {
|
512 |
+
var name = jQuery(ele).data('name');
|
513 |
+
update_social(name, 'order', i);
|
514 |
+
});
|
515 |
+
};
|
516 |
+
|
517 |
+
$sortableList.sortable({
|
518 |
+
stop: sortEventHandler,
|
519 |
+
});
|
520 |
+
|
521 |
+
$sortableList.on('sortchange', sortEventHandler);
|
522 |
+
}
|
523 |
+
|
524 |
+
// social checkbox to enable/disable input
|
525 |
+
(function ($) {
|
526 |
+
jQuery.fn.toggleDisabled = function () {
|
527 |
+
return this.each(function () {
|
528 |
+
var $this = jQuery(this);
|
529 |
+
var active;
|
530 |
+
var name = $this.data('name');
|
531 |
+
if ($this.attr('disabled')) {
|
532 |
+
$this.prop('disabled', false);
|
533 |
+
active = '1';
|
534 |
+
} else {
|
535 |
+
$this.prop('disabled', true);
|
536 |
+
active = '0';
|
537 |
+
}
|
538 |
+
update_social(name, 'active', active);
|
539 |
+
});
|
540 |
+
};
|
541 |
+
})(jQuery);
|
542 |
+
|
543 |
+
jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="text"]').focusout(function () {
|
544 |
+
var name = jQuery(this).data('name');
|
545 |
+
var socialurl = jQuery(this).val();
|
546 |
+
update_social(name, 'url', socialurl);
|
547 |
+
});
|
548 |
+
|
549 |
+
jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="checkbox"]').click(function (e) {
|
550 |
+
var $this = jQuery(this).siblings('input[type="text"]');
|
551 |
+
$this.toggleDisabled();
|
552 |
+
});
|
553 |
+
|
554 |
+
// social icons active/inactive
|
555 |
+
jQuery('.cmp-coming-soon-maintenance .social-media i').click(function () {
|
556 |
+
var name = jQuery(this).data('name');
|
557 |
+
jQuery(this).toggleClass('active');
|
558 |
+
jQuery('.cmp-coming-soon-maintenance .social-inputs li.' + name).toggleClass('active');
|
559 |
+
jQuery('.cmp-coming-soon-maintenance .social-inputs li.' + name + ' input').trigger('change');
|
560 |
+
|
561 |
+
if (jQuery(this).hasClass('active')) {
|
562 |
+
update_social(name, 'hidden', '0');
|
563 |
+
} else {
|
564 |
+
update_social(name, 'hidden', '1');
|
565 |
+
}
|
566 |
+
// hide/show input labels
|
567 |
+
if (jQuery('.cmp-coming-soon-maintenance .social-media i.active').length) {
|
568 |
+
jQuery('.social-inputs .label').css('display', 'block');
|
569 |
+
} else {
|
570 |
+
jQuery('.cmp-coming-soon-maintenance .social-inputs .label').css('display', 'none');
|
571 |
+
}
|
572 |
+
});
|
573 |
+
|
574 |
+
// hide/show input labels
|
575 |
+
if (jQuery('.cmp-coming-soon-maintenance .social-media i.active').length) {
|
576 |
+
jQuery('.cmp-coming-soon-maintenance .social-inputs .label').css('display', 'block');
|
577 |
+
}
|
578 |
+
|
579 |
+
// theme update via admin notice
|
580 |
+
jQuery('.cmp.update-theme').click(function (e) {
|
581 |
+
e.preventDefault();
|
582 |
+
var $this = jQuery(this),
|
583 |
+
$parent = $this.parents('.notice'),
|
584 |
+
security = $this.data('security'),
|
585 |
+
slug = $this.data('slug'),
|
586 |
+
themeName = $this.data('name'),
|
587 |
+
remoteUrl = jQuery(this).data('remote_url');
|
588 |
+
var update = {
|
589 |
+
name: slug,
|
590 |
+
tmp_name: '',
|
591 |
+
url: remoteUrl + '?action=download&slug=' + slug,
|
592 |
+
};
|
593 |
+
|
594 |
+
var data = {
|
595 |
+
action: 'cmp_theme_update_install',
|
596 |
+
security: security,
|
597 |
+
file: update,
|
598 |
+
};
|
599 |
+
|
600 |
+
$parent.find('.message').html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>');
|
601 |
+
|
602 |
+
jQuery.post(ajaxurl, data, function (response) {
|
603 |
+
response = response.trim();
|
604 |
+
|
605 |
+
if (response == 'success') {
|
606 |
+
setTimeout(function () {
|
607 |
+
$parent.removeClass('notice-warning').addClass('notice-success');
|
608 |
+
$parent.find('.message').html('<span> ' + themeName + ' CMP theme was updated sucessfully! You can enjoy latest features now :) </span><i class="far fa-smile" aria-hidden="true"></i>');
|
609 |
+
}, 1500);
|
610 |
+
} else {
|
611 |
+
response = response.slice(0, -1);
|
612 |
+
var error = jQuery('p', jQuery(response)).text();
|
613 |
+
$parent.removeClass('notice-warning').addClass('notice-error');
|
614 |
+
$parent.find('.message').html('<i class="far fa-frown" aria-hidden="true"></i><span> ' + error + '</span>');
|
615 |
+
}
|
616 |
+
});
|
617 |
+
});
|
618 |
+
|
619 |
+
// theme update via theme button
|
620 |
+
jQuery('.cmp-coming-soon-maintenance .theme-update.button').one('click', function (e) {
|
621 |
+
e.preventDefault();
|
622 |
+
var $this = jQuery(this),
|
623 |
+
$wrapper = $this.closest('.theme-wrapper'),
|
624 |
+
security = $wrapper.data('security'),
|
625 |
+
slug = $wrapper.data('slug'),
|
626 |
+
remoteUrl = $wrapper.data('remote_url');
|
627 |
+
|
628 |
+
var update = {
|
629 |
+
name: slug,
|
630 |
+
tmp_name: '',
|
631 |
+
url: remoteUrl + '?action=download&slug=' + slug,
|
632 |
+
};
|
633 |
+
|
634 |
+
var data = {
|
635 |
+
action: 'cmp_theme_update_install',
|
636 |
+
security: security,
|
637 |
+
file: update,
|
638 |
+
};
|
639 |
+
|
640 |
+
$this.html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>');
|
641 |
+
|
642 |
+
jQuery.post(ajaxurl, data, function (response) {
|
643 |
+
if (response == 'success') {
|
644 |
+
setTimeout(function () {
|
645 |
+
$this.html('<i class="far fa-smile" aria-hidden="true"></i><span>Updated!</span>');
|
646 |
+
setTimeout(function () {
|
647 |
+
$this.fadeOut();
|
648 |
+
}, 1500);
|
649 |
+
}, 1500);
|
650 |
+
} else {
|
651 |
+
response = response.slice(0, -1);
|
652 |
+
$this.html('<i class="far fa-frown" aria-hidden="true"></i><span>Update Failed!</span>');
|
653 |
+
}
|
654 |
+
});
|
655 |
+
});
|
656 |
+
|
657 |
+
// display theme details overlay
|
658 |
+
jQuery('.cmp-coming-soon-maintenance .theme-details').click(function (e) {
|
659 |
+
e.preventDefault();
|
660 |
+
var $this = jQuery(this),
|
661 |
+
$wrapper = $this.closest('.theme-wrapper'),
|
662 |
+
slug = $wrapper.data('slug'),
|
663 |
+
version = $wrapper.data('version'),
|
664 |
+
type = $wrapper.data('type'),
|
665 |
+
purchased = $wrapper.data('purchased'),
|
666 |
+
i = 0;
|
667 |
+
|
668 |
+
var data = {
|
669 |
+
action: 'niteo_themeinfo',
|
670 |
+
security: jQuery('.theme-wrapper').data('security'),
|
671 |
+
theme_slug: jQuery(this).parents('.theme-wrapper').data('slug'),
|
672 |
+
};
|
673 |
+
|
674 |
+
jQuery.post(ajaxurl, data, function (response) {
|
675 |
+
var buyButton = '';
|
676 |
+
var versionInfo = '';
|
677 |
+
var noticeHtml = '';
|
678 |
+
// parse JSON data to array
|
679 |
+
response = jQuery.parseJSON(response);
|
680 |
+
|
681 |
+
if (response.result == 'true') {
|
682 |
+
// overflow body hidden
|
683 |
+
jQuery('body').addClass('modal-open');
|
684 |
+
|
685 |
+
// if installed display version info
|
686 |
+
if (purchased == '1') {
|
687 |
+
versionInfo = '<span class="theme-version">Installed version: ' + version + '</span>';
|
688 |
+
}
|
689 |
+
|
690 |
+
// if premium and not installed, display buy button
|
691 |
+
if (purchased != '1' && type == 'premium') {
|
692 |
+
var buyURL = $wrapper.find('.cmp-purchase-theme').attr('href');
|
693 |
+
var buyButton = '<button type="button" class="theme-purchase button hide"><a href="' + buyURL + '" target="_blank"><i class="fas fa-cart-arrow-down" aria-hidden="true"></i>Get Theme</a></button>';
|
694 |
+
}
|
695 |
+
|
696 |
+
// get screenshots
|
697 |
+
var screenshots = response.screenshots;
|
698 |
+
var arrows = '';
|
699 |
+
// if we have more screenshots, generate navigation arrows
|
700 |
+
if (Object.keys(screenshots).length > 1) {
|
701 |
+
arrows = '<div class="screenshots-nav"><div class="left"><i class="fas fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fas fa-chevron-right" aria-hidden="true"></i></div></div>';
|
702 |
+
}
|
703 |
+
|
704 |
+
// generate html to append to theme-overlay
|
705 |
+
var html = jQuery(
|
706 |
+
[
|
707 |
+
'<div class="theme-backdrop">',
|
708 |
+
' <div class="theme-wrap">',
|
709 |
+
' <div class="theme-header">',
|
710 |
+
' <button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',
|
711 |
+
' </div>',
|
712 |
+
' <div class="theme-about">',
|
713 |
+
' <div class="theme-screenshots">',
|
714 |
+
' <div class="screenshot" style="background-image:url(\'' + screenshots['0'] + '\')">' + arrows + '</div>',
|
715 |
+
' </div>',
|
716 |
+
' <div class="theme-info">',
|
717 |
+
' <h2 class="theme-name">' + response['name'] + versionInfo + '</h2>',
|
718 |
+
' <p class="theme-author">By <a href="' + response['author_homepage'] + '" target="_blank">' + response['author'] + '</a></p>',
|
719 |
+
noticeHtml,
|
720 |
+
buyButton,
|
721 |
+
' <div class="theme-description">' + response['description'] + '</div>',
|
722 |
+
' </div>',
|
723 |
+
' </div>',
|
724 |
+
' <div class="theme-actions">',
|
725 |
+
' <a href="https://niteothemes.com/cmp-coming-soon-maintenance/?theme=' + slug + '&utm_source=cmp&utm_medium=referral&utm_campaign=' + slug + '" class="button cmp-preview" target="_blank" aria-label="Preview ' + response['name'] + '">Live Preview</a>',
|
726 |
+
' </div>',
|
727 |
+
' </div>',
|
728 |
+
'</div>',
|
729 |
+
].join('\n')
|
730 |
+
);
|
731 |
+
|
732 |
+
// append html to overlay
|
733 |
+
jQuery('.theme-overlay.cmp').append(html);
|
734 |
+
|
735 |
+
// attach close button handler
|
736 |
+
jQuery('.theme-overlay.cmp .close').click(function (e) {
|
737 |
+
e.preventDefault();
|
738 |
+
// overflow body hidden
|
739 |
+
jQuery('body').removeClass('modal-open');
|
740 |
+
jQuery('.theme-overlay.cmp .theme-backdrop').fadeOut('fast');
|
741 |
+
});
|
742 |
+
|
743 |
+
// attach arrows navigation handler
|
744 |
+
jQuery('.screenshots-nav .right').click(function () {
|
745 |
+
i++;
|
746 |
+
|
747 |
+
if (i == Object.keys(screenshots).length) {
|
748 |
+
i = 0;
|
749 |
+
}
|
750 |
+
|
751 |
+
if (i in screenshots) {
|
752 |
+
jQuery('.screenshot').css('background-image', "url('" + screenshots[i] + "')");
|
753 |
+
}
|
754 |
+
});
|
755 |
+
|
756 |
+
// attach arrows navigation handler
|
757 |
+
jQuery('.screenshots-nav .left').click(function () {
|
758 |
+
i--;
|
759 |
+
|
760 |
+
if (i < 0) {
|
761 |
+
i = Object.keys(screenshots).length - 1;
|
762 |
+
}
|
763 |
+
|
764 |
+
if (i in screenshots) {
|
765 |
+
jQuery('.screenshot').css('background-image', "url('" + screenshots[i] + "')");
|
766 |
+
}
|
767 |
+
});
|
768 |
+
}
|
769 |
+
});
|
770 |
+
});
|
771 |
+
|
772 |
+
function media_upload_button(name, multiple, type, element) {
|
773 |
+
// define var
|
774 |
+
var $container = jQuery('.' + name + '-wrapper');
|
775 |
+
var $add_button = jQuery('#add-' + name);
|
776 |
+
var $delete_button = jQuery('#delete-' + name);
|
777 |
+
var image;
|
778 |
+
var imgID = '';
|
779 |
+
var title = name.replace('-', ' ');
|
780 |
+
title = title[0].toUpperCase() + title.slice(1);
|
781 |
+
|
782 |
+
if (jQuery('#niteoCS-' + name + '-id').val() != '') {
|
783 |
+
// Display Delete button
|
784 |
+
$delete_button.css('display', 'block');
|
785 |
+
}
|
786 |
+
|
787 |
+
$add_button.click(function (e) {
|
788 |
+
e.preventDefault();
|
789 |
+
// If the media frame already exists, reopen it.
|
790 |
+
if (media_uploader) {
|
791 |
+
media_uploader.open();
|
792 |
+
return;
|
793 |
+
}
|
794 |
+
|
795 |
+
var media_uploader = wp
|
796 |
+
.media({
|
797 |
+
title: 'Select ' + title,
|
798 |
+
button: {
|
799 |
+
text: 'Insert ' + title,
|
800 |
+
},
|
801 |
+
multiple: multiple, // Set this to true to allow multiple files to be selected
|
802 |
+
library: {
|
803 |
+
type: [type],
|
804 |
+
},
|
805 |
+
})
|
806 |
+
.on('select', function () {
|
807 |
+
// Get media attachment details from the frame state
|
808 |
+
var attachment = media_uploader.state().get('selection').toJSON();
|
809 |
+
|
810 |
+
if (attachment.length > 0) {
|
811 |
+
$container.find('img').remove();
|
812 |
+
|
813 |
+
// remove and add gallery count class
|
814 |
+
$container.attr('class', name + '-wrapper custom-gallery');
|
815 |
+
$container.addClass('gallery-' + attachment.length);
|
816 |
+
|
817 |
+
// get images ID, append thumbnail and store IDs in hidden input
|
818 |
+
jQuery(attachment).each(function (i) {
|
819 |
+
if (attachment[i].sizes && attachment[i].sizes.large) {
|
820 |
+
image = attachment[i].sizes.large.url;
|
821 |
+
} else {
|
822 |
+
image = attachment[i].url;
|
823 |
+
}
|
824 |
+
|
825 |
+
// add image ID and url to comma-separated variable
|
826 |
+
var comma = i === 0 ? '' : ',';
|
827 |
+
imgID += comma + attachment[i].id;
|
828 |
+
|
829 |
+
// Send the attachment URL to our custom image input field.
|
830 |
+
switch (element) {
|
831 |
+
case 'video':
|
832 |
+
$container.append('<video width="600" height="400" controls><source src="' + image + '" type="video/mp4">Your browser does not support the video tag.</video>');
|
833 |
+
break;
|
834 |
+
|
835 |
+
case 'background':
|
836 |
+
$container.css('background-image', "url('" + image + "')");
|
837 |
+
break;
|
838 |
+
|
839 |
+
case 'img':
|
840 |
+
default:
|
841 |
+
// if gallery - more than one image, it must be a graphic background, attach the first image to big coontainer
|
842 |
+
if (attachment.length > 1 && i == 0 && jQuery('.' + name + '-wrapper .big-thumb').length) {
|
843 |
+
jQuery('.' + name + '-wrapper .big-thumb').append('<img src="' + image + '" alt=""/>');
|
844 |
+
|
845 |
+
// if gallery - more than one image, it must be a graphic background, attach all others images to normal wrapper
|
846 |
+
} else if (attachment.length > 1 && i !== 0) {
|
847 |
+
$container.append('<img src="' + image + '" alt="" class="no-blur"/>');
|
848 |
+
|
849 |
+
// if single image, and it is a background image, attach it to big container as well
|
850 |
+
} else if ($container.find('.big-thumb').length) {
|
851 |
+
jQuery('.' + name + '-wrapper .big-thumb').append('<img src="' + image + '" alt=""/>');
|
852 |
+
|
853 |
+
// all others images
|
854 |
+
} else {
|
855 |
+
$container.append('<img src="' + image + '" alt=""/>');
|
856 |
+
}
|
857 |
+
|
858 |
+
jQuery('.blur-range').trigger('input');
|
859 |
+
break;
|
860 |
+
}
|
861 |
+
});
|
862 |
+
|
863 |
+
// Display Delete button
|
864 |
+
$delete_button.css('display', 'block');
|
865 |
+
}
|
866 |
+
// update hidden input with media id and trigger change
|
867 |
+
jQuery('#niteoCS-' + name + '-id')
|
868 |
+
.val(imgID)
|
869 |
+
.trigger('change');
|
870 |
+
})
|
871 |
+
.open();
|
872 |
+
});
|
873 |
+
|
874 |
+
$delete_button.click(function (e) {
|
875 |
+
jQuery(this).css('display', 'none');
|
876 |
+
$container.find('img').remove();
|
877 |
+
jQuery('#niteoCS-' + name + '-id').val('');
|
878 |
+
jQuery('#niteoCS-' + name + '-id').trigger('change');
|
879 |
+
});
|
880 |
+
}
|
881 |
+
|
882 |
+
// Retrieve Mailchimp lists
|
883 |
+
jQuery('.cmp-coming-soon-maintenance #connect-mailchimp').click(function (e) {
|
884 |
+
e.preventDefault();
|
885 |
+
|
886 |
+
var apikey = jQuery('.cmp-coming-soon-maintenance input[name="niteoCS_mailchimp_apikey"]').val(),
|
887 |
+
security = jQuery(this).data('security'),
|
888 |
+
button = jQuery(this);
|
889 |
+
|
890 |
+
if (apikey != '') {
|
891 |
+
var params = { apikey: apikey, security: security };
|
892 |
+
|
893 |
+
jQuery(this).prop('disabled', true);
|
894 |
+
|
895 |
+
jQuery(this).html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span> retrieving lists..</span>');
|
896 |
+
|
897 |
+
var data = {
|
898 |
+
action: 'cmp_mailchimp_list_ajax',
|
899 |
+
security: security,
|
900 |
+
params: params,
|
901 |
+
};
|
902 |
+
|
903 |
+
jQuery
|
904 |
+
.post(ajaxurl, data, function (response) {
|
905 |
+
var lists = JSON.parse(response);
|
906 |
+
|
907 |
+
if (lists.response == 200) {
|
908 |
+
jQuery('#niteoCS_mailchimp_list').empty().prop('disabled', false);
|
909 |
+
jQuery.each(lists.lists, function (i, val) {
|
910 |
+
jQuery('#niteoCS_mailchimp_list').append('<option value="' + val.id + '">' + val.name + '</option>');
|
911 |
+
});
|
912 |
+
} else {
|
913 |
+
jQuery('#niteoCS_mailchimp_list')
|
914 |
+
.empty()
|
915 |
+
.prop('disabled', true)
|
916 |
+
.html('<option value="error">' + lists.message + '</option>')
|
917 |
+
.trigger('change');
|
918 |
+
}
|
919 |
+
|
920 |
+
button.html('Retrieve Lists');
|
921 |
+
button.prop('disabled', false);
|
922 |
+
})
|
923 |
+
.fail(function () {
|
924 |
+
button.html('Retrieve Lists');
|
925 |
+
button.prop('disabled', false);
|
926 |
+
});
|
927 |
+
}
|
928 |
+
});
|
929 |
+
|
930 |
+
function toggle_settings(classname) {
|
931 |
+
// Logo type inputs
|
932 |
+
jQuery('.cmp-coming-soon-maintenance .' + classname).change(function () {
|
933 |
+
var value = jQuery('.cmp-coming-soon-maintenance .' + classname + ':checked').val();
|
934 |
+
value = jQuery.isNumeric(value) ? 'x' + value : value;
|
935 |
+
value = value === undefined ? 'off' : value;
|
936 |
+
|
937 |
+
jQuery('.cmp-coming-soon-maintenance .' + classname + '-switch.' + value).css('display', 'block');
|
938 |
+
jQuery('.cmp-coming-soon-maintenance .' + classname + '-switch:not(.' + value + ')').css('display', 'none');
|
939 |
+
});
|
940 |
+
|
941 |
+
jQuery('.cmp-coming-soon-maintenance .' + classname)
|
942 |
+
.first()
|
943 |
+
.trigger('change');
|
944 |
+
}
|
945 |
+
|
946 |
+
function toggle_select(classname) {
|
947 |
+
jQuery('.cmp-coming-soon-maintenance .' + classname).change(function () {
|
948 |
+
var value = jQuery('.' + classname).val();
|
949 |
+
value = jQuery.isNumeric(value) ? 'x' + value : value;
|
950 |
+
|
951 |
+
jQuery('.cmp-coming-soon-maintenance .' + classname + '.' + value).css('display', 'block');
|
952 |
+
jQuery('.cmp-coming-soon-maintenance .' + classname + ':not(.' + value + ')').css('display', 'none');
|
953 |
+
});
|
954 |
+
|
955 |
+
jQuery('.' + classname)
|
956 |
+
.first()
|
957 |
+
.trigger('change');
|
958 |
+
}
|
959 |
+
|
960 |
+
function update_range(selector, target, method) {
|
961 |
+
jQuery(selector).on('input', function () {
|
962 |
+
var value = jQuery(this).val();
|
963 |
+
// change label value
|
964 |
+
if (method === 'html') {
|
965 |
+
jQuery(this).parent().find(target).html(value);
|
966 |
+
}
|
967 |
+
|
968 |
+
if (method === 'val') {
|
969 |
+
jQuery(this).parent().find(target).val(value);
|
970 |
+
}
|
971 |
+
});
|
972 |
+
}
|
973 |
+
|
974 |
+
// delete overlay color from premium themes after update 2.8
|
975 |
+
jQuery('.cmp-coming-soon-maintenance .table-wrapper.theme-setup h4').each(function () {
|
976 |
+
if (jQuery(this).html() == 'Overlay Color') {
|
977 |
+
jQuery(this).parents('tr').remove();
|
978 |
+
return false;
|
979 |
+
}
|
980 |
+
});
|
981 |
+
|
982 |
+
// warn users about unsaved changes for preview
|
983 |
+
jQuery('.nav-tab-wrapper').on('click', '.theme-preview', function (e) {
|
984 |
+
if (jQuery('#csoptions fieldset:not(.skip-preview-validation *)').serialize() != settings) {
|
985 |
+
if (!confirm('You have made changes that will not be visible in the preview until you save them. Please save changes first.\nContinue anyway?')) {
|
986 |
+
e.preventDefault();
|
987 |
+
return false;
|
988 |
+
}
|
989 |
+
}
|
990 |
+
|
991 |
+
return true;
|
992 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
993 |
});
|
js/settings.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function (e) { var n = document.location.hash.substring(1), a = jQuery("#csoptions").attr("action"), t = jQuery("#csoptions fieldset:not(.skip-preview-validation *)").serialize(); wp.codeEditor && jQuery("#niteoCS_custom_css").length && wp.codeEditor.initialize("niteoCS_custom_css"), navtab = function (e) { jQuery(".cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab").removeClass("nav-tab-active"), jQuery(".nav-tab-wrapper ." + e).addClass("nav-tab-active"), jQuery(".cmp-coming-soon-maintenance .table-wrapper." + e).css("display", "block"), jQuery(".cmp-coming-soon-maintenance .table-wrapper-css." + e).css("display", "block"), jQuery(".cmp-coming-soon-maintenance .comingsoon." + e).css("display", "block"), jQuery(".cmp-coming-soon-maintenance .table-wrapper:not(." + e + ")").css("display", "none"), jQuery(".cmp-coming-soon-maintenance .table-wrapper-css:not(." + e).css("display", "none"), jQuery(".cmp-coming-soon-maintenance .comingsoon:not(." + e + ")").css("display", "none"), "install" == e ? (jQuery(".cmp-coming-soon-maintenance .submit").css("display", "none"), jQuery(".cmp-coming-soon-maintenance #csoptions").attr("action", a)) : (jQuery(".cmp-coming-soon-maintenance .submit").css("display", "block"), jQuery(".cmp-coming-soon-maintenance #csoptions").attr("action", a + "#" + e)) }, "" != n ? navtab(n) : jQuery(".cmp-coming-soon-maintenance .table-wrapper-css").css("display", "none"), window.onhashchange = function () { n = document.location.hash.substring(1), navtab(n) }, jQuery(".cmp-coming-soon-maintenance .nav-tab:not(.theme-preview):not(.advanced)").click(function (e) { e.preventDefault(), n = jQuery(this).data("tab"), document.location.hash = n }), p(".cmp-coming-soon-maintenance .blur-range", "span", "html"), p(".cmp-coming-soon-maintenance .background-overlay-opacity", "span", "html"), p("#logo_size_slider", "#niteoCS_logo_size", "val"), p("#niteoCS_logo_size", "#logo_size_slider", "val"), l("logo", !1, "image", "img"), l("favicon", !1, "image", "img"), l("seo_img", !1, "image", "img"), l("images", !0, "image", "img"), l("mobile-images", !0, "image", "img"), l("pattern", !1, "image", "background"), l("video-thumb", !1, "image", "img"), l("video-local", !1, "video", "video"), l("subs-img", !1, "image", "img"), u("analytics"), u("contact-form"), u("subscribe"), u("background-effect"), u("special-effect"), u("cmp-logo"), u("background-type"), u("counter"), u("progress-bar"), u("overlay-text"), u("cmp-logo-size"), u("recaptcha-toggle"), u("login-icon"), u("custom-mobile-imgs"), u("lang-switcher"), m("counter-action"), m("subscribe-method"), m("background-overlay"), m("banner-video-source"), m("progress-bar-type"), jQuery(".cmp-coming-soon-maintenance select:not(.headings-google-font):not(.content-google-font )").select2({ width: "100%", minimumResultsForSearch: -1, placeholder: "Click to select.." }), jQuery(".cmp-coming-soon-maintenance #cmp-status").click(function () { jQuery(".cmp-coming-soon-maintenance .cmp-status input[type=radio]").prop("disabled", function (e, n) { return !n }), jQuery("#cmp-toggle-adminbar").toggleClass("status-1"), jQuery(".cmp-status-pages").fadeToggle() }), jQuery(".cmp-status-pages input[type=radio]").change(function () { jQuery(".cmp-status-pages input[type=radio]").parent().removeClass("active"), jQuery(this).parent().addClass("active") }), jQuery(".cmp-coming-soon-maintenance .cmp-status.switch:not(.disabled)").click(function () { if (0 != jQuery(".cmp-coming-soon-maintenance #cmp-status").prop("checked")) { var e = jQuery(this).children("input"); e.prop("checked", !0), jQuery(".cmp-coming-soon-maintenance .cmp-status.switch").removeClass("active"), jQuery(this).addClass("active"), e.trigger("change"), "3" == e.val() ? jQuery(".cmp-coming-soon-maintenance .redirect-inputs").fadeIn("fast") : jQuery(".cmp-coming-soon-maintenance .redirect-inputs").fadeOut("fast") } }), jQuery(".cmp-coming-soon-maintenance .table-wrapper h3").click(function () { jQuery(this).parent().toggleClass("closed") }), jQuery(".cmp-coming-soon-maintenance #test-unsplash").click(function (e) { e.preventDefault(); var n = jQuery(".cmp-coming-soon-maintenance #unsplash-media"), a = jQuery('.cmp-coming-soon-maintenance .unsplash_banner select[name^="unsplash_feed"] option:selected').val(), t = "", i = jQuery(this).data("security"); if (0 == a) { switch (a) { case "0": t = jQuery(".cmp-coming-soon-maintenance #niteoCS-unsplash-0").val() }if (3 == a || "" != t) { var o = { feed: a, url: t, feat: "", custom_str: "" }; jQuery(this).prop("disabled", !0), jQuery(this).html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'); var r = { action: "niteo_unsplash", security: i, params: o }; jQuery.post(ajaxurl, r, function (e) { var a = JSON.parse(e); jQuery("#unsplash_img").remove(); var t = setTimeout(function () { jQuery("#test-unsplash").prop("disabled", !1), jQuery("#test-unsplash").text("Display Unsplash Photo"), jQuery("#unsplash-media").html('<p>It seems <a href="https://status.unsplash.com/" target="_blank">Unsplash API</a> is not responding. Please try again later.</p>') }, 5e3); if ("200" == a.response) { if ((a = jQuery.parseJSON(a.body))[0]) var i = a[0].urls.raw + "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588", o = a[0].user.name, r = a[0].user.links.html, s = a[0].links.html, c = a[0].id; else i = a.urls.raw + "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588", o = a.user.name, r = a.user.links.html, s = a.links.html, c = a.id; jQuery("<img />", { src: i, id: "unsplash_img" }).one("load", function () { jQuery(this).appendTo(n), jQuery(this).fadeIn(), jQuery("#test-unsplash").prop("disabled", !1), jQuery("#test-unsplash").text("Display Unsplash Photo"), jQuery(".unsplash-id").html('<a href="' + s + '" target="_blank">Photo</a> (ID: ' + c + ') by <a href="' + r + '" target="_blank">' + o + '</a> / <a href="https://unsplash.com/" target="_blank">Unsplash</a>'), jQuery(".blur-range").trigger("input"), clearTimeout(t) }) } else jQuery(".cmp-coming-soon-maintenance #test-unsplash").prop("disabled", !1), jQuery(".cmp-coming-soon-maintenance #test-unsplash").text("Display Unsplash Photo"), jQuery(".cmp-coming-soon-maintenance #unsplash-media").html("<p>Error " + a.response + ': <span style="text-transform:lowercase;">' + JSON.parse(a.body).errors + "</span></p>"), clearTimeout(t) }) } else jQuery(".cmp-coming-soon-maintenance #unsplash_img").remove() } }), videoPreview = function () { if ("5" == jQuery(".cmp-coming-soon-maintenance .background-type:checked").val()) { var e = jQuery(".cmp-coming-soon-maintenance .banner-video-source").val(); if ("youtube" == e) { var n = jQuery(".cmp-coming-soon-maintenance #niteoCS-youtube-url").val(); if ("" != n) { var a = n.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/); if (a && 11 == a[7].length) { jQuery(".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper").html(""); var t = "https://img.youtube.com/vi/" + a[7] + "/maxresdefault.jpg"; jQuery(".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper").append('<img src="' + t + '" alt=""/>'), jQuery(".cmp-coming-soon-maintenance .blur-range").trigger("input") } else jQuery(".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper").html("") } } if ("local" == e) { var i = jQuery("#niteoCS-video-local-id").data("url"); "" != i && jQuery(".cmp-coming-soon-maintenance .video-local-wrapper").html('<video width="600" height="400" controls><source src="' + i + '" type="video/mp4">Your browser does not support the video tag.</video>') } } }, videoPreview(), jQuery(".cmp-coming-soon-maintenance .background-type").on("change", function () { videoPreview() }), jQuery(".cmp-coming-soon-maintenance #niteoCS-youtube-url").on("keyup", function () { videoPreview() }), jQuery(".cmp-coming-soon-maintenance .banner-video-source").on("change", function () { videoPreview() }); var i = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val(); function o(e) { switch (e) { case "solid-color": jQuery(".thumbnail-overlay").css("background", jQuery("#niteoCS_overlay_color").val()); break; case "gradient": jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").trigger("change"); break; case "disabled": jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css("background", "none") } } jQuery(".unsplash-feed-" + i).css("display", "block"), jQuery('.unsplash_banner select[name^="unsplash_feed"]').on("change", function () { i = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val(), jQuery(".unsplash-feed").css("display", "none"), jQuery(".unsplash-feed-" + i).css("display", "block"), jQuery("#test-unsplash").trigger("click") }), 1 == jQuery("#csoptions .niteoCS_banner:checked").val() && jQuery("#test-unsplash").trigger("click"), jQuery(".cmp-coming-soon-maintenance select.background-gradient").on("change", function () { var e = jQuery(".cmp-coming-soon-maintenance select.background-gradient option:selected").val(); "custom" == e ? (jQuery(".cmp-coming-soon-maintenance .custom-gradient").css("display", "block"), jQuery(".cmp-coming-soon-maintenance .gradient-preview").css({ background: "-moz-linear-gradient(-45deg, " + jQuery("#niteoCS_gradient_one").val() + " 0%, " + jQuery("#niteoCS_gradient_two").val() + " 100%)", background: "-webkit-linear-gradient(-45deg, " + jQuery("#niteoCS_gradient_one").val() + " 0%, " + jQuery("#niteoCS_gradient_two").val() + " 100%)", background: "linear-gradient(135deg, " + jQuery("#niteoCS_gradient_one").val() + " 0%, " + jQuery("#niteoCS_gradient_two").val() + " 100%)" })) : (colors = e.split(":"), jQuery(".cmp-coming-soon-maintenance .custom-gradient").css("display", "none"), jQuery(".cmp-coming-soon-maintenance .gradient-preview").css({ background: "-moz-linear-gradient(-45deg, " + colors[0] + " 0%, " + colors[1] + " 100%)", background: "-webkit-linear-gradient(-45deg, " + colors[0] + " 0%, " + colors[1] + " 100%)", background: "linear-gradient(135deg, " + colors[0] + " 0%, " + colors[1] + " 100%)" })) }).trigger("change"), jQuery(".cmp-coming-soon-maintenance #niteoCS_banner_color").wpColorPicker({ change: function (e, n) { jQuery(".color-preview").css("background-color", n.color.toString()) } }), jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_one").wpColorPicker({ change: function (e, n) { jQuery(".gradient-preview").css({ background: "-moz-linear-gradient(-45deg, " + n.color.toString() + " 0%, " + jQuery("#niteoCS_gradient_two").val() + " 100%)", background: "-webkit-linear-gradient(-45deg, " + n.color.toString() + " 0%, " + jQuery("#niteoCS_gradient_two").val() + " 100%)", background: "linear-gradient(135deg, " + n.color.toString() + " 0%, " + jQuery("#niteoCS_gradient_two").val() + " 100%)" }) } }), jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_two").wpColorPicker({ change: function (e, n) { jQuery(".gradient-preview").css({ background: "-moz-linear-gradient(-45deg, " + jQuery("#niteoCS_gradient_one").val() + " 0%, " + n.color.toString() + " 100%)", background: "-webkit-linear-gradient(-45deg, " + jQuery("#niteoCS_gradient_one").val() + " 0%, " + n.color.toString() + " 100%)", background: "linear-gradient(135deg, " + jQuery("#niteoCS_gradient_one").val() + " 0%, " + n.color.toString() + " 100%)" }) } }), jQuery(".cmp-coming-soon-maintenance #niteoCS_overlay_color").wpColorPicker({ change: function (e, n) { jQuery(".thumbnail-overlay").css("background", n.color.toString()) } }), jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css("background", jQuery("#niteoCS_overlay_color").val()), jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").on("change", function () { var e = jQuery("select.overlay-gradient option:selected").val(); if ("custom" == e) { jQuery(".cmp-coming-soon-maintenance .custom-overlay-gradient").css("display", "block"); var n = jQuery("#niteoCS_overlay_gradient_one").val(), a = jQuery("#niteoCS_overlay_gradient_two").val(); jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css({ background: "-moz-linear-gradient(-45deg, " + n + " 0%, " + a + " 100%)", background: "-webkit-linear-gradient(-45deg, " + n + " 0%, " + a + " 100%)", background: "linear-gradient(135deg, " + n + " 0%, " + a + " 100%)" }) } else colors = e.split(":"), jQuery(".cmp-coming-soon-maintenance .custom-overlay-gradient").css("display", "none"), jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css({ background: "-moz-linear-gradient(-45deg, " + colors[0] + " 0%, " + colors[1] + " 100%)", background: "-webkit-linear-gradient(-45deg, " + colors[0] + " 0%, " + colors[1] + " 100%)", background: "linear-gradient(135deg, " + colors[0] + " 0%, " + colors[1] + " 100%)" }) }), jQuery("#niteoCS_overlay_gradient_one").wpColorPicker({ change: function (e, n) { jQuery(".thumbnail-overlay").css({ background: "-moz-linear-gradient(-45deg, " + n.color.toString() + " 0%, " + jQuery("#niteoCS_overlay_gradient_two").val() + " 100%)", background: "-webkit-linear-gradient(-45deg, " + n.color.toString() + " 0%, " + jQuery("#niteoCS_overlay_gradient_two").val() + " 100%)", background: "linear-gradient(135deg, " + n.color.toString() + " 0%, " + jQuery("#niteoCS_overlay_gradient_two").val() + " 100%)" }) } }), jQuery("#niteoCS_overlay_gradient_two").wpColorPicker({ change: function (e, n) { jQuery(".thumbnail-overlay").css({ background: "-moz-linear-gradient(-45deg, " + jQuery("#niteoCS_overlay_gradient_one").val() + " 0%, " + n.color.toString() + " 100%)", background: "-webkit-linear-gradient(-45deg, " + jQuery("#niteoCS_overlay_gradient_one").val() + " 0%, " + n.color.toString() + " 100%)", background: "linear-gradient(135deg, " + jQuery("#niteoCS_overlay_gradient_one").val() + " 0%, " + n.color.toString() + " 100%)" }) } }), jQuery(".background-overlay-opacity").on("input", function () { var e = jQuery(this).val(); jQuery(".thumbnail-overlay").css("opacity", e) }).trigger("input"), o(jQuery(".cmp-coming-soon-maintenance .background-overlay").val()), jQuery(".cmp-coming-soon-maintenance .background-overlay").on("change", function () { o(jQuery(this).val()) }), jQuery(".cmp-coming-soon-maintenance .blur-range").on("input", function () { var e = jQuery(this).val(); jQuery(".cmp-coming-soon-maintenance .background-thumb-wrapper img:not(.no-blur)").css("filter", "blur(" + e + "px)") }).trigger("input"), jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"]').on("change", function () { var e = jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"] option:selected').val(); if ("custom" != e) { var n = jQuery(this).data("url"); jQuery(".cmp-coming-soon-maintenance #add-pattern").css("display", "none"), jQuery(".cmp-coming-soon-maintenance .pattern-wrapper").css("background-image", "url('" + n + e + ".png')") } else { n = jQuery(".cmp-coming-soon-maintenance #niteoCS_banner_pattern_custom").val(); jQuery(".cmp-coming-soon-maintenance #add-pattern").css("display", "block"), jQuery(".cmp-coming-soon-maintenance .pattern-wrapper").css("background-image", "url('" + n + "')") } }), jQuery(".cmp-coming-soon-maintenance .heading-animation").on("change", function () { heading_anim = jQuery(".cmp-coming-soon-maintenance .heading-animation option:selected").val(), jQuery(".cmp-coming-soon-maintenance #heading-example").removeClass().addClass("animated " + heading_anim) }), jQuery(".cmp-coming-soon-maintenance .content-animation").on("change", function () { heading_anim = jQuery(".cmp-coming-soon-maintenance .content-animation option:selected").val(), jQuery(".cmp-coming-soon-maintenance #content-example").removeClass().addClass("animated " + heading_anim) }); var r = function (e, n, a) { var t = jQuery(".cmp-coming-soon-maintenance #niteoCS_socialmedia").attr("value"); t = jQuery.parseJSON(t), jQuery.each(t, function (t, i) { i.name == e && (i[n] = a) }), jQuery(".cmp-coming-soon-maintenance #niteoCS_socialmedia").attr("value", JSON.stringify(t)) }; if (!/Mobi/.test(navigator.userAgent)) { var s = jQuery(".cmp-coming-soon-maintenance .social-inputs"), c = function (e, n) { var a = s.find('input[type="text"]'); n.item.index(); a.each(function (e, n) { var a = jQuery(n).data("name"); r(a, "order", e) }) }; s.sortable({ stop: c }), s.on("sortchange", c) } function l(e, n, a, t) { var i, o = jQuery("." + e + "-wrapper"), r = jQuery("#add-" + e), s = jQuery("#delete-" + e), c = "", l = e.replace("-", " "); l = l[0].toUpperCase() + l.slice(1), "" != jQuery("#niteoCS-" + e + "-id").val() && s.css("display", "block"), r.click(function (r) { if (r.preventDefault(), u) u.open(); else var u = wp.media({ title: "Select " + l, button: { text: "Insert " + l }, multiple: n, library: { type: [a] } }).on("select", function () { var n = u.state().get("selection").toJSON(); n.length > 0 && (o.find("img").remove(), o.attr("class", e + "-wrapper custom-gallery"), o.addClass("gallery-" + n.length), jQuery(n).each(function (a) { switch (i = n[a].sizes && n[a].sizes.large ? n[a].sizes.large.url : n[a].url, c += (0 === a ? "" : ",") + n[a].id, t) { case "video": o.append('<video width="600" height="400" controls><source src="' + i + '" type="video/mp4">Your browser does not support the video tag.</video>'); break; case "background": o.css("background-image", "url('" + i + "')"); break; case "img": default: n.length > 1 && 0 == a && jQuery("." + e + "-wrapper .big-thumb").length ? jQuery("." + e + "-wrapper .big-thumb").append('<img src="' + i + '" alt=""/>') : n.length > 1 && 0 !== a ? o.append('<img src="' + i + '" alt="" class="no-blur"/>') : o.find(".big-thumb").length ? jQuery("." + e + "-wrapper .big-thumb").append('<img src="' + i + '" alt=""/>') : o.append('<img src="' + i + '" alt=""/>'), jQuery(".blur-range").trigger("input") } }), s.css("display", "block")), jQuery("#niteoCS-" + e + "-id").val(c).trigger("change") }).open() }), s.click(function (n) { jQuery(this).css("display", "none"), o.find("img").remove(), jQuery("#niteoCS-" + e + "-id").val(""), jQuery("#niteoCS-" + e + "-id").trigger("change") }) } function u(e) { jQuery(".cmp-coming-soon-maintenance ." + e).change(function () { var n = jQuery(".cmp-coming-soon-maintenance ." + e + ":checked").val(); n = void 0 === (n = jQuery.isNumeric(n) ? "x" + n : n) ? "off" : n, jQuery(".cmp-coming-soon-maintenance ." + e + "-switch." + n).css("display", "block"), jQuery(".cmp-coming-soon-maintenance ." + e + "-switch:not(." + n + ")").css("display", "none") }), jQuery(".cmp-coming-soon-maintenance ." + e).first().trigger("change") } function m(e) { jQuery(".cmp-coming-soon-maintenance ." + e).change(function () { var n = jQuery("." + e).val(); n = jQuery.isNumeric(n) ? "x" + n : n, jQuery(".cmp-coming-soon-maintenance ." + e + "." + n).css("display", "block"), jQuery(".cmp-coming-soon-maintenance ." + e + ":not(." + n + ")").css("display", "none") }), jQuery("." + e).first().trigger("change") } function p(e, n, a) { jQuery(e).on("input", function () { var e = jQuery(this).val(); "html" === a && jQuery(this).parent().find(n).html(e), "val" === a && jQuery(this).parent().find(n).val(e) }) } jQuery, jQuery.fn.toggleDisabled = function () { return this.each(function () { var e, n = jQuery(this), a = n.data("name"); n.attr("disabled") ? (n.prop("disabled", !1), e = "1") : (n.prop("disabled", !0), e = "0"), r(a, "active", e) }) }, jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="text"]').focusout(function () { var e = jQuery(this).data("name"), n = jQuery(this).val(); r(e, "url", n) }), jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="checkbox"]').click(function (e) { jQuery(this).siblings('input[type="text"]').toggleDisabled() }), jQuery(".cmp-coming-soon-maintenance .social-media i").click(function () { var e = jQuery(this).data("name"); jQuery(this).toggleClass("active"), jQuery(".cmp-coming-soon-maintenance .social-inputs li." + e).toggleClass("active"), jQuery(".cmp-coming-soon-maintenance .social-inputs li." + e + " input").trigger("change"), jQuery(this).hasClass("active") ? r(e, "hidden", "0") : r(e, "hidden", "1"), jQuery(".cmp-coming-soon-maintenance .social-media i.active").length ? jQuery(".social-inputs .label").css("display", "block") : jQuery(".cmp-coming-soon-maintenance .social-inputs .label").css("display", "none") }), jQuery(".cmp-coming-soon-maintenance .social-media i.active").length && jQuery(".cmp-coming-soon-maintenance .social-inputs .label").css("display", "block"), jQuery(".cmp.update-theme").click(function (e) { e.preventDefault(); var n = jQuery(this), a = n.parents(".notice"), t = n.data("security"), i = n.data("slug"), o = n.data("name"), r = { action: "cmp_theme_update_install", security: t, file: { name: i, tmp_name: "", url: jQuery(this).data("remote_url") + "?action=download&slug=" + i } }; a.find(".message").html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>'), jQuery.post(ajaxurl, r, function (e) { if ("success" == (e = e.trim())) setTimeout(function () { a.removeClass("notice-warning").addClass("notice-success"), a.find(".message").html("<span> " + o + ' CMP theme was updated sucessfully! You can enjoy latest features now :) </span><i class="far fa-smile" aria-hidden="true"></i>') }, 1500); else { e = e.slice(0, -1); var n = jQuery("p", jQuery(e)).text(); a.removeClass("notice-warning").addClass("notice-error"), a.find(".message").html('<i class="far fa-frown" aria-hidden="true"></i><span> ' + n + "</span>") } }) }), jQuery(".cmp-coming-soon-maintenance .theme-update.button").one("click", function (e) { e.preventDefault(); var n = jQuery(this), a = n.closest(".theme-wrapper"), t = a.data("security"), i = a.data("slug"), o = { action: "cmp_theme_update_install", security: t, file: { name: i, tmp_name: "", url: a.data("remote_url") + "?action=download&slug=" + i } }; n.html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'), jQuery.post(ajaxurl, o, function (e) { "success" == e ? setTimeout(function () { n.html('<i class="far fa-smile" aria-hidden="true"></i><span>Updated!</span>'), setTimeout(function () { n.fadeOut() }, 1500) }, 1500) : (e = e.slice(0, -1), n.html('<i class="far fa-frown" aria-hidden="true"></i><span>Update Failed!</span>')) }) }), jQuery(".cmp-coming-soon-maintenance .theme-details").click(function (e) { e.preventDefault(); var n = jQuery(this).closest(".theme-wrapper"), a = n.data("slug"), t = n.data("version"), i = n.data("type"), o = n.data("purchased"), r = 0, s = { action: "niteo_themeinfo", security: jQuery(".theme-wrapper").data("security"), theme_slug: jQuery(this).parents(".theme-wrapper").data("slug") }; jQuery.post(ajaxurl, s, function (e) { var s = "", c = ""; if ("true" == (e = jQuery.parseJSON(e)).result) { if (jQuery("body").addClass("modal-open"), "1" == o && (c = '<span class="theme-version">Installed version: ' + t + "</span>"), "1" != o && "premium" == i) s = '<button type="button" class="theme-purchase button hide"><a href="' + n.find(".cmp-purchase-theme").attr("href") + '" target="_blank"><i class="fas fa-cart-arrow-down" aria-hidden="true"></i>Get Theme</a></button>'; var l = e.screenshots, u = ""; Object.keys(l).length > 1 && (u = '<div class="screenshots-nav"><div class="left"><i class="fas fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fas fa-chevron-right" aria-hidden="true"></i></div></div>'); var m = jQuery(['<div class="theme-backdrop">', '\t<div class="theme-wrap">', '\t\t<div class="theme-header">', '\t\t\t<button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>', "\t\t</div>", '\t\t<div class="theme-about">', '\t\t\t<div class="theme-screenshots">', '\t\t\t\t<div class="screenshot" style="background-image:url(\'' + l[0] + "')\">" + u + "</div>", "\t\t\t</div>", '\t\t\t<div class="theme-info">', '\t\t\t\t<h2 class="theme-name">' + e.name + c + "</h2>", '\t\t\t\t<p class="theme-author">By <a href="' + e.author_homepage + '" target="_blank">' + e.author + "</a></p>", "", s, '\t\t\t\t<div class="theme-description">' + e.description + "</div>", "\t\t\t</div>", "\t\t</div>", '\t\t<div class="theme-actions">', '\t\t\t<a href="https://niteothemes.com/cmp-coming-soon-maintenance/?theme=' + a + "&utm_source=cmp&utm_medium=referral&utm_campaign=" + a + '" class="button cmp-preview" target="_blank" aria-label="Preview ' + e.name + '">Live Preview</a>', "\t\t</div>", "\t</div>", "</div>"].join("\n")); jQuery(".theme-overlay.cmp").append(m), jQuery(".theme-overlay.cmp .close").click(function (e) { e.preventDefault(), jQuery("body").removeClass("modal-open"), jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast") }), jQuery(".screenshots-nav .right").click(function () { ++r == Object.keys(l).length && (r = 0), r in l && jQuery(".screenshot").css("background-image", "url('" + l[r] + "')") }), jQuery(".screenshots-nav .left").click(function () { --r < 0 && (r = Object.keys(l).length - 1), r in l && jQuery(".screenshot").css("background-image", "url('" + l[r] + "')") }) } }) }), jQuery(".cmp-coming-soon-maintenance #connect-mailchimp").click(function (e) { e.preventDefault(); var n = jQuery('.cmp-coming-soon-maintenance input[name="niteoCS_mailchimp_apikey"]').val(), a = jQuery(this).data("security"), t = jQuery(this); if ("" != n) { var i = { apikey: n, security: a }; jQuery(this).prop("disabled", !0), jQuery(this).html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span> retrieving lists..</span>'); var o = { action: "cmp_mailchimp_list_ajax", security: a, params: i }; jQuery.post(ajaxurl, o, function (e) { var n = JSON.parse(e); 200 == n.response ? (jQuery("#niteoCS_mailchimp_list").empty().prop("disabled", !1), jQuery.each(n.lists, function (e, n) { jQuery("#niteoCS_mailchimp_list").append('<option value="' + n.id + '">' + n.name + "</option>") })) : jQuery("#niteoCS_mailchimp_list").empty().prop("disabled", !0).html('<option value="error">' + n.message + "</option>").trigger("change"), t.html("Retrieve Lists"), t.prop("disabled", !1) }).fail(function () { t.html("Retrieve Lists"), t.prop("disabled", !1) }) } }), jQuery(".cmp-coming-soon-maintenance .table-wrapper.theme-setup h4").each(function () { if ("Overlay Color" == jQuery(this).html()) return jQuery(this).parents("tr").remove(), !1 }), jQuery(".nav-tab-wrapper").on("click", ".theme-preview", function (e) { return !(jQuery("#csoptions fieldset:not(.skip-preview-validation *)").serialize() != t && !confirm("You have made changes that will not be visible in the preview until you save them. Please save changes first.\nContinue anyway?")) || (e.preventDefault(), !1) }) });
|
1 |
+
jQuery(document).ready(function(e){var n=document.location.hash.substring(1),a=jQuery("#csoptions").attr("action"),t=jQuery("#csoptions fieldset:not(.skip-preview-validation *)").serialize();wp.codeEditor&&jQuery("#niteoCS_custom_css").length&&wp.codeEditor.initialize("niteoCS_custom_css"),navtab=function(e){jQuery(".cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab").removeClass("nav-tab-active"),jQuery(".nav-tab-wrapper ."+e).addClass("nav-tab-active"),jQuery(".cmp-coming-soon-maintenance .table-wrapper."+e).css("display","block"),jQuery(".cmp-coming-soon-maintenance .table-wrapper-css."+e).css("display","block"),jQuery(".cmp-coming-soon-maintenance .comingsoon."+e).css("display","block"),jQuery(".cmp-coming-soon-maintenance .table-wrapper:not(."+e+")").css("display","none"),jQuery(".cmp-coming-soon-maintenance .table-wrapper-css:not(."+e).css("display","none"),jQuery(".cmp-coming-soon-maintenance .comingsoon:not(."+e+")").css("display","none"),"install"==e?(jQuery(".cmp-coming-soon-maintenance .submit").css("display","none"),jQuery(".cmp-coming-soon-maintenance #csoptions").attr("action",a)):(jQuery(".cmp-coming-soon-maintenance .submit").css("display","block"),jQuery(".cmp-coming-soon-maintenance #csoptions").attr("action",a+"#"+e))},""!=n?navtab(n):jQuery(".cmp-coming-soon-maintenance .table-wrapper-css").css("display","none"),window.onhashchange=function(){n=document.location.hash.substring(1),navtab(n)},jQuery(".cmp-coming-soon-maintenance .nav-tab:not(.theme-preview):not(.advanced)").click(function(e){e.preventDefault(),n=jQuery(this).data("tab"),document.location.hash=n}),p(".cmp-coming-soon-maintenance .blur-range","span","html"),p(".cmp-coming-soon-maintenance .background-overlay-opacity","span","html"),p("#logo_size_slider","#niteoCS_logo_size","val"),p("#niteoCS_logo_size","#logo_size_slider","val"),l("logo",!1,"image","img"),l("favicon",!1,"image","img"),l("seo_img",!1,"image","img"),l("images",!0,"image","img"),l("mobile-images",!0,"image","img"),l("pattern",!1,"image","background"),l("video-thumb",!1,"image","img"),l("video-local",!1,"video","video"),l("subs-img",!1,"image","img"),l("avatar",!1,"image","img"),l("gallery",!0,"image","img"),u("analytics"),u("contact-form"),u("subscribe"),u("background-effect"),u("special-effect"),u("cmp-logo"),u("background-type"),u("counter"),u("progress-bar"),u("overlay-text"),u("cmp-logo-size"),u("recaptcha-toggle"),u("login-icon"),u("custom-mobile-imgs"),u("lang-switcher"),m("counter-action"),m("subscribe-method"),m("background-overlay"),m("banner-video-source"),m("progress-bar-type"),jQuery(".cmp-coming-soon-maintenance select:not(.headings-google-font):not(.content-google-font )").select2({width:"100%",minimumResultsForSearch:-1,placeholder:"Click to select.."}),jQuery(".cmp-coming-soon-maintenance #cmp-status").click(function(){jQuery(".cmp-coming-soon-maintenance .cmp-status input[type=radio]").prop("disabled",function(e,n){return!n}),jQuery("#cmp-toggle-adminbar").toggleClass("status-1"),jQuery(".cmp-status-pages").fadeToggle()}),jQuery(".cmp-status-pages input[type=radio]").change(function(){jQuery(".cmp-status-pages input[type=radio]").parent().removeClass("active"),jQuery(this).parent().addClass("active")}),jQuery(".cmp-coming-soon-maintenance .cmp-status.switch:not(.disabled)").click(function(){if(0!=jQuery(".cmp-coming-soon-maintenance #cmp-status").prop("checked")){var e=jQuery(this).children("input");e.prop("checked",!0),jQuery(".cmp-coming-soon-maintenance .cmp-status.switch").removeClass("active"),jQuery(this).addClass("active"),e.trigger("change"),"3"==e.val()?jQuery(".cmp-coming-soon-maintenance .redirect-inputs").fadeIn("fast"):jQuery(".cmp-coming-soon-maintenance .redirect-inputs").fadeOut("fast")}}),jQuery(".cmp-coming-soon-maintenance .table-wrapper h3").click(function(){jQuery(this).parent().toggleClass("closed")}),jQuery(".cmp-coming-soon-maintenance #test-unsplash").click(function(e){e.preventDefault();var n=jQuery(".cmp-coming-soon-maintenance #unsplash-media"),a=jQuery('.cmp-coming-soon-maintenance .unsplash_banner select[name^="unsplash_feed"] option:selected').val(),t="",i=jQuery(this).data("security");if(0==a){switch(a){case"0":t=jQuery(".cmp-coming-soon-maintenance #niteoCS-unsplash-0").val()}if(3==a||""!=t){var o={feed:a,url:t,feat:"",custom_str:""};jQuery(this).prop("disabled",!0),jQuery(this).html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>');var r={action:"niteo_unsplash",security:i,params:o};jQuery.post(ajaxurl,r,function(e){var a=JSON.parse(e);jQuery("#unsplash_img").remove();var t=setTimeout(function(){jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Display Unsplash Photo"),jQuery("#unsplash-media").html('<p>It seems <a href="https://status.unsplash.com/" target="_blank">Unsplash API</a> is not responding. Please try again later.</p>')},5e3);if("200"==a.response){if((a=jQuery.parseJSON(a.body))[0])var i=a[0].urls.raw+"?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588",o=a[0].user.name,r=a[0].user.links.html,s=a[0].links.html,c=a[0].id;else i=a.urls.raw+"?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588",o=a.user.name,r=a.user.links.html,s=a.links.html,c=a.id;jQuery("<img />",{src:i,id:"unsplash_img"}).one("load",function(){jQuery(this).appendTo(n),jQuery(this).fadeIn(),jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Display Unsplash Photo"),jQuery(".unsplash-id").html('<a href="'+s+'" target="_blank">Photo</a> (ID: '+c+') by <a href="'+r+'" target="_blank">'+o+'</a> / <a href="https://unsplash.com/" target="_blank">Unsplash</a>'),jQuery(".blur-range").trigger("input"),clearTimeout(t)})}else jQuery(".cmp-coming-soon-maintenance #test-unsplash").prop("disabled",!1),jQuery(".cmp-coming-soon-maintenance #test-unsplash").text("Display Unsplash Photo"),jQuery(".cmp-coming-soon-maintenance #unsplash-media").html("<p>Error "+a.response+': <span style="text-transform:lowercase;">'+JSON.parse(a.body).errors+"</span></p>"),clearTimeout(t)})}else jQuery(".cmp-coming-soon-maintenance #unsplash_img").remove()}}),videoPreview=function(){if("5"==jQuery(".cmp-coming-soon-maintenance .background-type:checked").val()){var e=jQuery(".cmp-coming-soon-maintenance .banner-video-source").val();if("youtube"==e){var n=jQuery(".cmp-coming-soon-maintenance #niteoCS-youtube-url").val();if(""!=n){var a=n.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/);if(a&&11==a[7].length){jQuery(".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper").html("");var t="https://img.youtube.com/vi/"+a[7]+"/maxresdefault.jpg";jQuery(".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper").append('<img src="'+t+'" alt=""/>'),jQuery(".cmp-coming-soon-maintenance .blur-range").trigger("input")}else jQuery(".cmp-coming-soon-maintenance .video-yt-wrapper .video-yt-thumb-wrapper").html("")}}if("local"==e){var i=jQuery("#niteoCS-video-local-id").data("url");""!=i&&jQuery(".cmp-coming-soon-maintenance .video-local-wrapper").html('<video width="600" height="400" controls><source src="'+i+'" type="video/mp4">Your browser does not support the video tag.</video>')}}},videoPreview(),jQuery(".cmp-coming-soon-maintenance .background-type").on("change",function(){videoPreview()}),jQuery(".cmp-coming-soon-maintenance #niteoCS-youtube-url").on("keyup",function(){videoPreview()}),jQuery(".cmp-coming-soon-maintenance .banner-video-source").on("change",function(){videoPreview()});var i=jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val();function o(e){switch(e){case"solid-color":jQuery(".thumbnail-overlay").css("background",jQuery("#niteoCS_overlay_color").val());break;case"gradient":jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").trigger("change");break;case"disabled":jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css("background","none")}}jQuery(".unsplash-feed-"+i).css("display","block"),jQuery('.unsplash_banner select[name^="unsplash_feed"]').on("change",function(){i=jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val(),jQuery(".unsplash-feed").css("display","none"),jQuery(".unsplash-feed-"+i).css("display","block"),jQuery("#test-unsplash").trigger("click")}),1==jQuery("#csoptions .niteoCS_banner:checked").val()&&jQuery("#test-unsplash").trigger("click"),jQuery(".cmp-coming-soon-maintenance select.background-gradient").on("change",function(){var e=jQuery(".cmp-coming-soon-maintenance select.background-gradient option:selected").val();"custom"==e?(jQuery(".cmp-coming-soon-maintenance .custom-gradient").css("display","block"),jQuery(".cmp-coming-soon-maintenance .gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"linear-gradient(135deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)"})):(colors=e.split(":"),jQuery(".cmp-coming-soon-maintenance .custom-gradient").css("display","none"),jQuery(".cmp-coming-soon-maintenance .gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+colors[0]+" 0%, "+colors[1]+" 100%)",background:"-webkit-linear-gradient(-45deg, "+colors[0]+" 0%, "+colors[1]+" 100%)",background:"linear-gradient(135deg, "+colors[0]+" 0%, "+colors[1]+" 100%)"}))}).trigger("change"),jQuery(".cmp-coming-soon-maintenance #niteoCS_banner_color").wpColorPicker({change:function(e,n){jQuery(".color-preview").css("background-color",n.color.toString())}}),jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_one").wpColorPicker({change:function(e,n){jQuery(".gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+n.color.toString()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+n.color.toString()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"linear-gradient(135deg, "+n.color.toString()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)"})}}),jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_two").wpColorPicker({change:function(e,n){jQuery(".gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+n.color.toString()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+n.color.toString()+" 100%)",background:"linear-gradient(135deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+n.color.toString()+" 100%)"})}}),jQuery(".cmp-coming-soon-maintenance #niteoCS_overlay_color").wpColorPicker({change:function(e,n){jQuery(".thumbnail-overlay").css("background",n.color.toString())}}),jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css("background",jQuery("#niteoCS_overlay_color").val()),jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").on("change",function(){var e=jQuery("select.overlay-gradient option:selected").val();if("custom"==e){jQuery(".cmp-coming-soon-maintenance .custom-overlay-gradient").css("display","block");var n=jQuery("#niteoCS_overlay_gradient_one").val(),a=jQuery("#niteoCS_overlay_gradient_two").val();jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css({background:"-moz-linear-gradient(-45deg, "+n+" 0%, "+a+" 100%)",background:"-webkit-linear-gradient(-45deg, "+n+" 0%, "+a+" 100%)",background:"linear-gradient(135deg, "+n+" 0%, "+a+" 100%)"})}else colors=e.split(":"),jQuery(".cmp-coming-soon-maintenance .custom-overlay-gradient").css("display","none"),jQuery(".cmp-coming-soon-maintenance .thumbnail-overlay").css({background:"-moz-linear-gradient(-45deg, "+colors[0]+" 0%, "+colors[1]+" 100%)",background:"-webkit-linear-gradient(-45deg, "+colors[0]+" 0%, "+colors[1]+" 100%)",background:"linear-gradient(135deg, "+colors[0]+" 0%, "+colors[1]+" 100%)"})}),jQuery("#niteoCS_overlay_gradient_one").wpColorPicker({change:function(e,n){jQuery(".thumbnail-overlay").css({background:"-moz-linear-gradient(-45deg, "+n.color.toString()+" 0%, "+jQuery("#niteoCS_overlay_gradient_two").val()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+n.color.toString()+" 0%, "+jQuery("#niteoCS_overlay_gradient_two").val()+" 100%)",background:"linear-gradient(135deg, "+n.color.toString()+" 0%, "+jQuery("#niteoCS_overlay_gradient_two").val()+" 100%)"})}}),jQuery("#niteoCS_overlay_gradient_two").wpColorPicker({change:function(e,n){jQuery(".thumbnail-overlay").css({background:"-moz-linear-gradient(-45deg, "+jQuery("#niteoCS_overlay_gradient_one").val()+" 0%, "+n.color.toString()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+jQuery("#niteoCS_overlay_gradient_one").val()+" 0%, "+n.color.toString()+" 100%)",background:"linear-gradient(135deg, "+jQuery("#niteoCS_overlay_gradient_one").val()+" 0%, "+n.color.toString()+" 100%)"})}}),jQuery(".background-overlay-opacity").on("input",function(){var e=jQuery(this).val();jQuery(".thumbnail-overlay").css("opacity",e)}).trigger("input"),o(jQuery(".cmp-coming-soon-maintenance .background-overlay").val()),jQuery(".cmp-coming-soon-maintenance .background-overlay").on("change",function(){o(jQuery(this).val())}),jQuery(".cmp-coming-soon-maintenance .blur-range").on("input",function(){var e=jQuery(this).val();jQuery(".cmp-coming-soon-maintenance .background-thumb-wrapper img:not(.no-blur)").css("filter","blur("+e+"px)")}).trigger("input"),jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"]').on("change",function(){var e=jQuery('.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"] option:selected').val();if("custom"!=e){var n=jQuery(this).data("url");jQuery(".cmp-coming-soon-maintenance #add-pattern").css("display","none"),jQuery(".cmp-coming-soon-maintenance .pattern-wrapper").css("background-image","url('"+n+e+".png')")}else{n=jQuery(".cmp-coming-soon-maintenance #niteoCS_banner_pattern_custom").val();jQuery(".cmp-coming-soon-maintenance #add-pattern").css("display","block"),jQuery(".cmp-coming-soon-maintenance .pattern-wrapper").css("background-image","url('"+n+"')")}}),jQuery(".cmp-coming-soon-maintenance .heading-animation").on("change",function(){heading_anim=jQuery(".cmp-coming-soon-maintenance .heading-animation option:selected").val(),jQuery(".cmp-coming-soon-maintenance #heading-example").removeClass().addClass("animated "+heading_anim)}),jQuery(".cmp-coming-soon-maintenance .content-animation").on("change",function(){heading_anim=jQuery(".cmp-coming-soon-maintenance .content-animation option:selected").val(),jQuery(".cmp-coming-soon-maintenance #content-example").removeClass().addClass("animated "+heading_anim)});var r=function(e,n,a){var t=jQuery(".cmp-coming-soon-maintenance #niteoCS_socialmedia").attr("value");t=jQuery.parseJSON(t),jQuery.each(t,function(t,i){i.name==e&&(i[n]=a)}),jQuery(".cmp-coming-soon-maintenance #niteoCS_socialmedia").attr("value",JSON.stringify(t))};if(!/Mobi/.test(navigator.userAgent)){var s=jQuery(".cmp-coming-soon-maintenance .social-inputs"),c=function(e,n){var a=s.find('input[type="text"]');n.item.index();a.each(function(e,n){var a=jQuery(n).data("name");r(a,"order",e)})};s.sortable({stop:c}),s.on("sortchange",c)}function l(e,n,a,t){var i,o=jQuery("."+e+"-wrapper"),r=jQuery("#add-"+e),s=jQuery("#delete-"+e),c="",l=e.replace("-"," ");l=l[0].toUpperCase()+l.slice(1),""!=jQuery("#niteoCS-"+e+"-id").val()&&s.css("display","block"),r.click(function(r){if(r.preventDefault(),u)u.open();else var u=wp.media({title:"Select "+l,button:{text:"Insert "+l},multiple:n,library:{type:[a]}}).on("select",function(){var n=u.state().get("selection").toJSON();n.length>0&&(o.find("img").remove(),o.attr("class",e+"-wrapper custom-gallery"),o.addClass("gallery-"+n.length),jQuery(n).each(function(a){switch(i=n[a].sizes&&n[a].sizes.large?n[a].sizes.large.url:n[a].url,c+=(0===a?"":",")+n[a].id,t){case"video":o.append('<video width="600" height="400" controls><source src="'+i+'" type="video/mp4">Your browser does not support the video tag.</video>');break;case"background":o.css("background-image","url('"+i+"')");break;case"img":default:n.length>1&&0==a&&jQuery("."+e+"-wrapper .big-thumb").length?jQuery("."+e+"-wrapper .big-thumb").append('<img src="'+i+'" alt=""/>'):n.length>1&&0!==a?o.append('<img src="'+i+'" alt="" class="no-blur"/>'):o.find(".big-thumb").length?jQuery("."+e+"-wrapper .big-thumb").append('<img src="'+i+'" alt=""/>'):o.append('<img src="'+i+'" alt=""/>'),jQuery(".blur-range").trigger("input")}}),s.css("display","block")),jQuery("#niteoCS-"+e+"-id").val(c).trigger("change")}).open()}),s.click(function(n){jQuery(this).css("display","none"),o.find("img").remove(),jQuery("#niteoCS-"+e+"-id").val(""),jQuery("#niteoCS-"+e+"-id").trigger("change")})}function u(e){jQuery(".cmp-coming-soon-maintenance ."+e).change(function(){var n=jQuery(".cmp-coming-soon-maintenance ."+e+":checked").val();n=void 0===(n=jQuery.isNumeric(n)?"x"+n:n)?"off":n,jQuery(".cmp-coming-soon-maintenance ."+e+"-switch."+n).css("display","block"),jQuery(".cmp-coming-soon-maintenance ."+e+"-switch:not(."+n+")").css("display","none")}),jQuery(".cmp-coming-soon-maintenance ."+e).first().trigger("change")}function m(e){jQuery(".cmp-coming-soon-maintenance ."+e).change(function(){var n=jQuery("."+e).val();n=jQuery.isNumeric(n)?"x"+n:n,jQuery(".cmp-coming-soon-maintenance ."+e+"."+n).css("display","block"),jQuery(".cmp-coming-soon-maintenance ."+e+":not(."+n+")").css("display","none")}),jQuery("."+e).first().trigger("change")}function p(e,n,a){jQuery(e).on("input",function(){var e=jQuery(this).val();"html"===a&&jQuery(this).parent().find(n).html(e),"val"===a&&jQuery(this).parent().find(n).val(e)})}jQuery,jQuery.fn.toggleDisabled=function(){return this.each(function(){var e,n=jQuery(this),a=n.data("name");n.attr("disabled")?(n.prop("disabled",!1),e="1"):(n.prop("disabled",!0),e="0"),r(a,"active",e)})},jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="text"]').focusout(function(){var e=jQuery(this).data("name"),n=jQuery(this).val();r(e,"url",n)}),jQuery('.cmp-coming-soon-maintenance .social-inputs input[type="checkbox"]').click(function(e){jQuery(this).siblings('input[type="text"]').toggleDisabled()}),jQuery(".cmp-coming-soon-maintenance .social-media i").click(function(){var e=jQuery(this).data("name");jQuery(this).toggleClass("active"),jQuery(".cmp-coming-soon-maintenance .social-inputs li."+e).toggleClass("active"),jQuery(".cmp-coming-soon-maintenance .social-inputs li."+e+" input").trigger("change"),jQuery(this).hasClass("active")?r(e,"hidden","0"):r(e,"hidden","1"),jQuery(".cmp-coming-soon-maintenance .social-media i.active").length?jQuery(".social-inputs .label").css("display","block"):jQuery(".cmp-coming-soon-maintenance .social-inputs .label").css("display","none")}),jQuery(".cmp-coming-soon-maintenance .social-media i.active").length&&jQuery(".cmp-coming-soon-maintenance .social-inputs .label").css("display","block"),jQuery(".cmp.update-theme").click(function(e){e.preventDefault();var n=jQuery(this),a=n.parents(".notice"),t=n.data("security"),i=n.data("slug"),o=n.data("name"),r={action:"cmp_theme_update_install",security:t,file:{name:i,tmp_name:"",url:jQuery(this).data("remote_url")+"?action=download&slug="+i}};a.find(".message").html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>'),jQuery.post(ajaxurl,r,function(e){if("success"==(e=e.trim()))setTimeout(function(){a.removeClass("notice-warning").addClass("notice-success"),a.find(".message").html("<span> "+o+' CMP theme was updated sucessfully! You can enjoy latest features now :) </span><i class="far fa-smile" aria-hidden="true"></i>')},1500);else{e=e.slice(0,-1);var n=jQuery("p",jQuery(e)).text();a.removeClass("notice-warning").addClass("notice-error"),a.find(".message").html('<i class="far fa-frown" aria-hidden="true"></i><span> '+n+"</span>")}})}),jQuery(".cmp-coming-soon-maintenance .theme-update.button").one("click",function(e){e.preventDefault();var n=jQuery(this),a=n.closest(".theme-wrapper"),t=a.data("security"),i=a.data("slug"),o={action:"cmp_theme_update_install",security:t,file:{name:i,tmp_name:"",url:a.data("remote_url")+"?action=download&slug="+i}};n.html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'),jQuery.post(ajaxurl,o,function(e){"success"==e?setTimeout(function(){n.html('<i class="far fa-smile" aria-hidden="true"></i><span>Updated!</span>'),setTimeout(function(){n.fadeOut()},1500)},1500):(e=e.slice(0,-1),n.html('<i class="far fa-frown" aria-hidden="true"></i><span>Update Failed!</span>'))})}),jQuery(".cmp-coming-soon-maintenance .theme-details").click(function(e){e.preventDefault();var n=jQuery(this).closest(".theme-wrapper"),a=n.data("slug"),t=n.data("version"),i=n.data("type"),o=n.data("purchased"),r=0,s={action:"niteo_themeinfo",security:jQuery(".theme-wrapper").data("security"),theme_slug:jQuery(this).parents(".theme-wrapper").data("slug")};jQuery.post(ajaxurl,s,function(e){var s="",c="";if("true"==(e=jQuery.parseJSON(e)).result){if(jQuery("body").addClass("modal-open"),"1"==o&&(c='<span class="theme-version">Installed version: '+t+"</span>"),"1"!=o&&"premium"==i)s='<button type="button" class="theme-purchase button hide"><a href="'+n.find(".cmp-purchase-theme").attr("href")+'" target="_blank"><i class="fas fa-cart-arrow-down" aria-hidden="true"></i>Get Theme</a></button>';var l=e.screenshots,u="";Object.keys(l).length>1&&(u='<div class="screenshots-nav"><div class="left"><i class="fas fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fas fa-chevron-right" aria-hidden="true"></i></div></div>');var m=jQuery(['<div class="theme-backdrop">','\t<div class="theme-wrap">','\t\t<div class="theme-header">','\t\t\t<button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',"\t\t</div>",'\t\t<div class="theme-about">','\t\t\t<div class="theme-screenshots">','\t\t\t\t<div class="screenshot" style="background-image:url(\''+l[0]+"')\">"+u+"</div>","\t\t\t</div>",'\t\t\t<div class="theme-info">','\t\t\t\t<h2 class="theme-name">'+e.name+c+"</h2>",'\t\t\t\t<p class="theme-author">By <a href="'+e.author_homepage+'" target="_blank">'+e.author+"</a></p>","",s,'\t\t\t\t<div class="theme-description">'+e.description+"</div>","\t\t\t</div>","\t\t</div>",'\t\t<div class="theme-actions">','\t\t\t<a href="https://niteothemes.com/cmp-coming-soon-maintenance/?theme='+a+"&utm_source=cmp&utm_medium=referral&utm_campaign="+a+'" class="button cmp-preview" target="_blank" aria-label="Preview '+e.name+'">Live Preview</a>',"\t\t</div>","\t</div>","</div>"].join("\n"));jQuery(".theme-overlay.cmp").append(m),jQuery(".theme-overlay.cmp .close").click(function(e){e.preventDefault(),jQuery("body").removeClass("modal-open"),jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast")}),jQuery(".screenshots-nav .right").click(function(){++r==Object.keys(l).length&&(r=0),r in l&&jQuery(".screenshot").css("background-image","url('"+l[r]+"')")}),jQuery(".screenshots-nav .left").click(function(){--r<0&&(r=Object.keys(l).length-1),r in l&&jQuery(".screenshot").css("background-image","url('"+l[r]+"')")})}})}),jQuery(".cmp-coming-soon-maintenance #connect-mailchimp").click(function(e){e.preventDefault();var n=jQuery('.cmp-coming-soon-maintenance input[name="niteoCS_mailchimp_apikey"]').val(),a=jQuery(this).data("security"),t=jQuery(this);if(""!=n){var i={apikey:n,security:a};jQuery(this).prop("disabled",!0),jQuery(this).html('<i class="fas fa-cog fa-spin fa-1x fa-fw"></i><span> retrieving lists..</span>');var o={action:"cmp_mailchimp_list_ajax",security:a,params:i};jQuery.post(ajaxurl,o,function(e){var n=JSON.parse(e);200==n.response?(jQuery("#niteoCS_mailchimp_list").empty().prop("disabled",!1),jQuery.each(n.lists,function(e,n){jQuery("#niteoCS_mailchimp_list").append('<option value="'+n.id+'">'+n.name+"</option>")})):jQuery("#niteoCS_mailchimp_list").empty().prop("disabled",!0).html('<option value="error">'+n.message+"</option>").trigger("change"),t.html("Retrieve Lists"),t.prop("disabled",!1)}).fail(function(){t.html("Retrieve Lists"),t.prop("disabled",!1)})}}),jQuery(".cmp-coming-soon-maintenance .table-wrapper.theme-setup h4").each(function(){if("Overlay Color"==jQuery(this).html())return jQuery(this).parents("tr").remove(),!1}),jQuery(".nav-tab-wrapper").on("click",".theme-preview",function(e){return!(jQuery("#csoptions fieldset:not(.skip-preview-validation *)").serialize()!=t&&!confirm("You have made changes that will not be visible in the preview until you save them. Please save changes first.\nContinue anyway?"))||(e.preventDefault(),!1)})});
|
niteo-cmp.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: CMP - Coming Soon & Maintenance Plugin
|
4 |
Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
|
5 |
Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
|
6 |
-
Version: 3.9.
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
@@ -63,7 +63,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
63 |
|
64 |
// define constants
|
65 |
private function constants() {
|
66 |
-
$this->define( 'CMP_VERSION', '3.9.
|
67 |
$this->define( 'CMP_DEBUG', FALSE );
|
68 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
69 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
@@ -455,6 +455,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
455 |
public function cmp_premium_themes() {
|
456 |
|
457 |
$premium_themes = array();
|
|
|
458 |
array_push( $premium_themes, array('name' => 'scout', 'url' => 'https://niteothemes.com/downloads/cmp-scout-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=scout', 'price' => '10') );
|
459 |
array_push( $premium_themes, array('name' => 'atlas', 'url' => 'https://niteothemes.com/downloads/cmp-atlas-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=atlas', 'price' => '12') );
|
460 |
array_push( $premium_themes, array('name' => 'mosaic', 'url' => 'https://niteothemes.com/downloads/cmp-mosaic-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=mosaic', 'price' => '10') );
|
3 |
Plugin Name: CMP - Coming Soon & Maintenance Plugin
|
4 |
Plugin URI: https://wordpress.org/plugins/cmp-coming-soon-maintenance/
|
5 |
Description: Display customizable landing page for Coming Soon, Maintenance & Under Construction page.
|
6 |
+
Version: 3.9.3
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
63 |
|
64 |
// define constants
|
65 |
private function constants() {
|
66 |
+
$this->define( 'CMP_VERSION', '3.9.3' );
|
67 |
$this->define( 'CMP_DEBUG', FALSE );
|
68 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
69 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
455 |
public function cmp_premium_themes() {
|
456 |
|
457 |
$premium_themes = array();
|
458 |
+
array_push( $premium_themes, array('name' => 'saturn', 'url' => 'https://niteothemes.com/downloads/cmp-saturn-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=saturn', 'price' => '12') );
|
459 |
array_push( $premium_themes, array('name' => 'scout', 'url' => 'https://niteothemes.com/downloads/cmp-scout-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=scout', 'price' => '10') );
|
460 |
array_push( $premium_themes, array('name' => 'atlas', 'url' => 'https://niteothemes.com/downloads/cmp-atlas-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=atlas', 'price' => '12') );
|
461 |
array_push( $premium_themes, array('name' => 'mosaic', 'url' => 'https://niteothemes.com/downloads/cmp-mosaic-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=mosaic', 'price' => '10') );
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: coming soon, coming soon page, launch page, maintenance mode, under constr
|
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.6
|
8 |
-
Stable tag: 3.9.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -159,6 +159,12 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
|
|
159 |
<h4>I really love your plugin and I want to support it!</h4>
|
160 |
<p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
== Changelog ==
|
163 |
<h4>CMP 3.9.2 - 28-Nov-20</h4>
|
164 |
<ul>
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.6
|
8 |
+
Stable tag: 3.9.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
159 |
<h4>I really love your plugin and I want to support it!</h4>
|
160 |
<p>Nothing is better than a good feedback! Please go to <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/">Plugin reviews</a> and rate it! Alternatively you can click on a Donate button too!:)</p>
|
161 |
|
162 |
+
== Changelog ==
|
163 |
+
<h4>CMP 3.9.3 - 17-Dec-20</h4>
|
164 |
+
<ul>
|
165 |
+
<li>New CMP Theme: Saturn</li>
|
166 |
+
</ul>
|
167 |
+
|
168 |
== Changelog ==
|
169 |
<h4>CMP 3.9.2 - 28-Nov-20</h4>
|
170 |
<ul>
|
themes/saturn.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Theme Name: Saturn
|
3 |
+
Description: <p>CMP Saturn is designed as a coming soon and a maintenance page for your website. Main aspect of the template are the three photos floating thumbnails. If you are a manufacturer of products, you own an e-shop, you are a designer or a photographer, this template is exactly for you. Add a profile photo, your logo, title, information, social icons and a modern "floating" gallery.</p><h4>Main Features</h4><ul><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Avatar and custom Info</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Custom Floating Gallery</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Custom Logo</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Custom Content</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Graphic Background including videos</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Countdown Timer</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Subscribe Form</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Social Media</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Custom Colors</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Custom Fonts</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Background Blur Effect</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Fade in/out Text Effects</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Background Special Effects</li><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Responsive Design</li><li class="not-supported"><i class="fas fa-times" aria-hidden="true"></i> Graphic Image Slider</li></ul>
|