Version Description
Download this release
Release Info
Developer | niteo |
Plugin | CMP – Coming Soon & Maintenance Plugin by NiteoThemes |
Version | 1.9.0 |
Comparing to | |
See all releases |
Code changes from version 1.8.0 to 1.9.0
- cmp-settings.php +81 -12
- cmp-sidebar.php +13 -6
- css/cmp-settings-style.css +27 -12
- js/settings.js +143 -1
- js/settings.min.js +1 -1
- js/vidim.min.js +8 -0
- niteo-cmp.php +131 -26
- readme.txt +24 -7
- themes/construct/construct-theme.php +111 -144
- themes/construct/style.css +16 -4
- themes/countdown/countdown-theme.php +129 -176
- themes/countdown/style.css +7 -3
- themes/hardwork/hardwork-theme.php +63 -123
- themes/hardwork/style.css +13 -1
cmp-settings.php
CHANGED
@@ -58,6 +58,22 @@ if (isset($_POST['niteoCS_banner_pattern_custom_'.$themeslug])) {
|
|
58 |
update_option('niteoCS_banner_pattern_custom['.$themeslug.']', esc_url_raw($_POST['niteoCS_banner_pattern_custom_'.$themeslug]));
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
if (isset($_POST['niteoCS_banner_id_'.$themeslug])) {
|
63 |
$allnums = true;
|
@@ -229,11 +245,14 @@ $niteoCS_unsplash_0 = get_option('niteoCS_unsplash_0['.$themeslug.']');
|
|
229 |
$niteoCS_unsplash_2 = get_option('niteoCS_unsplash_2['.$themeslug.']');
|
230 |
$niteoCS_unsplash_3 = get_option('niteoCS_unsplash_3['.$themeslug.']');
|
231 |
$niteoCS_unsplash_category = get_option('niteoCS_unsplash_category['.$themeslug.']', 'buildings');
|
|
|
232 |
$niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
|
233 |
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
|
234 |
$niteoCS_banner_pattern_custom = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
|
235 |
-
$
|
236 |
-
|
|
|
|
|
237 |
|
238 |
//include theme defaults
|
239 |
if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php')) {
|
@@ -923,29 +942,33 @@ add_thickbox();
|
|
923 |
</legend>
|
924 |
|
925 |
<p>
|
926 |
-
<label title="Custom
|
927 |
-
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="0"<?php if ( $niteoCS_banner == 0) { echo ' checked="checked"'; } ?>> <?php _e('Custom
|
928 |
</label>
|
929 |
</p>
|
930 |
|
931 |
<p>
|
932 |
-
<label title="Unsplash
|
933 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="1"<?php if ( $niteoCS_banner == 1) { echo ' checked="checked"'; } ?>> <?php _e('Unsplash library', 'cmp-coming-soon-maintenance');?>
|
934 |
</label>
|
935 |
</p>
|
936 |
-
|
|
|
|
|
|
|
|
|
937 |
<p>
|
938 |
<label title="Default Banner">
|
939 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="2"<?php if ( $niteoCS_banner == 2) { echo ' checked="checked"'; } ?>> <?php _e('Default Media', 'cmp-coming-soon-maintenance');?>
|
940 |
</label>
|
941 |
</p>
|
942 |
<p>
|
943 |
-
<label title="
|
944 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="3"<?php if ( $niteoCS_banner == 3) { echo ' checked="checked"'; } ?>> <?php _e('Graphic Pattern', 'cmp-coming-soon-maintenance');?>
|
945 |
</label>
|
946 |
</p>
|
947 |
<p>
|
948 |
-
<label title="Solid Color">
|
949 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="4"<?php if ( $niteoCS_banner == 4) { echo ' checked="checked"'; } ?>> <?php _e('Solid Color', 'cmp-coming-soon-maintenance');?>
|
950 |
</label>
|
951 |
</p>
|
@@ -1010,15 +1033,15 @@ add_thickbox();
|
|
1010 |
<input type="text" class="widefat" id="niteoCS-unsplash-2" name="niteoCS_unsplash_2_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_unsplash_2); ?>" />
|
1011 |
</p>
|
1012 |
|
1013 |
-
<
|
1014 |
<label for="niteoCS_unsplash_3_<?php echo esc_attr($themeslug);?>"><?php _e('Specify search terms', 'cmp-coming-soon-maintenance');?></label>
|
1015 |
<input type="text" class="widefat" id="niteoCS-unsplash-3" name="niteoCS_unsplash_3_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_unsplash_3); ?>" />
|
1016 |
|
1017 |
-
|
1018 |
<input type="checkbox" name="niteoCS_unsplash_feat_<?php echo esc_attr($themeslug);?>" id="niteoCS_unsplash_feat" value="1" <?php checked( '1', get_option( 'niteoCS_unsplash_feat', '0' ) ); ?> class="regular-text code"><label for="niteoCS_unsplash_feat"><?php _e('Limit search only to Featured/Curated Photos', 'cmp-coming-soon-maintenance');?></label>
|
1019 |
-
</
|
1020 |
|
1021 |
-
<button id="test-unsplash" class="button" data-security="<?php echo esc_attr($ajax_nonce);?>"
|
1022 |
<div id="unsplash-media"></div>
|
1023 |
</fieldset>
|
1024 |
|
@@ -1055,6 +1078,52 @@ add_thickbox();
|
|
1055 |
<div class="color-preview" style="background-color:<?php echo esc_attr( $niteoCS_banner_color); ?>"></div>
|
1056 |
</div>
|
1057 |
</fieldset>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1058 |
</td>
|
1059 |
</tr>
|
1060 |
<tr><th>
|
58 |
update_option('niteoCS_banner_pattern_custom['.$themeslug.']', esc_url_raw($_POST['niteoCS_banner_pattern_custom_'.$themeslug]));
|
59 |
}
|
60 |
|
61 |
+
if (isset($_POST['niteoCS_banner_video_'.$themeslug])) {
|
62 |
+
update_option('niteoCS_banner_video['.$themeslug.']', sanitize_text_field($_POST['niteoCS_banner_video_'.$themeslug]));
|
63 |
+
}
|
64 |
+
|
65 |
+
if (isset($_POST['niteoCS_youtube_url_'.$themeslug])) {
|
66 |
+
update_option('niteoCS_youtube_url['.$themeslug.']', sanitize_text_field($_POST['niteoCS_youtube_url_'.$themeslug]));
|
67 |
+
}
|
68 |
+
|
69 |
+
if (isset($_POST['niteoCS_vimeo_url_'.$themeslug])) {
|
70 |
+
update_option('niteoCS_vimeo_url['.$themeslug.']', sanitize_text_field($_POST['niteoCS_vimeo_url_'.$themeslug]));
|
71 |
+
}
|
72 |
+
|
73 |
+
if (isset($_POST['niteoCS_video_thumb_'.$themeslug])) {
|
74 |
+
update_option('niteoCS_video_thumb['.$themeslug.']', sanitize_text_field($_POST['niteoCS_video_thumb_'.$themeslug]));
|
75 |
+
}
|
76 |
+
|
77 |
|
78 |
if (isset($_POST['niteoCS_banner_id_'.$themeslug])) {
|
79 |
$allnums = true;
|
245 |
$niteoCS_unsplash_2 = get_option('niteoCS_unsplash_2['.$themeslug.']');
|
246 |
$niteoCS_unsplash_3 = get_option('niteoCS_unsplash_3['.$themeslug.']');
|
247 |
$niteoCS_unsplash_category = get_option('niteoCS_unsplash_category['.$themeslug.']', 'buildings');
|
248 |
+
$niteoCS_cat_keyword = get_option('niteoCS_cat_keyword['.$themeslug.']');
|
249 |
$niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
|
250 |
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
|
251 |
$niteoCS_banner_pattern_custom = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
|
252 |
+
$niteoCS_banner_video = get_option('niteoCS_banner_video['.$themeslug.']');
|
253 |
+
$niteoCS_youtube_url = get_option('niteoCS_youtube_url['.$themeslug.']');
|
254 |
+
$niteoCS_vimeo_url = get_option('niteoCS_vimeo_url['.$themeslug.']');
|
255 |
+
$niteoCS_video_thumb = get_option('niteoCS_video_thumb['.$themeslug.']');
|
256 |
|
257 |
//include theme defaults
|
258 |
if (file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php')) {
|
942 |
</legend>
|
943 |
|
944 |
<p>
|
945 |
+
<label title="Custom banner">
|
946 |
+
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="0"<?php if ( $niteoCS_banner == 0) { echo ' checked="checked"'; } ?>> <?php _e('Custom Images', 'cmp-coming-soon-maintenance');?>
|
947 |
</label>
|
948 |
</p>
|
949 |
|
950 |
<p>
|
951 |
+
<label title="Unsplash banner">
|
952 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="1"<?php if ( $niteoCS_banner == 1) { echo ' checked="checked"'; } ?>> <?php _e('Unsplash library', 'cmp-coming-soon-maintenance');?>
|
953 |
</label>
|
954 |
</p>
|
955 |
+
<p>
|
956 |
+
<label title="Video Banner">
|
957 |
+
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="5"<?php if ( $niteoCS_banner == 5) { echo ' checked="checked"'; } ?>> <?php _e('Youtube video', 'cmp-coming-soon-maintenance');?>
|
958 |
+
</label>
|
959 |
+
</p>
|
960 |
<p>
|
961 |
<label title="Default Banner">
|
962 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="2"<?php if ( $niteoCS_banner == 2) { echo ' checked="checked"'; } ?>> <?php _e('Default Media', 'cmp-coming-soon-maintenance');?>
|
963 |
</label>
|
964 |
</p>
|
965 |
<p>
|
966 |
+
<label title="Pattern Banner">
|
967 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="3"<?php if ( $niteoCS_banner == 3) { echo ' checked="checked"'; } ?>> <?php _e('Graphic Pattern', 'cmp-coming-soon-maintenance');?>
|
968 |
</label>
|
969 |
</p>
|
970 |
<p>
|
971 |
+
<label title="Solid Color Banner">
|
972 |
<input type="radio" class="niteoCS_banner" name="niteoCS_banner_<?php echo esc_attr($themeslug);?>" value="4"<?php if ( $niteoCS_banner == 4) { echo ' checked="checked"'; } ?>> <?php _e('Solid Color', 'cmp-coming-soon-maintenance');?>
|
973 |
</label>
|
974 |
</p>
|
1033 |
<input type="text" class="widefat" id="niteoCS-unsplash-2" name="niteoCS_unsplash_2_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_unsplash_2); ?>" />
|
1034 |
</p>
|
1035 |
|
1036 |
+
<div class="unsplash-feed" id="unsplash-feed-3">
|
1037 |
<label for="niteoCS_unsplash_3_<?php echo esc_attr($themeslug);?>"><?php _e('Specify search terms', 'cmp-coming-soon-maintenance');?></label>
|
1038 |
<input type="text" class="widefat" id="niteoCS-unsplash-3" name="niteoCS_unsplash_3_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_unsplash_3); ?>" />
|
1039 |
|
1040 |
+
<br><br>
|
1041 |
<input type="checkbox" name="niteoCS_unsplash_feat_<?php echo esc_attr($themeslug);?>" id="niteoCS_unsplash_feat" value="1" <?php checked( '1', get_option( 'niteoCS_unsplash_feat', '0' ) ); ?> class="regular-text code"><label for="niteoCS_unsplash_feat"><?php _e('Limit search only to Featured/Curated Photos', 'cmp-coming-soon-maintenance');?></label>
|
1042 |
+
</div><br>
|
1043 |
|
1044 |
+
<button id="test-unsplash" class="button" data-security="<?php echo esc_attr($ajax_nonce);?>"><?php _e('Test Unsplash', 'cmp-coming-soon-maintenance');?></button>
|
1045 |
<div id="unsplash-media"></div>
|
1046 |
</fieldset>
|
1047 |
|
1078 |
<div class="color-preview" style="background-color:<?php echo esc_attr( $niteoCS_banner_color); ?>"></div>
|
1079 |
</div>
|
1080 |
</fieldset>
|
1081 |
+
|
1082 |
+
<fieldset id="video_banner">
|
1083 |
+
<div class="banner-wrapper default">
|
1084 |
+
|
1085 |
+
<label for="niteoCS_banner_video_<?php echo esc_attr($themeslug);?>"><?php _e('Select Video Source', 'cmp-coming-soon-maintenance');?></label></br>
|
1086 |
+
<select name="niteoCS_banner_video_<?php echo esc_attr($themeslug);?>" class="banner-video-source">
|
1087 |
+
<option value="youtube" <?php if ( $niteoCS_banner_video == 'youtube' ) { echo ' selected="selected"'; } ?>><?php _e('Youtube', 'cmp-coming-soon-maintenance');?></option>
|
1088 |
+
<option disabled value="vimeo" <?php if ( $niteoCS_banner_video == 'vimeo' ) { echo ' selected="selected"'; } ?>><?php _e('Vimeo (coming soon...)', 'cmp-coming-soon-maintenance');?></option>
|
1089 |
+
</select><br>
|
1090 |
+
|
1091 |
+
|
1092 |
+
<p class="youtube-source-input">
|
1093 |
+
<label for="niteoCS_youtube_url_<?php echo esc_attr($themeslug);?>"><?php _e('Enter Youtube URL', 'cmp-coming-soon-maintenance');?></label>
|
1094 |
+
<input type="text" class="widefat" id="niteoCS-youtube-url" name="niteoCS_youtube_url_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_youtube_url); ?>" />
|
1095 |
+
|
1096 |
+
</p>
|
1097 |
+
|
1098 |
+
<p class="vimeo-source-input">
|
1099 |
+
<label for="niteoCS_vimeo_url_<?php echo esc_attr($themeslug);?>"><?php _e('Enter Vimeo URL', 'cmp-coming-soon-maintenance');?></label>
|
1100 |
+
<input type="text" class="widefat" id="niteoCS-vimeo-url" name="niteoCS_vimeo_url_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr($niteoCS_vimeo_url); ?>" />
|
1101 |
+
</p>
|
1102 |
+
|
1103 |
+
<button id="test-video" class="button" data-security="<?php echo esc_attr($ajax_nonce);?>"><?php _e('Preview Video', 'cmp-coming-soon-maintenance');?></button>
|
1104 |
+
|
1105 |
+
<div class="video-preview"></div>
|
1106 |
+
|
1107 |
+
<p><?php _e('Video backgrounds doesn`t work on mobile devices therefore only thumbnail video image will be displayed on mobile devices. If you want to display custom image you can upload it by pressing button below. ', 'cmp-coming-soon-maintenance');?></p>
|
1108 |
+
<input type="hidden" class="widefat" id="niteoCS-video-thumb" name="niteoCS_video_thumb_<?php echo esc_attr($themeslug);?>" type="text" value="<?php echo esc_attr( $niteoCS_video_thumb ); ?>" />
|
1109 |
+
<input id="add-video-thumb" type="button" class="button" value="<?php _e('Use custom image from Media Library', 'cmp-coming-soon-maintenance');?>" /><br><br>
|
1110 |
+
|
1111 |
+
<div class="video-thumb-wrapper">
|
1112 |
+
<?php
|
1113 |
+
if ( isset( $niteoCS_video_thumb ) && $niteoCS_video_thumb != '' ) {
|
1114 |
+
$img = wp_get_attachment_image_src($id, 'large');
|
1115 |
+
if (isset($img[0])) {
|
1116 |
+
echo '<img src="'.$img[0].'" alt="">';
|
1117 |
+
}
|
1118 |
+
|
1119 |
+
}
|
1120 |
+
?>
|
1121 |
+
</div>
|
1122 |
+
|
1123 |
+
<input id="delete-video-thumb" type="button" class="button" value="Remove Thumbnail" />
|
1124 |
+
|
1125 |
+
</div>
|
1126 |
+
</fieldset>
|
1127 |
</td>
|
1128 |
</tr>
|
1129 |
<tr><th>
|
cmp-sidebar.php
CHANGED
@@ -1,19 +1,21 @@
|
|
1 |
<div class="cmp-sidebar-wrapper">
|
2 |
<div class="cmp-rate-us widget">
|
3 |
<h3 class="cmp-rate-us title"><?php _e('Thank you for rating us with five stars!', 'cmp-coming-soon-maintenance');?></h3>
|
4 |
-
<p><?php
|
5 |
<a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/?rate=5#new-post" target="_blank" style="text-decoration:none;">
|
6 |
|
7 |
<p class="button button-primary"><?php _e('Rate Us', 'cmp-coming-soon-maintenance');?></p>
|
|
|
|
|
8 |
<span class="dashicons dashicons-star-filled"></span>
|
9 |
-
<
|
10 |
-
<
|
11 |
-
<span class="dashicons dashicons-star-filled"></span>
|
12 |
-
<span class="dashicons dashicons-star-filled"></span>
|
13 |
</a>
|
14 |
-
<p><?php _e('Also don`t forget you can ask Wordpress Community or
|
15 |
</p>
|
16 |
|
|
|
|
|
17 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
|
18 |
<input type="hidden" name="cmd" value="_s-xclick">
|
19 |
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBJBQ2LnaehhVpQYn5qVhtwXrweyURxj+cT2BsnPUN4RZn/UC7ftqhv6B733Cjh5J2xrEF0MOu7mFxywWPZEpiStKwXEyos6eIx9SRqeiaM3bpjjyPqDRjWuhrXaA2eHb7nRxEv7C/4HjiPaFuyp5RFpT1R0yINRFqVVuDubtYQtDELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIY1CTgb1/WqKAgYiwcmBIHYF08XkEezhgYklpp5d2J5wi6cOlEJsmxW4jVisb7CieTsadjEDiiLx4X9/IGp7IzRx1K+rx/dh9bpcJbz5NoB3oikfTqpdzqDAh8L0CW5AP0To368X2uDN40XElz4wDiwBXYAAtjsy3kVRH+/TrRIhWaezVUNqO7JmQ9hqxlOOjoMNyoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNTIzMTQzOTU0WjAjBgkqhkiG9w0BCQQxFgQUt08IwV3KFygWn0gNImPQ1mMrjAAwDQYJKoZIhvcNAQEBBQAEgYCISWoorrWsDcVzFPdWvmWNgGKcjW/PA4o6J/IYtUU+uMqD5Hg3s5FJO9pNzeGg4VFLB3hGJ5YJJ868qb/3/T2tIcED7CbGMqk/OsedUb2dyucYTCiBYViOOLPu/cxjdXjCLrB7UNTssqd4+3RvW4gzRSMThv98Lh/CA/BxHRZ45g==-----END PKCS7-----
|
@@ -24,5 +26,10 @@
|
|
24 |
|
25 |
</div>
|
26 |
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
</div>
|
1 |
<div class="cmp-sidebar-wrapper">
|
2 |
<div class="cmp-rate-us widget">
|
3 |
<h3 class="cmp-rate-us title"><?php _e('Thank you for rating us with five stars!', 'cmp-coming-soon-maintenance');?></h3>
|
4 |
+
<p><?php echo sprintf(__('If you find our CMP plugin useful, please show us some love and give 5x %s feedback by pressing button below.', 'cmp-coming-soon-maintenance'), '<i class="fa fa-star" aria-hidden="true"></i>');?></p>
|
5 |
<a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/?rate=5#new-post" target="_blank" style="text-decoration:none;">
|
6 |
|
7 |
<p class="button button-primary"><?php _e('Rate Us', 'cmp-coming-soon-maintenance');?></p>
|
8 |
+
<i class="fa fa-star" aria-hidden="true"></i>
|
9 |
+
<i class="fa fa-star" aria-hidden="true"></i>
|
10 |
<span class="dashicons dashicons-star-filled"></span>
|
11 |
+
<i class="fa fa-star" aria-hidden="true"></i>
|
12 |
+
<i class="fa fa-star" aria-hidden="true"></i>
|
|
|
|
|
13 |
</a>
|
14 |
+
<p><?php _e('Also don`t forget you can ask Wordpress Community or our NiteoThemes expert support. For a help simply visit link below.', 'cmp-coming-soon-maintenance');?> <a href="http://wordpress.org/support/plugin/cmp-coming-soon-maintenance/" target="_blank"><?php _e('Wordpress Support Forum', 'cmp-coming-soon-maintenance');?></a>
|
15 |
</p>
|
16 |
|
17 |
+
<p><?php echo sprintf(__('If you really love our CMP plugin or you just want to be very kind to us, you can also donate some %s by clicking button below', 'cmp-coming-soon-maintenance'), '<i class="fa fa-usd" aria-hidden="true"></i><i class="fa fa-usd" aria-hidden="true"></i><i class="fa fa-usd" aria-hidden="true"></i>');?> <i class="fa fa-smile-o" aria-hidden="true"></i></p>
|
18 |
+
|
19 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
|
20 |
<input type="hidden" name="cmd" value="_s-xclick">
|
21 |
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBJBQ2LnaehhVpQYn5qVhtwXrweyURxj+cT2BsnPUN4RZn/UC7ftqhv6B733Cjh5J2xrEF0MOu7mFxywWPZEpiStKwXEyos6eIx9SRqeiaM3bpjjyPqDRjWuhrXaA2eHb7nRxEv7C/4HjiPaFuyp5RFpT1R0yINRFqVVuDubtYQtDELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIY1CTgb1/WqKAgYiwcmBIHYF08XkEezhgYklpp5d2J5wi6cOlEJsmxW4jVisb7CieTsadjEDiiLx4X9/IGp7IzRx1K+rx/dh9bpcJbz5NoB3oikfTqpdzqDAh8L0CW5AP0To368X2uDN40XElz4wDiwBXYAAtjsy3kVRH+/TrRIhWaezVUNqO7JmQ9hqxlOOjoMNyoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcwNTIzMTQzOTU0WjAjBgkqhkiG9w0BCQQxFgQUt08IwV3KFygWn0gNImPQ1mMrjAAwDQYJKoZIhvcNAQEBBQAEgYCISWoorrWsDcVzFPdWvmWNgGKcjW/PA4o6J/IYtUU+uMqD5Hg3s5FJO9pNzeGg4VFLB3hGJ5YJJ868qb/3/T2tIcED7CbGMqk/OsedUb2dyucYTCiBYViOOLPu/cxjdXjCLrB7UNTssqd4+3RvW4gzRSMThv98Lh/CA/BxHRZ45g==-----END PKCS7-----
|
26 |
|
27 |
</div>
|
28 |
|
29 |
+
<div class="request-feature widget">
|
30 |
+
<h3 class="cmp-rate-us title"><?php _e('Request new features', 'cmp-coming-soon-maintenance');?></h3>
|
31 |
+
<p><?php echo sprintf(__('Do you think some useful feature is missing or you have idea how to improve CMP plugin? You can %s on official Wordpress Support Forum and if we find it useful we will implement it in next CMP Plugin update', 'cmp-coming-soon-maintenance'), '<a href="https://wordpress.org/support/topic/request-features-3/" target="_blank" style="text-decoration:none;">request feature</a>');?> <i class="fa fa-smile-o" aria-hidden="true"></i></p>
|
32 |
+
|
33 |
+
</div>
|
34 |
|
35 |
</div>
|
css/cmp-settings-style.css
CHANGED
@@ -119,7 +119,10 @@ input[type="text"], textarea{width:100%;}
|
|
119 |
width: 180px;
|
120 |
text-align: left;
|
121 |
}
|
122 |
-
#delete-logo
|
|
|
|
|
|
|
123 |
|
124 |
.social-media {margin-top: 0;margin-bottom: 3em;}
|
125 |
.social-inputs {position: relative;}
|
@@ -165,7 +168,7 @@ input[type="text"], textarea{width:100%;}
|
|
165 |
|
166 |
|
167 |
th label {font-weight: 600;}
|
168 |
-
#unsplash_img{display: none;}
|
169 |
#unsplash-media{padding-top: 1em;}
|
170 |
.unsplash-feed{display: none;}
|
171 |
.pattern-preview,
|
@@ -175,6 +178,12 @@ th label {font-weight: 600;}
|
|
175 |
border: 1px solid #ededed;
|
176 |
}
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
#add-pattern {margin-bottom: 1em;}
|
179 |
.info{font-size: 12px;}
|
180 |
.nav-tab i {padding-right:3px}
|
@@ -183,7 +192,7 @@ th label {font-weight: 600;}
|
|
183 |
.logo-wrapper img,
|
184 |
.favicon-wrapper img {background-color: #efefef;padding:1em;}
|
185 |
.favicon-wrapper img {max-width: 32px;}
|
186 |
-
.logo-wrapper img, .banner-wrapper img{max-width: 100%;}
|
187 |
.logo-wrapper img {max-height: 150px;}
|
188 |
|
189 |
#font-example-wrapper {padding:1em;border:1px solid #dedede;}
|
@@ -439,14 +448,21 @@ p.cmp-submit {
|
|
439 |
display: inline-block;
|
440 |
width: calc(100% - 6em - 920px);
|
441 |
max-width: 350px;
|
442 |
-
border: 1px solid #dedede;
|
443 |
-
padding: 2em;
|
444 |
margin-left: 1em;
|
445 |
padding-top: 0;
|
446 |
-
background: white;
|
447 |
vertical-align: top;
|
448 |
}
|
449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
.cmp-rate-us a,
|
451 |
.cmp-rate-us .button {display: block;
|
452 |
text-align:center;
|
@@ -467,8 +483,8 @@ p.cmp-submit {
|
|
467 |
}
|
468 |
|
469 |
@media screen and (max-width: 1450px) {
|
470 |
-
.cmp-inputs-wrapper {min-width:
|
471 |
-
.cmp-sidebar-wrapper {width: calc(30% -
|
472 |
.theme-wrapper { width: calc(50% - 3em - 5px);}
|
473 |
|
474 |
}
|
@@ -477,6 +493,7 @@ p.cmp-submit {
|
|
477 |
@media screen and (max-width: 1110px) {
|
478 |
.theme-wrapper { margin-right:0;width: calc(100% - 5px);}
|
479 |
.table-wrapper th {display: block;}
|
|
|
480 |
|
481 |
}
|
482 |
|
@@ -490,9 +507,7 @@ p.cmp-submit {
|
|
490 |
|
491 |
.social-inputs input[type=checkbox]:checked:before {margin: -1px 0px 0 -4px;}
|
492 |
.cmp-sidebar-wrapper,
|
493 |
-
.cmp-inputs-wrapper {display:
|
|
|
494 |
}
|
495 |
|
496 |
-
|
497 |
-
|
498 |
-
|
119 |
width: 180px;
|
120 |
text-align: left;
|
121 |
}
|
122 |
+
#delete-logo,
|
123 |
+
#delete-banner,
|
124 |
+
#delete-favicon,
|
125 |
+
#delete-video-thumb {display:none;}
|
126 |
|
127 |
.social-media {margin-top: 0;margin-bottom: 3em;}
|
128 |
.social-inputs {position: relative;}
|
168 |
|
169 |
|
170 |
th label {font-weight: 600;}
|
171 |
+
#unsplash_img{display: none;max-width: 100%;}
|
172 |
#unsplash-media{padding-top: 1em;}
|
173 |
.unsplash-feed{display: none;}
|
174 |
.pattern-preview,
|
178 |
border: 1px solid #ededed;
|
179 |
}
|
180 |
|
181 |
+
.video-preview {
|
182 |
+
position: relative;
|
183 |
+
width: 100%;
|
184 |
+
margin-top: 1em;
|
185 |
+
}
|
186 |
+
|
187 |
#add-pattern {margin-bottom: 1em;}
|
188 |
.info{font-size: 12px;}
|
189 |
.nav-tab i {padding-right:3px}
|
192 |
.logo-wrapper img,
|
193 |
.favicon-wrapper img {background-color: #efefef;padding:1em;}
|
194 |
.favicon-wrapper img {max-width: 32px;}
|
195 |
+
.logo-wrapper img, .banner-wrapper img{max-width: 100%;width:100%;}
|
196 |
.logo-wrapper img {max-height: 150px;}
|
197 |
|
198 |
#font-example-wrapper {padding:1em;border:1px solid #dedede;}
|
448 |
display: inline-block;
|
449 |
width: calc(100% - 6em - 920px);
|
450 |
max-width: 350px;
|
|
|
|
|
451 |
margin-left: 1em;
|
452 |
padding-top: 0;
|
|
|
453 |
vertical-align: top;
|
454 |
}
|
455 |
|
456 |
+
.cmp-sidebar-wrapper .widget {
|
457 |
+
padding: 2em;
|
458 |
+
border: 1px solid #dedede;
|
459 |
+
background: white;
|
460 |
+
}
|
461 |
+
|
462 |
+
.cmp-sidebar-wrapper h3 {
|
463 |
+
text-align: center;
|
464 |
+
}
|
465 |
+
|
466 |
.cmp-rate-us a,
|
467 |
.cmp-rate-us .button {display: block;
|
468 |
text-align:center;
|
483 |
}
|
484 |
|
485 |
@media screen and (max-width: 1450px) {
|
486 |
+
.cmp-inputs-wrapper {min-width: 70%;}
|
487 |
+
.cmp-sidebar-wrapper {width: calc(30% - 2em + 7px);}
|
488 |
.theme-wrapper { width: calc(50% - 3em - 5px);}
|
489 |
|
490 |
}
|
493 |
@media screen and (max-width: 1110px) {
|
494 |
.theme-wrapper { margin-right:0;width: calc(100% - 5px);}
|
495 |
.table-wrapper th {display: block;}
|
496 |
+
.cmp-sidebar-wrapper .widget {padding: 1em;}
|
497 |
|
498 |
}
|
499 |
|
507 |
|
508 |
.social-inputs input[type=checkbox]:checked:before {margin: -1px 0px 0 -4px;}
|
509 |
.cmp-sidebar-wrapper,
|
510 |
+
.cmp-inputs-wrapper {display: block;max-width:100%;width: 100%; margin:0;}
|
511 |
+
.cmp-sidebar-wrapper .widget {padding: 2em;}
|
512 |
}
|
513 |
|
|
|
|
|
|
js/settings.js
CHANGED
@@ -303,7 +303,7 @@ jQuery(document).ready(function($){
|
|
303 |
|
304 |
$.post(ajaxurl, data, function(response) {
|
305 |
jQuery('#unsplash_img').remove();
|
306 |
-
img_url = response.replace('WIDTHxHEIGHT', '
|
307 |
jQuery('<img />', {src: img_url, id: 'unsplash_img'}).
|
308 |
|
309 |
one('load', function() { //Set something to run when it finishes loading
|
@@ -316,6 +316,144 @@ jQuery(document).ready(function($){
|
|
316 |
|
317 |
});
|
318 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
// hiding banner on change
|
320 |
jQuery('#csoptions .niteoCS_banner').change(function() {
|
321 |
|
@@ -340,6 +478,10 @@ jQuery(document).ready(function($){
|
|
340 |
jQuery('#solid_color').css('display','block');
|
341 |
jQuery('.theme_background fieldset:not(#solid_color)').css('display','none');
|
342 |
break;
|
|
|
|
|
|
|
|
|
343 |
default:
|
344 |
jQuery('#custom_banner').css('display','block');
|
345 |
jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
|
303 |
|
304 |
$.post(ajaxurl, data, function(response) {
|
305 |
jQuery('#unsplash_img').remove();
|
306 |
+
img_url = response.replace('WIDTHxHEIGHT', '588x330');
|
307 |
jQuery('<img />', {src: img_url, id: 'unsplash_img'}).
|
308 |
|
309 |
one('load', function() { //Set something to run when it finishes loading
|
316 |
|
317 |
});
|
318 |
|
319 |
+
// hiding video source inputs
|
320 |
+
jQuery('#csoptions .banner-video-source').change(function() {
|
321 |
+
|
322 |
+
switch(jQuery('#csoptions .banner-video-source' ).val() ) {
|
323 |
+
case 'youtube':
|
324 |
+
jQuery('.youtube-source-input').css('display','block');
|
325 |
+
jQuery('.vimeo-source-input').css('display','none');
|
326 |
+
break;
|
327 |
+
case 'vimeo':
|
328 |
+
jQuery('.youtube-source-input').css('display','none');
|
329 |
+
jQuery('.vimeo-source-input').css('display','block');
|
330 |
+
break;
|
331 |
+
default:
|
332 |
+
jQuery('.youtube-source-input').css('display','none');
|
333 |
+
jQuery('.vimeo-source-input').css('display','block');
|
334 |
+
}
|
335 |
+
});
|
336 |
+
jQuery('#csoptions .banner-video-source').trigger('change');
|
337 |
+
|
338 |
+
// video pattern preview
|
339 |
+
jQuery('#test-video').click(function(e) {
|
340 |
+
e.preventDefault();
|
341 |
+
|
342 |
+
var source = $('.banner-video-source').val();
|
343 |
+
|
344 |
+
if ( source == 'youtube' ) {
|
345 |
+
var youtubeLink = $('#niteoCS-youtube-url').val();
|
346 |
+
if( youtubeLink.match(/(youtube.com)/) ){
|
347 |
+
var split_c = 'v=';
|
348 |
+
var split_n = 1;
|
349 |
+
}
|
350 |
+
|
351 |
+
if( youtubeLink.match(/(youtu.be)/) || youtubeLink.match(/(vimeo.com\/)+[0-9]/) ){
|
352 |
+
var split_c = '/';
|
353 |
+
var split_n = 3;
|
354 |
+
}
|
355 |
+
}
|
356 |
+
|
357 |
+
if ( source == 'vimeo' ) {
|
358 |
+
var youtubeLink = $('#niteoCS-vimeo-url').val();
|
359 |
+
|
360 |
+
if( youtubeLink.match(/(vimeo.com\/)+[a-zA-Z]/) ){
|
361 |
+
var split_c = '/';
|
362 |
+
var split_n = 5;
|
363 |
+
}
|
364 |
+
}
|
365 |
+
if ( youtubeLink ) {
|
366 |
+
var getYouTubeVideoID = youtubeLink.split(split_c)[split_n];
|
367 |
+
if ( getYouTubeVideoID != undefined ) {
|
368 |
+
var cleanVideoID = getYouTubeVideoID.replace(/(&)+(.*)/, '');
|
369 |
+
|
370 |
+
if( source == 'banner_youtube' && youtubeLink.match(/(youtu.be)/) || youtubeLink.match(/(youtube.com)/) ){
|
371 |
+
var videoEmbedLink = 'https://www.youtube.com/embed/'+cleanVideoID+'?autoplay=1';
|
372 |
+
}
|
373 |
+
|
374 |
+
if( source == 'banner_vimeo' && youtubeLink.match(/(vimeo.com\/)+[0-9]/) || youtubeLink.match(/(vimeo.com\/)+[a-zA-Z]/) ){
|
375 |
+
var videoEmbedLink = 'https://player.vimeo.com/video/'+cleanVideoID+'?autoplay=1';
|
376 |
+
}
|
377 |
+
|
378 |
+
var $iframe = $('<iframe src="'+videoEmbedLink+'" allowfullscreen></iframe>');
|
379 |
+
$('.video-preview').html($iframe);
|
380 |
+
var videoRatio = ( $iframe.height() / $iframe.width() ) * 100;
|
381 |
+
|
382 |
+
$iframe.css('position', 'absolute');
|
383 |
+
$iframe.css('top', '0');
|
384 |
+
$iframe.css('left', '0');
|
385 |
+
$iframe.css('width', '100%');
|
386 |
+
$iframe.css('height', '100%');
|
387 |
+
|
388 |
+
$('.video-preview').css('padding-top', videoRatio+'%');
|
389 |
+
$('#niteoCS-vimeo-url').css('border', '1px solid #ddd');
|
390 |
+
$('#niteoCS-youtube-url').css('border', '1px solid #ddd');
|
391 |
+
} else {
|
392 |
+
$('.video-preview').text('Please enter correct ' + source + ' URL.').css('padding-top', '0');
|
393 |
+
$('#niteoCS-vimeo-url').css('border', '1px solid #d60000');
|
394 |
+
$('#niteoCS-youtube-url').css('border', '1px solid #d60000');
|
395 |
+
}
|
396 |
+
|
397 |
+
} else {
|
398 |
+
$('.video-preview').text('Please enter ' + source + ' URL.').css('padding-top', '0');
|
399 |
+
$('#niteoCS-vimeo-url').css('border', '1px solid #d60000');
|
400 |
+
$('#niteoCS-youtube-url').css('border', '1px solid #d60000');
|
401 |
+
}
|
402 |
+
});
|
403 |
+
|
404 |
+
// script for video thumb upload
|
405 |
+
var $videoThumbContainer = jQuery('.video-thumb-wrapper');
|
406 |
+
|
407 |
+
if ( jQuery('#niteoCS-video-thumb').val() != '' ) {
|
408 |
+
jQuery('#delete-video-thumb').css( 'display', 'block' );
|
409 |
+
}
|
410 |
+
|
411 |
+
jQuery('#add-video-thumb').click(function(e) {
|
412 |
+
e.preventDefault();
|
413 |
+
// If the media frame already exists, reopen it.
|
414 |
+
if ( media_uploader ) {
|
415 |
+
media_uploader.open();
|
416 |
+
return;
|
417 |
+
}
|
418 |
+
var media_uploader = wp.media({
|
419 |
+
title: 'Select Image',
|
420 |
+
button: {
|
421 |
+
text: 'Insert Video Thumbnail'
|
422 |
+
},
|
423 |
+
multiple: false, // Set this to true to allow multiple files to be selected
|
424 |
+
type : 'image'
|
425 |
+
})
|
426 |
+
.on('select', function() {
|
427 |
+
// Get media attachment details from the frame state
|
428 |
+
var attachment = media_uploader.state().get('selection').first().toJSON();
|
429 |
+
|
430 |
+
$videoThumbContainer.empty();
|
431 |
+
|
432 |
+
// Send the attachment URL to our custom image input field.
|
433 |
+
if (attachment['sizes']['large']=== undefined) {
|
434 |
+
var thumbUrl = attachment.url;
|
435 |
+
} else {
|
436 |
+
var thumbUrl = attachment['sizes']['large'].url;
|
437 |
+
}
|
438 |
+
|
439 |
+
// Send the attachment URL to our custom image input field.
|
440 |
+
$videoThumbContainer.append( '<img src="' + thumbUrl + '" alt=""/>' );
|
441 |
+
// Display Delete Gallery
|
442 |
+
jQuery('#delete-video-thumb').css( 'display', 'block' );
|
443 |
+
|
444 |
+
jQuery('#niteoCS-video-thumb').val( attachment.id ).trigger('change');
|
445 |
+
|
446 |
+
})
|
447 |
+
.open();
|
448 |
+
});
|
449 |
+
|
450 |
+
jQuery('#delete-video-thumb').click(function(e) {
|
451 |
+
$videoThumbContainer.empty();
|
452 |
+
jQuery(this).css('display', 'none');
|
453 |
+
jQuery('#niteoCS-video-thumb').val('').trigger('change');
|
454 |
+
|
455 |
+
});
|
456 |
+
|
457 |
// hiding banner on change
|
458 |
jQuery('#csoptions .niteoCS_banner').change(function() {
|
459 |
|
478 |
jQuery('#solid_color').css('display','block');
|
479 |
jQuery('.theme_background fieldset:not(#solid_color)').css('display','none');
|
480 |
break;
|
481 |
+
case '5':
|
482 |
+
jQuery('#video_banner').css('display','block');
|
483 |
+
jQuery('.theme_background fieldset:not(#video_banner)').css('display','none');
|
484 |
+
break;
|
485 |
default:
|
486 |
jQuery('#custom_banner').css('display','block');
|
487 |
jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
|
js/settings.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(a){function h(a){return(a+"").replace(/^([a-z])|\s+([a-z])/g,function(a){return a.toUpperCase()})}function i(a){return(a+"").toLowerCase()}var c=document.location.hash.substring(1),d=jQuery("#csoptions").attr("action");navtab=function(a){jQuery(".nav-tab-wrapper .nav-tab").removeClass("nav-tab-active"),jQuery(".nav-tab-wrapper ."+a).addClass("nav-tab-active"),jQuery(".table-wrapper."+a).css("display","block"),jQuery(".comingsoon."+a).css("display","block"),jQuery(".table-wrapper:not(."+a+")").css("display","none"),jQuery(".comingsoon:not(."+a+")").css("display","none"),"install"==a?(jQuery(".submit").css("display","none"),jQuery("#csoptions").attr("action",d)):(jQuery(".submit").css("display","block"),jQuery("#csoptions").attr("action",d+"#"+a))},""!=c&&navtab(c),window.onhashchange=function(){c=document.location.hash.substring(1),navtab(c)},a(".nav-tab:not(.theme-preview)").click(function(b){b.preventDefault(),c=a(this).data("tab"),document.location.hash=c}),jQuery(".cmp-status legend").click(function(){var a=jQuery(this).children("input");a.prop("checked",!0),jQuery(".cmp-status legend").removeClass("active"),jQuery(this).addClass("active"),a.trigger("change"),"3"==a.val()?jQuery("#niteoCS_URL_redirect").prop("disabled",!1):jQuery("#niteoCS_URL_redirect").prop("disabled",!0)}),jQuery(".table-wrapper h3").click(function(){jQuery(this).toggleClass("closed"),jQuery(this).next().toggle()}),jQuery(".niteoCS-logo-type").change(function(){"text"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","block"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","none")):"graphic"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","block"),jQuery(".disabled-logo").css("display","none")):"disabled"==jQuery(".niteoCS-logo-type:checked").val()&&(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","block"))});var e=jQuery(".logo-wrapper");""!=jQuery("#niteoCS-logo-id").val()&&(jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block")),jQuery("#add-logo").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select Logo",button:{text:"Insert Logo"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();jQuery(".logo-wrapper").empty(),e.append('<img src="'+a.url+'" alt="" style="max-width:588px"/>'),jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block"),jQuery("#niteoCS-logo-id").val(a.id).trigger("change")}).open()}),jQuery("#delete-logo").click(function(a){jQuery(".logo-wrapper").empty(),jQuery("#add-logo").val("Select Logo"),jQuery(this).css("display","none"),jQuery("#niteoCS-logo-id").val(""),jQuery("#niteoCS-logo-id").trigger("change")});var f=jQuery(".favicon-wrapper");""!=jQuery("#niteoCS-favicon-id").val()&&(jQuery("#add-favicon").val("Change favicon"),jQuery("#delete-favicon").css("display","block")),jQuery("#add-favicon").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select favicon",button:{text:"Insert favicon"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();jQuery(".favicon-wrapper").empty(),f.append('<img src="'+a.url+'" alt="" style="max-width:32px"/>'),jQuery("#add-favicon").val("Change favicon"),jQuery("#delete-favicon").css("display","block"),jQuery("#niteoCS-favicon-id").val(a.id).trigger("change"),jQuery("#favicon").length?jQuery("#favicon").attr("href",a.url):jQuery("head").append('<link id="favicon" rel="shortcut icon" href="'+a.url+'" />')}).open()}),jQuery("#delete-favicon").click(function(a){jQuery(".favicon-wrapper").empty(),jQuery("#add-favicon").val("Select favicon"),jQuery(this).css("display","none"),jQuery("#niteoCS-favicon-id").val("").trigger("change"),jQuery("#favicon").remove()}),""!=jQuery("#niteoCS-banner-id").val()&&jQuery("#delete-banner").css("display","block"),jQuery("#add-banner").click(function(a){var b=jQuery(".banner-wrapper:not(.default)");if(a.preventDefault(),c)return void c.open();var c=wp.media({title:"Select Photos",button:{text:"Insert Photos"},multiple:!0,type:"image"}).on("select",function(){var a=c.state().get("selection").toJSON(),d="";a.length>0&&(b.empty(),jQuery(a).each(function(c){"large"in a[c].sizes?b.append('<img src="'+a[c].sizes.large.url+'" alt="" style="max-width:588px;"/>'):b.append('<img src="'+a[c].url+'" alt="" style="max-width:588px;"/>'),jQuery("#delete-banner").css("display","block"),d+=(0===c?"":",")+a[c].id}),jQuery("#niteoCS-banner-id").val(d).trigger("change"))}).open()}),jQuery("#delete-banner").click(function(a){jQuery(".banner-wrapper:not(.default)").empty(),jQuery(this).css("display","none"),jQuery("#niteoCS-banner-id").val("").trigger("change")}),jQuery("#test-unsplash").click(function(b){b.preventDefault();var c=jQuery("#unsplash-media"),d=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),e="",f="",g="",h=jQuery(this).data("security");switch(d){case"0":e=jQuery("#niteoCS-unsplash-0").val();break;case"1":e=jQuery("#niteoCS-unsplash-1").val(),f=jQuery('#unsplash_banner select[name^="unsplash_category"] option:selected').val(),g=jQuery("#niteoCS-category-keyword").val();break;case"2":e=jQuery("#niteoCS-unsplash-2").val();break;case"3":e=jQuery("#niteoCS-unsplash-3").val(),f=jQuery("#niteoCS_unsplash_feat").is(":checked")?"1":"0"}var i={feed:d,url:e,cat:f,custom_str:g};jQuery(this).prop("disabled",!0),jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'),c.html("");var j={action:"niteo_unsplash",security:h,params:i};a.post(ajaxurl,j,function(a){jQuery("#unsplash_img").remove(),img_url=a.replace("WIDTHxHEIGHT","400x225"),jQuery("<img />",{src:img_url,id:"unsplash_img"}).one("load",function(){jQuery(this).appendTo(c),jQuery(this).fadeIn(),jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Test Unsplash")})})}),jQuery("#csoptions .niteoCS_banner").change(function(){switch(jQuery("#csoptions .niteoCS_banner:checked").val()){case"0":jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none");break;case"1":jQuery("#unsplash_banner").css("display","block"),jQuery(".theme_background fieldset:not(#unsplash_banner)").css("display","none");break;case"2":jQuery("#default_banner").css("display","block"),jQuery(".theme_background fieldset:not(#default_banner)").css("display","none");break;case"3":jQuery("#graphic_pattern").css("display","block"),jQuery(".theme_background fieldset:not(#graphic_pattern)").css("display","none");break;case"4":jQuery("#solid_color").css("display","block"),jQuery(".theme_background fieldset:not(#solid_color)").css("display","none");break;default:jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none")}}),jQuery("#csoptions .niteoCS_banner").trigger("change");var g=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();jQuery("#unsplash-feed-"+g).css("display","block"),jQuery('#unsplash_banner select[name^="unsplash_feed"]').on("change",function(){g=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),jQuery(".unsplash-feed").css("display","none"),jQuery("#unsplash-feed-"+g).css("display","block")}),jQuery("#niteoCS_banner_color").wpColorPicker({change:function(a,b){jQuery(".color-preview").css("background-color",b.color.toString())}}),jQuery('select[name^="niteoCS_banner_pattern"]').on("change",function(){var a=jQuery('select[name^="niteoCS_banner_pattern"] option:selected').val();if("custom"!=a){var b=jQuery(this).data("url");jQuery("#add-pattern").css("display","none"),jQuery(".pattern-preview").css("background-image","url('"+b+a+".png')")}else{var b=jQuery("#niteoCS_banner_pattern_custom").val();jQuery("#add-pattern").css("display","block"),jQuery(".pattern-preview").css("background-image","url('"+b+"')")}}),jQuery("#add-pattern").click(function(a){if(a.preventDefault(),b)return void b.open();var b=wp.media({title:"Select Pattern",button:{text:"Select Pattern"},multiple:!1,type:"image"}).on("select",function(){var a=b.state().get("selection").first().toJSON();if(jQuery(".pattern-preview").css("background-image",""),void 0===a.sizes.large)var c=a.url;else var c=a.sizes.large.url;jQuery(".pattern-preview").css("background-image","url('"+c+"')"),jQuery("#niteoCS_banner_pattern_custom").val(a.url)}).open()}),1==jQuery("#niteoCS_subscribe").prop("checked")&&jQuery(".subscribe").css("display","block"),jQuery("#niteoCS_subscribe").change(function(){jQuery(this)[0].checked?jQuery(".subscribe").css("display","block"):jQuery(".subscribe").css("display","none")}),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function(){0==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","block"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","none")):1==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","block"),jQuery("#subscribe-niteo").css("display","none")):(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","block"))}),jQuery("#csv-generate").click(function(a){a.preventDefault(),jQuery.post(ajaxurl,"action=niteo_export_csv",function(a){a&&jQuery("<iframe />").attr("src",ajaxurl+"?action=niteo_export_csv").appendTo("body").hide()})});var j="",k="";j="custom"==jQuery(".niteoCS_font_headings option:selected").val()?h(i(jQuery("#niteoCS_font_headings_custom").val())):jQuery(".niteoCS_font_headings option:selected").val(),k="custom"==jQuery(".niteoCS_font_content option:selected").val()?h(i(jQuery("#niteoCS_font_content_custom").val())):jQuery(".niteoCS_font_contentoption:selected").val(),WebFont.load({google:{families:[h(i(j)),h(i(k))]},active:function(){a("#heading-example, #niteoCS-text-logo").css("font-family",j),a("#content-example").css("font-family",k)}}),jQuery(".niteoCS_font_headings").on("change",function(){niteoCS_font_headings=jQuery(".niteoCS_font_headings option:selected").val(),"custom"==niteoCS_font_headings?(jQuery("#custom_headings_font").css("display","block"),jQuery("#custom_headings_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[h(i(jQuery("#niteoCS_font_headings_custom").val()))]},active:function(){a("#heading-example, #niteoCS-text-logo").css("font-family",jQuery("#niteoCS_font_headings_custom").val())}})},1e3))})):(jQuery("#custom_headings_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_headings]},active:function(){a("#heading-example, #niteoCS-text-logo").css("font-family",niteoCS_font_headings||"")}}))}),jQuery(".niteoCS_font_content").on("change",function(){niteoCS_font_content=jQuery(".niteoCS_font_content option:selected").val(),"custom"==niteoCS_font_content?(jQuery("#custom_content_font").css("display","block"),jQuery("#custom_content_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[h(i(jQuery("#niteoCS_font_content_custom").val()))]},active:function(){a("#content-example").css("font-family",jQuery("#niteoCS_font_content_custom").val())}})},1e3))})):(jQuery("#custom_content_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_content]},active:function(){a("#content-example").css("font-family",niteoCS_font_content||"")}}))});var l=function(b,c,d){var e=a("#niteoCS_socialmedia").attr("value");e=a.parseJSON(e),a.each(e,function(a,e){e.name==b&&(e[c]=d)}),a("#niteoCS_socialmedia").attr("value",JSON.stringify(e))},m=a(".social-inputs"),n=function(b,c){var d=m.find('input[type="text"]');c.item.index();d.each(function(b,c){var d=a(c).data("name");l(d,"order",b)})};m.sortable({stop:n}),m.on("sortchange",n),function(a){a.fn.toggleDisabled=function(){return this.each(function(){var c,b=a(this),d=b.data("name");b.attr("disabled")?(b.prop("disabled",!1),c="1"):(b.prop("disabled",!0),c="0"),l(d,"active",c)})}}(jQuery),jQuery('.social-inputs input[type="text"]').focusout(function(){var a=jQuery(this).data("name"),b=jQuery(this).attr("value");l(a,"url",b)}),jQuery('.social-inputs input[type="checkbox"]').click(function(b){a(this).siblings('input[type="text"]').toggleDisabled()}),jQuery(".social-media i").click(function(){var a=jQuery(this).data("name");jQuery(this).toggleClass("active"),jQuery(".social-inputs li."+a).toggleClass("active"),jQuery(".social-inputs li."+a+" input").trigger("change"),jQuery(this).hasClass("active")?l(a,"hidden","0"):l(a,"hidden","1"),jQuery(".social-media i.active").length?jQuery(".social-inputs .label").css("display","block"):jQuery(".social-inputs .label").css("display","none")}),jQuery(".social-media i.active").length&&jQuery(".social-inputs .label").css("display","block"),jQuery(".view-release").click(function(a){a.preventDefault(),$this=jQuery(this);var b=$this.attr("href");jQuery.get(b,function(a){$this.closest(".notice").find(".release-note .notes").remove(),$this.closest(".notice").find(".release-note").append('<div class="notes">'+a+"</div>")}).fail(function(){$this.closest(".notice").find(".release-note p").remove(),$this.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".update-theme").click(function(b){b.preventDefault();var c=a(this),d=c.parents(".notice"),e=c.data("security"),f=c.data("slug"),g=c.data("type"),h=d.find(".theme-name").text(),i=jQuery(this).data("remote_url");update={name:f,tmp_name:"",type:g,url:i+"?action=download&slug="+f};var j={action:"cmp_theme_update_install",security:e,file:update};d.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>'),a.post(ajaxurl,j,function(b){if("success"==b)setTimeout(function(){d.removeClass("notice-warning").addClass("notice-success"),d.find(".message").html("<span> "+h+' Theme was updated sucessfully! </span><i class="fa fa-smile-o" aria-hidden="true"></i>')},1500);else{b=b.slice(0,-1);var c=a("p",a(b)).text();d.removeClass("notice-warning").addClass("notice-error"),d.find(".message").html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+c+"</span>")}})}),jQuery(".theme-select").click(function(){jQuery(this).parent().find('input[name="select_theme"]').prop("checked",!0).trigger("change"),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().find(".theme-select").addClass("selected")}),jQuery(".theme-update.button").one("click",function(b){b.preventDefault();var c=a(this),d=c.closest(".theme-wrapper"),e=d.data("security"),f=d.data("slug"),g=d.data("type"),h=d.data("remote_url"),i={name:f,tmp_name:"",type:g,url:h+"?action=download&slug="+f},j={action:"cmp_theme_update_install",security:e,file:i};c.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'),a.post(ajaxurl,j,function(a){"success"==a?setTimeout(function(){c.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'),setTimeout(function(){c.fadeOut()},1500)},1500):(a=a.slice(0,-1),c.html('<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>'))})}),jQuery(".theme-details").click(function(){var b=a(this),c=b.closest(".theme-wrapper"),d=c.data("slug"),e=c.data("version"),f=c.data("remote_url"),g=c.data("type"),h=c.data("purchased"),i="",j=jQuery(".update-theme").data("security"),k=1;a.getJSON(f+"?action=get_metadata&slug="+d,function(l){if(jQuery("body").addClass("modal-open"),"1"==h){e<l.version&&(i='<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+l.name+' theme available. <a href="'+f+"readme/"+d+'-readme.html" class="view-release">View update '+l.version+' notes</a> or <a href="'+window.location.href+"&action=update-cmp-theme&theme="+d+"&type="+g+'" class="update-theme" data-type="'+g+'" data-security="'+j+'" data-slug="'+d+'" data-remote_url="'+f+'">Update now.</a></strong></p><div class="release-note"></div></div>'),e==l.version&&(i='<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>');var m='<span class="theme-version">Version: '+e+"</span>",n="",o=""}else var m="",n="disabled ",p=c.find("a").attr("href"),o='<button type="button" class="theme-purchase button hide"><a href="'+p+'" target="_blank"><i class="fa fa-cart-arrow-down" aria-hidden="true"></i>Buy</a></button>';var q=a.parseJSON(l.details_url),r="";Object.keys(q).length>1&&(r='<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 s=a(['<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(\''+q[1]+"')\">"+r+"</div>","\t\t\t</div>",'\t\t\t<div class="theme-info">','\t\t\t\t<h2 class="theme-name">'+l.name+m+"</h2>",'\t\t\t\t<p class="theme-author">By <a href="'+l.author_homepage+'">'+l.author+"</a></p>",i,'\t\t\t\t<div class="theme-description">'+l.description+"</div>",o,"\t\t\t</div>","\t\t</div>",'\t\t<div class="theme-actions">','\t\t\t<button type="submit" '+n+'class="button activate" name="Submit" aria-label="Select '+l.name+'">Activate</button>','\t\t\t<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme='+d+'" class="button cmp-preview" target="_blank" aria-label="Preview '+l.name+'">Live Preview</a>',"\t\t</div>","\t</div>","</div>"].join("\n"));jQuery(".theme-overlay.cmp").append(s),jQuery(".theme-overlay.cmp .view-release").click(function(a){a.preventDefault(),b=jQuery(this);var c=b.attr("href");jQuery.get(c,function(a){b.closest(".notice").find(".release-note .notes").remove(),b.closest(".notice").find(".release-note").append('<div class="notes">'+a+"</div>")}).fail(function(){b.closest(".notice").find(".release-note p").remove(),b.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".theme-overlay.cmp .close").click(function(a){a.preventDefault(),jQuery("body").removeClass("modal-open"),jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast")}),jQuery(".theme-overlay.cmp .activate").click(function(a){a.preventDefault(),jQuery('input[name="select_theme"]').each(function(){jQuery(this).val()==d&&(jQuery(this).prop("checked",!0),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().addClass("selected"))}),jQuery("#csoptions").submit()}),jQuery(".screenshots-nav .right").click(function(){k++,k>Object.keys(q).length&&(k=1),k in q&&jQuery(".screenshot").css("background-image","url('"+q[k]+"')")}),jQuery(".screenshots-nav .left").click(function(){k--,k<1&&(k=Object.keys(q).length),k in q&&jQuery(".screenshot").css("background-image","url('"+q[k]+"')")})})}),jQuery('#csoptions input[name="niteoCS_banner"]').trigger("change"),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger("change")});
|
1 |
+
jQuery(document).ready(function(e){function t(e){return(e+"").replace(/^([a-z])|\s+([a-z])/g,function(e){return e.toUpperCase()})}function a(e){return(e+"").toLowerCase()}var n=document.location.hash.substring(1),s=jQuery("#csoptions").attr("action");navtab=function(e){jQuery(".nav-tab-wrapper .nav-tab").removeClass("nav-tab-active"),jQuery(".nav-tab-wrapper ."+e).addClass("nav-tab-active"),jQuery(".table-wrapper."+e).css("display","block"),jQuery(".comingsoon."+e).css("display","block"),jQuery(".table-wrapper:not(."+e+")").css("display","none"),jQuery(".comingsoon:not(."+e+")").css("display","none"),"install"==e?(jQuery(".submit").css("display","none"),jQuery("#csoptions").attr("action",s)):(jQuery(".submit").css("display","block"),jQuery("#csoptions").attr("action",s+"#"+e))},""!=n&&navtab(n),window.onhashchange=function(){n=document.location.hash.substring(1),navtab(n)},e(".nav-tab:not(.theme-preview)").click(function(t){t.preventDefault(),n=e(this).data("tab"),document.location.hash=n}),jQuery(".cmp-status legend").click(function(){var e=jQuery(this).children("input");e.prop("checked",!0),jQuery(".cmp-status legend").removeClass("active"),jQuery(this).addClass("active"),e.trigger("change"),"3"==e.val()?jQuery("#niteoCS_URL_redirect").prop("disabled",!1):jQuery("#niteoCS_URL_redirect").prop("disabled",!0)}),jQuery(".table-wrapper h3").click(function(){jQuery(this).toggleClass("closed"),jQuery(this).next().toggle()}),jQuery(".niteoCS-logo-type").change(function(){"text"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","block"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","none")):"graphic"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","block"),jQuery(".disabled-logo").css("display","none")):"disabled"==jQuery(".niteoCS-logo-type:checked").val()&&(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","block"))});var i=jQuery(".logo-wrapper");""!=jQuery("#niteoCS-logo-id").val()&&(jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block")),jQuery("#add-logo").click(function(e){if(e.preventDefault(),t)t.open();else var t=wp.media({title:"Select Logo",button:{text:"Insert Logo"},multiple:!1,type:"image"}).on("select",function(){var e=t.state().get("selection").first().toJSON();jQuery(".logo-wrapper").empty(),i.append('<img src="'+e.url+'" alt="" style="max-width:588px"/>'),jQuery("#add-logo").val("Change Logo"),jQuery("#delete-logo").css("display","block"),jQuery("#niteoCS-logo-id").val(e.id).trigger("change")}).open()}),jQuery("#delete-logo").click(function(e){jQuery(".logo-wrapper").empty(),jQuery("#add-logo").val("Select Logo"),jQuery(this).css("display","none"),jQuery("#niteoCS-logo-id").val(""),jQuery("#niteoCS-logo-id").trigger("change")});var o=jQuery(".favicon-wrapper");""!=jQuery("#niteoCS-favicon-id").val()&&(jQuery("#add-favicon").val("Change favicon"),jQuery("#delete-favicon").css("display","block")),jQuery("#add-favicon").click(function(e){if(e.preventDefault(),t)t.open();else var t=wp.media({title:"Select favicon",button:{text:"Insert favicon"},multiple:!1,type:"image"}).on("select",function(){var e=t.state().get("selection").first().toJSON();jQuery(".favicon-wrapper").empty(),o.append('<img src="'+e.url+'" alt="" style="max-width:32px"/>'),jQuery("#add-favicon").val("Change favicon"),jQuery("#delete-favicon").css("display","block"),jQuery("#niteoCS-favicon-id").val(e.id).trigger("change"),jQuery("#favicon").length?jQuery("#favicon").attr("href",e.url):jQuery("head").append('<link id="favicon" rel="shortcut icon" href="'+e.url+'" />')}).open()}),jQuery("#delete-favicon").click(function(e){jQuery(".favicon-wrapper").empty(),jQuery("#add-favicon").val("Select favicon"),jQuery(this).css("display","none"),jQuery("#niteoCS-favicon-id").val("").trigger("change"),jQuery("#favicon").remove()}),""!=jQuery("#niteoCS-banner-id").val()&&jQuery("#delete-banner").css("display","block"),jQuery("#add-banner").click(function(e){var t=jQuery(".banner-wrapper:not(.default)");if(e.preventDefault(),a)a.open();else var a=wp.media({title:"Select Photos",button:{text:"Insert Photos"},multiple:!0,type:"image"}).on("select",function(){var e=a.state().get("selection").toJSON(),n="";e.length>0&&(t.empty(),jQuery(e).each(function(a){"large"in e[a].sizes?t.append('<img src="'+e[a].sizes.large.url+'" alt="" style="max-width:588px;"/>'):t.append('<img src="'+e[a].url+'" alt="" style="max-width:588px;"/>'),jQuery("#delete-banner").css("display","block"),n+=(0===a?"":",")+e[a].id}),jQuery("#niteoCS-banner-id").val(n).trigger("change"))}).open()}),jQuery("#delete-banner").click(function(e){jQuery(".banner-wrapper:not(.default)").empty(),jQuery(this).css("display","none"),jQuery("#niteoCS-banner-id").val("").trigger("change")}),jQuery("#test-unsplash").click(function(t){t.preventDefault();var a=jQuery("#unsplash-media"),n=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),s="",i="",o="",r=jQuery(this).data("security");switch(n){case"0":s=jQuery("#niteoCS-unsplash-0").val();break;case"1":s=jQuery("#niteoCS-unsplash-1").val(),i=jQuery('#unsplash_banner select[name^="unsplash_category"] option:selected').val(),o=jQuery("#niteoCS-category-keyword").val();break;case"2":s=jQuery("#niteoCS-unsplash-2").val();break;case"3":s=jQuery("#niteoCS-unsplash-3").val(),i=jQuery("#niteoCS_unsplash_feat").is(":checked")?"1":"0"}var c={feed:n,url:s,cat:i,custom_str:o};jQuery(this).prop("disabled",!0),jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'),a.html("");var l={action:"niteo_unsplash",security:r,params:c};e.post(ajaxurl,l,function(e){jQuery("#unsplash_img").remove(),img_url=e.replace("WIDTHxHEIGHT","588x330"),jQuery("<img />",{src:img_url,id:"unsplash_img"}).one("load",function(){jQuery(this).appendTo(a),jQuery(this).fadeIn(),jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Test Unsplash")})})}),jQuery("#csoptions .banner-video-source").change(function(){switch(jQuery("#csoptions .banner-video-source").val()){case"youtube":jQuery(".youtube-source-input").css("display","block"),jQuery(".vimeo-source-input").css("display","none");break;case"vimeo":jQuery(".youtube-source-input").css("display","none"),jQuery(".vimeo-source-input").css("display","block");break;default:jQuery(".youtube-source-input").css("display","none"),jQuery(".vimeo-source-input").css("display","block")}}),jQuery("#csoptions .banner-video-source").trigger("change"),jQuery("#test-video").click(function(t){t.preventDefault();var a=e(".banner-video-source").val();if("youtube"==a){if((i=e("#niteoCS-youtube-url").val()).match(/(youtube.com)/))var n="v=",s=1;if(i.match(/(youtu.be)/)||i.match(/(vimeo.com\/)+[0-9]/))var n="/",s=3}if("vimeo"==a){var i=e("#niteoCS-vimeo-url").val();if(i.match(/(vimeo.com\/)+[a-zA-Z]/))var n="/",s=5}if(i){var o=i.split(n)[s];if(void 0!=o){var r=o.replace(/(&)+(.*)/,"");if("banner_youtube"==a&&i.match(/(youtu.be)/)||i.match(/(youtube.com)/))c="https://www.youtube.com/embed/"+r+"?autoplay=1";if("banner_vimeo"==a&&i.match(/(vimeo.com\/)+[0-9]/)||i.match(/(vimeo.com\/)+[a-zA-Z]/))var c="https://player.vimeo.com/video/"+r+"?autoplay=1";var l=e('<iframe src="'+c+'" allowfullscreen></iframe>');e(".video-preview").html(l);var u=l.height()/l.width()*100;l.css("position","absolute"),l.css("top","0"),l.css("left","0"),l.css("width","100%"),l.css("height","100%"),e(".video-preview").css("padding-top",u+"%"),e("#niteoCS-vimeo-url").css("border","1px solid #ddd"),e("#niteoCS-youtube-url").css("border","1px solid #ddd")}else e(".video-preview").text("Please enter correct "+a+" URL.").css("padding-top","0"),e("#niteoCS-vimeo-url").css("border","1px solid #d60000"),e("#niteoCS-youtube-url").css("border","1px solid #d60000")}else e(".video-preview").text("Please enter "+a+" URL.").css("padding-top","0"),e("#niteoCS-vimeo-url").css("border","1px solid #d60000"),e("#niteoCS-youtube-url").css("border","1px solid #d60000")});var r=jQuery(".video-thumb-wrapper");""!=jQuery("#niteoCS-video-thumb").val()&&jQuery("#delete-video-thumb").css("display","block"),jQuery("#add-video-thumb").click(function(e){if(e.preventDefault(),t)t.open();else var t=wp.media({title:"Select Image",button:{text:"Insert Video Thumbnail"},multiple:!1,type:"image"}).on("select",function(){var e=t.state().get("selection").first().toJSON();if(r.empty(),void 0===e.sizes.large)a=e.url;else var a=e.sizes.large.url;r.append('<img src="'+a+'" alt=""/>'),jQuery("#delete-video-thumb").css("display","block"),jQuery("#niteoCS-video-thumb").val(e.id).trigger("change")}).open()}),jQuery("#delete-video-thumb").click(function(e){r.empty(),jQuery(this).css("display","none"),jQuery("#niteoCS-video-thumb").val("").trigger("change")}),jQuery("#csoptions .niteoCS_banner").change(function(){switch(jQuery("#csoptions .niteoCS_banner:checked").val()){case"0":jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none");break;case"1":jQuery("#unsplash_banner").css("display","block"),jQuery(".theme_background fieldset:not(#unsplash_banner)").css("display","none");break;case"2":jQuery("#default_banner").css("display","block"),jQuery(".theme_background fieldset:not(#default_banner)").css("display","none");break;case"3":jQuery("#graphic_pattern").css("display","block"),jQuery(".theme_background fieldset:not(#graphic_pattern)").css("display","none");break;case"4":jQuery("#solid_color").css("display","block"),jQuery(".theme_background fieldset:not(#solid_color)").css("display","none");break;case"5":jQuery("#video_banner").css("display","block"),jQuery(".theme_background fieldset:not(#video_banner)").css("display","none");break;default:jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none")}}),jQuery("#csoptions .niteoCS_banner").trigger("change");var c=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();jQuery("#unsplash-feed-"+c).css("display","block"),jQuery('#unsplash_banner select[name^="unsplash_feed"]').on("change",function(){c=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),jQuery(".unsplash-feed").css("display","none"),jQuery("#unsplash-feed-"+c).css("display","block")}),jQuery("#niteoCS_banner_color").wpColorPicker({change:function(e,t){jQuery(".color-preview").css("background-color",t.color.toString())}}),jQuery('select[name^="niteoCS_banner_pattern"]').on("change",function(){var e=jQuery('select[name^="niteoCS_banner_pattern"] option:selected').val();if("custom"!=e){t=jQuery(this).data("url");jQuery("#add-pattern").css("display","none"),jQuery(".pattern-preview").css("background-image","url('"+t+e+".png')")}else{var t=jQuery("#niteoCS_banner_pattern_custom").val();jQuery("#add-pattern").css("display","block"),jQuery(".pattern-preview").css("background-image","url('"+t+"')")}}),jQuery("#add-pattern").click(function(e){if(e.preventDefault(),t)t.open();else var t=wp.media({title:"Select Pattern",button:{text:"Select Pattern"},multiple:!1,type:"image"}).on("select",function(){var e=t.state().get("selection").first().toJSON();if(jQuery(".pattern-preview").css("background-image",""),void 0===e.sizes.large)a=e.url;else var a=e.sizes.large.url;jQuery(".pattern-preview").css("background-image","url('"+a+"')"),jQuery("#niteoCS_banner_pattern_custom").val(e.url)}).open()}),1==jQuery("#niteoCS_subscribe").prop("checked")&&jQuery(".subscribe").css("display","block"),jQuery("#niteoCS_subscribe").change(function(){jQuery(this)[0].checked?jQuery(".subscribe").css("display","block"):jQuery(".subscribe").css("display","none")}),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function(){0==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","block"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","none")):1==jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()?(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","block"),jQuery("#subscribe-niteo").css("display","none")):(jQuery("#subscribe-disabled").css("display","none"),jQuery("#subscribe-3rdparty").css("display","none"),jQuery("#subscribe-niteo").css("display","block"))}),jQuery("#csv-generate").click(function(e){e.preventDefault();jQuery.post(ajaxurl,"action=niteo_export_csv",function(e){e&&jQuery("<iframe />").attr("src",ajaxurl+"?action=niteo_export_csv").appendTo("body").hide()})});var l="",u="";l="custom"==jQuery(".niteoCS_font_headings option:selected").val()?t(a(jQuery("#niteoCS_font_headings_custom").val())):jQuery(".niteoCS_font_headings option:selected").val(),u="custom"==jQuery(".niteoCS_font_content option:selected").val()?t(a(jQuery("#niteoCS_font_content_custom").val())):jQuery(".niteoCS_font_contentoption:selected").val(),WebFont.load({google:{families:[t(a(l)),t(a(u))]},active:function(){e("#heading-example, #niteoCS-text-logo").css("font-family",l),e("#content-example").css("font-family",u)}}),jQuery(".niteoCS_font_headings").on("change",function(){niteoCS_font_headings=jQuery(".niteoCS_font_headings option:selected").val(),"custom"==niteoCS_font_headings?(jQuery("#custom_headings_font").css("display","block"),jQuery("#custom_headings_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[t(a(jQuery("#niteoCS_font_headings_custom").val()))]},active:function(){e("#heading-example, #niteoCS-text-logo").css("font-family",jQuery("#niteoCS_font_headings_custom").val())}})},1e3))})):(jQuery("#custom_headings_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_headings]},active:function(){e("#heading-example, #niteoCS-text-logo").css("font-family",niteoCS_font_headings||"")}}))}),jQuery(".niteoCS_font_content").on("change",function(){niteoCS_font_content=jQuery(".niteoCS_font_content option:selected").val(),"custom"==niteoCS_font_content?(jQuery("#custom_content_font").css("display","block"),jQuery("#custom_content_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[t(a(jQuery("#niteoCS_font_content_custom").val()))]},active:function(){e("#content-example").css("font-family",jQuery("#niteoCS_font_content_custom").val())}})},1e3))})):(jQuery("#custom_content_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_content]},active:function(){e("#content-example").css("font-family",niteoCS_font_content||"")}}))});var d=function(t,a,n){var s=e("#niteoCS_socialmedia").attr("value");s=e.parseJSON(s),e.each(s,function(e,s){s.name==t&&(s[a]=n)}),e("#niteoCS_socialmedia").attr("value",JSON.stringify(s))},p=e(".social-inputs"),y=function(t,a){var n=p.find('input[type="text"]');a.item.index();n.each(function(t,a){var n=e(a).data("name");d(n,"order",t)})};p.sortable({stop:y}),p.on("sortchange",y),function(e){e.fn.toggleDisabled=function(){return this.each(function(){var t,a=e(this),n=a.data("name");a.attr("disabled")?(a.prop("disabled",!1),t="1"):(a.prop("disabled",!0),t="0"),d(n,"active",t)})}}(jQuery),jQuery('.social-inputs input[type="text"]').focusout(function(){var e=jQuery(this).data("name"),t=jQuery(this).attr("value");d(e,"url",t)}),jQuery('.social-inputs input[type="checkbox"]').click(function(t){e(this).siblings('input[type="text"]').toggleDisabled()}),jQuery(".social-media i").click(function(){var e=jQuery(this).data("name");jQuery(this).toggleClass("active"),jQuery(".social-inputs li."+e).toggleClass("active"),jQuery(".social-inputs li."+e+" input").trigger("change"),jQuery(this).hasClass("active")?d(e,"hidden","0"):d(e,"hidden","1"),jQuery(".social-media i.active").length?jQuery(".social-inputs .label").css("display","block"):jQuery(".social-inputs .label").css("display","none")}),jQuery(".social-media i.active").length&&jQuery(".social-inputs .label").css("display","block"),jQuery(".view-release").click(function(e){e.preventDefault(),$this=jQuery(this);var t=$this.attr("href");jQuery.get(t,function(e){$this.closest(".notice").find(".release-note .notes").remove(),$this.closest(".notice").find(".release-note").append('<div class="notes">'+e+"</div>")}).fail(function(){$this.closest(".notice").find(".release-note p").remove(),$this.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".update-theme").click(function(t){t.preventDefault();var a=e(this),n=a.parents(".notice"),s=a.data("security"),i=a.data("slug"),o=a.data("type"),r=n.find(".theme-name").text(),c=jQuery(this).data("remote_url");update={name:i,tmp_name:"",type:o,url:c+"?action=download&slug="+i};var l={action:"cmp_theme_update_install",security:s,file:update};n.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>'),e.post(ajaxurl,l,function(t){if("success"==t)setTimeout(function(){n.removeClass("notice-warning").addClass("notice-success"),n.find(".message").html("<span> "+r+' Theme was updated sucessfully! </span><i class="fa fa-smile-o" aria-hidden="true"></i>')},1500);else{t=t.slice(0,-1);var a=e("p",e(t)).text();n.removeClass("notice-warning").addClass("notice-error"),n.find(".message").html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+a+"</span>")}})}),jQuery(".theme-select").click(function(){jQuery(this).parent().find('input[name="select_theme"]').prop("checked",!0).trigger("change"),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().find(".theme-select").addClass("selected")}),jQuery(".theme-update.button").one("click",function(t){t.preventDefault();var a=e(this),n=a.closest(".theme-wrapper"),s=n.data("security"),i=n.data("slug"),o={action:"cmp_theme_update_install",security:s,file:{name:i,tmp_name:"",type:n.data("type"),url:n.data("remote_url")+"?action=download&slug="+i}};a.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'),e.post(ajaxurl,o,function(e){"success"==e?setTimeout(function(){a.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'),setTimeout(function(){a.fadeOut()},1500)},1500):(e=e.slice(0,-1),a.html('<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>'))})}),jQuery(".theme-details").click(function(){var t=e(this),a=t.closest(".theme-wrapper"),n=a.data("slug"),s=a.data("version"),i=a.data("remote_url"),o=a.data("type"),r=a.data("purchased"),c="",l=jQuery(".update-theme").data("security"),u=1;e.getJSON(i+"?action=get_metadata&slug="+n,function(d){if(jQuery("body").addClass("modal-open"),"1"==r){s<d.version&&(c='<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+d.name+' theme available. <a href="'+i+"readme/"+n+'-readme.html" class="view-release">View update '+d.version+' notes</a> or <a href="'+window.location.href+"&action=update-cmp-theme&theme="+n+"&type="+o+'" class="update-theme" data-type="'+o+'" data-security="'+l+'" data-slug="'+n+'" data-remote_url="'+i+'">Update now.</a></strong></p><div class="release-note"></div></div>'),s==d.version&&(c='<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>');var p='<span class="theme-version">Version: '+s+"</span>",y="",h=""}else var p="",y="disabled ",h='<button type="button" class="theme-purchase button hide"><a href="'+a.find("a").attr("href")+'" target="_blank"><i class="fa fa-cart-arrow-down" aria-hidden="true"></i>Buy</a></button>';var v=e.parseJSON(d.details_url),m="";Object.keys(v).length>1&&(m='<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 f=e(['<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(\''+v[1]+"')\">"+m+"</div>","\t\t\t</div>",'\t\t\t<div class="theme-info">','\t\t\t\t<h2 class="theme-name">'+d.name+p+"</h2>",'\t\t\t\t<p class="theme-author">By <a href="'+d.author_homepage+'">'+d.author+"</a></p>",c,'\t\t\t\t<div class="theme-description">'+d.description+"</div>",h,"\t\t\t</div>","\t\t</div>",'\t\t<div class="theme-actions">','\t\t\t<button type="submit" '+y+'class="button activate" name="Submit" aria-label="Select '+d.name+'">Activate</button>','\t\t\t<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme='+n+'" class="button cmp-preview" target="_blank" aria-label="Preview '+d.name+'">Live Preview</a>',"\t\t</div>","\t</div>","</div>"].join("\n"));jQuery(".theme-overlay.cmp").append(f),jQuery(".theme-overlay.cmp .view-release").click(function(e){e.preventDefault();var a=(t=jQuery(this)).attr("href");jQuery.get(a,function(e){t.closest(".notice").find(".release-note .notes").remove(),t.closest(".notice").find(".release-note").append('<div class="notes">'+e+"</div>")}).fail(function(){t.closest(".notice").find(".release-note p").remove(),t.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".theme-overlay.cmp .close").click(function(e){e.preventDefault(),jQuery("body").removeClass("modal-open"),jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast")}),jQuery(".theme-overlay.cmp .activate").click(function(e){e.preventDefault(),jQuery('input[name="select_theme"]').each(function(){jQuery(this).val()==n&&(jQuery(this).prop("checked",!0),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().addClass("selected"))}),jQuery("#csoptions").submit()}),jQuery(".screenshots-nav .right").click(function(){++u>Object.keys(v).length&&(u=1),u in v&&jQuery(".screenshot").css("background-image","url('"+v[u]+"')")}),jQuery(".screenshots-nav .left").click(function(){--u<1&&(u=Object.keys(v).length),u in v&&jQuery(".screenshot").css("background-image","url('"+v[u]+"')")})})}),jQuery('#csoptions input[name="niteoCS_banner"]').trigger("change"),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger("change")});
|
js/vidim.min.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* vidim v1.0.1
|
3 |
+
* 2017-03-13T17:00:04.439Z
|
4 |
+
* https://github.com/OriginalEXE/vidim
|
5 |
+
*
|
6 |
+
* Made by Ante Sepic
|
7 |
+
*/
|
8 |
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.vidim=e()}(this,function(){"use strict";function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t,e){var i=Object.keys(e);i.forEach(function(i){t.hasOwnProperty(i)||(t[i]=e[i])})}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return"string"==typeof t?e.querySelector(t):t}function s(t,e){var i,s,o,n,r=0,a=function(){r=Date.now(),i=null,n=t.apply(s,o),i||(s=o=null)},l=function(){var l=Date.now();r||(r=l);var h=e-(l-r);return s=this,o=arguments,h<=0||h>e?(i&&(clearTimeout(i),i=null),r=l,n=t.apply(s,o),i||(s=o=null)):i||(i=setTimeout(a,h)),n};return l.cancel=function(){clearTimeout(i),r=0,i=s=o=null},l}function o(t){"loading"!=document.readyState?t():document.addEventListener("DOMContentLoaded",t)}var n=t(function(t){function e(t){if(t)return i(t)}function i(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var s,o=0;o<i.length;o++)if(s=i[o],s===e||s.fn===e){i.splice(o,1);break}return this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),i=this._callbacks["$"+t];if(i){i=i.slice(0);for(var s=0,o=i.length;s<o;++s)i[s].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}),r=Object.freeze({setDefaults:e,getElement:i,throttle:s,ready:o}),a=function(t){var i={preload:"auto"},s={_initializeProvider:function(){e(this._options,i),this._constructPlayer(),this._dispatch(),this._listen()},_constructPlayer:function(){this.el=document.createElement("video"),this.el.setAttribute("playsinline",""),this._options.loop&&this.el.setAttribute("loop",""),this._options.autoplay&&this.el.setAttribute("autoplay",""),this._options.preload&&this.el.setAttribute("preload",this._options.preload),this._options.muted&&(this.el.muted=!0),this.el.style.position="absolute",this.el.style.left="50%",this.el.style.top="50%",this.el.style.transform="translate(-50%, -50%)",this.el.style.webkitTransform="translate(-50%, -50%)",this.el.style.msTransform="translate(-50%, -50%)",this.el.style.oTransform="translate(-50%, -50%)",this.el.style.mozTransform="translate(-50%, -50%)",this.el.style.minWidth="calc( 100% + 2px )",this.el.style.minHeight="calc( 100% + 2px )",this.el.style.opacity="0";var t=this._options.src;if(t.length&&"string"!=typeof t)for(var e=0;e<t.length;e++){var i=document.createElement("source");i.setAttribute("type",t[e].type),i.setAttribute("src",t[e].src),this.el.appendChild(i)}this.wrapper.appendChild(this.el),this._options.startAt&&(this.el.currentTime=this._options.startAt),"function"==typeof this._options.onReady&&this._options.onReady(this),this.emit("ready"),this._constructOverlay(),this.resize()},_dispatch:function(){var t=this;this.el.addEventListener("play",function(){t.emit("play",t)},!1),this.el.addEventListener("pause",function(){t.emit("pause",t)},!1),this.el.addEventListener("ended",function(){t.emit("end",t)},!1),this.el.addEventListener("canplay",function(){t.emit("canplay",t)},!1),this.el.addEventListener("canplaythrough",function(){t.emit("canplaythrough",t)},!1)},_listen:function(){var t=this;this.on("play",function(){t.el.style.opacity="1"}),this._options.showPosterBeforePlay||this.once("play",function(){t.wrapper.style.backgroundImage="url('"+t._options.poster+"')"}),this._options.showPosterOnEnd&&this.on("end",function(){t.el.style.opacity="0"}),this._options.showPosterOnPause&&this.on("pause",function(){t.el.style.opacity="0"})},play:function(){return this.el.play(),this},pause:function(){return this.el.pause(),this},setVolume:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this.el.volume=parseFloat(t/100),this},getVolume:function(){return 100*this.el.volume},mute:function(){return this.el.muted=!0,this},unMute:function(){return this.el.muted=!1,this},setTime:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.el.currentTime=t,this},getTime:function(){return this.el.currentTime},getDuration:function(){return this.el.duration},showPoster:function(){this.pause().el.style.opacity="0"},changeSource:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.el.innerHTML="",t.length&&"string"!=typeof t)for(var i=0;i<t.length;i++){var s=document.createElement("source");s.setAttribute("type",t[i].type),s.setAttribute("src",t[i].src),this.el.appendChild(s)}if(this.el.load&&this.el.load(),this._options.startAt&&(this.el.currentTime=this._options.startAt),e){var o=this._options.poster;-1!==this.wrapper.style.backgroundImage.indexOf(o)&&(this.wrapper.style.backgroundImage="url('"+e+"')"),this._options.poster=e}},destroy:function(){this.emit("destroy"),this.el.pause&&this.el.pause(),this.el.src="",this.el.load&&this.el.load();try{this.wrapper.parentNode.removeChild(this.wrapper)}catch(t){}t.deleteInstance(this.vidimID),delete this.container.vidimID,this.off()},resize:function(){if(this.el){var t=this.container.offsetHeight,e=this.container.offsetWidth;"BODY"===this.container.nodeName&&(e=window.innerWidth,t=window.innerHeight),1<this._options.ratio&&e/t<this._options.ratio||1>this._options.ratio&&t/e<this._options.ratio?(this.el.style.maxHeight="calc( 100% + 2px )",this.el.style.maxWidth=""):(this.el.style.maxHeight="",this.el.style.maxWidth="calc( 100% + 2px )"),this.emit("resize")}}};t.registerProvider("HTML5",s)},l=!1,h=function(t){var i={quality:"hd1080"},s={_initializeProvider:function(){var t=this;l?(e(this._options,i),this._constructPlayer(),this._listen()):window.addEventListener("vidimYouTubeAPIReady",function(){e(t._options,i),t._constructPlayer(),t._listen()},!1)},_constructPlayer:function(){var t=this;if(11===this._options.src.length)this.videoID=this._options.src;else{var e=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|\?v=)([^#\&\?]*).*/,i=this._options.src.match(e);if(!i||11!==i[2].length)return new Error("Provided source is not a valid YouTube url");this.videoID=i[2]}var s=document.createElement("div");this.wrapper.appendChild(s);var o={videoId:this.videoID,playerVars:{allowfullscreen:!1,controls:0,enablejsapi:1,disablekb:1,fs:0,iv_load_policy:3,modestbranding:1,origin:window.location.host,playsinline:1,rel:0,showinfo:0,start:this._options.startAt,autoplay:+this._options.autoplay},events:{onReady:function(){if(t._options.muted&&t.mute(),t.player.setPlaybackQuality(t._options.quality),"function"==typeof t._options.onReady&&t._options.onReady(t),t.emit("ready"),t._options.loop){var e=void 0;t.on("play",function(){e=setInterval(function(){(0===t.getTime()||t.getTime()+.15>t.getDuration())&&(t.setTime(0),t.play())},100)}),t.on("pause",function(){clearInterval(e)}),t.on("destroy",function(){clearInterval(e)})}},onStateChange:function(e){switch(e.data){case 0:t.emit("end",t);break;case 1:t.emit("play",t);break;case 2:t.emit("pause",t);break;case 3:t.emit("buffering",t)}}}};this._options.loop&&(o.playerVars.playlist=this.videoID,o.playerVars.loop=1),this.player=new YT.Player(s,o),this.el=this.player.getIframe(),this.el.style.position="absolute",this.el.style.left="50%",this.el.style.top="50%",this.el.style.transform="translate(-50%, -50%)",this.el.style.webkitTransform="translate(-50%, -50%)",this.el.style.msTransform="translate(-50%, -50%)",this.el.style.oTransform="translate(-50%, -50%)",this.el.style.mozTransform="translate(-50%, -50%)",this.el.style.minWidth="calc( 100% + 2px )",this.el.style.minHeight="calc( 100% + 2px )",this.el.style.opacity="0",this._constructOverlay(),this.resize()},_listen:function(){var t=this;this.on("play",function(){t.el.style.opacity="1"}),this._options.showPosterBeforePlay||this.once("play",function(){t.wrapper.style.backgroundImage="url('"+t._options.poster+"')"}),this._options.showPosterOnEnd?this.on("end",function(){t.el.style.opacity="0"}):this.on("end",function(){t.player.seekTo(t.player.getDuration()),t.player.playVideo(),t.player.pauseVideo()}),this._options.showPosterOnPause&&this.on("pause",function(){t.el.style.opacity="0"})},play:function(){return this.player.playVideo(),this},pause:function(){return this.player.pauseVideo(),this},setVolume:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this.player.setVolume(t),this},getVolume:function(){return this.getVolume()},mute:function(){return this.player.mute(),this},unMute:function(){return this.player.unMute(),this},setTime:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.player.seekTo(t,!0),this},getTime:function(){return this.player.getCurrentTime()},getDuration:function(){return this.player.getDuration()},showPoster:function(){this.pause().el.style.opacity="0"},changeSource:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(11===t.length)this.videoID=t;else{var i=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|\?v=)([^#\&\?]*).*/,s=t.match(i);if(!s||11!==s[2].length)return new Error("Provided source is not a valid YouTube url");this.videoID=s[2]}if(this.player.loadPlaylist(this.videoID,0,this._options.startAt,this._options.quality),this.player.setLoop(this._options.loop),e){var o=this._options.poster;-1!==this.wrapper.style.backgroundImage.indexOf(o)&&(this.wrapper.style.backgroundImage="url('"+e+"')"),this._options.poster=e}},destroy:function(){this.emit("destroy"),this.player.destroy();try{this.wrapper.parentNode.removeChild(this.wrapper)}catch(t){}t.deleteInstance(this.vidimID),delete this.container.vidimID,this.off()},resize:function(){if(this.el){var t=this.container.offsetHeight,e=this.container.offsetWidth;"BODY"===this.container.nodeName&&(e=window.innerWidth,t=window.innerHeight),1<this._options.ratio&&e/t<this._options.ratio||1>this._options.ratio&&t/e<this._options.ratio?(this.el.style.maxHeight="calc( 100% + 2px )",this.el.style.maxWidth="",this.el.style.height="",this.el.style.width=this.el.offsetHeight*this._options.ratio+200+"px"):(this.el.style.maxHeight="",this.el.style.maxWidth="calc( 100% + 2px )",this.el.style.height=this.el.offsetWidth/this._options.ratio+"px",this.el.style.width="",this.el.offsetHeight<this.wrapper.offsetHeight+140&&(this.el.style.height=this.el.offsetWidth/this._options.ratio+140+"px")),this.emit("resize")}}};t.registerProvider("YouTube",s)},p=document.createElement("script");p.src="https://www.youtube.com/iframe_api",document.querySelector("body").appendChild(p);var c=document.createEvent("Event");if(c.initEvent("vidimYouTubeAPIReady",!0,!0),"undefined"==typeof window.onYouTubeIframeAPIReady)window.onYouTubeIframeAPIReady=function(){window.vidimYouTubeAPIReady=!0,l=!0,window.dispatchEvent(c)};else{var u=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){u(),window.vidimYouTubeAPIReady=!0,l=!0,window.dispatchEvent(c)}}var d=function(t){function l(e,i){"function"==typeof i?g[e]=i.call(t,_):g[e]=i}function p(t){return m[t]?m[t]:null}function c(t){return t=i(t),"undefined"!=typeof t.vidimID&&m[t.vidimID]?m[t.vidimID]:null}function u(){for(var t in m)m[t].hasOwnProperty("destroy")&&m[t].destroy();m={}}function d(t){delete m[t]}function y(){var t=document.querySelectorAll("[data-vidim]");if(t.length)for(var e=0;e<t.length;e++){var i=t[e],s=i.getAttribute("data-vidim");if("undefined"==typeof i.vidimID)try{var o=/({|,)(?:\s*)(?:')?([A-Za-z_$\.][A-Za-z0-9_ \-\.$]*)(?:')?(?:\s*):/g,n=s.replace(o,'$1"$2":').replace(/:\s?'/g,':"').replace(/'\s?}/g,'"}').replace(/',"/g,'","'),r=JSON.parse(n);new f(i,r)}catch(t){}}}function f(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(s).forEach(function(t){w.push(t)}),e(s,_),s.src&&!g[s.type]?new Error("No provider can handle type: '"+s.type+"'"):("string"==typeof s.ratio&&("4/3"===s.ratio?s.ratio=4/3:s.ratio=16/9),this._options=s,this.container=i(t),this.container?(-1===w.indexOf("zIndex")&&"BODY"===this.container.nodeName&&(this._options.zIndex=-1),void this._initialize()):new Error("Could not find the container: "+t))}if("undefined"!=typeof t.document){var v=0,m={},_={wrapperClass:"",overlayClass:"",src:!1,type:"HTML5",ratio:1.7778,autoplay:!0,loop:!0,poster:"",showPosterBeforePlay:!0,showPosterOnEnd:!1,showPosterOnPause:!1,zIndex:0,autoResize:!0,muted:!0,startAt:0,onReady:!1},w=[],g={},b=f.prototype;return b._initialize=function(){if(this.vidimID=v++,this.container.vidimID=this.vidimID,m[this.vidimID]=this,n(this),!this._options.src&&this._options.poster)return this._constructWrapper(),void(this.destroy=function(){this.emit("destroy");try{this.wrapper.parentNode.removeChild(this.wrapper)}catch(t){}f.deleteInstance(this.vidimID),delete this.container.vidimID,this.off()});var t=g[this._options.type];for(var e in t)this[e]=t[e];return"function"!=typeof this._initializeProvider?new Error("Provider is missing method: _initializeProvider"):(this._constructWrapper(),this._initializeProvider(),this._options.autoResize&&window.addEventListener("resize",s(this.resize,200).bind(this),!1),void this.resize())},b._constructWrapper=function(){var t=getComputedStyle(this.container,null);"static"===t.getPropertyValue("position")&&(this.container.style.position="relative"),this.wrapper=document.createElement("div"),"BODY"===this.container.nodeName?this.wrapper.style.position="fixed":this.wrapper.style.position="absolute",this._options.wrapperClass&&("function"==typeof this._options.wrapperClass?this.wrapper.classList.add(this._options.wrapperClass.call(this)):this.wrapper.classList.add(this._options.wrapperClass)),this.wrapper.style.left=0,this.wrapper.style.top=0,this.wrapper.style.height="100%",this.wrapper.style.width="100%",this.wrapper.style.overflow="hidden",this.wrapper.style.zIndex=parseInt(this._options.zIndex,10),this._options.poster&&(this.wrapper.style.backgroundSize="cover",this.wrapper.style.backgroundPosition="center center",this.wrapper.style.backgroundRepear="no-repeat",this._options.showPosterBeforePlay&&(this.wrapper.style.backgroundImage="url('"+this._options.poster+"')")),this.container.insertBefore(this.wrapper,this.container.firstChild)},b._constructOverlay=function(){this.overlay=document.createElement("div"),this.overlay.style.position="absolute",this._options.overlayClass&&("function"==typeof this._options.overlayClass?this.overlay.classList.add(this._options.overlayClass.call(this)):this.overlay.classList.add(this._options.overlayClass)),this.overlay.style.left=0,this.overlay.style.top=0,this.overlay.style.height="100%",this.overlay.style.width="100%",this.wrapper.appendChild(this.overlay)},f.getInstanceFromID=p,f.getInstanceFromElement=c,f.registerProvider=l,f.destroyAllInstances=u,f.deleteInstance=d,f.utility=r,f.scanDOM=y,a(f),h(f),o(y),f}}("undefined"!=typeof window?window:void 0);return d});
|
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: 1.
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
@@ -19,12 +19,14 @@ class niteo_cmp {
|
|
19 |
var $dev;
|
20 |
var $remoteServer = '';
|
21 |
var $theme_array = array();
|
|
|
22 |
var $premium_installed = array();
|
23 |
var $countdown_themes = array();
|
24 |
var $slider_themes = array();
|
|
|
25 |
|
26 |
function __construct() {
|
27 |
-
$this->version = '1.
|
28 |
$this->dev = false;
|
29 |
$this->installedFolder = basename(dirname(__FILE__));
|
30 |
|
@@ -45,7 +47,9 @@ class niteo_cmp {
|
|
45 |
$this->theme_array = $this->themes_standard;
|
46 |
}
|
47 |
// set remote server URL for updates
|
48 |
-
$this->remoteServer = ($this->dev == true) ? 'https://niteothemes.com/updates/' : 'https://niteothemes.com/updates/';
|
|
|
|
|
49 |
}
|
50 |
|
51 |
function cmp() {
|
@@ -54,7 +58,7 @@ class niteo_cmp {
|
|
54 |
|
55 |
function cmp_adminInit() {
|
56 |
wp_register_style( 'cmp_style', plugins_url('/css/cmp-settings-style.css', __FILE__),'',$this->version);
|
57 |
-
wp_register_script('cmp_settings_js', plugins_url('/js/settings
|
58 |
wp_register_style( 'font_awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
|
59 |
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js', array(), false, true);
|
60 |
}
|
@@ -138,23 +142,23 @@ class niteo_cmp {
|
|
138 |
|
139 |
function cmp_settings_page() {
|
140 |
// include default options page
|
141 |
-
|
142 |
}
|
143 |
|
144 |
function cmp_subs_page() {
|
145 |
// include default options page
|
146 |
-
|
147 |
}
|
148 |
|
149 |
function cmp_help_page() {
|
150 |
// include default options page
|
151 |
-
|
152 |
}
|
153 |
|
154 |
-
function cmp_about_page() {
|
155 |
-
|
156 |
-
|
157 |
-
}
|
158 |
|
159 |
function cmp_displayPage() {
|
160 |
|
@@ -166,13 +170,13 @@ class niteo_cmp {
|
|
166 |
// if premium
|
167 |
if ( $this->niteo_in_array_r( $theme_preview, $this->cmp_plugin_premium() ) ) {
|
168 |
if ( file_exists(plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
|
169 |
-
|
170 |
die();
|
171 |
}
|
172 |
|
173 |
} else {
|
174 |
if ( file_exists(dirname(__FILE__) . '/themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
|
175 |
-
|
176 |
die();
|
177 |
}
|
178 |
|
@@ -182,7 +186,7 @@ class niteo_cmp {
|
|
182 |
|
183 |
// render html theme page
|
184 |
if ( file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php') ) {
|
185 |
-
|
186 |
die();
|
187 |
}
|
188 |
}
|
@@ -470,7 +474,7 @@ class niteo_cmp {
|
|
470 |
|
471 |
// load PHP WP FILE
|
472 |
if ( ! function_exists( 'wp_handle_upload' ) ) {
|
473 |
-
|
474 |
}
|
475 |
|
476 |
$uploadedfile = $zip;
|
@@ -835,8 +839,20 @@ class niteo_cmp {
|
|
835 |
return $existing_mimes;
|
836 |
}
|
837 |
|
838 |
-
// convert hex to rgba
|
839 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
840 |
function hex2rgba ( $hex, $opacity ) {
|
841 |
list( $red, $green, $blue ) = sscanf( $hex, '#%02x%02x%02x' );
|
842 |
|
@@ -957,18 +973,107 @@ class niteo_cmp {
|
|
957 |
}
|
958 |
}
|
959 |
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
966 |
|
967 |
-
|
968 |
-
|
|
|
|
|
|
|
969 |
}
|
970 |
-
|
971 |
-
}
|
972 |
|
973 |
}
|
974 |
|
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: 1.9.0
|
7 |
Author: NiteoThemes
|
8 |
Author URI: https://www.niteothemes.com
|
9 |
Text Domain: cmp-coming-soon-maintenance
|
19 |
var $dev;
|
20 |
var $remoteServer = '';
|
21 |
var $theme_array = array();
|
22 |
+
var $themes_standard = array();
|
23 |
var $premium_installed = array();
|
24 |
var $countdown_themes = array();
|
25 |
var $slider_themes = array();
|
26 |
+
var $minified = '';
|
27 |
|
28 |
function __construct() {
|
29 |
+
$this->version = '1.9.0';
|
30 |
$this->dev = false;
|
31 |
$this->installedFolder = basename(dirname(__FILE__));
|
32 |
|
47 |
$this->theme_array = $this->themes_standard;
|
48 |
}
|
49 |
// set remote server URL for updates
|
50 |
+
$this->remoteServer = ($this->dev == true) ? 'https://niteothemes.com/updates-test/' : 'https://niteothemes.com/updates/';
|
51 |
+
$this->minified = ($this->dev == true) ? '.js' : '.min.js';
|
52 |
+
|
53 |
}
|
54 |
|
55 |
function cmp() {
|
58 |
|
59 |
function cmp_adminInit() {
|
60 |
wp_register_style( 'cmp_style', plugins_url('/css/cmp-settings-style.css', __FILE__),'',$this->version);
|
61 |
+
wp_register_script('cmp_settings_js', plugins_url('/js/settings'.$this->minified, __FILE__),array('webfont'),$this->version);
|
62 |
wp_register_style( 'font_awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
|
63 |
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js', array(), false, true);
|
64 |
}
|
142 |
|
143 |
function cmp_settings_page() {
|
144 |
// include default options page
|
145 |
+
require_once ('cmp-settings.php');
|
146 |
}
|
147 |
|
148 |
function cmp_subs_page() {
|
149 |
// include default options page
|
150 |
+
require_once ('cmp-subscribers.php');
|
151 |
}
|
152 |
|
153 |
function cmp_help_page() {
|
154 |
// include default options page
|
155 |
+
require_once ('cmp-help.php');
|
156 |
}
|
157 |
|
158 |
+
// function cmp_about_page() {
|
159 |
+
// // include default options page
|
160 |
+
// require_once ('cmp-about.php');
|
161 |
+
// }
|
162 |
|
163 |
function cmp_displayPage() {
|
164 |
|
170 |
// if premium
|
171 |
if ( $this->niteo_in_array_r( $theme_preview, $this->cmp_plugin_premium() ) ) {
|
172 |
if ( file_exists(plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
|
173 |
+
require_once (plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/'.$theme_preview.'/'.$theme_preview.'-theme.php');
|
174 |
die();
|
175 |
}
|
176 |
|
177 |
} else {
|
178 |
if ( file_exists(dirname(__FILE__) . '/themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
|
179 |
+
require_once (dirname(__FILE__) . '/themes/'.$theme_preview.'/'.$theme_preview.'-theme.php');
|
180 |
die();
|
181 |
}
|
182 |
|
186 |
|
187 |
// render html theme page
|
188 |
if ( file_exists($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php') ) {
|
189 |
+
require_once ($this->cmp_themePath().$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php');
|
190 |
die();
|
191 |
}
|
192 |
}
|
474 |
|
475 |
// load PHP WP FILE
|
476 |
if ( ! function_exists( 'wp_handle_upload' ) ) {
|
477 |
+
require_once realpath('../../../wp-admin/includes/file.php');
|
478 |
}
|
479 |
|
480 |
$uploadedfile = $zip;
|
839 |
return $existing_mimes;
|
840 |
}
|
841 |
|
|
|
842 |
|
843 |
+
function cmp_admin_notice() {
|
844 |
+
if ( isset($_GET['page']) && $_GET['page'] == 'cmp-settings' ) {
|
845 |
+
if (isset($_GET['status']) && $_GET['status'] == 'settings-saved') {
|
846 |
+
$status = 'success';
|
847 |
+
$message = __('CMP Settings Saved', 'cmp-coming-soon-maintenance');
|
848 |
+
|
849 |
+
echo '<div class="notice notice-'.$status.' is-dismissible"><p>'.$message.'.</p></div>';
|
850 |
+
}
|
851 |
+
}
|
852 |
+
return;
|
853 |
+
}
|
854 |
+
|
855 |
+
// convert hex to rgba
|
856 |
function hex2rgba ( $hex, $opacity ) {
|
857 |
list( $red, $green, $blue ) = sscanf( $hex, '#%02x%02x%02x' );
|
858 |
|
973 |
}
|
974 |
}
|
975 |
|
976 |
+
function get_background_media( $niteoCS_banner, $themeslug ) {
|
977 |
+
$size = $this->isMobile() ? 'large' : 'full';
|
978 |
+
|
979 |
+
switch ($niteoCS_banner) {
|
980 |
+
// custom media
|
981 |
+
case '0':
|
982 |
+
$banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
|
983 |
+
$background_class = 'image';
|
984 |
+
if ( $banner_id != '' ) {
|
985 |
+
$banner_ids = explode(',', $banner_id);
|
986 |
+
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
987 |
+
if ( isset($banner_url[0]) ) {
|
988 |
+
$banner_url = $banner_url[0];
|
989 |
+
}
|
990 |
+
|
991 |
+
} else {
|
992 |
+
// send default image
|
993 |
+
$banner_url = $this->cmp_themeDirPath().$themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
994 |
+
}
|
995 |
+
|
996 |
+
return array( $background_class, $banner_url );
|
997 |
+
|
998 |
+
case '1':
|
999 |
+
// unsplash
|
1000 |
+
$background_class = 'image';
|
1001 |
+
$unplash_feed = get_option('niteoCS_unsplash_feed['.$themeslug.']', '0');
|
1002 |
+
switch ( $unplash_feed ) {
|
1003 |
+
// SINGLE IMAGE
|
1004 |
+
case '0':
|
1005 |
+
$params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
|
1006 |
+
$banner_url = $this->niteo_unsplash( $params );
|
1007 |
+
return array( $background_class, $banner_url );
|
1008 |
+
|
1009 |
+
// category random
|
1010 |
+
case '1':
|
1011 |
+
$params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
|
1012 |
+
$banner_url = $this->niteo_unsplash( $params );
|
1013 |
+
return array( $background_class, $banner_url );
|
1014 |
+
|
1015 |
+
// collection
|
1016 |
+
case '2':
|
1017 |
+
$params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
|
1018 |
+
$banner_url = $this->niteo_unsplash( $params );
|
1019 |
+
return array( $background_class, $banner_url );
|
1020 |
+
|
1021 |
+
// random photo
|
1022 |
+
case '3':
|
1023 |
+
$params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
|
1024 |
+
$banner_url = $this->niteo_unsplash( $params );
|
1025 |
+
return array( $background_class, $banner_url );
|
1026 |
+
|
1027 |
+
default:
|
1028 |
+
break;
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
break;
|
1032 |
+
|
1033 |
+
case '2':
|
1034 |
+
// default image
|
1035 |
+
$background_class = 'image';
|
1036 |
+
$banner_url = $this->cmp_themeDirPath().$themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
1037 |
+
return array($background_class, $banner_url);
|
1038 |
+
|
1039 |
+
case '3':
|
1040 |
+
// Pattern
|
1041 |
+
$background_class = 'pattern';
|
1042 |
+
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
|
1043 |
+
|
1044 |
+
if ( $niteoCS_banner_pattern != 'custom' ) {
|
1045 |
+
$banner_url = plugins_url('/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png', __FILE__);
|
1046 |
+
} else {
|
1047 |
+
|
1048 |
+
$banner_url = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
|
1049 |
+
}
|
1050 |
+
return array( $background_class, $banner_url );
|
1051 |
+
|
1052 |
+
case '4':
|
1053 |
+
// Pattern
|
1054 |
+
$background_class = 'color';
|
1055 |
+
$niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
|
1056 |
+
return array( $background_class, '<style>.banner.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>' );
|
1057 |
+
|
1058 |
+
case '5':
|
1059 |
+
// video
|
1060 |
+
$source = get_option('niteoCS_banner_video['.$themeslug.']');
|
1061 |
+
$background_class = 'video';
|
1062 |
+
$banner_url = ( $source == 'youtube' ) ? get_option('niteoCS_youtube_url['.$themeslug.']') : get_option('niteoCS_vimeo_url['.$themeslug.']');
|
1063 |
+
// $banner_url = str_replace('watch?v=', 'embed/', $banner_url);
|
1064 |
+
return array($background_class, $banner_url, $source);
|
1065 |
+
default:
|
1066 |
+
break;
|
1067 |
+
}
|
1068 |
+
}
|
1069 |
|
1070 |
+
function get_youtube_img( $youtube_url ) {
|
1071 |
+
$youtube = preg_match('/.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/', $youtube_url, $url);
|
1072 |
+
if ( isset( $url[7] ) && $url[7] != '') {
|
1073 |
+
$youtube_image = 'http://img.youtube.com/vi/' . $url[7] . '/hqdefault.jpg';
|
1074 |
+
return $youtube_image;
|
1075 |
}
|
1076 |
+
}
|
|
|
1077 |
|
1078 |
}
|
1079 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JF
|
|
4 |
Tags: under construction, construction page, maintenance mode, landing page, launch page, launching, security, coming soon, customizable, offline, offline page, unavailable, free, unsplash, subscribe form
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -15,9 +15,10 @@ Create and customize your own landing page for Coming soon Page or Maintenance m
|
|
15 |
Free plugin to create and customize your own Coming Soon or Maintenance landing page. Setup custom logos, background graphics, texts, subscribe form, your social networks, fonts and colors, and many more.
|
16 |
|
17 |
<h3>Preview</h3>
|
|
|
|
|
18 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=construct" target="_blank">Click for preview of Construct Theme >></a><br>
|
19 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork" target="_blank">Click for preview of Hardwork Theme >></a>
|
20 |
-
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=countdown" target="_blank">Click for preview of Countdown Theme >></a>
|
21 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork_premium" target="_blank">Click for preview of Hardwork Premium Theme >></a>
|
22 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=frame" target="_blank">Click for preview of Frame Theme >></a>
|
23 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=fifty" target="_blank">Click for preview of Fifty Theme >></a>
|
@@ -32,6 +33,7 @@ Free plugin to create and customize your own Coming Soon or Maintenance landing
|
|
32 |
<li>Subscribe form works with any 3rd party plugin(Mailchimp, etc)</li>
|
33 |
<li>Custom Subscribe form to store emails in custom database with export to csv</li>
|
34 |
<li>Select and Display random beautiful images from <a href="http://unsplash.com" target="_blank">Unsplash source</a> with built-in search API or use custom photos</li>
|
|
|
35 |
<li>Customize SEO meta tags to search engines</li>
|
36 |
<li>Set response code to search engines</li>
|
37 |
<li>Insert Google Analytics Code</li>
|
@@ -74,11 +76,20 @@ Free plugin to create and customize your own Coming Soon or Maintenance landing
|
|
74 |
|
75 |
|
76 |
== Screenshots ==
|
77 |
-
1. CMP - Coming Soon
|
78 |
-
2. CMP -
|
79 |
-
3. CMP -
|
80 |
-
4. CMP -
|
81 |
-
5. CMP - Settings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
== Frequently Asked Questions ==
|
84 |
<h4>I can't see the landing page I`ve just created!</h4>
|
@@ -101,6 +112,12 @@ Free plugin to create and customize your own Coming Soon or Maintenance landing
|
|
101 |
|
102 |
|
103 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
<h4>1.8.0</h4>
|
105 |
<h3>!Important Notice!</h3>
|
106 |
<p>Theme related settings - logo, graphic banner and font types will be lost after installation of this version! Make sure you set it up again in CMP Settings. Thank you for understanding :)</p>
|
4 |
Tags: under construction, construction page, maintenance mode, landing page, launch page, launching, security, coming soon, customizable, offline, offline page, unavailable, free, unsplash, subscribe form
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 1.9.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
15 |
Free plugin to create and customize your own Coming Soon or Maintenance landing page. Setup custom logos, background graphics, texts, subscribe form, your social networks, fonts and colors, and many more.
|
16 |
|
17 |
<h3>Preview</h3>
|
18 |
+
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork&video=true" target="_blank">Click for preview of Hardwork Theme with video background>></a>
|
19 |
+
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=countdown" target="_blank">Click for preview of Countdown Theme >></a>
|
20 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=construct" target="_blank">Click for preview of Construct Theme >></a><br>
|
21 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork" target="_blank">Click for preview of Hardwork Theme >></a>
|
|
|
22 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork_premium" target="_blank">Click for preview of Hardwork Premium Theme >></a>
|
23 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=frame" target="_blank">Click for preview of Frame Theme >></a>
|
24 |
<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=fifty" target="_blank">Click for preview of Fifty Theme >></a>
|
33 |
<li>Subscribe form works with any 3rd party plugin(Mailchimp, etc)</li>
|
34 |
<li>Custom Subscribe form to store emails in custom database with export to csv</li>
|
35 |
<li>Select and Display random beautiful images from <a href="http://unsplash.com" target="_blank">Unsplash source</a> with built-in search API or use custom photos</li>
|
36 |
+
<li>Video background options: Youtube or Vimeo</li>
|
37 |
<li>Customize SEO meta tags to search engines</li>
|
38 |
<li>Set response code to search engines</li>
|
39 |
<li>Insert Google Analytics Code</li>
|
76 |
|
77 |
|
78 |
== Screenshots ==
|
79 |
+
1. CMP - Coming Soon Plugin
|
80 |
+
2. CMP - Theme Selector
|
81 |
+
3. CMP - Subscriber List
|
82 |
+
4. CMP - Theme Selector detail
|
83 |
+
5. CMP - Global Settings
|
84 |
+
6. CMP - Theme Content Settings
|
85 |
+
7. CMP - SEO Settings
|
86 |
+
8. CMP - Construct Theme
|
87 |
+
9. CMP - Countdown Theme
|
88 |
+
10. CMP - Fifty Theme
|
89 |
+
11. CMP - Fifty Theme
|
90 |
+
12. CMP - Frame Theme
|
91 |
+
13. CMP - Hardwork Theme
|
92 |
+
14. CMP - Hardwork Premium Theme
|
93 |
|
94 |
== Frequently Asked Questions ==
|
95 |
<h4>I can't see the landing page I`ve just created!</h4>
|
112 |
|
113 |
|
114 |
== Changelog ==
|
115 |
+
<h4>1.9.0</h4>
|
116 |
+
<ul>
|
117 |
+
<li>New Feature: Video background option</li>
|
118 |
+
<li>Small changes in CMP Settings page.</li>
|
119 |
+
</ul>
|
120 |
+
|
121 |
<h4>1.8.0</h4>
|
122 |
<h3>!Important Notice!</h3>
|
123 |
<p>Theme related settings - logo, graphic banner and font types will be lost after installation of this version! Make sure you set it up again in CMP Settings. Thank you for understanding :)</p>
|
themes/construct/construct-theme.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
$subscribe_response = $this->niteo_subscribe( $_POST['EMAIL'] );
|
4 |
}
|
5 |
|
6 |
-
$ver = '1.
|
7 |
$themeslug = 'construct';
|
8 |
|
9 |
?>
|
@@ -20,33 +20,45 @@
|
|
20 |
<title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
|
21 |
<?php
|
22 |
// get theme related settings
|
23 |
-
$active_color
|
24 |
-
$font_color
|
25 |
-
$background_color
|
26 |
-
$heading_font
|
27 |
-
$content_font
|
28 |
-
$logo_type
|
29 |
-
|
30 |
-
$niteoCS_banner
|
31 |
-
|
32 |
if ( $heading_font == 'custom' ) {
|
33 |
-
$heading_font
|
34 |
}
|
35 |
|
36 |
if ( $content_font == 'custom' ) {
|
37 |
-
$content_font
|
38 |
}
|
39 |
|
40 |
// get global settings
|
41 |
-
$body_title
|
42 |
-
$subscribe
|
43 |
$niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
|
44 |
-
$copyright
|
45 |
-
$social_title
|
46 |
-
$favicon_id
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
//
|
50 |
if ( !get_option('niteoCS_socialmedia') ) {
|
51 |
$social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
|
52 |
$i = 0;
|
@@ -65,11 +77,11 @@
|
|
65 |
}
|
66 |
$socialmedia = $new_socials;
|
67 |
} else {
|
68 |
-
$socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
|
69 |
-
$socialmedia = json_decode($socialmedia, true);
|
70 |
}
|
71 |
|
72 |
-
foreach ($socialmedia as $social) {
|
73 |
|
74 |
if ( $social['hidden'] == '0' && $social['active'] == '1') {
|
75 |
$enable_social = true;
|
@@ -81,7 +93,7 @@
|
|
81 |
|
82 |
// display favicon
|
83 |
if ( $favicon_id && $favicon_id != '' ) {
|
84 |
-
$favicon_url = wp_get_attachment_image_src($favicon_id, 'thumbnail');
|
85 |
if ( isset($favicon_url[0]) ){
|
86 |
echo '<link id="favicon" rel="shortcut icon" href="'.$favicon_url[0].'" type="image/x-icon"/>';
|
87 |
}
|
@@ -101,7 +113,7 @@
|
|
101 |
<link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/style.css?ver='.$ver;?>" type="text/css" media="all"></link>
|
102 |
|
103 |
<link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $heading_font));?>|<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
|
104 |
-
|
105 |
<style>
|
106 |
body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
|
107 |
body{background-color:<?php echo esc_attr( $background_color ); ?>}
|
@@ -139,107 +151,27 @@
|
|
139 |
|
140 |
</script>
|
141 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
} ?>
|
143 |
|
144 |
</head>
|
145 |
|
146 |
<?php
|
147 |
|
148 |
-
// check for mobile/desktop and determine image size
|
149 |
-
if (preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"])) {
|
150 |
-
$size = 'large';
|
151 |
-
} else {
|
152 |
-
$size = 'full';
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
switch ($niteoCS_banner) {
|
157 |
-
// custom media
|
158 |
-
case '0':
|
159 |
-
$banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
|
160 |
-
$background_class = 'image';
|
161 |
-
if ( $banner_id != '' ) {
|
162 |
-
$banner_ids = explode(',', $banner_id);
|
163 |
-
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
164 |
-
if ( isset($banner_url[0]) ) {
|
165 |
-
$banner_url = $banner_url[0];
|
166 |
-
}
|
167 |
-
|
168 |
-
} else {
|
169 |
-
// set construct img
|
170 |
-
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
171 |
-
}
|
172 |
-
break;
|
173 |
-
|
174 |
-
case '1':
|
175 |
-
// unsplash
|
176 |
-
$background_class = 'image';
|
177 |
-
switch ( $unplash_feed ) {
|
178 |
-
// SINGLE IMAGE
|
179 |
-
case '0':
|
180 |
-
$params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
|
181 |
-
$banner_url = $this->niteo_unsplash( $params );
|
182 |
-
break;
|
183 |
-
// category random
|
184 |
-
case '1':
|
185 |
-
$params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
|
186 |
-
$banner_url = $this->niteo_unsplash( $params );
|
187 |
-
break;
|
188 |
-
// collection
|
189 |
-
case '2':
|
190 |
-
$params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
|
191 |
-
$banner_url = $this->niteo_unsplash( $params );
|
192 |
-
break;
|
193 |
-
// random photo
|
194 |
-
case '3':
|
195 |
-
$params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
|
196 |
-
$banner_url = $this->niteo_unsplash( $params );
|
197 |
-
break;
|
198 |
-
|
199 |
-
default:
|
200 |
-
break;
|
201 |
-
}
|
202 |
-
|
203 |
-
break;
|
204 |
-
|
205 |
-
case '2':
|
206 |
-
// default image
|
207 |
-
$background_class = 'image';
|
208 |
-
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
209 |
-
break;
|
210 |
-
|
211 |
-
case '3':
|
212 |
-
// Pattern
|
213 |
-
$background_class = 'pattern';
|
214 |
-
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
|
215 |
-
|
216 |
-
if ($niteoCS_banner_pattern != 'custom') {
|
217 |
-
$banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
|
218 |
-
// echo copyright pattern
|
219 |
-
echo '<!-- Background pattern from Subtle Patterns --!>';
|
220 |
-
|
221 |
-
} else {
|
222 |
-
$banner_url = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
|
223 |
-
}
|
224 |
-
|
225 |
-
break;
|
226 |
-
case '4':
|
227 |
-
// Pattern
|
228 |
-
$background_class = 'color';
|
229 |
-
$banner_url = '';
|
230 |
-
$niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
|
231 |
-
echo '<style>.banner.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
|
232 |
-
break;
|
233 |
-
|
234 |
-
default:
|
235 |
-
break;
|
236 |
-
}
|
237 |
?>
|
238 |
|
239 |
<body>
|
240 |
<section class="section section-logo">
|
241 |
<?php
|
242 |
-
switch ($logo_type) {
|
243 |
case 'graphic':
|
244 |
// get logo id
|
245 |
$logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
|
@@ -263,25 +195,44 @@
|
|
263 |
</section>
|
264 |
|
265 |
<section class="section section-banner" id="banner-wrapper">
|
266 |
-
<?php
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
} else { ?>
|
281 |
-
<
|
282 |
<?php
|
283 |
-
}
|
284 |
-
?>
|
285 |
</section>
|
286 |
|
287 |
|
@@ -325,19 +276,7 @@
|
|
325 |
|
326 |
<?php
|
327 |
if ( $enable_social === true ) {
|
328 |
-
|
329 |
-
//sort array by hidden, then order key
|
330 |
-
function sort_social($a, $b){
|
331 |
-
if ( $a['hidden'] == $b['hidden'] ) {
|
332 |
-
if( $a['order'] == $b['order'] ) {
|
333 |
-
return 0;
|
334 |
-
}
|
335 |
-
return $a['order'] < $b['order'] ? -1 : 1;
|
336 |
-
} else {
|
337 |
-
return $a['hidden'] > $b['hidden'] ? 1 : -1;
|
338 |
-
}
|
339 |
-
}
|
340 |
-
uasort($socialmedia , 'sort_social'); ?>
|
341 |
|
342 |
<section class="section section-social">
|
343 |
<?php if ( $social_title != '') { ?>
|
@@ -367,9 +306,37 @@
|
|
367 |
<p><?php echo esc_html( $copyright );?></p>
|
368 |
</footer>
|
369 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
} ?>
|
371 |
|
372 |
-
|
373 |
</body>
|
374 |
|
375 |
</html>
|
3 |
$subscribe_response = $this->niteo_subscribe( $_POST['EMAIL'] );
|
4 |
}
|
5 |
|
6 |
+
$ver = '1.8';
|
7 |
$themeslug = 'construct';
|
8 |
|
9 |
?>
|
20 |
<title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
|
21 |
<?php
|
22 |
// get theme related settings
|
23 |
+
$active_color = get_option('niteoCS_active_color['.$themeslug.']', '#f37004');
|
24 |
+
$font_color = get_option('niteoCS_font_color['.$themeslug.']', '#686868');
|
25 |
+
$background_color = get_option('niteoCS_background_color['.$themeslug.']', '#ffffff');
|
26 |
+
$heading_font = get_option('niteoCS_font_headings['.$themeslug.']', 'Fjalla One');
|
27 |
+
$content_font = get_option('niteoCS_font_content['.$themeslug.']', 'Average Sans');
|
28 |
+
$logo_type = get_option('niteoCS_logo_type['.$themeslug.']', 'text');
|
29 |
+
|
30 |
+
$niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']', '2');
|
31 |
+
|
32 |
if ( $heading_font == 'custom' ) {
|
33 |
+
$heading_font = get_option('niteoCS_font_headings_custom['.$themeslug.']');
|
34 |
}
|
35 |
|
36 |
if ( $content_font == 'custom' ) {
|
37 |
+
$content_font = get_option('niteoCS_font_content_custom['.$themeslug.']');
|
38 |
}
|
39 |
|
40 |
// get global settings
|
41 |
+
$body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
|
42 |
+
$subscribe = get_option('niteoCS_subscribe_type', '2');
|
43 |
$niteoCS_subscribe_label = get_option('niteoCS_subscribe_label', 'Type your email and get notified');
|
44 |
+
$copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
|
45 |
+
$social_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
|
46 |
+
$favicon_id = get_option('niteoCS_favicon_id');
|
47 |
+
|
48 |
+
// get background media
|
49 |
+
if ( method_exists ( $this, 'get_background_media' ) ) {
|
50 |
+
$background_media = $this->get_background_media( $niteoCS_banner, $themeslug);
|
51 |
+
$background_class = $background_media[0];
|
52 |
+
$banner_url = $background_media[1];
|
53 |
+
if ( $background_class == 'video' ) {
|
54 |
+
$source = $background_media[2];
|
55 |
+
}
|
56 |
+
} else {
|
57 |
+
$background_class = 'error';
|
58 |
+
$banner_url = '';
|
59 |
+
}
|
60 |
|
61 |
+
// migrate social media to new option after update 1.4.0
|
62 |
if ( !get_option('niteoCS_socialmedia') ) {
|
63 |
$social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
|
64 |
$i = 0;
|
77 |
}
|
78 |
$socialmedia = $new_socials;
|
79 |
} else {
|
80 |
+
$socialmedia = stripslashes( get_option('niteoCS_socialmedia') );
|
81 |
+
$socialmedia = json_decode( $socialmedia, true );
|
82 |
}
|
83 |
|
84 |
+
foreach ( $socialmedia as $social ) {
|
85 |
|
86 |
if ( $social['hidden'] == '0' && $social['active'] == '1') {
|
87 |
$enable_social = true;
|
93 |
|
94 |
// display favicon
|
95 |
if ( $favicon_id && $favicon_id != '' ) {
|
96 |
+
$favicon_url = wp_get_attachment_image_src( $favicon_id, 'thumbnail' );
|
97 |
if ( isset($favicon_url[0]) ){
|
98 |
echo '<link id="favicon" rel="shortcut icon" href="'.$favicon_url[0].'" type="image/x-icon"/>';
|
99 |
}
|
113 |
<link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/style.css?ver='.$ver;?>" type="text/css" media="all"></link>
|
114 |
|
115 |
<link href="https://fonts.googleapis.com/css?family=<?php echo esc_attr(str_replace(' ', '+', $heading_font));?>|<?php echo esc_attr(str_replace(' ', '+', $content_font));?>:400,400i,700" rel="stylesheet">
|
116 |
+
|
117 |
<style>
|
118 |
body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
|
119 |
body{background-color:<?php echo esc_attr( $background_color ); ?>}
|
151 |
|
152 |
</script>
|
153 |
<?php
|
154 |
+
}
|
155 |
+
// echo solid color style if $banner_url is set to color
|
156 |
+
if ( $niteoCS_banner == 4) {
|
157 |
+
echo $banner_url;
|
158 |
+
}
|
159 |
+
|
160 |
+
// echo pattern copyright
|
161 |
+
if ( $niteoCS_banner == 3 ) {
|
162 |
+
echo '<!-- Background pattern from Subtle Patterns --!>';
|
163 |
} ?>
|
164 |
|
165 |
</head>
|
166 |
|
167 |
<?php
|
168 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
?>
|
170 |
|
171 |
<body>
|
172 |
<section class="section section-logo">
|
173 |
<?php
|
174 |
+
switch ( $logo_type ) {
|
175 |
case 'graphic':
|
176 |
// get logo id
|
177 |
$logo_id = get_option('niteoCS_logo_id['.$themeslug.']');
|
195 |
</section>
|
196 |
|
197 |
<section class="section section-banner" id="banner-wrapper">
|
198 |
+
<?php
|
199 |
+
if ( $background_class != 'error' ) {
|
200 |
+
switch ( $niteoCS_banner ) {
|
201 |
+
// custom media / default / pattern / color
|
202 |
+
case '0':
|
203 |
+
case '2':
|
204 |
+
case '3':
|
205 |
+
case '4': ?>
|
206 |
+
<div class="banner <?php echo esc_attr($background_class);?>" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
207 |
+
<?php
|
208 |
+
break;
|
209 |
+
|
210 |
+
// unsplash media
|
211 |
+
case '1': ?>
|
212 |
+
<script>
|
213 |
+
var screenWidth = Math.round(screen.width*window.devicePixelRatio);
|
214 |
+
var screenHeight = screenWidth / 1.77777;
|
215 |
+
screenHeight = screenHeight.toFixed(0);
|
216 |
+
|
217 |
+
var banner = '<div class="banner" style="background-image:url(\'<?php echo esc_url( $banner_url ); ?>\')"></div>';
|
218 |
+
banner = banner.replace('WIDTHxHEIGHT', screenWidth + 'x' + screenHeight);
|
219 |
+
document.getElementById('banner-wrapper').innerHTML = banner;
|
220 |
+
</script>
|
221 |
+
<?php
|
222 |
+
// video media
|
223 |
+
case '5': ?>
|
224 |
+
|
225 |
+
<div id="player" class="video-banner"></div>
|
226 |
+
|
227 |
+
<?php
|
228 |
+
default:
|
229 |
+
break;
|
230 |
+
}
|
231 |
|
232 |
} else { ?>
|
233 |
+
<p class="error"><?php _e('To Display Graphic Media please upgrade CMP Plugin to latest version. You can download latest version on ', 'cmp-coming-soon-maintenance');?><a href="https://wordpress.org/plugins/cmp-coming-soon-maintenance/">Wordpress website</a> <?php _e('or you can use automatic plugin update in WP-Admin > Plugins > CMP - Coming Soon & Maintenance Plugin > Update Now.', 'cmp-coming-soon-maintenance');?></p>
|
234 |
<?php
|
235 |
+
} ?>
|
|
|
236 |
</section>
|
237 |
|
238 |
|
276 |
|
277 |
<?php
|
278 |
if ( $enable_social === true ) {
|
279 |
+
uasort( $socialmedia, array($this,'sort_social') ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
<section class="section section-social">
|
282 |
<?php if ( $social_title != '') { ?>
|
306 |
<p><?php echo esc_html( $copyright );?></p>
|
307 |
</footer>
|
308 |
<?php
|
309 |
+
}
|
310 |
+
|
311 |
+
if ( $niteoCS_banner != 5 ) { ?>
|
312 |
+
<script type='text/javascript' src='<?php echo plugin_dir_url( dirname( __FILE__ ) ) . $themeslug .'/paraxify.min.js';?>'></script>
|
313 |
+
<?php
|
314 |
+
|
315 |
+
} else {
|
316 |
+
$niteoCS_video_thumb = get_option('niteoCS_video_thumb['.$themeslug.']');
|
317 |
+
if ( $niteoCS_video_thumb != '' ) {
|
318 |
+
$thumb_id = wp_get_attachment_image_src($niteoCS_video_thumb, 'large');
|
319 |
+
|
320 |
+
if ( isset($thumb_id[0]) ) {
|
321 |
+
$thumb = $thumb_id[0];
|
322 |
+
}
|
323 |
+
} ?>
|
324 |
+
|
325 |
+
<script type='text/javascript' src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/vidim.min.js');?>'></script>
|
326 |
+
|
327 |
+
<script>
|
328 |
+
var myBackground = new vidim( '#player', {
|
329 |
+
src: '<?php echo esc_url( $banner_url ); ?>',
|
330 |
+
type: 'YouTube',
|
331 |
+
poster: '<?php echo ( $niteoCS_video_thumb == '' ) ? $this->get_youtube_img($banner_url) : esc_url($thumb);?>',
|
332 |
+
}
|
333 |
+
);
|
334 |
+
|
335 |
+
</script>
|
336 |
+
<?php
|
337 |
} ?>
|
338 |
|
339 |
+
|
340 |
</body>
|
341 |
|
342 |
</html>
|
themes/construct/style.css
CHANGED
@@ -3,7 +3,7 @@ Theme Name: Construct
|
|
3 |
Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=construct
|
4 |
Author: Niteo
|
5 |
Author URI: https://niteothemes.com
|
6 |
-
Version: 1.
|
7 |
Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/construct\/screenshot1.jpg"}
|
8 |
Description: <p>Construct is clean and modern designed theme for CMP plugin. Construct features big paralax banner which can be set to any custom graphic, pattern or Unsplash library media. Add subscribe form, your customized social media icons and it can be used both Coming soon or Under Construction landing page.</p><h4>Main Features</h4><ul><li>Custom paralax banner</li><li>Subscribe form</li><li>Responsive design</li></ul>
|
9 |
|
@@ -39,11 +39,11 @@ h1,h2,h3,h4,h5,h6{font-weight: 400;font-size:2em;}
|
|
39 |
.section-logo {max-width: 500px; margin: 0 auto;}
|
40 |
.section-logo img {max-width: 100%;max-height: 300px;}
|
41 |
.section-logo h1 {font-size: 2.5em; text-transform: uppercase;}
|
42 |
-
.section-banner{height:
|
43 |
.section-body p{width:70%;max-width: 900px;margin:1em auto;}
|
44 |
.section-social{background-color: #f8f8f8;}
|
45 |
.section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;}
|
46 |
-
.banner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;background-attachment: fixed;background-position: center center;background-repeat: no-repeat;background-size: cover;}
|
47 |
.banner.pattern{background-size: initial; background-repeat: repeat;}
|
48 |
.social-list{padding:0;margin-bottom: 0;}
|
49 |
.social-list li{list-style: none;display: inline-block; padding: 0 5px;}
|
@@ -88,11 +88,23 @@ input[type="submit"] {display: inline-block;line-height: 4em;height: 4em;box-siz
|
|
88 |
to {transform:rotate(360deg);}
|
89 |
}
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
@media only screen and (max-width : 480px) {
|
92 |
-
.section {padding: 20px 10px;}
|
93 |
input[type="email"],
|
94 |
input[type="submit"] {line-height: 3em;height: 3em;}
|
95 |
input[type="email"] {width: 70%;}
|
96 |
input[type="submit"] {width: 30%;}
|
97 |
.section-body p {width:90%;}
|
98 |
}
|
|
3 |
Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=construct
|
4 |
Author: Niteo
|
5 |
Author URI: https://niteothemes.com
|
6 |
+
Version: 1.8
|
7 |
Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/construct\/screenshot1.jpg"}
|
8 |
Description: <p>Construct is clean and modern designed theme for CMP plugin. Construct features big paralax banner which can be set to any custom graphic, pattern or Unsplash library media. Add subscribe form, your customized social media icons and it can be used both Coming soon or Under Construction landing page.</p><h4>Main Features</h4><ul><li>Custom paralax banner</li><li>Subscribe form</li><li>Responsive design</li></ul>
|
9 |
|
39 |
.section-logo {max-width: 500px; margin: 0 auto;}
|
40 |
.section-logo img {max-width: 100%;max-height: 300px;}
|
41 |
.section-logo h1 {font-size: 2.5em; text-transform: uppercase;}
|
42 |
+
.section-banner{padding-top: 30%;height: 0;}
|
43 |
.section-body p{width:70%;max-width: 900px;margin:1em auto;}
|
44 |
.section-social{background-color: #f8f8f8;}
|
45 |
.section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;}
|
46 |
+
.banner, .video-banner{position: absolute;top: 0;right: 0;bottom: 0;left: 0;background-attachment: fixed;background-position: center center;background-repeat: no-repeat;background-size: cover;}
|
47 |
.banner.pattern{background-size: initial; background-repeat: repeat;}
|
48 |
.social-list{padding:0;margin-bottom: 0;}
|
49 |
.social-list li{list-style: none;display: inline-block; padding: 0 5px;}
|
88 |
to {transform:rotate(360deg);}
|
89 |
}
|
90 |
|
91 |
+
.video-banner iframe {
|
92 |
+
transition: opacity 1500ms;
|
93 |
+
}
|
94 |
+
|
95 |
+
@media only screen and (min-width : 1920px) {
|
96 |
+
.section-banner {
|
97 |
+
padding-top: 20%;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
|
102 |
@media only screen and (max-width : 480px) {
|
103 |
+
.section:not(.section-banner) {padding: 20px 10px;}
|
104 |
input[type="email"],
|
105 |
input[type="submit"] {line-height: 3em;height: 3em;}
|
106 |
input[type="email"] {width: 70%;}
|
107 |
input[type="submit"] {width: 30%;}
|
108 |
.section-body p {width:90%;}
|
109 |
}
|
110 |
+
|
themes/countdown/countdown-theme.php
CHANGED
@@ -15,8 +15,9 @@
|
|
15 |
<title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' is coming soon!')) ); ?></title>
|
16 |
|
17 |
<?php
|
18 |
-
$ver = '1.
|
19 |
$themeslug = 'countdown';
|
|
|
20 |
// get theme related settings
|
21 |
$niteoCS_active_color = get_option('niteoCS_active_color['.$themeslug.']', '#E85C4F');
|
22 |
$niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#ffffff');
|
@@ -53,28 +54,31 @@
|
|
53 |
$social_location = get_option('social_location', 'footer');
|
54 |
$enable_social = false;
|
55 |
|
56 |
-
if (is_array($socialmedia)) {
|
57 |
-
foreach ($socialmedia as $social) {
|
58 |
|
59 |
if ( $social['hidden'] == '0' && $social['active'] == '1') {
|
60 |
$enable_social = true;
|
61 |
//sort array by hidden, then order key
|
62 |
-
|
63 |
-
if ( $a['hidden'] == $b['hidden'] ) {
|
64 |
-
if( $a['order'] == $b['order'] ) {
|
65 |
-
return 0;
|
66 |
-
}
|
67 |
-
return $a['order'] < $b['order'] ? -1 : 1;
|
68 |
-
} else {
|
69 |
-
return $a['hidden'] > $b['hidden'] ? 1 : -1;
|
70 |
-
}
|
71 |
-
}
|
72 |
-
uasort($socialmedia , 'sort_social');
|
73 |
break;
|
74 |
}
|
75 |
}
|
76 |
}
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
// override options if theme preview isset
|
79 |
if ( isset( $theme_preview ) && $theme_preview == 'countdown' ) {
|
80 |
$niteoCS_subscribe_label = 'Type your email and get notified.';
|
@@ -125,7 +129,7 @@
|
|
125 |
.social-list.footer li:not(:last-of-type)::after {background-color: <?php echo esc_attr( $niteoCS_font_color_light ); ?>;}
|
126 |
<?php
|
127 |
// if graphic banner, display transparent counter and input
|
128 |
-
$types = array('0', '1', '2');
|
129 |
if ( in_array($niteoCS_banner, $types) ) { ?>
|
130 |
.counter-wrap,
|
131 |
input[type="email"],
|
@@ -168,121 +172,47 @@
|
|
168 |
|
169 |
</head>
|
170 |
|
171 |
-
<?php
|
172 |
-
// check for mobile/desktop and determine image size
|
173 |
-
if (preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"])) {
|
174 |
-
$size = 'large';
|
175 |
-
} else {
|
176 |
-
$size = 'full';
|
177 |
-
}
|
178 |
-
|
179 |
-
switch ($niteoCS_banner) {
|
180 |
-
// custom media
|
181 |
-
case '0':
|
182 |
-
$banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
|
183 |
-
$background_class = 'image';
|
184 |
-
if ( $banner_id != '' ) {
|
185 |
-
$banner_ids = explode(',', $banner_id);
|
186 |
-
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
187 |
-
if ( isset($banner_url[0]) ) {
|
188 |
-
$banner_url = $banner_url[0];
|
189 |
-
}
|
190 |
-
|
191 |
-
} else {
|
192 |
-
// set construct img
|
193 |
-
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
194 |
-
}
|
195 |
-
break;
|
196 |
-
|
197 |
-
case '1':
|
198 |
-
// unsplash
|
199 |
-
$background_class = 'image';
|
200 |
-
switch ( $unplash_feed ) {
|
201 |
-
// SINGLE IMAGE
|
202 |
-
case '0':
|
203 |
-
$params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
|
204 |
-
$banner_url = $this->niteo_unsplash( $params );
|
205 |
-
break;
|
206 |
-
// category random
|
207 |
-
case '1':
|
208 |
-
$params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
|
209 |
-
$banner_url = $this->niteo_unsplash( $params );
|
210 |
-
break;
|
211 |
-
// collection
|
212 |
-
case '2':
|
213 |
-
$params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
|
214 |
-
$banner_url = $this->niteo_unsplash( $params );
|
215 |
-
break;
|
216 |
-
// random photo
|
217 |
-
case '3':
|
218 |
-
$params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
|
219 |
-
$banner_url = $this->niteo_unsplash( $params );
|
220 |
-
break;
|
221 |
-
|
222 |
-
default:
|
223 |
-
break;
|
224 |
-
}
|
225 |
-
|
226 |
-
break;
|
227 |
-
|
228 |
-
case '2':
|
229 |
-
// default image
|
230 |
-
$background_class = 'image';
|
231 |
-
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
232 |
-
break;
|
233 |
-
|
234 |
-
case '3':
|
235 |
-
// Pattern
|
236 |
-
$background_class = 'pattern';
|
237 |
-
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
|
238 |
-
|
239 |
-
if ($niteoCS_banner_pattern != 'custom') {
|
240 |
-
$banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
|
241 |
-
// echo copyright pattern
|
242 |
-
echo '<!-- Background pattern from Subtle Patterns --!>';
|
243 |
-
|
244 |
-
} else {
|
245 |
-
$banner_url = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
|
246 |
-
}
|
247 |
-
|
248 |
-
break;
|
249 |
-
case '4':
|
250 |
-
// Pattern
|
251 |
-
$background_class = 'color';
|
252 |
-
$banner_url = '';
|
253 |
-
$niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#bdc3c7');
|
254 |
-
echo '<style>#background-image.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
|
255 |
-
break;
|
256 |
-
|
257 |
-
default:
|
258 |
-
break;
|
259 |
-
}
|
260 |
-
|
261 |
-
?>
|
262 |
-
|
263 |
<body id="body">
|
264 |
|
265 |
<div id="background-wrapper">
|
266 |
<?php
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
} else { ?>
|
281 |
-
<
|
282 |
<?php
|
283 |
-
}
|
284 |
|
285 |
-
if ($niteoCS_overlay_opacity != '0') { ?>
|
286 |
|
287 |
<div class="background-overlay"></div>
|
288 |
<?php
|
@@ -462,64 +392,87 @@
|
|
462 |
echo '</footer>';
|
463 |
} ?>
|
464 |
</div>
|
465 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
|
467 |
-
|
468 |
-
if ( $niteoCS_counter == '1') { ?>
|
469 |
-
<script>
|
470 |
-
// Set the date we're counting down to
|
471 |
-
var counter = document.getElementById('counter');
|
472 |
-
var unixtime = counter.getAttribute('data-date');
|
473 |
-
var date = new Date(unixtime*1000);
|
474 |
-
var countDownDate = new Date(date).getTime();
|
475 |
|
476 |
-
|
477 |
-
|
|
|
|
|
|
|
|
|
|
|
478 |
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
// Find the distance between now an the count down date
|
483 |
-
var distance = countDownDate - now;
|
484 |
-
|
485 |
-
// Time calculations for days, hours, minutes and seconds
|
486 |
-
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
487 |
-
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
488 |
-
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
489 |
-
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
490 |
-
|
491 |
-
if (days < 10) {
|
492 |
-
days = '0' + days;
|
493 |
-
}
|
494 |
-
if (hours < 10) {
|
495 |
-
hours = '0' + hours;
|
496 |
-
}
|
497 |
-
if (minutes < 10) {
|
498 |
-
minutes = '0' + minutes;
|
499 |
-
}
|
500 |
-
if (seconds < 10) {
|
501 |
-
seconds = '0' + seconds;
|
502 |
-
}
|
503 |
-
if (distance >= 0) {
|
504 |
-
document.getElementById('counter-day').innerHTML = days;
|
505 |
-
document.getElementById('counter-hour').innerHTML = hours;
|
506 |
-
document.getElementById('counter-minute').innerHTML = minutes;
|
507 |
-
document.getElementById('counter-second').innerHTML = seconds;
|
508 |
-
}
|
509 |
|
510 |
-
|
511 |
-
|
|
|
|
|
|
|
|
|
|
|
512 |
|
513 |
-
//
|
514 |
-
|
515 |
-
clearInterval(x);
|
516 |
-
window.location.reload();
|
517 |
-
}
|
518 |
-
<?php
|
519 |
-
} ?>
|
520 |
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
525 |
</html>
|
15 |
<title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' is coming soon!')) ); ?></title>
|
16 |
|
17 |
<?php
|
18 |
+
$ver = '1.4';
|
19 |
$themeslug = 'countdown';
|
20 |
+
|
21 |
// get theme related settings
|
22 |
$niteoCS_active_color = get_option('niteoCS_active_color['.$themeslug.']', '#E85C4F');
|
23 |
$niteoCS_font_color = get_option('niteoCS_font_color['.$themeslug.']', '#ffffff');
|
54 |
$social_location = get_option('social_location', 'footer');
|
55 |
$enable_social = false;
|
56 |
|
57 |
+
if ( is_array($socialmedia) ) {
|
58 |
+
foreach ( $socialmedia as $social ) {
|
59 |
|
60 |
if ( $social['hidden'] == '0' && $social['active'] == '1') {
|
61 |
$enable_social = true;
|
62 |
//sort array by hidden, then order key
|
63 |
+
uasort( $socialmedia , array($this,'sort_social') );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
break;
|
65 |
}
|
66 |
}
|
67 |
}
|
68 |
|
69 |
+
// get background media
|
70 |
+
if ( method_exists ( $this, 'get_background_media' ) ) {
|
71 |
+
$background_media = $this->get_background_media( $niteoCS_banner, $themeslug);
|
72 |
+
$background_class = $background_media[0];
|
73 |
+
$banner_url = $background_media[1];
|
74 |
+
if ( $background_class == 'video' ) {
|
75 |
+
$source = $background_media[2];
|
76 |
+
}
|
77 |
+
} else {
|
78 |
+
$background_class = 'error';
|
79 |
+
$banner_url = '';
|
80 |
+
}
|
81 |
+
|
82 |
// override options if theme preview isset
|
83 |
if ( isset( $theme_preview ) && $theme_preview == 'countdown' ) {
|
84 |
$niteoCS_subscribe_label = 'Type your email and get notified.';
|
129 |
.social-list.footer li:not(:last-of-type)::after {background-color: <?php echo esc_attr( $niteoCS_font_color_light ); ?>;}
|
130 |
<?php
|
131 |
// if graphic banner, display transparent counter and input
|
132 |
+
$types = array('0', '1', '2', '5');
|
133 |
if ( in_array($niteoCS_banner, $types) ) { ?>
|
134 |
.counter-wrap,
|
135 |
input[type="email"],
|
172 |
|
173 |
</head>
|
174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
<body id="body">
|
176 |
|
177 |
<div id="background-wrapper">
|
178 |
<?php
|
179 |
+
if ( $background_class != 'error' ) {
|
180 |
+
switch ( $niteoCS_banner ) {
|
181 |
+
// custom media / default / pattern / color
|
182 |
+
case '0':
|
183 |
+
case '2':
|
184 |
+
case '3':
|
185 |
+
case '4': ?>
|
186 |
+
<div id="background-image" class="<?php echo esc_attr($background_class);?>" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
187 |
+
<?php
|
188 |
+
break;
|
189 |
+
|
190 |
+
// unsplash media
|
191 |
+
case '1': ?>
|
192 |
+
<script>
|
193 |
+
var screenWidth = Math.round(screen.width*window.devicePixelRatio);
|
194 |
+
var screenHeight = screenWidth / 1.77777;
|
195 |
+
screenHeight = screenHeight.toFixed(0);
|
196 |
+
|
197 |
+
var banner = '<div id="background-image" style="background-image:url(\'<?php echo esc_url( $banner_url ); ?>\')"></div>';
|
198 |
+
banner = banner.replace('WIDTHxHEIGHT', screenWidth + 'x' + screenHeight);
|
199 |
+
document.getElementById('background-wrapper').innerHTML = banner;
|
200 |
+
</script>
|
201 |
+
<?php
|
202 |
+
// video media
|
203 |
+
case '5': ?>
|
204 |
+
<div id="player" class="video-banner"></div>
|
205 |
+
<?php
|
206 |
+
default:
|
207 |
+
break;
|
208 |
+
}
|
209 |
|
210 |
} else { ?>
|
211 |
+
<p class="error"><?php _e('To Display Graphic Media please upgrade CMP Plugin to latest version. You can download latest version on ', 'cmp-coming-soon-maintenance');?><a href="https://wordpress.org/plugins/cmp-coming-soon-maintenance/">Wordpress website</a> <?php _e('or you can use automatic plugin update in WP-Admin > Plugins > CMP - Coming Soon & Maintenance Plugin > Update Now.', 'cmp-coming-soon-maintenance');?></p>
|
212 |
<?php
|
213 |
+
}
|
214 |
|
215 |
+
if ( $niteoCS_overlay_opacity != '0' ) { ?>
|
216 |
|
217 |
<div class="background-overlay"></div>
|
218 |
<?php
|
392 |
echo '</footer>';
|
393 |
} ?>
|
394 |
</div>
|
395 |
+
<?php
|
396 |
+
if ( $niteoCS_banner == 5 ) {
|
397 |
+
$niteoCS_video_thumb = get_option('niteoCS_video_thumb['.$themeslug.']');
|
398 |
+
if ( $niteoCS_video_thumb != '' ) {
|
399 |
+
$thumb_id = wp_get_attachment_image_src($niteoCS_video_thumb, 'large');
|
400 |
+
|
401 |
+
if ( isset($thumb_id[0]) ) {
|
402 |
+
$thumb = $thumb_id[0];
|
403 |
+
}
|
404 |
+
} ?>
|
405 |
|
406 |
+
<script type='text/javascript' src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/vidim.min.js');?>'></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
|
408 |
+
<script>
|
409 |
+
var myBackground = new vidim( '#player', {
|
410 |
+
src: '<?php echo esc_url( $banner_url ); ?>',
|
411 |
+
type: 'YouTube',
|
412 |
+
poster: '<?php echo ( $niteoCS_video_thumb == '' ) ? $this->get_youtube_img($banner_url) : esc_url($thumb);?>',
|
413 |
+
}
|
414 |
+
);
|
415 |
|
416 |
+
</script>
|
417 |
+
<?php
|
418 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
|
420 |
+
if ( $niteoCS_counter == '1') { ?>
|
421 |
+
<script>
|
422 |
+
// Set the date we're counting down to
|
423 |
+
var counter = document.getElementById('counter');
|
424 |
+
var unixtime = counter.getAttribute('data-date');
|
425 |
+
var date = new Date(unixtime*1000);
|
426 |
+
var countDownDate = new Date(date).getTime();
|
427 |
|
428 |
+
// Update the count down every 1 second
|
429 |
+
var x = setInterval(function() {
|
|
|
|
|
|
|
|
|
|
|
430 |
|
431 |
+
// Get todays date and time
|
432 |
+
var now = new Date().getTime();
|
433 |
+
|
434 |
+
// Find the distance between now an the count down date
|
435 |
+
var distance = countDownDate - now;
|
436 |
+
|
437 |
+
// Time calculations for days, hours, minutes and seconds
|
438 |
+
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
439 |
+
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
440 |
+
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
441 |
+
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
442 |
+
|
443 |
+
if (days < 10) {
|
444 |
+
days = '0' + days;
|
445 |
+
}
|
446 |
+
if (hours < 10) {
|
447 |
+
hours = '0' + hours;
|
448 |
+
}
|
449 |
+
if (minutes < 10) {
|
450 |
+
minutes = '0' + minutes;
|
451 |
+
}
|
452 |
+
if (seconds < 10) {
|
453 |
+
seconds = '0' + seconds;
|
454 |
+
}
|
455 |
+
if (distance >= 0) {
|
456 |
+
document.getElementById('counter-day').innerHTML = days;
|
457 |
+
document.getElementById('counter-hour').innerHTML = hours;
|
458 |
+
document.getElementById('counter-minute').innerHTML = minutes;
|
459 |
+
document.getElementById('counter-second').innerHTML = seconds;
|
460 |
+
}
|
461 |
+
|
462 |
+
<?php
|
463 |
+
if ( $countdown_action != 'no-action' && $countdown_action != 'display-text') { ?>
|
464 |
+
|
465 |
+
// If the count down is over, write some text
|
466 |
+
if (distance < 0) {
|
467 |
+
clearInterval(x);
|
468 |
+
window.location.reload();
|
469 |
+
}
|
470 |
+
<?php
|
471 |
+
} ?>
|
472 |
+
|
473 |
+
}, 1000);
|
474 |
+
</script>
|
475 |
+
<?php
|
476 |
+
} ?>
|
477 |
+
</body>
|
478 |
</html>
|
themes/countdown/style.css
CHANGED
@@ -3,7 +3,7 @@ Theme Name: Countdown
|
|
3 |
Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=countdown
|
4 |
Author: Niteo
|
5 |
Author URI: https//niteothemes.com
|
6 |
-
Version: 1.
|
7 |
Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/countdown\/screenshot1.jpg","2":"https:\/\/niteothemes.com\/cmp-screenshots\/countdown\/screenshot2.jpg"}
|
8 |
Description: <p>Countdown theme attracts attention with big counting clocks, which you can set to any expiration date. When timer hits zero you can set following actions: do-nothing, redirect to set URL or disable CMP plugin and display your normal page to visitors.</p><p>Social icons can be set to a footer with transparent icons or inside Countdown body with big beautiful eye attacting icons.</p><h4>Main Features</h4><ul><li>Counter setup with three predefined actions</li><li>Two designs for Socials icons</li><li>Subscribe Form</li><li>Responsive design</li></ul>
|
9 |
|
@@ -287,7 +287,8 @@ h3,h4,h5,h6 {
|
|
287 |
}
|
288 |
|
289 |
|
290 |
-
#background-image
|
|
|
291 |
position: absolute;
|
292 |
top: 0;
|
293 |
right: 0;
|
@@ -299,6 +300,10 @@ h3,h4,h5,h6 {
|
|
299 |
z-index: -1;
|
300 |
}
|
301 |
|
|
|
|
|
|
|
|
|
302 |
.background-overlay {
|
303 |
position: absolute;
|
304 |
top: 0;
|
@@ -354,7 +359,6 @@ footer {
|
|
354 |
|
355 |
.logo {
|
356 |
padding: 30px 0;
|
357 |
-
padding-bottom: 80px;
|
358 |
}
|
359 |
|
360 |
.logo img {
|
3 |
Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=countdown
|
4 |
Author: Niteo
|
5 |
Author URI: https//niteothemes.com
|
6 |
+
Version: 1.4
|
7 |
Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/countdown\/screenshot1.jpg","2":"https:\/\/niteothemes.com\/cmp-screenshots\/countdown\/screenshot2.jpg"}
|
8 |
Description: <p>Countdown theme attracts attention with big counting clocks, which you can set to any expiration date. When timer hits zero you can set following actions: do-nothing, redirect to set URL or disable CMP plugin and display your normal page to visitors.</p><p>Social icons can be set to a footer with transparent icons or inside Countdown body with big beautiful eye attacting icons.</p><h4>Main Features</h4><ul><li>Counter setup with three predefined actions</li><li>Two designs for Socials icons</li><li>Subscribe Form</li><li>Responsive design</li></ul>
|
9 |
|
287 |
}
|
288 |
|
289 |
|
290 |
+
#background-image,
|
291 |
+
.video-banner {
|
292 |
position: absolute;
|
293 |
top: 0;
|
294 |
right: 0;
|
300 |
z-index: -1;
|
301 |
}
|
302 |
|
303 |
+
.video-banner iframe {
|
304 |
+
transition: opacity 1500ms;
|
305 |
+
}
|
306 |
+
|
307 |
.background-overlay {
|
308 |
position: absolute;
|
309 |
top: 0;
|
359 |
|
360 |
.logo {
|
361 |
padding: 30px 0;
|
|
|
362 |
}
|
363 |
|
364 |
.logo img {
|
themes/hardwork/hardwork-theme.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
|
11 |
|
12 |
<?php
|
13 |
-
$ver = '1.
|
14 |
$themeslug = 'hardwork';
|
15 |
// get theme related settings
|
16 |
$font_color = get_option('niteoCS_font_color['.$themeslug.']', '#494949');
|
@@ -75,6 +75,19 @@
|
|
75 |
}
|
76 |
}
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
// display favicon
|
79 |
if ( $favicon_id && $favicon_id != '' ) {
|
80 |
$favicon_url = wp_get_attachment_image_src($favicon_id, 'thumbnail');
|
@@ -141,129 +154,46 @@
|
|
141 |
|
142 |
</head>
|
143 |
|
144 |
-
<?php
|
145 |
-
|
146 |
-
if ( $heading_font == 'custom' ) {
|
147 |
-
$heading_font = str_replace(' ', '+', get_option('niteoCS_font_headings_custom'));
|
148 |
-
}
|
149 |
-
|
150 |
-
if ( $content_font == 'custom' ) {
|
151 |
-
$content_font = str_replace(' ', '+', get_option('niteoCS_font_content_custom'));
|
152 |
-
}
|
153 |
-
// check for mobile/desktop and determine image size
|
154 |
-
if (preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"])) {
|
155 |
-
$size = 'large';
|
156 |
-
} else {
|
157 |
-
$size = 'full';
|
158 |
-
}
|
159 |
-
|
160 |
-
switch ($niteoCS_banner) {
|
161 |
-
// custom media
|
162 |
-
case '0':
|
163 |
-
$banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
|
164 |
-
$background_class = 'image';
|
165 |
-
if ( $banner_id != '' ) {
|
166 |
-
$banner_ids = explode(',', $banner_id);
|
167 |
-
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
168 |
-
if ( isset($banner_url[0]) ) {
|
169 |
-
$banner_url = $banner_url[0];
|
170 |
-
}
|
171 |
-
|
172 |
-
} else {
|
173 |
-
// set construct img
|
174 |
-
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
175 |
-
}
|
176 |
-
break;
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
switch ( $
|
182 |
-
//
|
183 |
case '0':
|
184 |
-
$params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
|
185 |
-
$banner_url = $this->niteo_unsplash( $params );
|
186 |
-
break;
|
187 |
-
// category random
|
188 |
-
case '1':
|
189 |
-
$params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
|
190 |
-
$banner_url = $this->niteo_unsplash( $params );
|
191 |
-
break;
|
192 |
-
// collection
|
193 |
case '2':
|
194 |
-
$params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
|
195 |
-
$banner_url = $this->niteo_unsplash( $params );
|
196 |
-
break;
|
197 |
-
// random photo
|
198 |
case '3':
|
199 |
-
|
200 |
-
|
|
|
201 |
break;
|
202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
default:
|
204 |
break;
|
205 |
}
|
206 |
|
207 |
-
break;
|
208 |
-
|
209 |
-
case '2':
|
210 |
-
// default image
|
211 |
-
$background_class = 'image';
|
212 |
-
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . $themeslug.'/img/'.$themeslug.'_banner_'.$size.'.jpg';
|
213 |
-
break;
|
214 |
-
|
215 |
-
case '3':
|
216 |
-
// Pattern
|
217 |
-
$background_class = 'pattern';
|
218 |
-
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern['.$themeslug.']', 'sakura');
|
219 |
-
|
220 |
-
if ($niteoCS_banner_pattern != 'custom') {
|
221 |
-
$banner_url = plugins_url('cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png');
|
222 |
-
// echo copyright pattern
|
223 |
-
echo '<!-- Background pattern from Subtle Patterns --!>';
|
224 |
-
|
225 |
-
} else {
|
226 |
-
$banner_url = get_option('niteoCS_banner_pattern_custom['.$themeslug.']');
|
227 |
-
}
|
228 |
-
|
229 |
-
break;
|
230 |
-
case '4':
|
231 |
-
// Pattern
|
232 |
-
$background_class = 'color';
|
233 |
-
$banner_url = '';
|
234 |
-
$niteoCS_banner_color = get_option('niteoCS_banner_color['.$themeslug.']', '#ffffff');
|
235 |
-
echo '<style>#background-image.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
|
236 |
-
break;
|
237 |
-
|
238 |
-
default:
|
239 |
-
break;
|
240 |
-
}
|
241 |
-
?>
|
242 |
-
|
243 |
-
<body id="body">
|
244 |
-
<?php
|
245 |
-
// if banner is unsplash
|
246 |
-
if ( $niteoCS_banner == 1 ) { ?>
|
247 |
-
<script>
|
248 |
-
var screenWidth = Math.round(screen.width*window.devicePixelRatio);
|
249 |
-
var screenHeight = screenWidth / 1.77777;
|
250 |
-
screenHeight = screenHeight.toFixed(0);
|
251 |
-
|
252 |
-
var banner = '<div id="background-wrapper"><div id="background-image" style="background-image:url(\'<?php echo esc_url( $banner_url ); ?>\')"></div><div id="background-color"></div></div>';
|
253 |
-
banner = banner.replace('WIDTHxHEIGHT', screenWidth + 'x' + screenHeight);
|
254 |
-
document.getElementById('body').innerHTML = banner;
|
255 |
-
</script>
|
256 |
-
<?php
|
257 |
-
|
258 |
} else { ?>
|
259 |
-
<
|
260 |
-
<div id="background-image" class="<?php echo esc_attr($background_class);?>" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
261 |
-
<div id="background-color"></div>
|
262 |
-
</div>
|
263 |
<?php
|
264 |
}
|
265 |
?>
|
266 |
-
|
267 |
<section class="section section-body">
|
268 |
<div class="logo-wrapper">
|
269 |
<?php
|
@@ -303,19 +233,8 @@
|
|
303 |
|
304 |
<?php
|
305 |
if ( $enable_social === true ) {
|
306 |
-
|
307 |
//sort array by hidden, then order key
|
308 |
-
|
309 |
-
if ( $a['hidden'] == $b['hidden'] ) {
|
310 |
-
if( $a['order'] == $b['order'] ) {
|
311 |
-
return 0;
|
312 |
-
}
|
313 |
-
return $a['order'] < $b['order'] ? -1 : 1;
|
314 |
-
} else {
|
315 |
-
return $a['hidden'] > $b['hidden'] ? 1 : -1;
|
316 |
-
}
|
317 |
-
}
|
318 |
-
uasort($socialmedia , 'sort_social'); ?>
|
319 |
|
320 |
<section class="section section-social">
|
321 |
|
@@ -335,9 +254,30 @@
|
|
335 |
</ul>
|
336 |
</section>
|
337 |
<?php
|
338 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
|
|
|
|
|
|
|
341 |
</body>
|
342 |
|
343 |
</html>
|
10 |
<title><?php echo esc_html( stripslashes(get_option('niteoCS_title', get_bloginfo('name').' Coming soon!')) ); ?></title>
|
11 |
|
12 |
<?php
|
13 |
+
$ver = '1.9';
|
14 |
$themeslug = 'hardwork';
|
15 |
// get theme related settings
|
16 |
$font_color = get_option('niteoCS_font_color['.$themeslug.']', '#494949');
|
75 |
}
|
76 |
}
|
77 |
|
78 |
+
// get background media
|
79 |
+
if ( method_exists ( $this, 'get_background_media' ) ) {
|
80 |
+
$background_media = $this->get_background_media( $niteoCS_banner, $themeslug);
|
81 |
+
$background_class = $background_media[0];
|
82 |
+
$banner_url = $background_media[1];
|
83 |
+
if ( $background_class == 'video' ) {
|
84 |
+
$source = $background_media[2];
|
85 |
+
}
|
86 |
+
} else {
|
87 |
+
$background_class = 'error';
|
88 |
+
$banner_url = '';
|
89 |
+
}
|
90 |
+
|
91 |
// display favicon
|
92 |
if ( $favicon_id && $favicon_id != '' ) {
|
93 |
$favicon_url = wp_get_attachment_image_src($favicon_id, 'thumbnail');
|
154 |
|
155 |
</head>
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
+
<body id="body">
|
159 |
+
<?php
|
160 |
+
if ( $background_class != 'error' ) {
|
161 |
+
switch ( $niteoCS_banner ) {
|
162 |
+
// custom media / default / pattern / color
|
163 |
case '0':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
case '2':
|
|
|
|
|
|
|
|
|
165 |
case '3':
|
166 |
+
case '4': ?>
|
167 |
+
<div id="background-image" class="<?php echo esc_attr( $background_class );?>" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
168 |
+
<?php
|
169 |
break;
|
170 |
|
171 |
+
// unsplash media
|
172 |
+
case '1': ?>
|
173 |
+
<script>
|
174 |
+
var screenWidth = Math.round(screen.width*window.devicePixelRatio);
|
175 |
+
var screenHeight = screenWidth / 1.77777;
|
176 |
+
screenHeight = screenHeight.toFixed(0);
|
177 |
+
|
178 |
+
var banner = '<div id="background-image" style="background-image:url(\'<?php echo esc_url( $banner_url ); ?>\')"></div>';
|
179 |
+
banner = banner.replace('WIDTHxHEIGHT', screenWidth + 'x' + screenHeight);
|
180 |
+
document.getElementById('body').innerHTML = banner;
|
181 |
+
</script>
|
182 |
+
<?php
|
183 |
+
// video media
|
184 |
+
case '5': ?>
|
185 |
+
<div id="player" class="video-banner"></div>
|
186 |
+
<?php
|
187 |
default:
|
188 |
break;
|
189 |
}
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
} else { ?>
|
192 |
+
<p class="error"><?php _e('To Display Graphic Media please upgrade CMP Plugin to latest version. You can download latest version on ', 'cmp-coming-soon-maintenance');?><a href="https://wordpress.org/plugins/cmp-coming-soon-maintenance/">Wordpress website</a> <?php _e('or you can use automatic plugin update in WP-Admin > Plugins > CMP - Coming Soon & Maintenance Plugin > Update Now.', 'cmp-coming-soon-maintenance');?></p>
|
|
|
|
|
|
|
193 |
<?php
|
194 |
}
|
195 |
?>
|
196 |
+
<div id="background-color"></div>
|
197 |
<section class="section section-body">
|
198 |
<div class="logo-wrapper">
|
199 |
<?php
|
233 |
|
234 |
<?php
|
235 |
if ( $enable_social === true ) {
|
|
|
236 |
//sort array by hidden, then order key
|
237 |
+
uasort( $socialmedia , array($this,'sort_social') ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
|
239 |
<section class="section section-social">
|
240 |
|
254 |
</ul>
|
255 |
</section>
|
256 |
<?php
|
257 |
+
}
|
258 |
+
if ( $niteoCS_banner == 5 ) {
|
259 |
+
$niteoCS_video_thumb = get_option('niteoCS_video_thumb['.$themeslug.']');
|
260 |
+
if ( $niteoCS_video_thumb != '' ) {
|
261 |
+
$thumb_id = wp_get_attachment_image_src($niteoCS_video_thumb, 'large');
|
262 |
+
|
263 |
+
if ( isset($thumb_id[0]) ) {
|
264 |
+
$thumb = $thumb_id[0];
|
265 |
+
}
|
266 |
+
} ?>
|
267 |
+
|
268 |
+
<script type='text/javascript' src='<?php echo plugins_url('cmp-coming-soon-maintenance/js/vidim.min.js');?>'></script>
|
269 |
|
270 |
+
<script>
|
271 |
+
var myBackground = new vidim( '#player', {
|
272 |
+
src: '<?php echo esc_url( $banner_url ); ?>',
|
273 |
+
type: 'YouTube',
|
274 |
+
poster: '<?php echo ( $niteoCS_video_thumb == '' ) ? $this->get_youtube_img($banner_url) : esc_url($thumb);?>',
|
275 |
+
}
|
276 |
+
);
|
277 |
|
278 |
+
</script>
|
279 |
+
<?php
|
280 |
+
} ?>
|
281 |
</body>
|
282 |
|
283 |
</html>
|
themes/hardwork/style.css
CHANGED
@@ -3,7 +3,7 @@ Theme Name: Hardwork
|
|
3 |
Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork
|
4 |
Author: Niteo
|
5 |
Author URI: https://niteothemes.com
|
6 |
-
Version: 1.
|
7 |
Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/hardwork\/screenshot1.jpg","2": "https:\/\/niteothemes.com\/cmp-screenshots\/hardwork\/screenshot2.jpg","3": "http:\/\/niteo.cz\/cmp-screenshots\/hardwork\/screenshot3.jpg"}
|
8 |
Description: <p>Hardwork is our default theme for CMP plugin. By default it is set to modern white screen with only one heading to display clear message: "This website is under construction, please come back later".</p><p>Set a fullscreen custom image or use any from thousands Unsplash Library media, set social icons, add custom texts with overlay color and you have beautiful colorful landing page both for Under construction or Coming soon page.</p><h4>Main Features</h4><ul><li>Fullscreen image with overlay color</li><li>Responsive design</li></ul>
|
9 |
|
@@ -97,6 +97,18 @@ h1,h2,h3,h4,h5,h6{
|
|
97 |
background-repeat: repeat;
|
98 |
}
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
.social-list {
|
101 |
display: inline-block;
|
102 |
padding:0;
|
3 |
Theme URI: http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork
|
4 |
Author: Niteo
|
5 |
Author URI: https://niteothemes.com
|
6 |
+
Version: 1.9
|
7 |
Details URI: {"1": "https:\/\/niteothemes.com\/cmp-screenshots\/hardwork\/screenshot1.jpg","2": "https:\/\/niteothemes.com\/cmp-screenshots\/hardwork\/screenshot2.jpg","3": "http:\/\/niteo.cz\/cmp-screenshots\/hardwork\/screenshot3.jpg"}
|
8 |
Description: <p>Hardwork is our default theme for CMP plugin. By default it is set to modern white screen with only one heading to display clear message: "This website is under construction, please come back later".</p><p>Set a fullscreen custom image or use any from thousands Unsplash Library media, set social icons, add custom texts with overlay color and you have beautiful colorful landing page both for Under construction or Coming soon page.</p><h4>Main Features</h4><ul><li>Fullscreen image with overlay color</li><li>Responsive design</li></ul>
|
9 |
|
97 |
background-repeat: repeat;
|
98 |
}
|
99 |
|
100 |
+
.video-banner {
|
101 |
+
position: absolute;
|
102 |
+
top: 0;
|
103 |
+
right: 0;
|
104 |
+
bottom: 0;
|
105 |
+
left: 0;
|
106 |
+
background-position: center center;
|
107 |
+
background-repeat: no-repeat;
|
108 |
+
background-size: cover;
|
109 |
+
z-index: -1;
|
110 |
+
}
|
111 |
+
|
112 |
.social-list {
|
113 |
display: inline-block;
|
114 |
padding:0;
|