Version Description
Download this release
Release Info
Developer | niteo |
Plugin | CMP – Coming Soon & Maintenance Plugin by NiteoThemes |
Version | 3.8.8 |
Comparing to | |
See all releases |
Code changes from version 3.8.7 to 3.8.8
- cmp-settings.php +8 -1
- cmp-sidebar.php +6 -0
- img/clp-banner.jpg +0 -0
- img/thumbnails/divi_thumbnail.jpg +0 -0
- img/thumbnails/scout/screenshot1.jpg +0 -0
- img/thumbnails/scout/screenshot2.jpg +0 -0
- img/thumbnails/scout/screenshot3.jpg +0 -0
- img/thumbnails/scout_thumbnail.jpg +0 -0
- inc/class-cmp-render_html.php +17 -0
- inc/cmp-update-process.php +132 -120
- inc/render/custom-css.php +15 -0
- inc/render/progress-bar.php +48 -0
- inc/render/subscribe-form.php +22 -21
- inc/settings/settings-progress-bar.php +141 -0
- js/settings.js +2 -0
- js/settings.min.js +1 -1
- niteo-cmp.php +21 -11
- readme.txt +6 -1
- themes/scout.txt +3 -0
cmp-settings.php
CHANGED
@@ -700,9 +700,16 @@ add_thickbox();
|
|
700 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-counter-disabled.php') ) {
|
701 |
require (dirname(__FILE__) . '/inc/settings/settings-counter-disabled.php');
|
702 |
}
|
703 |
-
|
704 |
}
|
705 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
706 |
// get subscribe settings
|
707 |
if ( isset( $theme_supports['subscribe'] ) && $theme_supports['subscribe'] ) {
|
708 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-subscribe.php') ) {
|
700 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-counter-disabled.php') ) {
|
701 |
require (dirname(__FILE__) . '/inc/settings/settings-counter-disabled.php');
|
702 |
}
|
|
|
703 |
}
|
704 |
|
705 |
+
// progress bar
|
706 |
+
if ( isset( $theme_supports['progress_bar'] ) && $theme_supports['progress_bar'] ) {
|
707 |
+
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-progress-bar.php') ) {
|
708 |
+
require (dirname(__FILE__) . '/inc/settings/settings-progress-bar.php');
|
709 |
+
}
|
710 |
+
|
711 |
+
}
|
712 |
+
|
713 |
// get subscribe settings
|
714 |
if ( isset( $theme_supports['subscribe'] ) && $theme_supports['subscribe'] ) {
|
715 |
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-subscribe.php') ) {
|
cmp-sidebar.php
CHANGED
@@ -31,6 +31,12 @@ if ( !file_exists( CMP_PLUGIN_DIR . 'img/thumbnails/'. $slug . '_thumbnail.jpg'
|
|
31 |
</form>
|
32 |
</div>
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<div class="cmp-rate-us widget">
|
35 |
<h3 class="cmp-rate-us title"><?php _e('Thank you for rating us with five stars!', 'cmp-coming-soon-maintenance');?></h3>
|
36 |
<p><?php echo sprintf(__('If you find our CMP plugin useful, please show us some love and give 5%s feedback by pressing button below.', 'cmp-coming-soon-maintenance'), '<i class="fas fa-star" aria-hidden="true"></i>');?></p>
|
31 |
</form>
|
32 |
</div>
|
33 |
|
34 |
+
<div class="clp-widget widget" style="padding: 0;">
|
35 |
+
<h3 ><?php _e('Check out our other plugins!', 'cmp-coming-soon-maintenance');?></h3>
|
36 |
+
<a href="https://wordpress.org/plugins/clp-custom-login-page/" target="_blank"><img src="<?php echo plugins_url('/img/clp-banner.jpg', __FILE__);?>" alt="CLP - Custom Login Page" style="max-width:100%;vertical-align:top"></a>
|
37 |
+
<p><a href="https://wordpress.org/plugins/clp-custom-login-page/" target="_blank" style="text-decoration:none">CLP - Custom Login Page</a> - <?php _e('Awesome plugin to customize WordPress Login Page!', 'cmp-coming-soon-maintenance');?></p>
|
38 |
+
</div>
|
39 |
+
|
40 |
<div class="cmp-rate-us widget">
|
41 |
<h3 class="cmp-rate-us title"><?php _e('Thank you for rating us with five stars!', 'cmp-coming-soon-maintenance');?></h3>
|
42 |
<p><?php echo sprintf(__('If you find our CMP plugin useful, please show us some love and give 5%s feedback by pressing button below.', 'cmp-coming-soon-maintenance'), '<i class="fas fa-star" aria-hidden="true"></i>');?></p>
|
img/clp-banner.jpg
ADDED
Binary file
|
img/thumbnails/divi_thumbnail.jpg
CHANGED
Binary file
|
img/thumbnails/scout/screenshot1.jpg
ADDED
Binary file
|
img/thumbnails/scout/screenshot2.jpg
ADDED
Binary file
|
img/thumbnails/scout/screenshot3.jpg
ADDED
Binary file
|
img/thumbnails/scout_thumbnail.jpg
ADDED
Binary file
|
inc/class-cmp-render_html.php
CHANGED
@@ -425,6 +425,22 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
|
|
425 |
}
|
426 |
}
|
427 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
/**
|
429 |
* Helper function to return subscribe type
|
430 |
*
|
@@ -460,5 +476,6 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
|
|
460 |
|
461 |
return false;
|
462 |
}
|
|
|
463 |
|
464 |
}
|
425 |
}
|
426 |
}
|
427 |
|
428 |
+
/**
|
429 |
+
* render progress bar
|
430 |
+
*
|
431 |
+
* @since 3.8.8
|
432 |
+
* @return html
|
433 |
+
**/
|
434 |
+
public function cmp_render_progress_bar( $timeout = 0, $wrapper_class = '' ) {
|
435 |
+
if ( get_option('niteoCS_progress_bar', '1') !== '1' ) {
|
436 |
+
return '';
|
437 |
+
}
|
438 |
+
|
439 |
+
include dirname( __FILE__) . '/render/progress-bar.php';
|
440 |
+
|
441 |
+
return $html;
|
442 |
+
}
|
443 |
+
|
444 |
/**
|
445 |
* Helper function to return subscribe type
|
446 |
*
|
476 |
|
477 |
return false;
|
478 |
}
|
479 |
+
|
480 |
|
481 |
}
|
inc/cmp-update-process.php
CHANGED
@@ -7,34 +7,135 @@ if ( !get_option( 'niteoCS_version' ) ) {
|
|
7 |
update_option( 'niteoCS_version', CMP_VERSION );
|
8 |
}
|
9 |
|
10 |
-
|
11 |
|
12 |
-
$current_theme = get_option('niteoCS_theme', 'countdown');
|
13 |
-
|
14 |
-
$premium_themes = $this->cmp_premium_themes_installed();
|
15 |
|
|
|
|
|
|
|
16 |
// delete transients for theme updates, to ensure the updates for latest cmp versions runs again
|
17 |
foreach ( $premium_themes as $theme_slug ) {
|
18 |
delete_transient( $theme_slug.'_updatecheck' );
|
19 |
}
|
20 |
|
21 |
-
//
|
22 |
-
if (
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
update_option('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
}
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
if ( get_option('niteoCS_socialmedia') ) {
|
39 |
$niteoCS_socialmedia = stripslashes( get_option('niteoCS_socialmedia') );
|
40 |
$socialmedia = json_decode( $niteoCS_socialmedia, true );
|
@@ -157,116 +258,27 @@ if ( version_compare( get_option('niteoCS_version'), CMP_VERSION ) < 0 ) {
|
|
157 |
}
|
158 |
}
|
159 |
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
foreach( $
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
update_option('niteoCS_subscribers_list', $subscribe_list);
|
176 |
-
}
|
177 |
-
}
|
178 |
-
|
179 |
-
// migrate overlay color and opacity settings after update 2.8
|
180 |
-
$overlay_color = get_option('niteoCS_overlay_color['.$current_theme.']');
|
181 |
-
$overlay_opacity = get_option('niteoCS_overlay_opacity['.$current_theme.']');
|
182 |
-
|
183 |
-
if ( $overlay_color ) {
|
184 |
-
update_option( 'niteoCS_overlay['.$current_theme.']', 'color' );
|
185 |
-
update_option( 'niteoCS_overlay['.$current_theme.'][color]', $overlay_color );
|
186 |
-
delete_option('niteoCS_overlay_color['.$current_theme.']');
|
187 |
-
}
|
188 |
-
|
189 |
-
if ( $overlay_opacity ) {
|
190 |
-
update_option( 'niteoCS_overlay['.$current_theme.'][opacity]', $overlay_opacity );
|
191 |
-
delete_option('niteoCS_overlay_opacity['.$current_theme.']');
|
192 |
-
}
|
193 |
-
|
194 |
-
// 2.9.3 version - migrate logo per theme settings to only one settings for all themes
|
195 |
-
$logo_type = get_option('niteoCS_logo_type['.$current_theme.']');
|
196 |
-
$niteoCS_logo_id = get_option('niteoCS_logo_id['.$current_theme.']');
|
197 |
-
$niteoCS_text_logo = get_option('niteoCS_text_logo['.$current_theme.']');
|
198 |
-
|
199 |
-
if ( $logo_type ) {
|
200 |
-
update_option( 'niteoCS_logo_type', $logo_type );
|
201 |
-
delete_option('niteoCS_logo_type['.$current_theme.']');
|
202 |
-
}
|
203 |
-
|
204 |
-
if ( $niteoCS_logo_id ) {
|
205 |
-
update_option( 'niteoCS_logo_id', $niteoCS_logo_id );
|
206 |
-
delete_option('niteoCS_logo_id['.$current_theme.']');
|
207 |
-
}
|
208 |
-
|
209 |
-
if ( $niteoCS_text_logo ) {
|
210 |
-
update_option( 'niteoCS_text_logo', $niteoCS_text_logo );
|
211 |
-
delete_option('niteoCS_text_logo['.$current_theme.']');
|
212 |
-
}
|
213 |
-
|
214 |
-
// 2.9.5 update - migrate graphic background to indepenedent theme settings
|
215 |
-
$settings = array( 'niteoCS_banner['.$current_theme.']', 'niteoCS_banner_id['.$current_theme.']', 'niteoCS_unsplash_feed['.$current_theme.']', 'niteoCS_unsplash_0['.$current_theme.']', 'niteoCS_unsplash_2['.$current_theme.']', 'niteoCS_unsplash_3['.$current_theme.']', 'niteoCS_unsplash_1['.$current_theme.']', 'niteoCS_banner_video['.$current_theme.']', 'niteoCS_youtube_url['.$current_theme.']', 'niteoCS_vimeo_url['.$current_theme.']', 'niteoCS_video_file_url['.$current_theme.']', 'niteoCS_video_thumb['.$current_theme.']', 'niteoCS_banner_pattern['.$current_theme.']', 'niteoCS_banner_pattern_custom['.$current_theme.']', 'niteoCS_banner_color['.$current_theme.']', 'niteoCS_gradient['.$current_theme.']', 'niteoCS_banner_gradient_one['.$current_theme.']', 'niteoCS_banner_gradient_two['.$current_theme.']', 'niteoCS_effect_blur['.$current_theme.']', 'niteoCS_overlay['.$current_theme.']', 'niteoCS_overlay['.$current_theme.'][color]', 'niteoCS_overlay['.$current_theme.'][gradient]', 'niteoCS_overlay['.$current_theme.'][gradient_one]', 'niteoCS_overlay['.$current_theme.'][gradient_two]', 'niteoCS_overlay['.$current_theme.'][opacity]', 'niteoCS_banner['.$current_theme.']', 'niteoCS_slider_count['.$current_theme.']', 'niteoCS_slider_effect['.$current_theme.']', 'niteoCS_slider_auto['.$current_theme.']', 'niteoCS_special_effect['.$current_theme.']', 'niteoCS_special_effect['.$current_theme.'][constellation][color]' );
|
216 |
-
|
217 |
-
foreach ( $settings as $name ) {
|
218 |
-
$value = get_option( $name );
|
219 |
-
if ( $value !== false ) {
|
220 |
-
$new_settings = str_replace('['.$current_theme.']', '', $name);
|
221 |
-
update_option( $new_settings, $value );
|
222 |
-
if ( $name != 'niteoCS_banner['.$current_theme.']' ) {
|
223 |
-
delete_option( $name );
|
224 |
-
}
|
225 |
-
}
|
226 |
-
}
|
227 |
-
|
228 |
-
// update CMP activation status from false to 0 after update 3.1.2
|
229 |
-
if ( get_option('niteoCS_status') == false ) {
|
230 |
-
update_option('niteoCS_status', '0');
|
231 |
-
}
|
232 |
-
|
233 |
-
|
234 |
-
$translation = json_decode( get_option('niteoCS_translation'), true );
|
235 |
-
if ( $translation ) {
|
236 |
-
$translation[0]['name'] = 'Counter Seconds Label';
|
237 |
-
$translation[1]['name'] = 'Counter Minutes Label';
|
238 |
-
$translation[2]['name'] = 'Counter Hours Label';
|
239 |
-
$translation[3]['name'] = 'Counter Days Label';
|
240 |
-
$translation[4]['name'] = 'Subscribe Form Placeholder';
|
241 |
-
$translation[5]['name'] = 'Subscribe Response Duplicate';
|
242 |
-
$translation[6]['name'] = 'Subscribe Response Not Valid';
|
243 |
-
$translation[7]['name'] = 'Subscribe Response Thanks';
|
244 |
-
$translation[8]['name'] = 'Subscribe Submit Button Label';
|
245 |
-
$translation[9]['name'] = 'CMP Eclipse Theme: Scroll Text';
|
246 |
-
$translation[10]['name'] = 'Subscribe Form First Name Placeholder';
|
247 |
-
$translation[11]['name'] = 'Subscribe Form Last Name Placeholder';
|
248 |
-
$translation[12]['name'] = 'Subscribe';
|
249 |
-
update_option('niteoCS_translation', wp_json_encode( $translation ));
|
250 |
-
}
|
251 |
-
|
252 |
-
// delete unzip theme from cmp-premium-dir
|
253 |
-
if ( file_exists( CMP_PREMIUM_THEMES_DIR ) ) {
|
254 |
-
$files = glob(CMP_PREMIUM_THEMES_DIR . '/*');
|
255 |
-
$premium_themes = array_column( $this->cmp_premium_themes(), 'name' );
|
256 |
-
|
257 |
-
foreach( $files as $file ) {
|
258 |
-
if ( is_file($file) ){
|
259 |
-
unlink($file);
|
260 |
-
} else {
|
261 |
-
if ( !in_array(basename($file), $premium_themes)) {
|
262 |
-
array_map('unlink', glob("$file/*.*"));
|
263 |
-
rmdir($file);
|
264 |
}
|
265 |
-
|
266 |
}
|
267 |
}
|
268 |
}
|
269 |
|
270 |
// bump version for next udpate check
|
271 |
update_option( 'niteoCS_version', CMP_VERSION );
|
|
|
272 |
}
|
7 |
update_option( 'niteoCS_version', CMP_VERSION );
|
8 |
}
|
9 |
|
10 |
+
$pre_update_version = get_option('niteoCS_version');
|
11 |
|
|
|
|
|
|
|
12 |
|
13 |
+
if ( version_compare($pre_update_version, CMP_VERSION ) < 0 ) {
|
14 |
+
|
15 |
+
$premium_themes = $this->cmp_premium_themes_installed();
|
16 |
// delete transients for theme updates, to ensure the updates for latest cmp versions runs again
|
17 |
foreach ( $premium_themes as $theme_slug ) {
|
18 |
delete_transient( $theme_slug.'_updatecheck' );
|
19 |
}
|
20 |
|
21 |
+
// Lower than 2.0
|
22 |
+
if ( version_compare( $pre_update_version, '2.0' ) < 0 ) {
|
23 |
+
if ( get_option('niteoCS_subscribers_list') ) {
|
24 |
+
$subscribe_list = get_option('niteoCS_subscribers_list');
|
25 |
+
|
26 |
+
if ( is_array( $subscribe_list ) && count( $subscribe_list ) > 0 && !array_key_exists ('id', $subscribe_list[0]) ) {
|
27 |
+
$i = 1;
|
28 |
+
foreach( $subscribe_list as &$sub ){
|
29 |
+
$sub['id'] = $i;
|
30 |
+
$sub = array('id' => $sub['id']) + $sub;
|
31 |
+
// check if ip address is set
|
32 |
+
if (!array_key_exists('ip_address', $sub)) {
|
33 |
+
$sub['ip_address'] = 'nodata';
|
34 |
+
}
|
35 |
+
$i++;
|
36 |
+
}
|
37 |
+
update_option('niteoCS_subscribers_list', $subscribe_list);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
42 |
+
// Lower than 3.0
|
43 |
+
if ( version_compare( $pre_update_version, '3.0' ) < 0 ) {
|
44 |
|
45 |
+
$current_theme = get_option('niteoCS_theme', 'countdown');
|
46 |
+
|
47 |
+
if ( get_option('niteoCS_analytics') && get_option('niteoCS_analytics') != '' ) {
|
48 |
+
update_option('niteoCS_analytics_status', 'google');
|
49 |
+
}
|
50 |
+
|
51 |
+
// migrate overlay color and opacity settings after update 2.8
|
52 |
+
$overlay_color = get_option('niteoCS_overlay_color['.$current_theme.']');
|
53 |
+
$overlay_opacity = get_option('niteoCS_overlay_opacity['.$current_theme.']');
|
54 |
+
|
55 |
+
if ( $overlay_color ) {
|
56 |
+
update_option( 'niteoCS_overlay['.$current_theme.']', 'color' );
|
57 |
+
update_option( 'niteoCS_overlay['.$current_theme.'][color]', $overlay_color );
|
58 |
+
delete_option('niteoCS_overlay_color['.$current_theme.']');
|
59 |
+
}
|
60 |
+
|
61 |
+
if ( $overlay_opacity ) {
|
62 |
+
update_option( 'niteoCS_overlay['.$current_theme.'][opacity]', $overlay_opacity );
|
63 |
+
delete_option('niteoCS_overlay_opacity['.$current_theme.']');
|
64 |
+
}
|
65 |
+
|
66 |
+
// 2.9.3 version - migrate logo per theme settings to only one settings for all themes
|
67 |
+
$logo_type = get_option('niteoCS_logo_type['.$current_theme.']');
|
68 |
+
$niteoCS_logo_id = get_option('niteoCS_logo_id['.$current_theme.']');
|
69 |
+
$niteoCS_text_logo = get_option('niteoCS_text_logo['.$current_theme.']');
|
70 |
+
|
71 |
+
if ( $logo_type ) {
|
72 |
+
update_option( 'niteoCS_logo_type', $logo_type );
|
73 |
+
delete_option('niteoCS_logo_type['.$current_theme.']');
|
74 |
+
}
|
75 |
+
|
76 |
+
if ( $niteoCS_logo_id ) {
|
77 |
+
update_option( 'niteoCS_logo_id', $niteoCS_logo_id );
|
78 |
+
delete_option('niteoCS_logo_id['.$current_theme.']');
|
79 |
+
}
|
80 |
+
|
81 |
+
if ( $niteoCS_text_logo ) {
|
82 |
+
update_option( 'niteoCS_text_logo', $niteoCS_text_logo );
|
83 |
+
delete_option('niteoCS_text_logo['.$current_theme.']');
|
84 |
+
}
|
85 |
+
|
86 |
+
// 2.9.5 update - migrate graphic background to indepenedent theme settings
|
87 |
+
$settings = array( 'niteoCS_banner['.$current_theme.']', 'niteoCS_banner_id['.$current_theme.']', 'niteoCS_unsplash_feed['.$current_theme.']', 'niteoCS_unsplash_0['.$current_theme.']', 'niteoCS_unsplash_2['.$current_theme.']', 'niteoCS_unsplash_3['.$current_theme.']', 'niteoCS_unsplash_1['.$current_theme.']', 'niteoCS_banner_video['.$current_theme.']', 'niteoCS_youtube_url['.$current_theme.']', 'niteoCS_vimeo_url['.$current_theme.']', 'niteoCS_video_file_url['.$current_theme.']', 'niteoCS_video_thumb['.$current_theme.']', 'niteoCS_banner_pattern['.$current_theme.']', 'niteoCS_banner_pattern_custom['.$current_theme.']', 'niteoCS_banner_color['.$current_theme.']', 'niteoCS_gradient['.$current_theme.']', 'niteoCS_banner_gradient_one['.$current_theme.']', 'niteoCS_banner_gradient_two['.$current_theme.']', 'niteoCS_effect_blur['.$current_theme.']', 'niteoCS_overlay['.$current_theme.']', 'niteoCS_overlay['.$current_theme.'][color]', 'niteoCS_overlay['.$current_theme.'][gradient]', 'niteoCS_overlay['.$current_theme.'][gradient_one]', 'niteoCS_overlay['.$current_theme.'][gradient_two]', 'niteoCS_overlay['.$current_theme.'][opacity]', 'niteoCS_banner['.$current_theme.']', 'niteoCS_slider_count['.$current_theme.']', 'niteoCS_slider_effect['.$current_theme.']', 'niteoCS_slider_auto['.$current_theme.']', 'niteoCS_special_effect['.$current_theme.']', 'niteoCS_special_effect['.$current_theme.'][constellation][color]' );
|
88 |
+
|
89 |
+
foreach ( $settings as $name ) {
|
90 |
+
$value = get_option( $name );
|
91 |
+
if ( $value !== false ) {
|
92 |
+
$new_settings = str_replace('['.$current_theme.']', '', $name);
|
93 |
+
update_option( $new_settings, $value );
|
94 |
+
if ( $name != 'niteoCS_banner['.$current_theme.']' ) {
|
95 |
+
delete_option( $name );
|
96 |
+
}
|
97 |
+
}
|
98 |
}
|
99 |
}
|
100 |
|
101 |
+
|
102 |
+
// update CMP activation status from false to 0 after update 3.1.2
|
103 |
+
if ( version_compare( $pre_update_version, '3.1.2' ) < 0 ) {
|
104 |
+
if ( get_option('niteoCS_status') == false ) {
|
105 |
+
update_option('niteoCS_status', '0');
|
106 |
+
}
|
107 |
}
|
108 |
|
109 |
+
// update translation strings
|
110 |
+
if ( version_compare( $pre_update_version, '3.8.8' ) < 0 ) {
|
111 |
+
|
112 |
+
if ( get_option('niteoCS_translation') ) {
|
113 |
+
$current = json_decode( get_option('niteoCS_translation'), TRUE );
|
114 |
+
|
115 |
+
$translation = array(
|
116 |
+
0 => array('id' => 0, 'name' => 'Counter Seconds Label', 'string' => __('Seconds', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[0]['translation']) ? $current[0]['translation'] : __('Seconds', 'cmp-coming-soon-maintenance') ),
|
117 |
+
1 => array('id' => 1, 'name' => 'Counter Minutes Label', 'string' => __('Minutes', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[1]['translation']) ? $current[1]['translation'] : __('Minutes', 'cmp-coming-soon-maintenance') ),
|
118 |
+
2 => array('id' => 2, 'name' => 'Counter Hours Label', 'string' => __('Hours', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[2]['translation']) ? $current[2]['translation'] : __('Hours', 'cmp-coming-soon-maintenance') ),
|
119 |
+
3 => array('id' => 3, 'name' => 'Counter Days Label', 'string' => __('Days', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[3]['translation']) ? $current[3]['translation'] : __('Days', 'cmp-coming-soon-maintenance') ),
|
120 |
+
4 => array('id' => 4, 'name' => 'Subscribe Form Placeholder', 'string' => __('Insert your email address.', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[4]['translation']) ? $current[4]['translation'] : __('Insert your email address.', 'cmp-coming-soon-maintenance') ),
|
121 |
+
5 => array('id' => 5, 'name' => 'Subscribe Response Duplicate', 'string' => __('Oops! This email address is already on our list.', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[5]['translation']) ? $current[5]['translation'] : __('Oops! This email address is already on our list.', 'cmp-coming-soon-maintenance') ),
|
122 |
+
6 => array('id' => 6, 'name' => 'Subscribe Response Not Valid', 'string' => __('Oops! We need a valid email address. Please try again.', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[6]['translation']) ? $current[6]['translation'] : __('Oops! We need a valid email address. Please try again.', 'cmp-coming-soon-maintenance') ),
|
123 |
+
7 => array('id' => 7, 'name' => 'Subscribe Response Thanks', 'string' => __('Thank you! Your sign up request was successful.', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[7]['translation']) ? $current[7]['translation'] : __('Thank you! Your sign up request was successful.', 'cmp-coming-soon-maintenance') ),
|
124 |
+
8 => array('id' => 8, 'name' => 'Subscribe Submit Button Label', 'string' => __('Submit', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[8]['translation']) ? $current[8]['translation'] : __('Submit', 'cmp-coming-soon-maintenance') ),
|
125 |
+
9 => array('id' => 9, 'name' => 'CMP Eclipse Theme: Scroll Text', 'string' => __('Scroll', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[8]['translation']) ? $current[9]['translation'] : __('Scroll', 'cmp-coming-soon-maintenance') ),
|
126 |
+
10 => array('id' => 10, 'name' => 'Subscribe Form First Name Placeholder', 'string' => __('First Name', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[10]['translation']) ? $current[10]['translation'] : __('First Name', 'cmp-coming-soon-maintenance') ),
|
127 |
+
11 => array('id' => 11, 'name' => 'Subscribe Form Last Name Placeholder', 'string' => __('Last Name', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[11]['translation']) ? $current[11]['translation'] : __('Last Name', 'cmp-coming-soon-maintenance') ),
|
128 |
+
12 => array('id' => 12, 'name' => 'Subscribe', 'string' => __('Subscribe', 'cmp-coming-soon-maintenance'), 'translation' => isset($current[12]['translation']) ? $current[12]['translation'] : __('Subscribe', 'cmp-coming-soon-maintenance') ),
|
129 |
+
13 => array('id' => 13, 'name' => 'Subscribe GDPR Checkbox', 'string' => __('You must agree with our Terms and Conditions.', 'cmp-coming-soon-maintenance'), 'translation' => __('You must agree with our Terms and Conditions.', 'cmp-coming-soon-maintenance') ),
|
130 |
+
14 => array('id' => 14, 'name' => 'Subscribe Missing Email', 'string' => __('Oops! Email is empty.', 'cmp-coming-soon-maintenance'), 'translation' => __('Oops! Email is empty.', 'cmp-coming-soon-maintenance') ),
|
131 |
+
);
|
132 |
+
|
133 |
+
update_option('niteoCS_translation', wp_json_encode( $translation ));
|
134 |
+
}
|
135 |
+
|
136 |
+
}
|
137 |
+
|
138 |
+
// update social icons to social settings
|
139 |
if ( get_option('niteoCS_socialmedia') ) {
|
140 |
$niteoCS_socialmedia = stripslashes( get_option('niteoCS_socialmedia') );
|
141 |
$socialmedia = json_decode( $niteoCS_socialmedia, true );
|
258 |
}
|
259 |
}
|
260 |
|
261 |
+
if ( version_compare( $pre_update_version, '3.6' ) < 0 ) {
|
262 |
+
// delete unzip theme from cmp-premium-dir
|
263 |
+
if ( file_exists( CMP_PREMIUM_THEMES_DIR ) ) {
|
264 |
+
$files = glob(CMP_PREMIUM_THEMES_DIR . '/*');
|
265 |
+
$premium_themes = array_column( $this->cmp_premium_themes(), 'name' );
|
266 |
+
|
267 |
+
foreach( $files as $file ) {
|
268 |
+
if ( is_file($file) ){
|
269 |
+
unlink($file);
|
270 |
+
} else {
|
271 |
+
if ( !in_array(basename($file), $premium_themes)) {
|
272 |
+
array_map('unlink', glob("$file/*.*"));
|
273 |
+
rmdir($file);
|
274 |
+
}
|
275 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
}
|
|
|
277 |
}
|
278 |
}
|
279 |
}
|
280 |
|
281 |
// bump version for next udpate check
|
282 |
update_option( 'niteoCS_version', CMP_VERSION );
|
283 |
+
|
284 |
}
|
inc/render/custom-css.php
CHANGED
@@ -38,6 +38,21 @@ ob_start(); ?>
|
|
38 |
|
39 |
<?php
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
// add blur effect if enabled
|
42 |
$blur = get_option('niteoCS_effect_blur', '0.0');
|
43 |
|
38 |
|
39 |
<?php
|
40 |
|
41 |
+
$gdpr_checkbox = get_option( 'niteoCS_subscribe_gdpr_checkbox', '0' );
|
42 |
+
|
43 |
+
if ( $gdpr_checkbox ) {
|
44 |
+
?>
|
45 |
+
<style>
|
46 |
+
.cmp-subscribe input[type="submit"]:disabled {
|
47 |
+
opacity: .6;
|
48 |
+
}
|
49 |
+
.cmp-form-notes label {
|
50 |
+
cursor: pointer;
|
51 |
+
}
|
52 |
+
</style>
|
53 |
+
<?php
|
54 |
+
}
|
55 |
+
|
56 |
// add blur effect if enabled
|
57 |
$blur = get_option('niteoCS_effect_blur', '0.0');
|
58 |
|
inc/render/progress-bar.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$progress_bar_type = get_option('niteoCS_progress_bar_type', 'manual');
|
4 |
+
|
5 |
+
if ( $progress_bar_type === 'manual' ) {
|
6 |
+
$progress = get_option('niteoCS_progress_bar_percentage', '0');
|
7 |
+
}
|
8 |
+
|
9 |
+
if ( $progress_bar_type === 'auto' ) {
|
10 |
+
$progress_bar_start_date = (int)get_option('niteoCS_progress_start_bar_date', time());
|
11 |
+
$progress_bar_end_date = (int)get_option('niteoCS_progress_end_bar_date', time() + 86400);
|
12 |
+
$current_date = time();
|
13 |
+
$progress = round(($current_date - $progress_bar_start_date) / ( $progress_bar_end_date - $progress_bar_start_date) * 100);
|
14 |
+
}
|
15 |
+
|
16 |
+
ob_start();
|
17 |
+
|
18 |
+
?>
|
19 |
+
<div id="progress-bar" class="<?php echo esc_attr( $wrapper_class );?>" data-width="<?php echo esc_attr( $progress );?>">
|
20 |
+
<div class="bar-wrapper">
|
21 |
+
<div class="growing-bar"></div>
|
22 |
+
</div>
|
23 |
+
<div class="bar-percentage"><span class="bar-percentage-number">0</span>%</div>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<script>
|
27 |
+
const progressBar = document.getElementById('progress-bar');
|
28 |
+
const growingBar = document.querySelector('.growing-bar');
|
29 |
+
const percentageNumber = document.querySelector('.bar-percentage-number');
|
30 |
+
const progress = progressBar.getAttribute('data-width');
|
31 |
+
let counter = 0;
|
32 |
+
setTimeout(() => {
|
33 |
+
growingBar.style.width = progress + '%';
|
34 |
+
|
35 |
+
let countUp = setInterval(() => {
|
36 |
+
percentageNumber.innerHTML = counter;
|
37 |
+
if (counter >= progress) {
|
38 |
+
clearInterval(countUp);
|
39 |
+
}
|
40 |
+
counter++;
|
41 |
+
}, 1000 / progress);
|
42 |
+
|
43 |
+
}, <?php echo esc_attr($timeout);?>);
|
44 |
+
</script>
|
45 |
+
<?php
|
46 |
+
|
47 |
+
|
48 |
+
$html = ob_get_clean();
|
inc/render/subscribe-form.php
CHANGED
@@ -32,6 +32,8 @@ switch ($subscribe_type) {
|
|
32 |
$placeholder_lastname = stripslashes( $translation[11]['translation'] );
|
33 |
|
34 |
$subscribe = stripslashes( $translation[12]['translation'] );
|
|
|
|
|
35 |
$gdpr_checkbox = get_option( 'niteoCS_subscribe_gdpr_checkbox', '0' );
|
36 |
|
37 |
// overwrite it with theme specific requirements
|
@@ -117,16 +119,16 @@ switch ($subscribe_type) {
|
|
117 |
|
118 |
switch ( $theme ) {
|
119 |
case 'mercury': ?>
|
120 |
-
<button type="submit" id="submit-subscribe"
|
121 |
<?php
|
122 |
break;
|
123 |
case 'headliner': ?>
|
124 |
-
<input type="submit" id="submit-subscribe" value="<?php echo esc_attr( $subscribe );?>" data-subscribe="<?php echo esc_attr( $submit );?>"
|
125 |
<?php
|
126 |
break;
|
127 |
|
128 |
default: ?>
|
129 |
-
<input type="submit" id="submit-subscribe" value="<?php echo esc_attr( $submit );?>"
|
130 |
<?php
|
131 |
break;
|
132 |
} ?>
|
@@ -144,8 +146,6 @@ switch ($subscribe_type) {
|
|
144 |
// render Subscribe form Message/GDPR
|
145 |
if ( $niteoCS_subscribe_label != '' ) {
|
146 |
|
147 |
-
$checkbox = '';
|
148 |
-
|
149 |
$allowed_html = array(
|
150 |
'a' => array(
|
151 |
'href' => array(),
|
@@ -157,16 +157,16 @@ switch ($subscribe_type) {
|
|
157 |
'id' => array(),
|
158 |
'name' => array(),
|
159 |
'required' => array(),
|
160 |
-
)
|
|
|
161 |
);
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
} ?>
|
167 |
|
|
|
168 |
<div class="cmp-form-notes">
|
169 |
-
|
170 |
</div>
|
171 |
<?php
|
172 |
} ?>
|
@@ -201,20 +201,17 @@ switch ($subscribe_type) {
|
|
201 |
const lastnameInput = document.getElementById('lastname-subscribe');
|
202 |
const gdprCheckbox = document.getElementById('gdpr-checkbox');
|
203 |
|
204 |
-
if ( gdprCheckbox ) {
|
205 |
-
gdprCheckbox.addEventListener('change', function() {
|
206 |
-
if ( this.checked ) {
|
207 |
-
submitButton.disabled = false;
|
208 |
-
} else {
|
209 |
-
submitButton.disabled = true;
|
210 |
-
}
|
211 |
-
})
|
212 |
-
}
|
213 |
-
|
214 |
submitButton.onclick = function( e ) {
|
215 |
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
<?php
|
217 |
if ( get_option( 'niteoCS_recaptcha_status', '1' ) === '1' ) { ?>
|
|
|
218 |
grecaptcha.ready(function() {
|
219 |
grecaptcha.execute('<?php echo esc_attr($site_key);?>').then(function(token) {
|
220 |
subForm( form, resultElement, emailInput, firstnameInput, lastnameInput, token );
|
@@ -223,6 +220,7 @@ switch ($subscribe_type) {
|
|
223 |
|
224 |
<?php
|
225 |
} else { ?>
|
|
|
226 |
subForm( form, resultElement, emailInput, firstnameInput, lastnameInput );
|
227 |
<?php
|
228 |
} ?>
|
@@ -269,6 +267,9 @@ switch ($subscribe_type) {
|
|
269 |
}
|
270 |
} )
|
271 |
.catch(function(error) { console.log(error.message); });
|
|
|
|
|
|
|
272 |
}
|
273 |
}
|
274 |
</script>
|
32 |
$placeholder_lastname = stripslashes( $translation[11]['translation'] );
|
33 |
|
34 |
$subscribe = stripslashes( $translation[12]['translation'] );
|
35 |
+
$missing_gdpr = stripslashes( $translation[13]['translation'] );
|
36 |
+
$empty_email = stripslashes( $translation[14]['translation'] );
|
37 |
$gdpr_checkbox = get_option( 'niteoCS_subscribe_gdpr_checkbox', '0' );
|
38 |
|
39 |
// overwrite it with theme specific requirements
|
119 |
|
120 |
switch ( $theme ) {
|
121 |
case 'mercury': ?>
|
122 |
+
<button type="submit" id="submit-subscribe"><?php echo esc_attr( $submit );?></button>
|
123 |
<?php
|
124 |
break;
|
125 |
case 'headliner': ?>
|
126 |
+
<input type="submit" id="submit-subscribe" value="<?php echo esc_attr( $subscribe );?>" data-subscribe="<?php echo esc_attr( $submit );?>">
|
127 |
<?php
|
128 |
break;
|
129 |
|
130 |
default: ?>
|
131 |
+
<input type="submit" id="submit-subscribe" value="<?php echo esc_attr( $submit );?>">
|
132 |
<?php
|
133 |
break;
|
134 |
} ?>
|
146 |
// render Subscribe form Message/GDPR
|
147 |
if ( $niteoCS_subscribe_label != '' ) {
|
148 |
|
|
|
|
|
149 |
$allowed_html = array(
|
150 |
'a' => array(
|
151 |
'href' => array(),
|
157 |
'id' => array(),
|
158 |
'name' => array(),
|
159 |
'required' => array(),
|
160 |
+
),
|
161 |
+
'label' => array()
|
162 |
);
|
163 |
|
164 |
+
$checkbox = $gdpr_checkbox ? '<label><input type="checkbox" id="gdpr-checkbox" name="gdpr-checkbox" required /> ' : '';
|
165 |
+
$closing_checkbox = $gdpr_checkbox ? '</label>' : '';
|
|
|
|
|
166 |
|
167 |
+
?>
|
168 |
<div class="cmp-form-notes">
|
169 |
+
<?php echo wpautop(wp_kses( $checkbox . $niteoCS_subscribe_label, $allowed_html, $closing_checkbox )); ?>
|
170 |
</div>
|
171 |
<?php
|
172 |
} ?>
|
201 |
const lastnameInput = document.getElementById('lastname-subscribe');
|
202 |
const gdprCheckbox = document.getElementById('gdpr-checkbox');
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
submitButton.onclick = function( e ) {
|
205 |
e.preventDefault();
|
206 |
+
// check GDPR checkbox
|
207 |
+
if ( gdprCheckbox && gdprCheckbox.checked === false ) {
|
208 |
+
resultElement.innerHTML = '<?php echo esc_attr($missing_gdpr);?>';
|
209 |
+
return false;
|
210 |
+
}
|
211 |
+
|
212 |
<?php
|
213 |
if ( get_option( 'niteoCS_recaptcha_status', '1' ) === '1' ) { ?>
|
214 |
+
// google recaptcha
|
215 |
grecaptcha.ready(function() {
|
216 |
grecaptcha.execute('<?php echo esc_attr($site_key);?>').then(function(token) {
|
217 |
subForm( form, resultElement, emailInput, firstnameInput, lastnameInput, token );
|
220 |
|
221 |
<?php
|
222 |
} else { ?>
|
223 |
+
// submit form
|
224 |
subForm( form, resultElement, emailInput, firstnameInput, lastnameInput );
|
225 |
<?php
|
226 |
} ?>
|
267 |
}
|
268 |
} )
|
269 |
.catch(function(error) { console.log(error.message); });
|
270 |
+
|
271 |
+
} else {
|
272 |
+
resultElement.innerHTML = '<?php echo esc_attr($empty_email);?>';
|
273 |
}
|
274 |
}
|
275 |
</script>
|
inc/settings/settings-progress-bar.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
3 |
+
|
4 |
+
if ( isset($_POST['niteoCS_progress_bar']) && is_numeric( $_POST['niteoCS_progress_bar'] )) {
|
5 |
+
update_option('niteoCS_progress_bar', sanitize_text_field( $_POST['niteoCS_progress_bar'] ));
|
6 |
+
}
|
7 |
+
|
8 |
+
if ( isset($_POST['niteoCS_progress_start_bar_date']) ) {
|
9 |
+
update_option('niteoCS_progress_start_bar_date', sanitize_text_field( $_POST['niteoCS_progress_start_bar_date'] ));
|
10 |
+
}
|
11 |
+
if ( isset($_POST['niteoCS_progress_end_bar_date']) ) {
|
12 |
+
update_option('niteoCS_progress_end_bar_date', sanitize_text_field( $_POST['niteoCS_progress_end_bar_date'] ));
|
13 |
+
}
|
14 |
+
|
15 |
+
if ( isset($_POST['niteoCS_progress_bar_type']) ) {
|
16 |
+
update_option('niteoCS_progress_bar_type', sanitize_text_field( $_POST['niteoCS_progress_bar_type'] ));
|
17 |
+
}
|
18 |
+
|
19 |
+
if ( isset($_POST['niteoCS_progress_bar_percentage']) ) {
|
20 |
+
update_option('niteoCS_progress_bar_percentage', sanitize_text_field( $_POST['niteoCS_progress_bar_percentage'] ));
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
// register and enqueue admin needed scripts
|
26 |
+
wp_enqueue_script('countdown_flatpicker_js');
|
27 |
+
wp_enqueue_style( 'countdown_flatpicker_css');
|
28 |
+
|
29 |
+
// get counter settings
|
30 |
+
$progress_bar = get_option('niteoCS_progress_bar', '0');
|
31 |
+
$progress_bar_start_date = get_option('niteoCS_progress_start_bar_date', time());
|
32 |
+
$progress_bar_end_date = get_option('niteoCS_progress_end_bar_date', time() + 86400);
|
33 |
+
$progress_bar_type = get_option('niteoCS_progress_bar_type', 'manual');
|
34 |
+
$progress_bar_percentage = get_option('niteoCS_progress_bar_percentage', '0');
|
35 |
+
|
36 |
+
?>
|
37 |
+
|
38 |
+
|
39 |
+
<div class="table-wrapper content">
|
40 |
+
<h3><?php _e('Progress Bar', 'cmp-coming-soon-maintenance');?></h3>
|
41 |
+
<table class="content">
|
42 |
+
<tr>
|
43 |
+
<th>
|
44 |
+
<fieldset>
|
45 |
+
<legend class="screen-reader-text">
|
46 |
+
<span><?php _e('Progress Bar', 'cmp-coming-soon-maintenance');?></span>
|
47 |
+
</legend>
|
48 |
+
|
49 |
+
<p>
|
50 |
+
<label title="Enabled">
|
51 |
+
<input type="radio" name="niteoCS_progress_bar" class="progress-bar" value="1"<?php if ( $progress_bar == 1 ) { echo ' checked="checked"'; } ?>> <?php _e('Enabled', 'cmp-coming-soon-maintenance');?>
|
52 |
+
</label>
|
53 |
+
</p>
|
54 |
+
|
55 |
+
<p>
|
56 |
+
<label title="Disabled">
|
57 |
+
<input type="radio" name="niteoCS_progress_bar" class="progress-bar" value="0"<?php if ( $progress_bar == 0 ) { echo ' checked="checked"'; } ?>> <?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
|
58 |
+
</label>
|
59 |
+
</p>
|
60 |
+
|
61 |
+
</fieldset>
|
62 |
+
</th>
|
63 |
+
|
64 |
+
<td id="progress-bar-disabled" class="progress-bar-switch x0">
|
65 |
+
<p><?php _e('Progress Bar is disabled.', 'cmp-coming-soon-maintenance');?></p>
|
66 |
+
</td>
|
67 |
+
|
68 |
+
<td id="progress-bar-enabled" class="progress-bar-switch x1">
|
69 |
+
|
70 |
+
<select name="niteoCS_progress_bar_type" id="niteoCS_progress_bar_type" class="progress-bar-type">
|
71 |
+
<option value="manual" <?php selected( 'manual', $progress_bar_type ); ?>><?php _e('Set Progress Bar Manually', 'cmp-coming-soon-maintenance');?></option>
|
72 |
+
<option value="auto" <?php selected( 'auto', $progress_bar_type ); ?>><?php _e('Set Automatic Progress Bar by Date', 'cmp-coming-soon-maintenance');?></option>
|
73 |
+
</select>
|
74 |
+
|
75 |
+
<div class="progress-bar-type manual">
|
76 |
+
<fieldset style="margin: 1em 0">
|
77 |
+
<h4><?php _e('Progress', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $progress_bar_percentage ); ?></span>%</h4>
|
78 |
+
<input type="range" id="niteoCS_progress_bar_percentage" name="niteoCS_progress_bar_percentage" min="0" max="100" step="1" value="<?php echo esc_attr( $progress_bar_percentage ); ?>" />
|
79 |
+
</fieldset>
|
80 |
+
</div>
|
81 |
+
|
82 |
+
<div class="progress-bar-type auto">
|
83 |
+
|
84 |
+
<h4 style="margin-top:1em"><?php _e('Click to Set Starting Date', 'cmp-coming-soon-maintenance');?></h4>
|
85 |
+
<fieldset>
|
86 |
+
<input type="text" name="niteoCS_progress_start_bar_date" id="niteoCS_progress_start_bar_date" placeholder="<?php _e('Select Starting Date..','cmp-coming-soon-maintenance');?>" value="<?php echo esc_attr( $progress_bar_start_date); ?>" class="regular-text code"><br>
|
87 |
+
<br>
|
88 |
+
</fieldset>
|
89 |
+
|
90 |
+
<h4><?php _e('Click to Set Ending Date', 'cmp-coming-soon-maintenance');?></h4>
|
91 |
+
<fieldset>
|
92 |
+
<input type="text" name="niteoCS_progress_end_bar_date" id="niteoCS_progress_end_bar_date" placeholder="<?php _e('Select Ending Date..','cmp-coming-soon-maintenance');?>" value="<?php echo esc_attr( $progress_bar_end_date); ?>" class="regular-text code"><br>
|
93 |
+
<br>
|
94 |
+
</fieldset>
|
95 |
+
</div>
|
96 |
+
</td>
|
97 |
+
</tr>
|
98 |
+
|
99 |
+
<?php echo $this->render_settings->submit(); ?>
|
100 |
+
|
101 |
+
</table>
|
102 |
+
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<script>
|
106 |
+
jQuery(document).ready(function($){
|
107 |
+
var EndDate = false;
|
108 |
+
var StartDate = false;
|
109 |
+
<?php
|
110 |
+
if ( $progress_bar_end_date != '') { ?>
|
111 |
+
var EndDate = new Date(<?php echo esc_attr( $progress_bar_end_date );?>*1000);
|
112 |
+
<?php
|
113 |
+
}
|
114 |
+
if ( $progress_bar_start_date != '') { ?>
|
115 |
+
var StartDate = new Date(<?php echo esc_attr( $progress_bar_start_date );?>*1000);
|
116 |
+
<?php
|
117 |
+
} ?>
|
118 |
+
// flatpicker
|
119 |
+
$('#niteoCS_progress_start_bar_date').flatpickr({
|
120 |
+
maxDate: new Date().fp_incr(1),
|
121 |
+
defaultDate: StartDate,
|
122 |
+
enableTime: true,
|
123 |
+
altInput: true,
|
124 |
+
dateFormat: 'U'
|
125 |
+
});
|
126 |
+
$('#niteoCS_progress_end_bar_date').flatpickr({
|
127 |
+
minDate: 'today',
|
128 |
+
defaultDate: EndDate,
|
129 |
+
enableTime: true,
|
130 |
+
altInput: true,
|
131 |
+
dateFormat: 'U'
|
132 |
+
});
|
133 |
+
|
134 |
+
jQuery( '#niteoCS_progress_bar_percentage' ).on('input', function () {
|
135 |
+
var value = jQuery(this).val();
|
136 |
+
// change label value
|
137 |
+
jQuery(this).parent().find('span').html(value);
|
138 |
+
|
139 |
+
});
|
140 |
+
});
|
141 |
+
</script>
|
js/settings.js
CHANGED
@@ -108,6 +108,7 @@ jQuery(document).ready(function ($) {
|
|
108 |
toggle_settings("cmp-logo");
|
109 |
toggle_settings("background-type");
|
110 |
toggle_settings("counter");
|
|
|
111 |
toggle_settings("overlay-text");
|
112 |
toggle_settings("cmp-logo-size");
|
113 |
toggle_settings("recaptcha-toggle");
|
@@ -119,6 +120,7 @@ jQuery(document).ready(function ($) {
|
|
119 |
toggle_select("subscribe-method");
|
120 |
toggle_select("background-overlay");
|
121 |
toggle_select("banner-video-source");
|
|
|
122 |
|
123 |
// change all selects to select2
|
124 |
jQuery(
|
108 |
toggle_settings("cmp-logo");
|
109 |
toggle_settings("background-type");
|
110 |
toggle_settings("counter");
|
111 |
+
toggle_settings("progress-bar");
|
112 |
toggle_settings("overlay-text");
|
113 |
toggle_settings("cmp-logo-size");
|
114 |
toggle_settings("recaptcha-toggle");
|
120 |
toggle_select("subscribe-method");
|
121 |
toggle_select("background-overlay");
|
122 |
toggle_select("banner-video-source");
|
123 |
+
toggle_select("progress-bar-type");
|
124 |
|
125 |
// change all selects to select2
|
126 |
jQuery(
|
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("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"), 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, c = a[0].links.html, s = 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, c = a.links.html, s = 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="' + c + '" target="_blank">Photo</a> (ID: ' + s + ') 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 c = jQuery(".cmp-coming-soon-maintenance .social-inputs"), s = function (e, n) { var a = c.find('input[type="text"]'); n.item.index(); a.each(function (e, n) { var a = jQuery(n).data("name"); r(a, "order", e) }) }; c.sortable({ stop: s }), c.on("sortchange", s) } function l(e, n, a, t) { var i, o = jQuery("." + e + "-wrapper"), r = jQuery("#add-" + e), c = jQuery("#delete-" + e), s = "", l = e.replace("-", " "); l = l[0].toUpperCase() + l.slice(1), "" != jQuery("#niteoCS-" + e + "-id").val() && c.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, s += (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") } }), c.css("display", "block")), jQuery("#niteoCS-" + e + "-id").val(s).trigger("change") }).open() }), c.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, c = { action: "niteo_themeinfo", security: jQuery(".theme-wrapper").data("security"), theme_slug: jQuery(this).parents(".theme-wrapper").data("slug") }; jQuery.post(ajaxurl, c, function (e) { var c = "", s = ""; if ("true" == (e = jQuery.parseJSON(e)).result) { if (jQuery("body").addClass("modal-open"), "1" == o && (s = '<span class="theme-version">Installed version: ' + t + "</span>"), "1" != o && "premium" == i) c = '<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 + s + "</h2>", '\t\t\t\t<p class="theme-author">By <a href="' + e.author_homepage + '" target="_blank">' + e.author + "</a></p>", "", c, '\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"), 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.8.
|
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.8.
|
67 |
$this->define( 'CMP_DEBUG', FALSE );
|
68 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
69 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
@@ -186,7 +186,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
186 |
2 => array('id' => 2, 'name' => 'Counter Hours Label', 'string' => __('Hours', 'cmp-coming-soon-maintenance'), 'translation' => __('Hours', 'cmp-coming-soon-maintenance') ),
|
187 |
3 => array('id' => 3, 'name' => 'Counter Days Label', 'string' => __('Days', 'cmp-coming-soon-maintenance'), 'translation' => __('Days', 'cmp-coming-soon-maintenance') ),
|
188 |
4 => array('id' => 4, 'name' => 'Subscribe Form Placeholder', 'string' => __('Insert your email address.', 'cmp-coming-soon-maintenance'), 'translation' => __('Insert your email address.', 'cmp-coming-soon-maintenance') ),
|
189 |
-
5 => array('id' => 5, 'name' => 'Subscribe Response Duplicate', 'string' => __('Oops! This email address is already on our list', 'cmp-coming-soon-maintenance'), 'translation' => __('Oops! This email address is already on our list.', 'cmp-coming-soon-maintenance') ),
|
190 |
6 => array('id' => 6, 'name' => 'Subscribe Response Not Valid', 'string' => __('Oops! We need a valid email address. Please try again.', 'cmp-coming-soon-maintenance'), 'translation' => __('Oops! We need a valid email address. Please try again.', 'cmp-coming-soon-maintenance') ),
|
191 |
7 => array('id' => 7, 'name' => 'Subscribe Response Thanks', 'string' => __('Thank you! Your sign up request was successful.', 'cmp-coming-soon-maintenance'), 'translation' => __('Thank you! Your sign up request was successful.', 'cmp-coming-soon-maintenance') ),
|
192 |
8 => array('id' => 8, 'name' => 'Subscribe Submit Button Label', 'string' => __('Submit', 'cmp-coming-soon-maintenance'), 'translation' => __('Submit', 'cmp-coming-soon-maintenance') ),
|
@@ -194,6 +194,8 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
194 |
10 => array('id' => 10, 'name' => 'Subscribe Form First Name Placeholder', 'string' => __('First Name', 'cmp-coming-soon-maintenance'), 'translation' => __('First Name', 'cmp-coming-soon-maintenance') ),
|
195 |
11 => array('id' => 11, 'name' => 'Subscribe Form Last Name Placeholder', 'string' => __('Last Name', 'cmp-coming-soon-maintenance'), 'translation' => __('Last Name', 'cmp-coming-soon-maintenance') ),
|
196 |
12 => array('id' => 12, 'name' => 'Subscribe', 'string' => __('Subscribe', 'cmp-coming-soon-maintenance'), 'translation' => __('Subscribe', 'cmp-coming-soon-maintenance') ),
|
|
|
|
|
197 |
);
|
198 |
|
199 |
update_option('niteoCS_translation', wp_json_encode( $translation ));
|
@@ -454,7 +456,8 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
454 |
public function cmp_premium_themes() {
|
455 |
|
456 |
$premium_themes = array();
|
457 |
-
array_push( $premium_themes, array('name' => '
|
|
|
458 |
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') );
|
459 |
array_push( $premium_themes, array('name' => 'headliner', 'url' => 'https://niteothemes.com/downloads/cmp-headliner-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=headliner', 'price' => '10') );
|
460 |
array_push( $premium_themes, array('name' => 'mercury', 'url' => 'https://niteothemes.com/downloads/cmp-mercury-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=mercury', 'price' => '10') );
|
@@ -2062,12 +2065,18 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
2062 |
}
|
2063 |
|
2064 |
public function get_youtube_img( $youtube_url ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2065 |
$youtube = preg_match('/.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/', $youtube_url, $url);
|
2066 |
|
2067 |
-
|
2068 |
-
$youtube_image = 'http://img.youtube.com/vi/' . $url[7] . '/hqdefault.jpg';
|
2069 |
-
return $youtube_image;
|
2070 |
-
}
|
2071 |
}
|
2072 |
|
2073 |
public function cmp_get_pages( $post_status = 'publish,draft') {
|
@@ -2333,15 +2342,16 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
2333 |
|
2334 |
// returns version of selected CMP theme
|
2335 |
public function cmp_theme_version( $theme_slug ) {
|
|
|
|
|
|
|
2336 |
// if premium theme style.css exists get its version
|
2337 |
if ( in_array( $theme_slug, $this->cmp_premium_themes_installed() ) ) {
|
2338 |
if ( file_exists( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css' ) ) {
|
2339 |
$version = get_file_data( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css', array('Version'), '' );
|
2340 |
}
|
2341 |
|
2342 |
-
}
|
2343 |
-
$version = CMP_VERSION;
|
2344 |
-
}
|
2345 |
|
2346 |
// if we have local version of theme and not in updating theme
|
2347 |
if ( is_array( $version ) ) {
|
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.8.8
|
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.8.8' );
|
67 |
$this->define( 'CMP_DEBUG', FALSE );
|
68 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
69 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
186 |
2 => array('id' => 2, 'name' => 'Counter Hours Label', 'string' => __('Hours', 'cmp-coming-soon-maintenance'), 'translation' => __('Hours', 'cmp-coming-soon-maintenance') ),
|
187 |
3 => array('id' => 3, 'name' => 'Counter Days Label', 'string' => __('Days', 'cmp-coming-soon-maintenance'), 'translation' => __('Days', 'cmp-coming-soon-maintenance') ),
|
188 |
4 => array('id' => 4, 'name' => 'Subscribe Form Placeholder', 'string' => __('Insert your email address.', 'cmp-coming-soon-maintenance'), 'translation' => __('Insert your email address.', 'cmp-coming-soon-maintenance') ),
|
189 |
+
5 => array('id' => 5, 'name' => 'Subscribe Response Duplicate', 'string' => __('Oops! This email address is already on our list.', 'cmp-coming-soon-maintenance'), 'translation' => __('Oops! This email address is already on our list.', 'cmp-coming-soon-maintenance') ),
|
190 |
6 => array('id' => 6, 'name' => 'Subscribe Response Not Valid', 'string' => __('Oops! We need a valid email address. Please try again.', 'cmp-coming-soon-maintenance'), 'translation' => __('Oops! We need a valid email address. Please try again.', 'cmp-coming-soon-maintenance') ),
|
191 |
7 => array('id' => 7, 'name' => 'Subscribe Response Thanks', 'string' => __('Thank you! Your sign up request was successful.', 'cmp-coming-soon-maintenance'), 'translation' => __('Thank you! Your sign up request was successful.', 'cmp-coming-soon-maintenance') ),
|
192 |
8 => array('id' => 8, 'name' => 'Subscribe Submit Button Label', 'string' => __('Submit', 'cmp-coming-soon-maintenance'), 'translation' => __('Submit', 'cmp-coming-soon-maintenance') ),
|
194 |
10 => array('id' => 10, 'name' => 'Subscribe Form First Name Placeholder', 'string' => __('First Name', 'cmp-coming-soon-maintenance'), 'translation' => __('First Name', 'cmp-coming-soon-maintenance') ),
|
195 |
11 => array('id' => 11, 'name' => 'Subscribe Form Last Name Placeholder', 'string' => __('Last Name', 'cmp-coming-soon-maintenance'), 'translation' => __('Last Name', 'cmp-coming-soon-maintenance') ),
|
196 |
12 => array('id' => 12, 'name' => 'Subscribe', 'string' => __('Subscribe', 'cmp-coming-soon-maintenance'), 'translation' => __('Subscribe', 'cmp-coming-soon-maintenance') ),
|
197 |
+
13 => array('id' => 13, 'name' => 'Subscribe GDPR Checkbox', 'string' => __('You must agree with our Terms and Conditions.', 'cmp-coming-soon-maintenance'), 'translation' => __('You must agree with our Terms and Conditions.', 'cmp-coming-soon-maintenance') ),
|
198 |
+
14 => array('id' => 14, 'name' => 'Subscribe Missing Email', 'string' => __('Oops! Email is empty.', 'cmp-coming-soon-maintenance'), 'translation' => __('Oops! Email is empty.', 'cmp-coming-soon-maintenance') ),
|
199 |
);
|
200 |
|
201 |
update_option('niteoCS_translation', wp_json_encode( $translation ));
|
456 |
public function cmp_premium_themes() {
|
457 |
|
458 |
$premium_themes = array();
|
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') );
|
462 |
array_push( $premium_themes, array('name' => 'headliner', 'url' => 'https://niteothemes.com/downloads/cmp-headliner-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=headliner', 'price' => '10') );
|
463 |
array_push( $premium_themes, array('name' => 'mercury', 'url' => 'https://niteothemes.com/downloads/cmp-mercury-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=mercury', 'price' => '10') );
|
2065 |
}
|
2066 |
|
2067 |
public function get_youtube_img( $youtube_url ) {
|
2068 |
+
$yt_id = $this->get_youtube_id( $youtube_url );
|
2069 |
+
|
2070 |
+
$youtube_image = 'http://img.youtube.com/vi/' . $yt_id . '/hqdefault.jpg';
|
2071 |
+
|
2072 |
+
return $youtube_image;
|
2073 |
+
}
|
2074 |
+
|
2075 |
+
|
2076 |
+
public function get_youtube_id( $youtube_url ) {
|
2077 |
$youtube = preg_match('/.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/', $youtube_url, $url);
|
2078 |
|
2079 |
+
return $url[7];
|
|
|
|
|
|
|
2080 |
}
|
2081 |
|
2082 |
public function cmp_get_pages( $post_status = 'publish,draft') {
|
2342 |
|
2343 |
// returns version of selected CMP theme
|
2344 |
public function cmp_theme_version( $theme_slug ) {
|
2345 |
+
|
2346 |
+
$version = CMP_VERSION;
|
2347 |
+
|
2348 |
// if premium theme style.css exists get its version
|
2349 |
if ( in_array( $theme_slug, $this->cmp_premium_themes_installed() ) ) {
|
2350 |
if ( file_exists( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css' ) ) {
|
2351 |
$version = get_file_data( CMP_PREMIUM_THEMES_DIR . $theme_slug . '/style.css', array('Version'), '' );
|
2352 |
}
|
2353 |
|
2354 |
+
}
|
|
|
|
|
2355 |
|
2356 |
// if we have local version of theme and not in updating theme
|
2357 |
if ( is_array( $version ) ) {
|
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.5
|
8 |
-
Stable tag: 3.8.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -159,6 +159,11 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
|
|
159 |
<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>
|
160 |
|
161 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
162 |
<h4>CMP 3.8.7 - 04-Oct-20</h4>
|
163 |
<ul>
|
164 |
<li>Resolved issue with confict between CMP and WooCommerce Order Status Manager when using Font Awesome icons. Thanks to @swiss13 for reporting this and helping us to resolve it.</li>
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.5
|
8 |
+
Stable tag: 3.8.8
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
159 |
<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>
|
160 |
|
161 |
== Changelog ==
|
162 |
+
<h4>CMP 3.8.8 - 14-Oct-20</h4>
|
163 |
+
<ul>
|
164 |
+
<li>New CMP Theme: Scout</li>
|
165 |
+
<li>New Subscribe error messages - no email inserted, GDPR checkbox not checked.</li>
|
166 |
+
</ul>
|
167 |
<h4>CMP 3.8.7 - 04-Oct-20</h4>
|
168 |
<ul>
|
169 |
<li>Resolved issue with confict between CMP and WooCommerce Order Status Manager when using Font Awesome icons. Thanks to @swiss13 for reporting this and helping us to resolve it.</li>
|
themes/scout.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Theme Name: Scout
|
3 |
+
Description: <p>Scout is designed as a coming soon and a maintenance page. All major functionalities are available, such as the ability to display an image, video, pattern, gradient or solid color. This template is fully customizable. Emphasis is placed on the background image, slider, or video. In the administration you can add a link directly to YouTube video. This will display the custom play button on the home page. If you want to view more information about the status of the site or your project, you can link to any post in the administration. In the administration, you can also change the radius of all buttons to change the appearance of the page.</p><h4>Main Features</h4><ul><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> Fade in/out Text Effects</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> Graphic Image Slider Background</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> Background Special Effects</li>><li class="supported"><i class="far fa-check-square" aria-hidden="true"></i> Responsive Design</li></ul>
|