Version Description
Download this release
Release Info
Developer | niteo |
Plugin | CMP – Coming Soon & Maintenance Plugin by NiteoThemes |
Version | 3.7.2 |
Comparing to | |
See all releases |
Code changes from version 3.7.1 to 3.7.2
- cmp-settings.php +8 -1
- img/login-icon.svg +3 -0
- inc/class-cmp-render_html.php +7 -0
- inc/render/custom-css.php +39 -8
- inc/render/login-icon.php +13 -0
- inc/settings/settings-counter.php +1 -1
- inc/settings/settings-login-icon.php +113 -0
- js/cmp-advanced.js +73 -73
- js/settings.js +117 -116
- js/settings.min.js +1 -1
- niteo-cmp.php +14 -15
- readme.txt +9 -1
cmp-settings.php
CHANGED
@@ -593,6 +593,8 @@ add_thickbox();
|
|
593 |
<a class="nav-tab seo" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#seo" data-tab="seo"><i class="fa fa-line-chart" aria-hidden="true"></i><?php _e('SEO & Analytics', 'cmp-coming-soon-maintenance');?></a>
|
594 |
|
595 |
<a class="nav-tab custom_css" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#custom_css" data-tab="custom_css"><i class="fa fa-code" aria-hidden="true"></i><?php _e('Custom CSS', 'cmp-coming-soon-maintenance');?></a>
|
|
|
|
|
596 |
|
597 |
<a class="nav-tab theme-preview" href="<?php echo get_home_url(); ?>?cmp_preview=true" data-tab="theme-preview" target="_blank" ><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('Preview', 'cmp-coming-soon-maintenance');?></a>
|
598 |
|
@@ -612,7 +614,7 @@ add_thickbox();
|
|
612 |
|
613 |
// include banner
|
614 |
if ( !class_exists('cmp_themes_manager') ) { ?>
|
615 |
-
<a class="cmp-bundle-banner table-wrapper general" href="https://niteothemes.com/
|
616 |
<?php
|
617 |
}
|
618 |
|
@@ -737,6 +739,11 @@ add_thickbox();
|
|
737 |
}
|
738 |
}
|
739 |
|
|
|
|
|
|
|
|
|
|
|
740 |
// include theme related settings
|
741 |
if ( file_exists( $this->cmp_theme_dir( $themeslug ).$themeslug.'/'.$themeslug.'-settings.php' ) ) {
|
742 |
require ( $this->cmp_theme_dir( $themeslug ).$themeslug.'/'.$themeslug.'-settings.php' );
|
593 |
<a class="nav-tab seo" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#seo" data-tab="seo"><i class="fa fa-line-chart" aria-hidden="true"></i><?php _e('SEO & Analytics', 'cmp-coming-soon-maintenance');?></a>
|
594 |
|
595 |
<a class="nav-tab custom_css" href="<?php echo admin_url(); ?>admin.php?page=cmp-settings#custom_css" data-tab="custom_css"><i class="fa fa-code" aria-hidden="true"></i><?php _e('Custom CSS', 'cmp-coming-soon-maintenance');?></a>
|
596 |
+
|
597 |
+
<a class="nav-tab advanced" href="<?php echo admin_url(); ?>admin.php?page=cmp-advanced"><i class="fa fa-cogs" aria-hidden="true"></i><?php _e('Advanced', 'cmp-coming-soon-maintenance');?></a>
|
598 |
|
599 |
<a class="nav-tab theme-preview" href="<?php echo get_home_url(); ?>?cmp_preview=true" data-tab="theme-preview" target="_blank" ><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('Preview', 'cmp-coming-soon-maintenance');?></a>
|
600 |
|
614 |
|
615 |
// include banner
|
616 |
if ( !class_exists('cmp_themes_manager') ) { ?>
|
617 |
+
<a class="cmp-bundle-banner table-wrapper general" href="https://niteothemes.com/bundles/" target="_blank"><img src="<?php echo plugins_url('img/banner_bundle.jpg', __FILE__);?>" alt="CMP Bundle Banner"></a>
|
618 |
<?php
|
619 |
}
|
620 |
|
739 |
}
|
740 |
}
|
741 |
|
742 |
+
// login icon
|
743 |
+
if ( file_exists(dirname(__FILE__) . '/inc/settings/settings-login-icon.php' ) ) {
|
744 |
+
require ( dirname(__FILE__) . '/inc/settings/settings-login-icon.php' );
|
745 |
+
}
|
746 |
+
|
747 |
// include theme related settings
|
748 |
if ( file_exists( $this->cmp_theme_dir( $themeslug ).$themeslug.'/'.$themeslug.'-settings.php' ) ) {
|
749 |
require ( $this->cmp_theme_dir( $themeslug ).$themeslug.'/'.$themeslug.'-settings.php' );
|
img/login-icon.svg
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="31.5" viewBox="0 0 24 31.5">
|
2 |
+
<path id="Icon_material-lock-outline" data-name="Icon material-lock-outline" d="M18,25.5a3,3,0,1,0-3-3A3.009,3.009,0,0,0,18,25.5ZM27,12H25.5V9a7.5,7.5,0,0,0-15,0v3H9a3.009,3.009,0,0,0-3,3V30a3.009,3.009,0,0,0,3,3H27a3.009,3.009,0,0,0,3-3V15A3.009,3.009,0,0,0,27,12ZM13.35,9a4.65,4.65,0,1,1,9.3,0v3h-9.3ZM27,30H9V15H27Z" transform="translate(-6 -1.5)" fill="#fff" opacity="0.94"/>
|
3 |
+
</svg>
|
inc/class-cmp-render_html.php
CHANGED
@@ -316,6 +316,12 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
|
|
316 |
**/
|
317 |
public function cmp_wp_footer() {
|
318 |
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
include dirname( __FILE__) . '/render/footer.php';
|
320 |
|
321 |
return;
|
@@ -352,6 +358,7 @@ class CMP_Coming_Soon_and_Maintenance_Render_HTML extends CMP_Coming_Soon_and_Ma
|
|
352 |
*/
|
353 |
public function cmp_subscribe_type() {
|
354 |
$subscribe_type = get_option('niteoCS_subscribe_type', '2');
|
|
|
355 |
if ( $subscribe_type == '3' ) {
|
356 |
$optin_type = $this->mailoptin_campaign_type();
|
357 |
$subscribe_type = $optin_type === 'lightbox' ? '0' : $subscribe_type;
|
316 |
**/
|
317 |
public function cmp_wp_footer() {
|
318 |
|
319 |
+
$login_icon = get_option('niteoCS_login_icon', '0');
|
320 |
+
|
321 |
+
if ( $login_icon !== '0' ) {
|
322 |
+
include dirname( __FILE__) . '/render/login-icon.php';
|
323 |
+
}
|
324 |
+
|
325 |
include dirname( __FILE__) . '/render/footer.php';
|
326 |
|
327 |
return;
|
358 |
*/
|
359 |
public function cmp_subscribe_type() {
|
360 |
$subscribe_type = get_option('niteoCS_subscribe_type', '2');
|
361 |
+
|
362 |
if ( $subscribe_type == '3' ) {
|
363 |
$optin_type = $this->mailoptin_campaign_type();
|
364 |
$subscribe_type = $optin_type === 'lightbox' ? '0' : $subscribe_type;
|
inc/render/custom-css.php
CHANGED
@@ -20,14 +20,14 @@ if ( isset( $_GET['background'] ) && !empty($_GET['background']) ) {
|
|
20 |
// add CMP CSS to all themes
|
21 |
ob_start(); ?>
|
22 |
|
23 |
-
<style>
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
</style>
|
31 |
|
32 |
<?php
|
33 |
|
@@ -139,6 +139,37 @@ if ( in_array( $themeslug, $this->cmp_premium_themes_installed() ) ) {
|
|
139 |
}
|
140 |
}
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
$css = ob_get_clean();
|
143 |
|
144 |
$custom_css = ( get_option('niteoCS_custom_css', '') != '' ) ? '<style>'.stripslashes( wp_filter_nohtml_kses( get_option('niteoCS_custom_css') ) ).'</style>' : '';
|
20 |
// add CMP CSS to all themes
|
21 |
ob_start(); ?>
|
22 |
|
23 |
+
<style>
|
24 |
+
/* wp video shortcode */
|
25 |
+
.wp-video {margin: 0 auto;}
|
26 |
+
.wp-video-shortcode {max-width: 100%;}
|
27 |
+
/* google recaptcha badge */
|
28 |
+
.grecaptcha-badge {display: none;}
|
29 |
+
.text-logo {display: inline-block;}
|
30 |
+
</style>
|
31 |
|
32 |
<?php
|
33 |
|
139 |
}
|
140 |
}
|
141 |
|
142 |
+
if ( get_option('niteoCS_login_icon', '0') !== '0' ) {
|
143 |
+
$top = get_option('niteoCS_login_icon[position]', '30');
|
144 |
+
$position = $top == '100' ? 'calc(100% - 60px)' : $top . '%';
|
145 |
+
$radius = get_option('niteoCS_login_icon[radius]', '0');
|
146 |
+
|
147 |
+
?>
|
148 |
+
<style>
|
149 |
+
#login-icon {
|
150 |
+
position: fixed;
|
151 |
+
top: <?php echo esc_attr($position);?>;
|
152 |
+
right: 0;
|
153 |
+
width: 60px;
|
154 |
+
height: 60px;
|
155 |
+
background: <?php echo esc_attr(get_option('niteoCS_login_icon[background]', '#000000'));?>;
|
156 |
+
opacity: <?php echo esc_attr(get_option('niteoCS_login_icon[opacity]', '0.6'));?>;
|
157 |
+
display: flex;
|
158 |
+
align-items: center;
|
159 |
+
justify-content: center;
|
160 |
+
transition: opacity 300ms ease-in-out;
|
161 |
+
z-index: 100000;
|
162 |
+
border-top-left-radius: <?php echo $top == '0' ? '' : esc_attr( $radius );?>px;
|
163 |
+
border-bottom-left-radius: <?php echo $top == '100' ? '' : esc_attr( $radius );?>px;
|
164 |
+
}
|
165 |
+
#login-icon:hover {
|
166 |
+
opacity: 1;
|
167 |
+
}
|
168 |
+
</style>
|
169 |
+
<?php
|
170 |
+
|
171 |
+
}
|
172 |
+
|
173 |
$css = ob_get_clean();
|
174 |
|
175 |
$custom_css = ( get_option('niteoCS_custom_css', '') != '' ) ? '<style>'.stripslashes( wp_filter_nohtml_kses( get_option('niteoCS_custom_css') ) ).'</style>' : '';
|
inc/render/login-icon.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
3 |
+
|
4 |
+
$login_url = wp_login_url();
|
5 |
+
$custom_login_url = get_option('niteoCS_custom_login_url', get_option( 'whl_page' ));
|
6 |
+
|
7 |
+
if ( $custom_login_url ) {
|
8 |
+
$login_url = $custom_login_url;
|
9 |
+
} ?>
|
10 |
+
|
11 |
+
<div id="login-icon">
|
12 |
+
<a href="<?php echo esc_url( $login_url );?>"><img src="<?php echo CMP_PLUGIN_URL . '/img/login-icon.svg';?>"/></a>
|
13 |
+
</div>
|
inc/settings/settings-counter.php
CHANGED
@@ -9,7 +9,7 @@ if ( isset($_POST['niteoCS_counter_date']) ) {
|
|
9 |
update_option('niteoCS_counter_date', sanitize_text_field( $_POST['niteoCS_counter_date'] ));
|
10 |
|
11 |
if ( $_POST['niteoCS_counter_date'] > time() ) {
|
12 |
-
|
13 |
}
|
14 |
}
|
15 |
|
9 |
update_option('niteoCS_counter_date', sanitize_text_field( $_POST['niteoCS_counter_date'] ));
|
10 |
|
11 |
if ( $_POST['niteoCS_counter_date'] > time() ) {
|
12 |
+
delete_option( 'niteoCS_counter_email' );
|
13 |
}
|
14 |
}
|
15 |
|
inc/settings/settings-login-icon.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
3 |
+
|
4 |
+
if ( isset( $_POST['niteoCS_login_icon'] ) ) {
|
5 |
+
update_option( 'niteoCS_login_icon', sanitize_text_field($_POST['niteoCS_login_icon']) );
|
6 |
+
}
|
7 |
+
if ( isset( $_POST['niteoCS_login_icon_background'] ) ) {
|
8 |
+
update_option( 'niteoCS_login_icon[background]', sanitize_text_field($_POST['niteoCS_login_icon_background']) );
|
9 |
+
}
|
10 |
+
if ( isset( $_POST['niteoCS_login_icon_position'] ) ) {
|
11 |
+
update_option( 'niteoCS_login_icon[position]', sanitize_text_field($_POST['niteoCS_login_icon_position']) );
|
12 |
+
}
|
13 |
+
if ( isset( $_POST['niteoCS_login_icon_opacity'] ) ) {
|
14 |
+
update_option( 'niteoCS_login_icon[opacity]', sanitize_text_field($_POST['niteoCS_login_icon_opacity']) );
|
15 |
+
}
|
16 |
+
if ( isset( $_POST['niteoCS_login_icon_radius'] ) ) {
|
17 |
+
update_option( 'niteoCS_login_icon[radius]', sanitize_text_field($_POST['niteoCS_login_icon_radius']) );
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
$login_icon_status = get_option('niteoCS_login_icon', '0');
|
22 |
+
$login_icon_position = get_option('niteoCS_login_icon[position]', '30');
|
23 |
+
$login_icon_background = get_option('niteoCS_login_icon[background]', '#000000');
|
24 |
+
$login_icon_opacity = get_option('niteoCS_login_icon[opacity]', '0.6');
|
25 |
+
$login_icon_radius = get_option('niteoCS_login_icon[radius]', '0');
|
26 |
+
$login_icon_login_url = get_option('niteoCS_login_icon[radius]', '0');
|
27 |
+
?>
|
28 |
+
|
29 |
+
<div class="table-wrapper theme-setup">
|
30 |
+
<h3><?php _e('Login Icon', 'cmp-coming-soon-maintenance');?></h3>
|
31 |
+
<table class="theme-setup">
|
32 |
+
<tbody>
|
33 |
+
<tr>
|
34 |
+
<th>
|
35 |
+
<fieldset>
|
36 |
+
<legend class="screen-reader-text">
|
37 |
+
<span><?php _e('Login Icons', 'cmp-coming-soon-maintenance');?></span>
|
38 |
+
</legend>
|
39 |
+
|
40 |
+
<p>
|
41 |
+
<label title="Enabled">
|
42 |
+
<input type="radio" class="login-icon" name="niteoCS_login_icon" value="1" <?php checked( '1', $login_icon_status );?>> <?php _e('Enabled', 'cmp-coming-soon-maintenance');?>
|
43 |
+
</label>
|
44 |
+
</p>
|
45 |
+
|
46 |
+
<p>
|
47 |
+
<label title="Disabled">
|
48 |
+
<input type="radio" class="login-icon" name="niteoCS_login_icon" value="0" <?php checked( '0', $login_icon_status );?>> <?php _e('Disabled', 'cmp-coming-soon-maintenance');?>
|
49 |
+
</label>
|
50 |
+
</p>
|
51 |
+
|
52 |
+
</fieldset>
|
53 |
+
</th>
|
54 |
+
|
55 |
+
<td class="login-icon-switch x0">
|
56 |
+
<fieldset>
|
57 |
+
<p><?php _e('Login Icon is disabled', 'cmp-coming-soon-maintenance')?></p>
|
58 |
+
</fieldset>
|
59 |
+
</td>
|
60 |
+
|
61 |
+
<td class="login-icon-switch x1">
|
62 |
+
|
63 |
+
<fieldset>
|
64 |
+
<h4><?php _e('Background Color', 'cmp-coming-soon-maintenance');?></h4>
|
65 |
+
<input type="text" name="niteoCS_login_icon_background" id="niteoCS_login_icon_background" value="<?php echo esc_attr( $login_icon_background ); ?>" data-default-color="#000000" class="regular-text code"><br>
|
66 |
+
</fieldset>
|
67 |
+
|
68 |
+
<fieldset style="margin: 1em 0">
|
69 |
+
<h4><?php _e('Position from Top', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $login_icon_position ); ?></span>%</h4>
|
70 |
+
<input type="range" class="login-icon-position" name="niteoCS_login_icon_position" min="0" max="100" step="1" value="<?php echo esc_attr( $login_icon_position ); ?>" />
|
71 |
+
</fieldset>
|
72 |
+
|
73 |
+
<fieldset>
|
74 |
+
<h4><?php _e('Icon Opacity', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $login_icon_opacity ); ?></span></h4>
|
75 |
+
<input type="range" class="login-icon-opacity" name="niteoCS_login_icon_opacity" min="0" max="1" step="0.1" value="<?php echo esc_attr( $login_icon_opacity ); ?>" />
|
76 |
+
</fieldset>
|
77 |
+
<br>
|
78 |
+
<fieldset>
|
79 |
+
<h4><?php _e('Rouned Corners', 'cmp-coming-soon-maintenance');?>: <span><?php echo esc_attr( $login_icon_radius ); ?></span>px</h4>
|
80 |
+
<input type="range" class="login-icon-radius" name="niteoCS_login_icon_radius" min="0" max="30" step="1" value="<?php echo esc_attr( $login_icon_radius ); ?>" />
|
81 |
+
</fieldset>
|
82 |
+
|
83 |
+
<br>
|
84 |
+
<p class="cmp-hint"><?php echo sprintf(__('Login Icon URL is set to standard WordPress wp-login.php. To Change the URL go to %s > Custom Login URL.', 'cmp-coming-soon-maintenance'), '<a href="' . get_admin_url() . 'admin.php?page=cmp-advanced">CMP Advanced Settings</a>');?></p>
|
85 |
+
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
|
89 |
+
<?php echo $this->render_settings->submit(); ?>
|
90 |
+
|
91 |
+
</tbody>
|
92 |
+
</table>
|
93 |
+
|
94 |
+
</div>
|
95 |
+
|
96 |
+
<script>
|
97 |
+
jQuery(document).ready(function($){
|
98 |
+
// ini color picker
|
99 |
+
jQuery('#niteoCS_login_icon_background').wpColorPicker();
|
100 |
+
jQuery( '.login-icon-opacity' ).on('input', function () {
|
101 |
+
var value = jQuery(this).val();
|
102 |
+
jQuery(this).parent().find('span').html(value);
|
103 |
+
});
|
104 |
+
jQuery( '.login-icon-position' ).on('input', function () {
|
105 |
+
var value = jQuery(this).val();
|
106 |
+
jQuery(this).parent().find('span').html(value);
|
107 |
+
});
|
108 |
+
jQuery( '.login-icon-radius' ).on('input', function () {
|
109 |
+
var value = jQuery(this).val();
|
110 |
+
jQuery(this).parent().find('span').html(value);
|
111 |
+
});
|
112 |
+
});
|
113 |
+
</script>
|
js/cmp-advanced.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
|
3 |
var tab = document.location.hash.substring(1);
|
4 |
var action = jQuery("#csoptions").attr("action");
|
5 |
var importing = false;
|
6 |
|
7 |
// function to tab navigation
|
8 |
-
navtab = function(tab) {
|
9 |
jQuery(
|
10 |
".cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab"
|
11 |
).removeClass("nav-tab-active");
|
@@ -60,12 +60,12 @@ jQuery(document).ready(function($) {
|
|
60 |
);
|
61 |
}
|
62 |
|
63 |
-
window.onhashchange = function() {
|
64 |
tab = document.location.hash.substring(1);
|
65 |
navtab(tab);
|
66 |
};
|
67 |
|
68 |
-
jQuery(".cmp-coming-soon-maintenance .nav-tab").click(function(e) {
|
69 |
e.preventDefault();
|
70 |
tab = jQuery(this).data("tab");
|
71 |
document.location.hash = tab;
|
@@ -80,12 +80,12 @@ jQuery(document).ready(function($) {
|
|
80 |
cmp_repeat_fields('footer_scripts');
|
81 |
|
82 |
// upload json file button
|
83 |
-
jQuery('#cmp-import-json').on('change', function(e) {
|
84 |
// change label
|
85 |
jQuery('.import-json-label').attr('data-default', e.target.files[0].name);
|
86 |
|
87 |
var reader = new FileReader();
|
88 |
-
reader.onload = function(e) {
|
89 |
jQuery('#cmp-import-input').val(e.target.result);
|
90 |
}
|
91 |
|
@@ -99,27 +99,27 @@ jQuery(document).ready(function($) {
|
|
99 |
});
|
100 |
|
101 |
// export button ajax call
|
102 |
-
jQuery('#cmp-export-json').click(function(e){
|
103 |
-
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
});
|
116 |
|
117 |
// import button ajax call
|
118 |
-
jQuery('#cmp-import-settings').click(function(e){
|
119 |
|
120 |
e.preventDefault();
|
121 |
|
122 |
-
if (
|
123 |
return false;
|
124 |
}
|
125 |
|
@@ -127,21 +127,21 @@ jQuery(document).ready(function($) {
|
|
127 |
var $label = jQuery('.import-json-label');
|
128 |
|
129 |
// remove settings keys with media if no media import
|
130 |
-
if (
|
131 |
|
132 |
var settings = new Array('niteoCS_banner_id', 'niteoCS_logo_id', 'niteoCS_seo_img_id');
|
133 |
|
134 |
json = jQuery.parseJSON(json);
|
135 |
|
136 |
-
json.map(function(value, index) {
|
137 |
-
for (
|
138 |
-
if
|
139 |
json.splice(index, 1);
|
140 |
}
|
141 |
-
|
142 |
}
|
143 |
});
|
144 |
-
|
145 |
json = JSON.stringify(json);
|
146 |
|
147 |
}
|
@@ -154,62 +154,62 @@ jQuery(document).ready(function($) {
|
|
154 |
|
155 |
importing = true;
|
156 |
|
157 |
-
var ajaxTime= new Date().getTime();
|
158 |
|
159 |
// change label
|
160 |
$label.html('<i class="fa fa-cog fa-spin" aria-hidden="true"></i> importing..');
|
161 |
$label.attr('data-default', '');
|
162 |
|
163 |
-
jQuery.post(ajaxurl, data, function(response) {
|
164 |
|
165 |
-
if (
|
166 |
var totalTime = new Date().getTime() - ajaxTime;
|
167 |
var result = jQuery.parseJSON(response);
|
168 |
|
169 |
-
if (
|
170 |
-
if (
|
171 |
$label.addClass('import-success');
|
172 |
} else {
|
173 |
$label.addClass('import-fail');
|
174 |
}
|
175 |
-
|
176 |
$label.html('');
|
177 |
$label.attr('data-default', result.message);
|
178 |
|
179 |
} else {
|
180 |
-
setTimeout(function(){
|
181 |
|
182 |
-
if (
|
183 |
$label.addClass('import-success');
|
184 |
} else {
|
185 |
$label.addClass('import-fail');
|
186 |
}
|
187 |
-
|
188 |
$label.html('');
|
189 |
$label.attr('data-default', result.message);
|
190 |
}, 2000 - totalTime);
|
191 |
}
|
192 |
|
193 |
-
}
|
194 |
});
|
195 |
});
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
value = (
|
201 |
-
value = (
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
|
207 |
-
|
208 |
-
|
209 |
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
});
|
214 |
|
215 |
jQuery('select[name="niteoCS_topbar_version"]').select2({
|
@@ -217,30 +217,30 @@ jQuery(document).ready(function($) {
|
|
217 |
minimumResultsForSearch: -1
|
218 |
});
|
219 |
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
}
|
245 |
});
|
246 |
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
|
3 |
var tab = document.location.hash.substring(1);
|
4 |
var action = jQuery("#csoptions").attr("action");
|
5 |
var importing = false;
|
6 |
|
7 |
// function to tab navigation
|
8 |
+
navtab = function (tab) {
|
9 |
jQuery(
|
10 |
".cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab"
|
11 |
).removeClass("nav-tab-active");
|
60 |
);
|
61 |
}
|
62 |
|
63 |
+
window.onhashchange = function () {
|
64 |
tab = document.location.hash.substring(1);
|
65 |
navtab(tab);
|
66 |
};
|
67 |
|
68 |
+
jQuery(".cmp-coming-soon-maintenance .nav-tab").click(function (e) {
|
69 |
e.preventDefault();
|
70 |
tab = jQuery(this).data("tab");
|
71 |
document.location.hash = tab;
|
80 |
cmp_repeat_fields('footer_scripts');
|
81 |
|
82 |
// upload json file button
|
83 |
+
jQuery('#cmp-import-json').on('change', function (e) {
|
84 |
// change label
|
85 |
jQuery('.import-json-label').attr('data-default', e.target.files[0].name);
|
86 |
|
87 |
var reader = new FileReader();
|
88 |
+
reader.onload = function (e) {
|
89 |
jQuery('#cmp-import-input').val(e.target.result);
|
90 |
}
|
91 |
|
99 |
});
|
100 |
|
101 |
// export button ajax call
|
102 |
+
jQuery('#cmp-export-json').click(function (e) {
|
103 |
+
e.preventDefault();
|
104 |
|
105 |
+
var data = {
|
106 |
+
action: "cmp_ajax_export_settings",
|
107 |
+
security: jQuery(this).data('security'),
|
108 |
+
};
|
109 |
+
|
110 |
+
jQuery.post(ajaxurl, data, function (response) {
|
111 |
+
if (response) {
|
112 |
+
jQuery('<iframe />').attr('src', ajaxurl + '?action=cmp_ajax_export_settings&security=' + jQuery('#cmp-export-json').data('security')).appendTo('body').hide();
|
113 |
+
}
|
114 |
+
});
|
115 |
});
|
116 |
|
117 |
// import button ajax call
|
118 |
+
jQuery('#cmp-import-settings').click(function (e) {
|
119 |
|
120 |
e.preventDefault();
|
121 |
|
122 |
+
if (importing === true) {
|
123 |
return false;
|
124 |
}
|
125 |
|
127 |
var $label = jQuery('.import-json-label');
|
128 |
|
129 |
// remove settings keys with media if no media import
|
130 |
+
if (!jQuery('#cmp-import-media').is(':checked')) {
|
131 |
|
132 |
var settings = new Array('niteoCS_banner_id', 'niteoCS_logo_id', 'niteoCS_seo_img_id');
|
133 |
|
134 |
json = jQuery.parseJSON(json);
|
135 |
|
136 |
+
json.map(function (value, index) {
|
137 |
+
for (var key in value) {
|
138 |
+
if (settings.indexOf(key) > -1) {
|
139 |
json.splice(index, 1);
|
140 |
}
|
141 |
+
|
142 |
}
|
143 |
});
|
144 |
+
|
145 |
json = JSON.stringify(json);
|
146 |
|
147 |
}
|
154 |
|
155 |
importing = true;
|
156 |
|
157 |
+
var ajaxTime = new Date().getTime();
|
158 |
|
159 |
// change label
|
160 |
$label.html('<i class="fa fa-cog fa-spin" aria-hidden="true"></i> importing..');
|
161 |
$label.attr('data-default', '');
|
162 |
|
163 |
+
jQuery.post(ajaxurl, data, function (response) {
|
164 |
|
165 |
+
if (response) {
|
166 |
var totalTime = new Date().getTime() - ajaxTime;
|
167 |
var result = jQuery.parseJSON(response);
|
168 |
|
169 |
+
if (totalTime > 2000) {
|
170 |
+
if (result.result == 'success') {
|
171 |
$label.addClass('import-success');
|
172 |
} else {
|
173 |
$label.addClass('import-fail');
|
174 |
}
|
175 |
+
|
176 |
$label.html('');
|
177 |
$label.attr('data-default', result.message);
|
178 |
|
179 |
} else {
|
180 |
+
setTimeout(function () {
|
181 |
|
182 |
+
if (result.result == 'success') {
|
183 |
$label.addClass('import-success');
|
184 |
} else {
|
185 |
$label.addClass('import-fail');
|
186 |
}
|
187 |
+
|
188 |
$label.html('');
|
189 |
$label.attr('data-default', result.message);
|
190 |
}, 2000 - totalTime);
|
191 |
}
|
192 |
|
193 |
+
}
|
194 |
});
|
195 |
});
|
196 |
|
197 |
+
function toggle_settings(classname) {
|
198 |
+
jQuery('.' + classname).change(function () {
|
199 |
+
var value = jQuery('.' + classname + ':checked').val();
|
200 |
+
value = (jQuery.isNumeric(value)) ? 'x' + value : value;
|
201 |
+
value = (value === undefined) ? 'x' + 0 : value;
|
202 |
|
203 |
+
jQuery('.' + classname + '-switch.' + value).css('display', 'block');
|
204 |
+
jQuery('.' + classname + '-switch:not(.' + value + ')').css('display', 'none');
|
205 |
+
});
|
206 |
|
207 |
+
jQuery('.' + classname).first().trigger('change');
|
208 |
+
}
|
209 |
|
210 |
+
jQuery('.cmp-whitelist-select, .cmp-blacklist, .cmp-user_roles').select2({
|
211 |
+
width: 'calc(100% - 1em)',
|
212 |
+
placeholder: 'Click to select..',
|
213 |
});
|
214 |
|
215 |
jQuery('select[name="niteoCS_topbar_version"]').select2({
|
217 |
minimumResultsForSearch: -1
|
218 |
});
|
219 |
|
220 |
+
function cmp_repeat_fields(field_id) {
|
221 |
+
jQuery('#add-' + field_id).click(function (e) {
|
222 |
+
e.preventDefault();
|
223 |
+
var $wrapper = jQuery('#wrapper-' + field_id);
|
224 |
+
var $target = jQuery('#wrapper-' + field_id + ' .target-repeater-fields');
|
225 |
+
var $fields = $wrapper.find('.source-repeater-fields').children().clone();
|
226 |
+
$($fields[0]).val('');
|
227 |
+
$($target).append($fields);
|
228 |
+
});
|
229 |
+
|
230 |
+
cmp_delete_field(field_id);
|
231 |
+
}
|
232 |
+
|
233 |
+
function cmp_delete_field(field_id) {
|
234 |
+
jQuery('#wrapper-' + field_id + ' .target-repeater-fields').on('click', 'a[href=#delete-' + field_id + ']', function (e) {
|
235 |
+
e.preventDefault();
|
236 |
+
$(this).prev().remove();
|
237 |
+
$(this).remove();
|
238 |
+
});
|
239 |
+
|
240 |
+
jQuery('#wrapper-' + field_id + ' .source-repeater-fields').on('click', 'a[href=#delete-' + field_id + ']', function (e) {
|
241 |
+
e.preventDefault();
|
242 |
+
$(this).prev().val('');
|
243 |
+
});
|
244 |
}
|
245 |
});
|
246 |
|
js/settings.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
jQuery(document).ready(function($) {
|
2 |
var tab = document.location.hash.substring(1);
|
3 |
var action = jQuery("#csoptions").attr("action");
|
4 |
var settings = jQuery(
|
@@ -6,12 +6,12 @@ jQuery(document).ready(function($) {
|
|
6 |
).serialize();
|
7 |
|
8 |
// ini custom css textarea to codeEditor
|
9 |
-
if (
|
10 |
wp.codeEditor.initialize("niteoCS_custom_css");
|
11 |
}
|
12 |
|
13 |
// function to tab navigation
|
14 |
-
navtab = function(tab) {
|
15 |
jQuery(
|
16 |
".cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab"
|
17 |
).removeClass("nav-tab-active");
|
@@ -65,13 +65,13 @@ jQuery(document).ready(function($) {
|
|
65 |
);
|
66 |
}
|
67 |
|
68 |
-
window.onhashchange = function() {
|
69 |
tab = document.location.hash.substring(1);
|
70 |
navtab(tab);
|
71 |
};
|
72 |
-
|
73 |
|
74 |
-
|
|
|
75 |
e.preventDefault();
|
76 |
tab = jQuery(this).data("tab");
|
77 |
document.location.hash = tab;
|
@@ -109,6 +109,7 @@ jQuery(document).ready(function($) {
|
|
109 |
toggle_settings("overlay-text");
|
110 |
toggle_settings("cmp-logo-size");
|
111 |
toggle_settings("recaptcha-toggle");
|
|
|
112 |
|
113 |
toggle_select("counter-action");
|
114 |
toggle_select("subscribe-method");
|
@@ -124,10 +125,10 @@ jQuery(document).ready(function($) {
|
|
124 |
placeholder: "Click to select.."
|
125 |
});
|
126 |
|
127 |
-
jQuery(".cmp-coming-soon-maintenance #cmp-status").click(function() {
|
128 |
jQuery(".cmp-coming-soon-maintenance .cmp-status input[type=radio]").prop(
|
129 |
"disabled",
|
130 |
-
function(_, val) {
|
131 |
return !val;
|
132 |
}
|
133 |
);
|
@@ -135,10 +136,10 @@ jQuery(document).ready(function($) {
|
|
135 |
jQuery('.cmp-status-pages').fadeToggle();
|
136 |
});
|
137 |
|
138 |
-
jQuery('.cmp-status-pages input[type=radio]').change(function() {
|
139 |
jQuery('.cmp-status-pages input[type=radio]').parent().removeClass('active');
|
140 |
jQuery(this).parent().addClass('active');
|
141 |
-
|
142 |
});
|
143 |
|
144 |
cmp_status_inputs();
|
@@ -147,7 +148,7 @@ jQuery(document).ready(function($) {
|
|
147 |
// Make clickable status radio buttons
|
148 |
jQuery(
|
149 |
".cmp-coming-soon-maintenance .cmp-status.switch:not(.disabled)"
|
150 |
-
).click(function() {
|
151 |
if (
|
152 |
jQuery(".cmp-coming-soon-maintenance #cmp-status").prop("checked") ==
|
153 |
false
|
@@ -172,14 +173,14 @@ jQuery(document).ready(function($) {
|
|
172 |
}
|
173 |
|
174 |
// expandable tabs
|
175 |
-
jQuery(".cmp-coming-soon-maintenance .table-wrapper h3").click(function() {
|
176 |
jQuery(this)
|
177 |
.parent()
|
178 |
.toggleClass("closed");
|
179 |
});
|
180 |
|
181 |
// test unsplash image
|
182 |
-
jQuery(".cmp-coming-soon-maintenance #test-unsplash").click(function(e) {
|
183 |
e.preventDefault();
|
184 |
|
185 |
var media_wrapper = jQuery(".cmp-coming-soon-maintenance #unsplash-media"),
|
@@ -226,12 +227,12 @@ jQuery(document).ready(function($) {
|
|
226 |
params: params
|
227 |
};
|
228 |
|
229 |
-
jQuery.post(ajaxurl, data, function(response) {
|
230 |
var unsplash = JSON.parse(response);
|
231 |
|
232 |
jQuery("#unsplash_img").remove();
|
233 |
|
234 |
-
var loadingTimeout = setTimeout(function() {
|
235 |
jQuery("#test-unsplash").prop("disabled", false);
|
236 |
jQuery("#test-unsplash").text("Display Unsplash Photo");
|
237 |
jQuery("#unsplash-media").html(
|
@@ -249,7 +250,7 @@ jQuery(document).ready(function($) {
|
|
249 |
var img_url = unsplash[0]["links"]["html"];
|
250 |
var img_id = unsplash[0]["id"];
|
251 |
} else {
|
252 |
-
var img =unsplash["urls"]["raw"] + "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588";
|
253 |
var author = unsplash["user"]["name"];
|
254 |
var author_url = unsplash["user"]["links"]["html"];
|
255 |
var img_url = unsplash["links"]["html"];
|
@@ -258,7 +259,7 @@ jQuery(document).ready(function($) {
|
|
258 |
|
259 |
jQuery("<img />", { src: img, id: "unsplash_img" }).one(
|
260 |
"load",
|
261 |
-
function() {
|
262 |
//Set something to run when it finishes loading
|
263 |
jQuery(this).appendTo(media_wrapper);
|
264 |
jQuery(this).fadeIn();
|
@@ -266,14 +267,14 @@ jQuery(document).ready(function($) {
|
|
266 |
jQuery("#test-unsplash").text("Display Unsplash Photo");
|
267 |
jQuery(".unsplash-id").html(
|
268 |
'<a href="' +
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
);
|
278 |
jQuery(".blur-range").trigger("input");
|
279 |
clearTimeout(loadingTimeout);
|
@@ -289,10 +290,10 @@ jQuery(document).ready(function($) {
|
|
289 |
);
|
290 |
jQuery(".cmp-coming-soon-maintenance #unsplash-media").html(
|
291 |
"<p>Error " +
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
);
|
297 |
clearTimeout(loadingTimeout);
|
298 |
}
|
@@ -302,7 +303,7 @@ jQuery(document).ready(function($) {
|
|
302 |
}
|
303 |
});
|
304 |
|
305 |
-
videoPreview = function() {
|
306 |
// return of video background is not selected
|
307 |
if (
|
308 |
jQuery(".cmp-coming-soon-maintenance .background-type:checked").val() !=
|
@@ -348,8 +349,8 @@ jQuery(document).ready(function($) {
|
|
348 |
if (videoURL != "") {
|
349 |
jQuery(".cmp-coming-soon-maintenance .video-local-wrapper").html(
|
350 |
'<video width="600" height="400" controls><source src="' +
|
351 |
-
|
352 |
-
|
353 |
);
|
354 |
}
|
355 |
}
|
@@ -361,7 +362,7 @@ jQuery(document).ready(function($) {
|
|
361 |
// display videos on background change to video type
|
362 |
jQuery(".cmp-coming-soon-maintenance .background-type").on(
|
363 |
"change",
|
364 |
-
function() {
|
365 |
videoPreview();
|
366 |
}
|
367 |
);
|
@@ -369,14 +370,14 @@ jQuery(document).ready(function($) {
|
|
369 |
// display YT video while inserting YT URL
|
370 |
jQuery(".cmp-coming-soon-maintenance #niteoCS-youtube-url").on(
|
371 |
"keyup",
|
372 |
-
function() {
|
373 |
videoPreview();
|
374 |
}
|
375 |
);
|
376 |
|
377 |
jQuery(".cmp-coming-soon-maintenance .banner-video-source").on(
|
378 |
"change",
|
379 |
-
function() {
|
380 |
videoPreview();
|
381 |
}
|
382 |
);
|
@@ -389,7 +390,7 @@ jQuery(document).ready(function($) {
|
|
389 |
|
390 |
jQuery('.unsplash_banner select[name^="unsplash_feed"]').on(
|
391 |
"change",
|
392 |
-
function() {
|
393 |
unsplashfeed = jQuery(
|
394 |
'.unsplash_banner select[name^="unsplash_feed"] option:selected'
|
395 |
).val();
|
@@ -406,7 +407,7 @@ jQuery(document).ready(function($) {
|
|
406 |
|
407 |
// preview gradient on select change
|
408 |
jQuery(".cmp-coming-soon-maintenance select.background-gradient")
|
409 |
-
.on("change", function() {
|
410 |
var gradient = jQuery(
|
411 |
".cmp-coming-soon-maintenance select.background-gradient option:selected"
|
412 |
).val();
|
@@ -468,14 +469,14 @@ jQuery(document).ready(function($) {
|
|
468 |
|
469 |
// banner background colorpicker
|
470 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_banner_color").wpColorPicker({
|
471 |
-
change: function(event, ui) {
|
472 |
jQuery(".color-preview").css("background-color", ui.color.toString());
|
473 |
}
|
474 |
});
|
475 |
|
476 |
// banner gradient background colorpicker one
|
477 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_one").wpColorPicker({
|
478 |
-
change: function(event, ui) {
|
479 |
jQuery(".gradient-preview").css({
|
480 |
background:
|
481 |
"-moz-linear-gradient(-45deg, " +
|
@@ -501,7 +502,7 @@ jQuery(document).ready(function($) {
|
|
501 |
|
502 |
// banner gradient background colorpicker two
|
503 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_two").wpColorPicker({
|
504 |
-
change: function(event, ui) {
|
505 |
jQuery(".gradient-preview").css({
|
506 |
background:
|
507 |
"-moz-linear-gradient(-45deg, " +
|
@@ -527,7 +528,7 @@ jQuery(document).ready(function($) {
|
|
527 |
|
528 |
// OVERLAY COLOR
|
529 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_overlay_color").wpColorPicker({
|
530 |
-
change: function(event, ui) {
|
531 |
jQuery(".thumbnail-overlay").css("background", ui.color.toString());
|
532 |
}
|
533 |
});
|
@@ -541,7 +542,7 @@ jQuery(document).ready(function($) {
|
|
541 |
// OVERLAY GRADIENT
|
542 |
jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").on(
|
543 |
"change",
|
544 |
-
function() {
|
545 |
var overlay_gradient = jQuery(
|
546 |
"select.overlay-gradient option:selected"
|
547 |
).val();
|
@@ -607,7 +608,7 @@ jQuery(document).ready(function($) {
|
|
607 |
|
608 |
// Overlay gradient colorpicker one
|
609 |
jQuery("#niteoCS_overlay_gradient_one").wpColorPicker({
|
610 |
-
change: function(event, ui) {
|
611 |
jQuery(".thumbnail-overlay").css({
|
612 |
background:
|
613 |
"-moz-linear-gradient(-45deg, " +
|
@@ -633,7 +634,7 @@ jQuery(document).ready(function($) {
|
|
633 |
|
634 |
// Overlay gradient colorpicker two
|
635 |
jQuery("#niteoCS_overlay_gradient_two").wpColorPicker({
|
636 |
-
change: function(event, ui) {
|
637 |
jQuery(".thumbnail-overlay").css({
|
638 |
background:
|
639 |
"-moz-linear-gradient(-45deg, " +
|
@@ -659,7 +660,7 @@ jQuery(document).ready(function($) {
|
|
659 |
|
660 |
// OVERLAY OPACITY
|
661 |
jQuery(".background-overlay-opacity")
|
662 |
-
.on("input", function() {
|
663 |
var value = jQuery(this).val();
|
664 |
jQuery(".thumbnail-overlay").css("opacity", value);
|
665 |
})
|
@@ -670,7 +671,7 @@ jQuery(document).ready(function($) {
|
|
670 |
|
671 |
jQuery(".cmp-coming-soon-maintenance .background-overlay").on(
|
672 |
"change",
|
673 |
-
function() {
|
674 |
gradientIni(jQuery(this).val());
|
675 |
}
|
676 |
);
|
@@ -704,7 +705,7 @@ jQuery(document).ready(function($) {
|
|
704 |
|
705 |
// BLUR PREVIEW
|
706 |
jQuery(".cmp-coming-soon-maintenance .blur-range")
|
707 |
-
.on("input", function() {
|
708 |
var value = jQuery(this).val();
|
709 |
jQuery(
|
710 |
".cmp-coming-soon-maintenance .background-thumb-wrapper img:not(.no-blur)"
|
@@ -715,7 +716,7 @@ jQuery(document).ready(function($) {
|
|
715 |
// banner pattern on change image preview
|
716 |
jQuery(
|
717 |
'.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"]'
|
718 |
-
).on("change", function() {
|
719 |
var pattern = jQuery(
|
720 |
'.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"] option:selected'
|
721 |
).val();
|
@@ -748,7 +749,7 @@ jQuery(document).ready(function($) {
|
|
748 |
// preview animation
|
749 |
jQuery(".cmp-coming-soon-maintenance .heading-animation").on(
|
750 |
"change",
|
751 |
-
function() {
|
752 |
heading_anim = jQuery(
|
753 |
".cmp-coming-soon-maintenance .heading-animation option:selected"
|
754 |
).val();
|
@@ -760,7 +761,7 @@ jQuery(document).ready(function($) {
|
|
760 |
|
761 |
jQuery(".cmp-coming-soon-maintenance .content-animation").on(
|
762 |
"change",
|
763 |
-
function() {
|
764 |
heading_anim = jQuery(
|
765 |
".cmp-coming-soon-maintenance .content-animation option:selected"
|
766 |
).val();
|
@@ -772,13 +773,13 @@ jQuery(document).ready(function($) {
|
|
772 |
|
773 |
// ----------------------- sortable social list -----------------------
|
774 |
// function to update social list
|
775 |
-
var update_social = function(name, key, val) {
|
776 |
var socialmedia = jQuery(
|
777 |
".cmp-coming-soon-maintenance #niteoCS_socialmedia"
|
778 |
).attr("value");
|
779 |
socialmedia = jQuery.parseJSON(socialmedia);
|
780 |
|
781 |
-
jQuery.each(socialmedia, function(i, ele) {
|
782 |
if (ele["name"] == name) {
|
783 |
ele[key] = val;
|
784 |
}
|
@@ -794,12 +795,12 @@ jQuery(document).ready(function($) {
|
|
794 |
if (!/Mobi/.test(navigator.userAgent)) {
|
795 |
var $sortableList = jQuery(".cmp-coming-soon-maintenance .social-inputs");
|
796 |
|
797 |
-
var sortEventHandler = function(event, ui) {
|
798 |
var inputs = $sortableList.find('input[type="text"]');
|
799 |
|
800 |
var order = ui.item.index();
|
801 |
|
802 |
-
inputs.each(function(i, ele) {
|
803 |
var name = jQuery(ele).data("name");
|
804 |
update_social(name, "order", i);
|
805 |
});
|
@@ -813,9 +814,9 @@ jQuery(document).ready(function($) {
|
|
813 |
}
|
814 |
|
815 |
// social checkbox to enable/disable input
|
816 |
-
(function($) {
|
817 |
-
jQuery.fn.toggleDisabled = function() {
|
818 |
-
return this.each(function() {
|
819 |
var $this = jQuery(this);
|
820 |
var active;
|
821 |
var name = $this.data("name");
|
@@ -833,7 +834,7 @@ jQuery(document).ready(function($) {
|
|
833 |
|
834 |
jQuery(
|
835 |
'.cmp-coming-soon-maintenance .social-inputs input[type="text"]'
|
836 |
-
).focusout(function() {
|
837 |
var name = jQuery(this).data("name");
|
838 |
var socialurl = jQuery(this).attr("value");
|
839 |
update_social(name, "url", socialurl);
|
@@ -841,13 +842,13 @@ jQuery(document).ready(function($) {
|
|
841 |
|
842 |
jQuery(
|
843 |
'.cmp-coming-soon-maintenance .social-inputs input[type="checkbox"]'
|
844 |
-
).click(function(e) {
|
845 |
var $this = jQuery(this).siblings('input[type="text"]');
|
846 |
$this.toggleDisabled();
|
847 |
});
|
848 |
|
849 |
// social icons active/inactive
|
850 |
-
jQuery(".cmp-coming-soon-maintenance .social-media i").click(function() {
|
851 |
var name = jQuery(this).data("name");
|
852 |
jQuery(this).toggleClass("active");
|
853 |
jQuery(
|
@@ -883,7 +884,7 @@ jQuery(document).ready(function($) {
|
|
883 |
|
884 |
|
885 |
// theme update via admin notice
|
886 |
-
jQuery(".cmp.update-theme").click(function(e) {
|
887 |
e.preventDefault();
|
888 |
var $this = jQuery(this),
|
889 |
$parent = $this.parents(".notice"),
|
@@ -909,18 +910,18 @@ jQuery(document).ready(function($) {
|
|
909 |
'<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>'
|
910 |
);
|
911 |
|
912 |
-
jQuery.post(ajaxurl, data, function(response) {
|
913 |
response = response.trim();
|
914 |
|
915 |
if (response == "success") {
|
916 |
-
setTimeout(function() {
|
917 |
$parent.removeClass("notice-warning").addClass("notice-success");
|
918 |
$parent
|
919 |
.find(".message")
|
920 |
.html(
|
921 |
"<span> " +
|
922 |
-
|
923 |
-
|
924 |
);
|
925 |
}, 1500);
|
926 |
} else {
|
@@ -931,8 +932,8 @@ jQuery(document).ready(function($) {
|
|
931 |
.find(".message")
|
932 |
.html(
|
933 |
'<i class="fa fa-frown-o" aria-hidden="true"></i><span> ' +
|
934 |
-
|
935 |
-
|
936 |
);
|
937 |
}
|
938 |
});
|
@@ -941,7 +942,7 @@ jQuery(document).ready(function($) {
|
|
941 |
// theme update via theme button
|
942 |
jQuery(".cmp-coming-soon-maintenance .theme-update.button").one(
|
943 |
"click",
|
944 |
-
function(e) {
|
945 |
e.preventDefault();
|
946 |
var $this = jQuery(this),
|
947 |
$wrapper = $this.closest(".theme-wrapper"),
|
@@ -965,13 +966,13 @@ jQuery(document).ready(function($) {
|
|
965 |
'<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'
|
966 |
);
|
967 |
|
968 |
-
jQuery.post(ajaxurl, data, function(response) {
|
969 |
if (response == "success") {
|
970 |
-
setTimeout(function() {
|
971 |
$this.html(
|
972 |
'<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'
|
973 |
);
|
974 |
-
setTimeout(function() {
|
975 |
$this.fadeOut();
|
976 |
}, 1500);
|
977 |
}, 1500);
|
@@ -986,7 +987,7 @@ jQuery(document).ready(function($) {
|
|
986 |
);
|
987 |
|
988 |
// display theme details overlay
|
989 |
-
jQuery(".cmp-coming-soon-maintenance .theme-details").click(function(e) {
|
990 |
e.preventDefault();
|
991 |
var $this = jQuery(this),
|
992 |
$wrapper = $this.closest(".theme-wrapper"),
|
@@ -1004,7 +1005,7 @@ jQuery(document).ready(function($) {
|
|
1004 |
.data("slug")
|
1005 |
};
|
1006 |
|
1007 |
-
jQuery.post(ajaxurl, data, function(response) {
|
1008 |
var buyButton = "";
|
1009 |
var versionInfo = "";
|
1010 |
var noticeHtml = "";
|
@@ -1049,36 +1050,36 @@ jQuery(document).ready(function($) {
|
|
1049 |
' <div class="theme-about">',
|
1050 |
' <div class="theme-screenshots">',
|
1051 |
' <div class="screenshot" style="background-image:url(\'' +
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
" </div>",
|
1057 |
' <div class="theme-info">',
|
1058 |
' <h2 class="theme-name">' +
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
' <p class="theme-author">By <a href="' +
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
noticeHtml,
|
1068 |
buyButton,
|
1069 |
' <div class="theme-description">' +
|
1070 |
-
|
1071 |
-
|
1072 |
" </div>",
|
1073 |
" </div>",
|
1074 |
' <div class="theme-actions">',
|
1075 |
' <a href="https://niteothemes.com/cmp-coming-soon-maintenance/?theme=' +
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
" </div>",
|
1083 |
" </div>",
|
1084 |
"</div>"
|
@@ -1089,7 +1090,7 @@ jQuery(document).ready(function($) {
|
|
1089 |
jQuery(".theme-overlay.cmp").append(html);
|
1090 |
|
1091 |
// attach close button handler
|
1092 |
-
jQuery(".theme-overlay.cmp .close").click(function(e) {
|
1093 |
e.preventDefault();
|
1094 |
// overflow body hidden
|
1095 |
jQuery("body").removeClass("modal-open");
|
@@ -1097,7 +1098,7 @@ jQuery(document).ready(function($) {
|
|
1097 |
});
|
1098 |
|
1099 |
// attach arrows navigation handler
|
1100 |
-
jQuery(".screenshots-nav .right").click(function() {
|
1101 |
i++;
|
1102 |
|
1103 |
if (i == Object.keys(screenshots).length) {
|
@@ -1113,7 +1114,7 @@ jQuery(document).ready(function($) {
|
|
1113 |
});
|
1114 |
|
1115 |
// attach arrows navigation handler
|
1116 |
-
jQuery(".screenshots-nav .left").click(function() {
|
1117 |
i--;
|
1118 |
|
1119 |
if (i < 0) {
|
@@ -1146,7 +1147,7 @@ jQuery(document).ready(function($) {
|
|
1146 |
$delete_button.css("display", "block");
|
1147 |
}
|
1148 |
|
1149 |
-
$add_button.click(function(e) {
|
1150 |
e.preventDefault();
|
1151 |
// If the media frame already exists, reopen it.
|
1152 |
if (media_uploader) {
|
@@ -1165,7 +1166,7 @@ jQuery(document).ready(function($) {
|
|
1165 |
type: [type]
|
1166 |
}
|
1167 |
})
|
1168 |
-
.on("select", function() {
|
1169 |
// Get media attachment details from the frame state
|
1170 |
var attachment = media_uploader
|
1171 |
.state()
|
@@ -1180,7 +1181,7 @@ jQuery(document).ready(function($) {
|
|
1180 |
$container.addClass("gallery-" + attachment.length);
|
1181 |
|
1182 |
// get images ID, append thumbnail and store IDs in hidden input
|
1183 |
-
jQuery(attachment).each(function(i) {
|
1184 |
if (attachment[i].sizes && attachment[i].sizes.large) {
|
1185 |
image = attachment[i].sizes.large.url;
|
1186 |
} else {
|
@@ -1196,8 +1197,8 @@ jQuery(document).ready(function($) {
|
|
1196 |
case "video":
|
1197 |
$container.append(
|
1198 |
'<video width="600" height="400" controls><source src="' +
|
1199 |
-
|
1200 |
-
|
1201 |
);
|
1202 |
break;
|
1203 |
|
@@ -1246,7 +1247,7 @@ jQuery(document).ready(function($) {
|
|
1246 |
.open();
|
1247 |
});
|
1248 |
|
1249 |
-
$delete_button.click(function(e) {
|
1250 |
jQuery(this).css("display", "none");
|
1251 |
$container.find("img").remove();
|
1252 |
jQuery("#niteoCS-" + name + "-id").val("");
|
@@ -1255,12 +1256,12 @@ jQuery(document).ready(function($) {
|
|
1255 |
}
|
1256 |
|
1257 |
// Retrieve Mailchimp lists
|
1258 |
-
jQuery(".cmp-coming-soon-maintenance #connect-mailchimp").click(function(e) {
|
1259 |
e.preventDefault();
|
1260 |
|
1261 |
var apikey = jQuery(
|
1262 |
-
|
1263 |
-
|
1264 |
security = jQuery(this).data("security"),
|
1265 |
button = jQuery(this);
|
1266 |
|
@@ -1279,14 +1280,14 @@ jQuery(document).ready(function($) {
|
|
1279 |
params: params
|
1280 |
};
|
1281 |
|
1282 |
-
jQuery.post(ajaxurl, data, function(response) {
|
1283 |
var lists = JSON.parse(response);
|
1284 |
|
1285 |
if (lists.response == 200) {
|
1286 |
jQuery("#niteoCS_mailchimp_list")
|
1287 |
.empty()
|
1288 |
.prop("disabled", false);
|
1289 |
-
jQuery.each(lists.lists, function(i, val) {
|
1290 |
jQuery("#niteoCS_mailchimp_list").append(
|
1291 |
'<option value="' + val.id + '">' + val.name + "</option>"
|
1292 |
);
|
@@ -1301,7 +1302,7 @@ jQuery(document).ready(function($) {
|
|
1301 |
|
1302 |
button.html("Retrieve Lists");
|
1303 |
button.prop("disabled", false);
|
1304 |
-
}).fail(function() {
|
1305 |
button.html("Retrieve Lists");
|
1306 |
button.prop("disabled", false);
|
1307 |
});
|
@@ -1310,7 +1311,7 @@ jQuery(document).ready(function($) {
|
|
1310 |
|
1311 |
function toggle_settings(classname) {
|
1312 |
// Logo type inputs
|
1313 |
-
jQuery(".cmp-coming-soon-maintenance ." + classname).change(function() {
|
1314 |
var value = jQuery(
|
1315 |
".cmp-coming-soon-maintenance ." + classname + ":checked"
|
1316 |
).val();
|
@@ -1322,10 +1323,10 @@ jQuery(document).ready(function($) {
|
|
1322 |
).css("display", "block");
|
1323 |
jQuery(
|
1324 |
".cmp-coming-soon-maintenance ." +
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
).css("display", "none");
|
1330 |
});
|
1331 |
|
@@ -1335,7 +1336,7 @@ jQuery(document).ready(function($) {
|
|
1335 |
}
|
1336 |
|
1337 |
function toggle_select(classname) {
|
1338 |
-
jQuery(".cmp-coming-soon-maintenance ." + classname).change(function() {
|
1339 |
var value = jQuery("." + classname).val();
|
1340 |
value = jQuery.isNumeric(value) ? "x" + value : value;
|
1341 |
|
@@ -1354,7 +1355,7 @@ jQuery(document).ready(function($) {
|
|
1354 |
}
|
1355 |
|
1356 |
function update_range(selector, target, method) {
|
1357 |
-
jQuery(selector).on("input", function() {
|
1358 |
var value = jQuery(this).val();
|
1359 |
// change label value
|
1360 |
if (method === "html") {
|
@@ -1375,7 +1376,7 @@ jQuery(document).ready(function($) {
|
|
1375 |
|
1376 |
// delete overlay color from premium themes after update 2.8
|
1377 |
jQuery(".cmp-coming-soon-maintenance .table-wrapper.theme-setup h4").each(
|
1378 |
-
function() {
|
1379 |
if (jQuery(this).html() == "Overlay Color") {
|
1380 |
jQuery(this)
|
1381 |
.parents("tr")
|
@@ -1386,7 +1387,7 @@ jQuery(document).ready(function($) {
|
|
1386 |
);
|
1387 |
|
1388 |
// warn users about unsaved changes for preview
|
1389 |
-
jQuery(".nav-tab-wrapper").on("click", ".theme-preview", function(e) {
|
1390 |
if (
|
1391 |
jQuery("#csoptions fieldset:not(.skip-preview-validation *)").serialize() !=
|
1392 |
settings
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
var tab = document.location.hash.substring(1);
|
3 |
var action = jQuery("#csoptions").attr("action");
|
4 |
var settings = jQuery(
|
6 |
).serialize();
|
7 |
|
8 |
// ini custom css textarea to codeEditor
|
9 |
+
if (wp.codeEditor && jQuery('#niteoCS_custom_css').length) {
|
10 |
wp.codeEditor.initialize("niteoCS_custom_css");
|
11 |
}
|
12 |
|
13 |
// function to tab navigation
|
14 |
+
navtab = function (tab) {
|
15 |
jQuery(
|
16 |
".cmp-coming-soon-maintenance .nav-tab-wrapper .nav-tab"
|
17 |
).removeClass("nav-tab-active");
|
65 |
);
|
66 |
}
|
67 |
|
68 |
+
window.onhashchange = function () {
|
69 |
tab = document.location.hash.substring(1);
|
70 |
navtab(tab);
|
71 |
};
|
|
|
72 |
|
73 |
+
|
74 |
+
jQuery(".cmp-coming-soon-maintenance .nav-tab:not(.theme-preview):not(.advanced)").click(function (e) {
|
75 |
e.preventDefault();
|
76 |
tab = jQuery(this).data("tab");
|
77 |
document.location.hash = tab;
|
109 |
toggle_settings("overlay-text");
|
110 |
toggle_settings("cmp-logo-size");
|
111 |
toggle_settings("recaptcha-toggle");
|
112 |
+
toggle_settings("login-icon");
|
113 |
|
114 |
toggle_select("counter-action");
|
115 |
toggle_select("subscribe-method");
|
125 |
placeholder: "Click to select.."
|
126 |
});
|
127 |
|
128 |
+
jQuery(".cmp-coming-soon-maintenance #cmp-status").click(function () {
|
129 |
jQuery(".cmp-coming-soon-maintenance .cmp-status input[type=radio]").prop(
|
130 |
"disabled",
|
131 |
+
function (_, val) {
|
132 |
return !val;
|
133 |
}
|
134 |
);
|
136 |
jQuery('.cmp-status-pages').fadeToggle();
|
137 |
});
|
138 |
|
139 |
+
jQuery('.cmp-status-pages input[type=radio]').change(function () {
|
140 |
jQuery('.cmp-status-pages input[type=radio]').parent().removeClass('active');
|
141 |
jQuery(this).parent().addClass('active');
|
142 |
+
|
143 |
});
|
144 |
|
145 |
cmp_status_inputs();
|
148 |
// Make clickable status radio buttons
|
149 |
jQuery(
|
150 |
".cmp-coming-soon-maintenance .cmp-status.switch:not(.disabled)"
|
151 |
+
).click(function () {
|
152 |
if (
|
153 |
jQuery(".cmp-coming-soon-maintenance #cmp-status").prop("checked") ==
|
154 |
false
|
173 |
}
|
174 |
|
175 |
// expandable tabs
|
176 |
+
jQuery(".cmp-coming-soon-maintenance .table-wrapper h3").click(function () {
|
177 |
jQuery(this)
|
178 |
.parent()
|
179 |
.toggleClass("closed");
|
180 |
});
|
181 |
|
182 |
// test unsplash image
|
183 |
+
jQuery(".cmp-coming-soon-maintenance #test-unsplash").click(function (e) {
|
184 |
e.preventDefault();
|
185 |
|
186 |
var media_wrapper = jQuery(".cmp-coming-soon-maintenance #unsplash-media"),
|
227 |
params: params
|
228 |
};
|
229 |
|
230 |
+
jQuery.post(ajaxurl, data, function (response) {
|
231 |
var unsplash = JSON.parse(response);
|
232 |
|
233 |
jQuery("#unsplash_img").remove();
|
234 |
|
235 |
+
var loadingTimeout = setTimeout(function () {
|
236 |
jQuery("#test-unsplash").prop("disabled", false);
|
237 |
jQuery("#test-unsplash").text("Display Unsplash Photo");
|
238 |
jQuery("#unsplash-media").html(
|
250 |
var img_url = unsplash[0]["links"]["html"];
|
251 |
var img_id = unsplash[0]["id"];
|
252 |
} else {
|
253 |
+
var img = unsplash["urls"]["raw"] + "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588";
|
254 |
var author = unsplash["user"]["name"];
|
255 |
var author_url = unsplash["user"]["links"]["html"];
|
256 |
var img_url = unsplash["links"]["html"];
|
259 |
|
260 |
jQuery("<img />", { src: img, id: "unsplash_img" }).one(
|
261 |
"load",
|
262 |
+
function () {
|
263 |
//Set something to run when it finishes loading
|
264 |
jQuery(this).appendTo(media_wrapper);
|
265 |
jQuery(this).fadeIn();
|
267 |
jQuery("#test-unsplash").text("Display Unsplash Photo");
|
268 |
jQuery(".unsplash-id").html(
|
269 |
'<a href="' +
|
270 |
+
img_url +
|
271 |
+
'" target="_blank">Photo</a> (ID: ' +
|
272 |
+
img_id +
|
273 |
+
') by <a href="' +
|
274 |
+
author_url +
|
275 |
+
'" target="_blank">' +
|
276 |
+
author +
|
277 |
+
'</a> / <a href="https://unsplash.com/" target="_blank">Unsplash</a>'
|
278 |
);
|
279 |
jQuery(".blur-range").trigger("input");
|
280 |
clearTimeout(loadingTimeout);
|
290 |
);
|
291 |
jQuery(".cmp-coming-soon-maintenance #unsplash-media").html(
|
292 |
"<p>Error " +
|
293 |
+
unsplash.response +
|
294 |
+
': <span style="text-transform:lowercase;">' +
|
295 |
+
JSON.parse(unsplash.body).errors +
|
296 |
+
"</span></p>"
|
297 |
);
|
298 |
clearTimeout(loadingTimeout);
|
299 |
}
|
303 |
}
|
304 |
});
|
305 |
|
306 |
+
videoPreview = function () {
|
307 |
// return of video background is not selected
|
308 |
if (
|
309 |
jQuery(".cmp-coming-soon-maintenance .background-type:checked").val() !=
|
349 |
if (videoURL != "") {
|
350 |
jQuery(".cmp-coming-soon-maintenance .video-local-wrapper").html(
|
351 |
'<video width="600" height="400" controls><source src="' +
|
352 |
+
videoURL +
|
353 |
+
'" type="video/mp4">Your browser does not support the video tag.</video>'
|
354 |
);
|
355 |
}
|
356 |
}
|
362 |
// display videos on background change to video type
|
363 |
jQuery(".cmp-coming-soon-maintenance .background-type").on(
|
364 |
"change",
|
365 |
+
function () {
|
366 |
videoPreview();
|
367 |
}
|
368 |
);
|
370 |
// display YT video while inserting YT URL
|
371 |
jQuery(".cmp-coming-soon-maintenance #niteoCS-youtube-url").on(
|
372 |
"keyup",
|
373 |
+
function () {
|
374 |
videoPreview();
|
375 |
}
|
376 |
);
|
377 |
|
378 |
jQuery(".cmp-coming-soon-maintenance .banner-video-source").on(
|
379 |
"change",
|
380 |
+
function () {
|
381 |
videoPreview();
|
382 |
}
|
383 |
);
|
390 |
|
391 |
jQuery('.unsplash_banner select[name^="unsplash_feed"]').on(
|
392 |
"change",
|
393 |
+
function () {
|
394 |
unsplashfeed = jQuery(
|
395 |
'.unsplash_banner select[name^="unsplash_feed"] option:selected'
|
396 |
).val();
|
407 |
|
408 |
// preview gradient on select change
|
409 |
jQuery(".cmp-coming-soon-maintenance select.background-gradient")
|
410 |
+
.on("change", function () {
|
411 |
var gradient = jQuery(
|
412 |
".cmp-coming-soon-maintenance select.background-gradient option:selected"
|
413 |
).val();
|
469 |
|
470 |
// banner background colorpicker
|
471 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_banner_color").wpColorPicker({
|
472 |
+
change: function (event, ui) {
|
473 |
jQuery(".color-preview").css("background-color", ui.color.toString());
|
474 |
}
|
475 |
});
|
476 |
|
477 |
// banner gradient background colorpicker one
|
478 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_one").wpColorPicker({
|
479 |
+
change: function (event, ui) {
|
480 |
jQuery(".gradient-preview").css({
|
481 |
background:
|
482 |
"-moz-linear-gradient(-45deg, " +
|
502 |
|
503 |
// banner gradient background colorpicker two
|
504 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_gradient_two").wpColorPicker({
|
505 |
+
change: function (event, ui) {
|
506 |
jQuery(".gradient-preview").css({
|
507 |
background:
|
508 |
"-moz-linear-gradient(-45deg, " +
|
528 |
|
529 |
// OVERLAY COLOR
|
530 |
jQuery(".cmp-coming-soon-maintenance #niteoCS_overlay_color").wpColorPicker({
|
531 |
+
change: function (event, ui) {
|
532 |
jQuery(".thumbnail-overlay").css("background", ui.color.toString());
|
533 |
}
|
534 |
});
|
542 |
// OVERLAY GRADIENT
|
543 |
jQuery(".cmp-coming-soon-maintenance select.overlay-gradient").on(
|
544 |
"change",
|
545 |
+
function () {
|
546 |
var overlay_gradient = jQuery(
|
547 |
"select.overlay-gradient option:selected"
|
548 |
).val();
|
608 |
|
609 |
// Overlay gradient colorpicker one
|
610 |
jQuery("#niteoCS_overlay_gradient_one").wpColorPicker({
|
611 |
+
change: function (event, ui) {
|
612 |
jQuery(".thumbnail-overlay").css({
|
613 |
background:
|
614 |
"-moz-linear-gradient(-45deg, " +
|
634 |
|
635 |
// Overlay gradient colorpicker two
|
636 |
jQuery("#niteoCS_overlay_gradient_two").wpColorPicker({
|
637 |
+
change: function (event, ui) {
|
638 |
jQuery(".thumbnail-overlay").css({
|
639 |
background:
|
640 |
"-moz-linear-gradient(-45deg, " +
|
660 |
|
661 |
// OVERLAY OPACITY
|
662 |
jQuery(".background-overlay-opacity")
|
663 |
+
.on("input", function () {
|
664 |
var value = jQuery(this).val();
|
665 |
jQuery(".thumbnail-overlay").css("opacity", value);
|
666 |
})
|
671 |
|
672 |
jQuery(".cmp-coming-soon-maintenance .background-overlay").on(
|
673 |
"change",
|
674 |
+
function () {
|
675 |
gradientIni(jQuery(this).val());
|
676 |
}
|
677 |
);
|
705 |
|
706 |
// BLUR PREVIEW
|
707 |
jQuery(".cmp-coming-soon-maintenance .blur-range")
|
708 |
+
.on("input", function () {
|
709 |
var value = jQuery(this).val();
|
710 |
jQuery(
|
711 |
".cmp-coming-soon-maintenance .background-thumb-wrapper img:not(.no-blur)"
|
716 |
// banner pattern on change image preview
|
717 |
jQuery(
|
718 |
'.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"]'
|
719 |
+
).on("change", function () {
|
720 |
var pattern = jQuery(
|
721 |
'.cmp-coming-soon-maintenance select[name^="niteoCS_banner_pattern"] option:selected'
|
722 |
).val();
|
749 |
// preview animation
|
750 |
jQuery(".cmp-coming-soon-maintenance .heading-animation").on(
|
751 |
"change",
|
752 |
+
function () {
|
753 |
heading_anim = jQuery(
|
754 |
".cmp-coming-soon-maintenance .heading-animation option:selected"
|
755 |
).val();
|
761 |
|
762 |
jQuery(".cmp-coming-soon-maintenance .content-animation").on(
|
763 |
"change",
|
764 |
+
function () {
|
765 |
heading_anim = jQuery(
|
766 |
".cmp-coming-soon-maintenance .content-animation option:selected"
|
767 |
).val();
|
773 |
|
774 |
// ----------------------- sortable social list -----------------------
|
775 |
// function to update social list
|
776 |
+
var update_social = function (name, key, val) {
|
777 |
var socialmedia = jQuery(
|
778 |
".cmp-coming-soon-maintenance #niteoCS_socialmedia"
|
779 |
).attr("value");
|
780 |
socialmedia = jQuery.parseJSON(socialmedia);
|
781 |
|
782 |
+
jQuery.each(socialmedia, function (i, ele) {
|
783 |
if (ele["name"] == name) {
|
784 |
ele[key] = val;
|
785 |
}
|
795 |
if (!/Mobi/.test(navigator.userAgent)) {
|
796 |
var $sortableList = jQuery(".cmp-coming-soon-maintenance .social-inputs");
|
797 |
|
798 |
+
var sortEventHandler = function (event, ui) {
|
799 |
var inputs = $sortableList.find('input[type="text"]');
|
800 |
|
801 |
var order = ui.item.index();
|
802 |
|
803 |
+
inputs.each(function (i, ele) {
|
804 |
var name = jQuery(ele).data("name");
|
805 |
update_social(name, "order", i);
|
806 |
});
|
814 |
}
|
815 |
|
816 |
// social checkbox to enable/disable input
|
817 |
+
(function ($) {
|
818 |
+
jQuery.fn.toggleDisabled = function () {
|
819 |
+
return this.each(function () {
|
820 |
var $this = jQuery(this);
|
821 |
var active;
|
822 |
var name = $this.data("name");
|
834 |
|
835 |
jQuery(
|
836 |
'.cmp-coming-soon-maintenance .social-inputs input[type="text"]'
|
837 |
+
).focusout(function () {
|
838 |
var name = jQuery(this).data("name");
|
839 |
var socialurl = jQuery(this).attr("value");
|
840 |
update_social(name, "url", socialurl);
|
842 |
|
843 |
jQuery(
|
844 |
'.cmp-coming-soon-maintenance .social-inputs input[type="checkbox"]'
|
845 |
+
).click(function (e) {
|
846 |
var $this = jQuery(this).siblings('input[type="text"]');
|
847 |
$this.toggleDisabled();
|
848 |
});
|
849 |
|
850 |
// social icons active/inactive
|
851 |
+
jQuery(".cmp-coming-soon-maintenance .social-media i").click(function () {
|
852 |
var name = jQuery(this).data("name");
|
853 |
jQuery(this).toggleClass("active");
|
854 |
jQuery(
|
884 |
|
885 |
|
886 |
// theme update via admin notice
|
887 |
+
jQuery(".cmp.update-theme").click(function (e) {
|
888 |
e.preventDefault();
|
889 |
var $this = jQuery(this),
|
890 |
$parent = $this.parents(".notice"),
|
910 |
'<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>'
|
911 |
);
|
912 |
|
913 |
+
jQuery.post(ajaxurl, data, function (response) {
|
914 |
response = response.trim();
|
915 |
|
916 |
if (response == "success") {
|
917 |
+
setTimeout(function () {
|
918 |
$parent.removeClass("notice-warning").addClass("notice-success");
|
919 |
$parent
|
920 |
.find(".message")
|
921 |
.html(
|
922 |
"<span> " +
|
923 |
+
themeName +
|
924 |
+
' CMP theme was updated sucessfully! You can enjoy latest features now :) </span><i class="fa fa-smile-o" aria-hidden="true"></i>'
|
925 |
);
|
926 |
}, 1500);
|
927 |
} else {
|
932 |
.find(".message")
|
933 |
.html(
|
934 |
'<i class="fa fa-frown-o" aria-hidden="true"></i><span> ' +
|
935 |
+
error +
|
936 |
+
"</span>"
|
937 |
);
|
938 |
}
|
939 |
});
|
942 |
// theme update via theme button
|
943 |
jQuery(".cmp-coming-soon-maintenance .theme-update.button").one(
|
944 |
"click",
|
945 |
+
function (e) {
|
946 |
e.preventDefault();
|
947 |
var $this = jQuery(this),
|
948 |
$wrapper = $this.closest(".theme-wrapper"),
|
966 |
'<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'
|
967 |
);
|
968 |
|
969 |
+
jQuery.post(ajaxurl, data, function (response) {
|
970 |
if (response == "success") {
|
971 |
+
setTimeout(function () {
|
972 |
$this.html(
|
973 |
'<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'
|
974 |
);
|
975 |
+
setTimeout(function () {
|
976 |
$this.fadeOut();
|
977 |
}, 1500);
|
978 |
}, 1500);
|
987 |
);
|
988 |
|
989 |
// display theme details overlay
|
990 |
+
jQuery(".cmp-coming-soon-maintenance .theme-details").click(function (e) {
|
991 |
e.preventDefault();
|
992 |
var $this = jQuery(this),
|
993 |
$wrapper = $this.closest(".theme-wrapper"),
|
1005 |
.data("slug")
|
1006 |
};
|
1007 |
|
1008 |
+
jQuery.post(ajaxurl, data, function (response) {
|
1009 |
var buyButton = "";
|
1010 |
var versionInfo = "";
|
1011 |
var noticeHtml = "";
|
1050 |
' <div class="theme-about">',
|
1051 |
' <div class="theme-screenshots">',
|
1052 |
' <div class="screenshot" style="background-image:url(\'' +
|
1053 |
+
screenshots["0"] +
|
1054 |
+
"')\">" +
|
1055 |
+
arrows +
|
1056 |
+
"</div>",
|
1057 |
" </div>",
|
1058 |
' <div class="theme-info">',
|
1059 |
' <h2 class="theme-name">' +
|
1060 |
+
response["name"] +
|
1061 |
+
versionInfo +
|
1062 |
+
"</h2>",
|
1063 |
' <p class="theme-author">By <a href="' +
|
1064 |
+
response["author_homepage"] +
|
1065 |
+
'" target="_blank">' +
|
1066 |
+
response["author"] +
|
1067 |
+
"</a></p>",
|
1068 |
noticeHtml,
|
1069 |
buyButton,
|
1070 |
' <div class="theme-description">' +
|
1071 |
+
response["description"] +
|
1072 |
+
"</div>",
|
1073 |
" </div>",
|
1074 |
" </div>",
|
1075 |
' <div class="theme-actions">',
|
1076 |
' <a href="https://niteothemes.com/cmp-coming-soon-maintenance/?theme=' +
|
1077 |
+
slug +
|
1078 |
+
"&utm_source=cmp&utm_medium=referral&utm_campaign=" +
|
1079 |
+
slug +
|
1080 |
+
'" class="button cmp-preview" target="_blank" aria-label="Preview ' +
|
1081 |
+
response["name"] +
|
1082 |
+
'">Live Preview</a>',
|
1083 |
" </div>",
|
1084 |
" </div>",
|
1085 |
"</div>"
|
1090 |
jQuery(".theme-overlay.cmp").append(html);
|
1091 |
|
1092 |
// attach close button handler
|
1093 |
+
jQuery(".theme-overlay.cmp .close").click(function (e) {
|
1094 |
e.preventDefault();
|
1095 |
// overflow body hidden
|
1096 |
jQuery("body").removeClass("modal-open");
|
1098 |
});
|
1099 |
|
1100 |
// attach arrows navigation handler
|
1101 |
+
jQuery(".screenshots-nav .right").click(function () {
|
1102 |
i++;
|
1103 |
|
1104 |
if (i == Object.keys(screenshots).length) {
|
1114 |
});
|
1115 |
|
1116 |
// attach arrows navigation handler
|
1117 |
+
jQuery(".screenshots-nav .left").click(function () {
|
1118 |
i--;
|
1119 |
|
1120 |
if (i < 0) {
|
1147 |
$delete_button.css("display", "block");
|
1148 |
}
|
1149 |
|
1150 |
+
$add_button.click(function (e) {
|
1151 |
e.preventDefault();
|
1152 |
// If the media frame already exists, reopen it.
|
1153 |
if (media_uploader) {
|
1166 |
type: [type]
|
1167 |
}
|
1168 |
})
|
1169 |
+
.on("select", function () {
|
1170 |
// Get media attachment details from the frame state
|
1171 |
var attachment = media_uploader
|
1172 |
.state()
|
1181 |
$container.addClass("gallery-" + attachment.length);
|
1182 |
|
1183 |
// get images ID, append thumbnail and store IDs in hidden input
|
1184 |
+
jQuery(attachment).each(function (i) {
|
1185 |
if (attachment[i].sizes && attachment[i].sizes.large) {
|
1186 |
image = attachment[i].sizes.large.url;
|
1187 |
} else {
|
1197 |
case "video":
|
1198 |
$container.append(
|
1199 |
'<video width="600" height="400" controls><source src="' +
|
1200 |
+
image +
|
1201 |
+
'" type="video/mp4">Your browser does not support the video tag.</video>'
|
1202 |
);
|
1203 |
break;
|
1204 |
|
1247 |
.open();
|
1248 |
});
|
1249 |
|
1250 |
+
$delete_button.click(function (e) {
|
1251 |
jQuery(this).css("display", "none");
|
1252 |
$container.find("img").remove();
|
1253 |
jQuery("#niteoCS-" + name + "-id").val("");
|
1256 |
}
|
1257 |
|
1258 |
// Retrieve Mailchimp lists
|
1259 |
+
jQuery(".cmp-coming-soon-maintenance #connect-mailchimp").click(function (e) {
|
1260 |
e.preventDefault();
|
1261 |
|
1262 |
var apikey = jQuery(
|
1263 |
+
'.cmp-coming-soon-maintenance input[name="niteoCS_mailchimp_apikey"]'
|
1264 |
+
).val(),
|
1265 |
security = jQuery(this).data("security"),
|
1266 |
button = jQuery(this);
|
1267 |
|
1280 |
params: params
|
1281 |
};
|
1282 |
|
1283 |
+
jQuery.post(ajaxurl, data, function (response) {
|
1284 |
var lists = JSON.parse(response);
|
1285 |
|
1286 |
if (lists.response == 200) {
|
1287 |
jQuery("#niteoCS_mailchimp_list")
|
1288 |
.empty()
|
1289 |
.prop("disabled", false);
|
1290 |
+
jQuery.each(lists.lists, function (i, val) {
|
1291 |
jQuery("#niteoCS_mailchimp_list").append(
|
1292 |
'<option value="' + val.id + '">' + val.name + "</option>"
|
1293 |
);
|
1302 |
|
1303 |
button.html("Retrieve Lists");
|
1304 |
button.prop("disabled", false);
|
1305 |
+
}).fail(function () {
|
1306 |
button.html("Retrieve Lists");
|
1307 |
button.prop("disabled", false);
|
1308 |
});
|
1311 |
|
1312 |
function toggle_settings(classname) {
|
1313 |
// Logo type inputs
|
1314 |
+
jQuery(".cmp-coming-soon-maintenance ." + classname).change(function () {
|
1315 |
var value = jQuery(
|
1316 |
".cmp-coming-soon-maintenance ." + classname + ":checked"
|
1317 |
).val();
|
1323 |
).css("display", "block");
|
1324 |
jQuery(
|
1325 |
".cmp-coming-soon-maintenance ." +
|
1326 |
+
classname +
|
1327 |
+
"-switch:not(." +
|
1328 |
+
value +
|
1329 |
+
")"
|
1330 |
).css("display", "none");
|
1331 |
});
|
1332 |
|
1336 |
}
|
1337 |
|
1338 |
function toggle_select(classname) {
|
1339 |
+
jQuery(".cmp-coming-soon-maintenance ." + classname).change(function () {
|
1340 |
var value = jQuery("." + classname).val();
|
1341 |
value = jQuery.isNumeric(value) ? "x" + value : value;
|
1342 |
|
1355 |
}
|
1356 |
|
1357 |
function update_range(selector, target, method) {
|
1358 |
+
jQuery(selector).on("input", function () {
|
1359 |
var value = jQuery(this).val();
|
1360 |
// change label value
|
1361 |
if (method === "html") {
|
1376 |
|
1377 |
// delete overlay color from premium themes after update 2.8
|
1378 |
jQuery(".cmp-coming-soon-maintenance .table-wrapper.theme-setup h4").each(
|
1379 |
+
function () {
|
1380 |
if (jQuery(this).html() == "Overlay Color") {
|
1381 |
jQuery(this)
|
1382 |
.parents("tr")
|
1387 |
);
|
1388 |
|
1389 |
// warn users about unsaved changes for preview
|
1390 |
+
jQuery(".nav-tab-wrapper").on("click", ".theme-preview", function (e) {
|
1391 |
if (
|
1392 |
jQuery("#csoptions fieldset:not(.skip-preview-validation *)").serialize() !=
|
1393 |
settings
|
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)").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("pattern",!1,"image","background"),l("video-thumb",!1,"image","img"),l("video-local",!1,"video","video"),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"),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="fa 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(e){switch(i=n[e].sizes&&n[e].sizes.large?n[e].sizes.large.url:n[e].url,s+=(0===e?"":",")+n[e].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==e?jQuery(".big-thumb").append('<img src="'+i+'" alt=""/>'):n.length>1&&0!==e?o.append('<img src="'+i+'" alt="" class="no-blur"/>'):o.find(".big-thumb").length?jQuery(".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).attr("value");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="fa 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="fa fa-smile-o" 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="fa fa-frown-o" 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="fa 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="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'),setTimeout(function(){n.fadeOut()},1500)},1500):(e=e.slice(0,-1),n.html('<i class="fa fa-frown-o" 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="fa 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="fa fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fa 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="fa 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("pattern", !1, "image", "background"), l("video-thumb", !1, "image", "img"), l("video-local", !1, "video", "video"), 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"), 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 = "", o = 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 i = { feed: a, url: t, feat: "", custom_str: "" }; jQuery(this).prop("disabled", !0), jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'); var r = { action: "niteo_unsplash", security: o, params: i }; 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 o = a[0].urls.raw + "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588", i = a[0].user.name, r = a[0].user.links.html, c = a[0].links.html, s = a[0].id; else o = a.urls.raw + "?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&fit=max&w=588", i = a.user.name, r = a.user.links.html, c = a.links.html, s = a.id; jQuery("<img />", { src: o, 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">' + i + '</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 o = jQuery("#niteoCS-video-local-id").data("url"); "" != o && jQuery(".cmp-coming-soon-maintenance .video-local-wrapper").html('<video width="600" height="400" controls><source src="' + o + '" 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 o = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val(); function i(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-" + o).css("display", "block"), jQuery('.unsplash_banner select[name^="unsplash_feed"]').on("change", function () { o = jQuery('.unsplash_banner select[name^="unsplash_feed"] option:selected').val(), jQuery(".unsplash-feed").css("display", "none"), jQuery(".unsplash-feed-" + o).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"), i(jQuery(".cmp-coming-soon-maintenance .background-overlay").val()), jQuery(".cmp-coming-soon-maintenance .background-overlay").on("change", function () { i(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, o) { o.name == e && (o[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 o, i = 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 && (i.find("img").remove(), i.attr("class", e + "-wrapper custom-gallery"), i.addClass("gallery-" + n.length), jQuery(n).each(function (e) { switch (o = n[e].sizes && n[e].sizes.large ? n[e].sizes.large.url : n[e].url, s += (0 === e ? "" : ",") + n[e].id, t) { case "video": i.append('<video width="600" height="400" controls><source src="' + o + '" type="video/mp4">Your browser does not support the video tag.</video>'); break; case "background": i.css("background-image", "url('" + o + "')"); break; case "img": default: n.length > 1 && 0 == e ? jQuery(".big-thumb").append('<img src="' + o + '" alt=""/>') : n.length > 1 && 0 !== e ? i.append('<img src="' + o + '" alt="" class="no-blur"/>') : i.find(".big-thumb").length ? jQuery(".big-thumb").append('<img src="' + o + '" alt=""/>') : i.append('<img src="' + o + '" 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"), i.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).attr("value"); 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"), o = n.data("slug"), i = n.data("name"), r = { action: "cmp_theme_update_install", security: t, file: { name: o, tmp_name: "", url: jQuery(this).data("remote_url") + "?action=download&slug=" + o } }; a.find(".message").html('<i class="fa 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> " + i + ' CMP theme was updated sucessfully! You can enjoy latest features now :) </span><i class="fa fa-smile-o" 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="fa fa-frown-o" 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"), o = a.data("slug"), i = { action: "cmp_theme_update_install", security: t, file: { name: o, tmp_name: "", url: a.data("remote_url") + "?action=download&slug=" + o } }; n.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'), jQuery.post(ajaxurl, i, function (e) { "success" == e ? setTimeout(function () { n.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'), setTimeout(function () { n.fadeOut() }, 1500) }, 1500) : (e = e.slice(0, -1), n.html('<i class="fa fa-frown-o" 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"), o = n.data("type"), i = 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" == i && (s = '<span class="theme-version">Installed version: ' + t + "</span>"), "1" != i && "premium" == o) c = '<button type="button" class="theme-purchase button hide"><a href="' + n.find(".cmp-purchase-theme").attr("href") + '" target="_blank"><i class="fa 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="fa fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fa 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 o = { apikey: n, security: a }; jQuery(this).prop("disabled", !0), jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> retrieving lists..</span>'); var i = { action: "cmp_mailchimp_list_ajax", security: a, params: o }; jQuery.post(ajaxurl, i, 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.7.
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
@@ -66,7 +66,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
66 |
|
67 |
// define constants
|
68 |
private function constants() {
|
69 |
-
$this->define( 'CMP_VERSION', '3.7.
|
70 |
$this->define( 'CMP_DEBUG', FALSE );
|
71 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
72 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
@@ -74,7 +74,7 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
74 |
$this->define( 'CMP_PREMIUM_THEMES_DIR', plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/' );
|
75 |
$this->define( 'CMP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
76 |
$this->define( 'CMP_UPDATE_URL', 'https://niteothemes.com/updates/' );
|
77 |
-
CMP_DEBUG ===
|
78 |
? $this->define( 'CMP_LICENSE_SERVER_URL', 'https://niteothemes.com/dev2/' )
|
79 |
: $this->define( 'CMP_LICENSE_SERVER_URL', 'https://niteothemes.com/' );
|
80 |
}
|
@@ -233,15 +233,15 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
233 |
public function cmp_premium_themes() {
|
234 |
|
235 |
$premium_themes = array();
|
236 |
-
array_push( $premium_themes, array('name' => 'divi', 'url' => 'https://niteothemes.com/downloads/cmp-divi-addon/?utm_source=cmp&utm_medium=referral&utm_campaign=divi', 'price' => '29') );
|
237 |
-
array_push( $premium_themes, array('name' => 'thor', 'url' => 'https://niteothemes.com/downloads/cmp-thor-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=delta', 'price' => '10') );
|
238 |
-
array_push( $premium_themes, array('name' => 'delta', 'url' => 'https://niteothemes.com/downloads/cmp-delta-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=delta', 'price' => '10') );
|
239 |
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') );
|
240 |
array_push( $premium_themes, array('name' => 'fifty', 'url' => 'https://niteothemes.com/downloads/cmp-fifty-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=fifty', 'price' => '10') );
|
241 |
-
array_push( $premium_themes, array('name' => '
|
242 |
array_push( $premium_themes, array('name' => 'libra', 'url' => 'https://niteothemes.com/downloads/cmp-libra-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=libra', 'price' => '10') );
|
243 |
-
array_push( $premium_themes, array('name' => 'tempie', 'url' => 'https://niteothemes.com/downloads/cmp-tempie-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=tempie', 'price' => '10') );
|
244 |
array_push( $premium_themes, array('name' => 'timex', 'url' => 'https://niteothemes.com/downloads/cmp-timex-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=timex', 'price' => '15') );
|
|
|
|
|
|
|
|
|
245 |
array_push( $premium_themes, array('name' => 'stylo', 'url' => 'https://niteothemes.com/downloads/cmp-stylo-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=stylo', 'price' => '10') );
|
246 |
array_push( $premium_themes, array('name' => 'apollo', 'url' => 'https://niteothemes.com/downloads/cmp-apollo-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=apollo', 'price' => '10') );
|
247 |
array_push( $premium_themes, array('name' => 'ares', 'url' => 'https://niteothemes.com/downloads/cmp-ares-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=ares', 'price' => '10') );
|
@@ -597,12 +597,12 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
597 |
|
598 |
// if timer < timestamp do pre-set action
|
599 |
if ( get_option('niteoCS_counter_date' ) < time() ) {
|
600 |
-
|
601 |
$action = get_option('niteoCS_countdown_action', 'no-action');
|
602 |
|
603 |
// send notification email if email transient is not set
|
604 |
-
if ( get_option('niteoCS_countdown_notification', '1') == '1' &&
|
605 |
-
|
606 |
switch ( $action ) {
|
607 |
case 'no-action':
|
608 |
$message = __('Counter expired but it is set to make no action - you should login to your Wordpress Admin and adjust the expired timer or disable Coming Soon / Maintenance Mode.', 'cmp-coming-soon-maintenance');
|
@@ -626,8 +626,9 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
626 |
$headers = array('Content-Type: text/plain; charset=UTF-8');
|
627 |
// send email
|
628 |
wp_mail( $to, $subject, $body, $headers );
|
629 |
-
|
630 |
-
|
|
|
631 |
|
632 |
}
|
633 |
|
@@ -882,8 +883,6 @@ if ( ! class_exists( 'CMP_Coming_Soon_and_Maintenance' ) ) :
|
|
882 |
}
|
883 |
|
884 |
$this->cmp_purge_cache();
|
885 |
-
|
886 |
-
delete_transient( 'cmp_counter_email' );
|
887 |
}
|
888 |
|
889 |
/**
|
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.7.2
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
66 |
|
67 |
// define constants
|
68 |
private function constants() {
|
69 |
+
$this->define( 'CMP_VERSION', '3.7.2' );
|
70 |
$this->define( 'CMP_DEBUG', FALSE );
|
71 |
$this->define( 'CMP_AUTHOR', 'NiteoThemes' );
|
72 |
$this->define( 'CMP_AUTHOR_HOMEPAGE', 'https://niteothemes.com' );
|
74 |
$this->define( 'CMP_PREMIUM_THEMES_DIR', plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/' );
|
75 |
$this->define( 'CMP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
76 |
$this->define( 'CMP_UPDATE_URL', 'https://niteothemes.com/updates/' );
|
77 |
+
CMP_DEBUG === FALSE
|
78 |
? $this->define( 'CMP_LICENSE_SERVER_URL', 'https://niteothemes.com/dev2/' )
|
79 |
: $this->define( 'CMP_LICENSE_SERVER_URL', 'https://niteothemes.com/' );
|
80 |
}
|
233 |
public function cmp_premium_themes() {
|
234 |
|
235 |
$premium_themes = array();
|
|
|
|
|
|
|
236 |
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') );
|
237 |
array_push( $premium_themes, array('name' => 'fifty', 'url' => 'https://niteothemes.com/downloads/cmp-fifty-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=fifty', 'price' => '10') );
|
238 |
+
array_push( $premium_themes, array('name' => 'delta', 'url' => 'https://niteothemes.com/downloads/cmp-delta-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=delta', 'price' => '10') );
|
239 |
array_push( $premium_themes, array('name' => 'libra', 'url' => 'https://niteothemes.com/downloads/cmp-libra-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=libra', 'price' => '10') );
|
|
|
240 |
array_push( $premium_themes, array('name' => 'timex', 'url' => 'https://niteothemes.com/downloads/cmp-timex-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=timex', 'price' => '15') );
|
241 |
+
array_push( $premium_themes, array('name' => 'divi', 'url' => 'https://niteothemes.com/downloads/cmp-divi-addon/?utm_source=cmp&utm_medium=referral&utm_campaign=divi', 'price' => '29') );
|
242 |
+
array_push( $premium_themes, array('name' => 'thor', 'url' => 'https://niteothemes.com/downloads/cmp-thor-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=thor', 'price' => '10') );
|
243 |
+
array_push( $premium_themes, array('name' => 'hardwork_premium', 'url' => 'https://niteothemes.com/downloads/cmp-hardwork-premium/?utm_source=cmp&utm_medium=referral&utm_campaign=hardwork_premium', 'price' => '10') );
|
244 |
+
array_push( $premium_themes, array('name' => 'tempie', 'url' => 'https://niteothemes.com/downloads/cmp-tempie-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=tempie', 'price' => '10') );
|
245 |
array_push( $premium_themes, array('name' => 'stylo', 'url' => 'https://niteothemes.com/downloads/cmp-stylo-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=stylo', 'price' => '10') );
|
246 |
array_push( $premium_themes, array('name' => 'apollo', 'url' => 'https://niteothemes.com/downloads/cmp-apollo-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=apollo', 'price' => '10') );
|
247 |
array_push( $premium_themes, array('name' => 'ares', 'url' => 'https://niteothemes.com/downloads/cmp-ares-theme/?utm_source=cmp&utm_medium=referral&utm_campaign=ares', 'price' => '10') );
|
597 |
|
598 |
// if timer < timestamp do pre-set action
|
599 |
if ( get_option('niteoCS_counter_date' ) < time() ) {
|
600 |
+
|
601 |
$action = get_option('niteoCS_countdown_action', 'no-action');
|
602 |
|
603 |
// send notification email if email transient is not set
|
604 |
+
if ( get_option('niteoCS_countdown_notification', '1') == '1' && get_option( 'niteoCS_counter_email', false ) !== 'sent' ) {
|
605 |
+
|
606 |
switch ( $action ) {
|
607 |
case 'no-action':
|
608 |
$message = __('Counter expired but it is set to make no action - you should login to your Wordpress Admin and adjust the expired timer or disable Coming Soon / Maintenance Mode.', 'cmp-coming-soon-maintenance');
|
626 |
$headers = array('Content-Type: text/plain; charset=UTF-8');
|
627 |
// send email
|
628 |
wp_mail( $to, $subject, $body, $headers );
|
629 |
+
|
630 |
+
// set email option
|
631 |
+
update_option( 'niteoCS_counter_email', 'sent' );
|
632 |
|
633 |
}
|
634 |
|
883 |
}
|
884 |
|
885 |
$this->cmp_purge_cache();
|
|
|
|
|
886 |
}
|
887 |
|
888 |
/**
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: coming soon, landing page, launch page, maintenance mode, under constructi
|
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.4
|
8 |
-
Stable tag: 3.7.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -34,6 +34,7 @@ Packed with functions like Whitelist/Blacklist to enable CMP only on specific pa
|
|
34 |
<li>CMP Landing page can be enabled on specific pages only (Blacklist and Whitelist) if required.</li>
|
35 |
<li>Supporting WordPress roles to bypass CMP and display your full website for logged-in users.</li>
|
36 |
<li>Bypass URL to preview a website for your customers.</li>
|
|
|
37 |
<li>Compatible with custom WordPress login URL.</li>
|
38 |
<li>Configurable Countdown Action - disable Coming soon / Maintenance mode or redirect to another website.</li>
|
39 |
<li>Configurable SEO meta tags for search engines, editable favicon, Search Engine Visibility and No-cache Headers.</li>
|
@@ -150,6 +151,13 @@ https://www.youtube.com/watch?v=uxuJfHzwdtE
|
|
150 |
<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>
|
151 |
|
152 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
<h4>CMP 3.7.1 - 12-Mar-20</h4>
|
154 |
<ul>
|
155 |
<li>Introducing CMP & Divi Integration!</li>
|
5 |
Requires at least: 3.0
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.4
|
8 |
+
Stable tag: 3.7.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
34 |
<li>CMP Landing page can be enabled on specific pages only (Blacklist and Whitelist) if required.</li>
|
35 |
<li>Supporting WordPress roles to bypass CMP and display your full website for logged-in users.</li>
|
36 |
<li>Bypass URL to preview a website for your customers.</li>
|
37 |
+
<li>Possibility to display Login Icon Button on Coming soon pages.</li>
|
38 |
<li>Compatible with custom WordPress login URL.</li>
|
39 |
<li>Configurable Countdown Action - disable Coming soon / Maintenance mode or redirect to another website.</li>
|
40 |
<li>Configurable SEO meta tags for search engines, editable favicon, Search Engine Visibility and No-cache Headers.</li>
|
151 |
<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>
|
152 |
|
153 |
== Changelog ==
|
154 |
+
<h4>CMP 3.7.2 - 29-Mar-20</h4>
|
155 |
+
<ul>
|
156 |
+
<li>New Feature: Display login button on Coming Soon pages to navigate to login WordPress URL.</li>
|
157 |
+
<li>Change email notification flag from set_transient to update_option since it's not working properly for some users using caching plugins.</li>
|
158 |
+
<li>Added Advanced Tab to Basic Settings for a faster navigation.</li>
|
159 |
+
</ul>
|
160 |
+
|
161 |
<h4>CMP 3.7.1 - 12-Mar-20</h4>
|
162 |
<ul>
|
163 |
<li>Introducing CMP & Divi Integration!</li>
|