Version Description
Download this release
Release Info
Developer | niteo |
Plugin | CMP – Coming Soon & Maintenance Plugin by NiteoThemes |
Version | 1.5.0 |
Comparing to | |
See all releases |
Code changes from version 1.4.1 to 1.5.0
- cmp-options.php +195 -144
- comingsoon.js +126 -56
- comingsoon.min.js +1 -1
- cs_style.css +25 -2
- img/patterns/playstation.png +0 -0
- img/patterns/sakura.png +0 -0
- niteo-cmp.php +291 -18
- readme.txt +12 -3
- themes/construct/construct-settings.php +2 -2
- themes/construct/construct-theme.php +26 -3
- themes/construct/style.css +8 -10
- themes/hardwork/hardwork-settings.php +3 -3
- themes/hardwork/hardwork-theme.php +41 -14
- themes/hardwork/style.css +11 -10
cmp-options.php
CHANGED
@@ -16,6 +16,18 @@ if (isset($_POST['niteoCS_banner']) && is_numeric($_POST['niteoCS_banner'])) {
|
|
16 |
update_option('niteoCS_banner', sanitize_text_field($_POST['niteoCS_banner']));
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
if (isset($_POST['niteoCS_banner_id'])) {
|
20 |
$allnums = true;
|
21 |
|
@@ -97,7 +109,7 @@ if (isset($_POST['niteoCS_custom_css'])) {
|
|
97 |
update_option('niteoCS_custom_css', $_POST['niteoCS_custom_css']);
|
98 |
}
|
99 |
|
100 |
-
if ( isset($_POST['select_theme']) && in_array($_POST['select_theme'], $theme_array)) {
|
101 |
update_option('niteoCS_theme', sanitize_text_field($_POST['select_theme']));
|
102 |
}
|
103 |
|
@@ -151,23 +163,24 @@ if (isset($_POST['niteoCS_copyright'])) {
|
|
151 |
update_option('niteoCS_copyright', $this->niteo_sanitize_html( $_POST['niteoCS_copyright']));
|
152 |
}
|
153 |
|
154 |
-
|
155 |
-
|
156 |
// get saved options
|
157 |
-
$ajax_nonce
|
158 |
-
$title
|
159 |
-
$descr
|
160 |
-
$niteoCS_analytics
|
161 |
-
$niteoCS_custom_css
|
162 |
-
$niteoCS_unsplash_id
|
163 |
-
$logo_id
|
164 |
$niteoCS_banner = get_option('niteoCS_banner', '0');
|
165 |
$banner_id = get_option('niteoCS_banner_id');
|
166 |
-
$unsplash_feed = get_option('niteoCS_unsplash_feed', '
|
167 |
$niteoCS_unsplash_0 = get_option('niteoCS_unsplash_0');
|
168 |
$niteoCS_unsplash_2 = get_option('niteoCS_unsplash_2');
|
169 |
$niteoCS_unsplash_3 = get_option('niteoCS_unsplash_3');
|
170 |
$unsplash_category = get_option('niteoCS_unsplash_category', 'buildings');
|
|
|
|
|
|
|
171 |
$niteoCS_cat_keyword = get_option('niteoCS_cat_keyword');
|
172 |
$niteoCS_soc_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
|
173 |
$niteoCS_subscribe_type = get_option('niteoCS_subscribe_type', '0');
|
@@ -182,7 +195,7 @@ $niteoCS_font_headings_custom = get_option('niteoCS_font_headings_custom');
|
|
182 |
$niteoCS_body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
|
183 |
$body = get_option('niteoCS_body');
|
184 |
$niteoCS_copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
|
185 |
-
$
|
186 |
$niteoCS_socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
|
187 |
|
188 |
|
@@ -194,6 +207,15 @@ if ( $logo_id != '' ) {
|
|
194 |
}
|
195 |
}
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
// count new subscribers
|
198 |
$new_subs = array();
|
199 |
|
@@ -208,6 +230,12 @@ if ( $subscriber_list ) {
|
|
208 |
$new_subs = '0';
|
209 |
}
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
// migrade social media to new option after update 1.4.0
|
212 |
if ( !get_option('niteoCS_socialmedia') ) {
|
213 |
$social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
|
@@ -228,72 +256,27 @@ if ( !get_option('niteoCS_socialmedia') ) {
|
|
228 |
$niteoCS_socialmedia = json_encode($new_socials);
|
229 |
}
|
230 |
|
|
|
231 |
// Handle ZIP UPLOAD
|
232 |
if( isset($_POST['submit_theme']) ) {
|
233 |
-
|
234 |
-
// allow zip file to upload
|
235 |
-
add_filter('upload_mimes', array($this, 'niteo_allow_zip_mime'));
|
236 |
-
|
237 |
-
// load PHP WP FILE
|
238 |
-
if ( ! function_exists( 'wp_handle_upload' ) ) {
|
239 |
-
require realpath('../../../wp-admin/includes/file.php');
|
240 |
-
}
|
241 |
-
|
242 |
-
$uploadedfile = $_FILES['fileToUpload'];
|
243 |
-
$filename = $uploadedfile['name'];
|
244 |
-
/* You can use wp_check_filetype() function to check the
|
245 |
-
file type and go on wit the upload or stop it.*/
|
246 |
-
$filetype = wp_check_filetype( $filename );
|
247 |
-
|
248 |
-
if ( $filetype['ext'] == 'zip' ) {
|
249 |
-
|
250 |
-
|
251 |
-
// Upload file
|
252 |
-
$movefile = wp_handle_upload( $uploadedfile, array('test_form' => FALSE) );
|
253 |
-
|
254 |
-
if ( $movefile && !isset( $movefile['error'] ) ) {
|
255 |
-
|
256 |
-
WP_Filesystem();
|
257 |
-
$source_path = $movefile['file'];
|
258 |
-
$theme_name = str_replace('.zip', '', $filename);
|
259 |
-
$destination_path = plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/';
|
260 |
-
|
261 |
-
// create new theme DIR
|
262 |
-
if ( wp_mkdir_p( $destination_path ) ) {
|
263 |
-
// Unzip FILE into that DIR
|
264 |
-
$unzipfile = unzip_file( $source_path, $destination_path);
|
265 |
-
|
266 |
-
if ( $unzipfile ) {
|
267 |
-
// delete FILE
|
268 |
-
wp_delete_file( $source_path );
|
269 |
-
$premium_installed = array_map('basename', glob( $destination_path . '*', GLOB_ONLYDIR));
|
270 |
-
$theme_array = array_merge( $theme_array, $premium_installed );
|
271 |
-
|
272 |
-
_e('<p class="cmp-success">Successfully installed new Theme!</p>', 'cmp');
|
273 |
-
|
274 |
-
} else {
|
275 |
-
_e('<p class="cmp-error">There was an error unzipping the file!</p>', 'cmp');
|
276 |
-
}
|
277 |
-
|
278 |
-
} else {
|
279 |
-
_e('<p class="cmp-error">Error creating Theme subdirectory!</p>', 'cmp');
|
280 |
-
}
|
281 |
-
|
282 |
-
} else {
|
283 |
-
/**
|
284 |
-
* Error generated by _wp_handle_upload()
|
285 |
-
* @see _wp_handle_upload() in wp-admin/includes/file.php
|
286 |
-
*/
|
287 |
-
echo $movefile['error'];
|
288 |
-
}
|
289 |
-
} else {
|
290 |
-
echo '<p class="cmp-error">Unable to upload new Theme file. '. strtoupper($filetype['ext']) . ' file extension is not supported. Please upload ZIP file containing Niteo Coming Soon Theme.</p>';
|
291 |
-
}
|
292 |
-
|
293 |
-
add_filter('upload_mimes', array($this, 'niteo_remove_zip_mime'));
|
294 |
-
|
295 |
}
|
296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
|
298 |
add_thickbox();
|
299 |
|
@@ -312,20 +295,20 @@ add_thickbox();
|
|
312 |
<div id="icon-options-general" class="icon32">
|
313 |
<br />
|
314 |
</div>
|
315 |
-
<form method="post" action="options-general.php?page=cmp-settings" id="csoptions">
|
316 |
|
317 |
<h2 class="nav-tab-wrapper">
|
318 |
-
<a class="nav-tab nav-tab-active settings" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="
|
319 |
-
<a class="nav-tab
|
320 |
<a class="nav-tab seo" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="seo"><i class="fa fa-users" aria-hidden="true"></i><?php _e('SEO', 'cmp');?></a>
|
321 |
<a class="nav-tab custom_css" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="custom_css"><i class="fa fa-code" aria-hidden="true"></i><?php _e('Custom CSS', 'cmp');?></a>
|
322 |
<a class="nav-tab theme-preview" href="<?php echo get_home_url(); ?>?cmp_preview=true" data-tab="theme-preview" target="_blank" ><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('Preview', 'cmp');?></a>
|
323 |
<a class="nav-tab install" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="install"><i class="fa fa-plus" aria-hidden="true"></i><?php _e('Install New Theme', 'cmp');?></a>
|
324 |
</h2>
|
325 |
|
326 |
-
<div class="table-wrapper
|
327 |
<h3><?php _e('General Settings', 'cmp');?></h3>
|
328 |
-
<table class="
|
329 |
<tr>
|
330 |
<th><h4><?php _e('Status', 'cmp');?></h4></th>
|
331 |
<td>
|
@@ -342,7 +325,7 @@ add_thickbox();
|
|
342 |
<p class="info"><?php _e('Returns 503 HTTP Service unavailable code to indexing robots. Set this option if your site is down due to maintanance and you want to display Maintanance page.','cmp')?></p>
|
343 |
</label><br />
|
344 |
<label title="cmp">
|
345 |
-
<input type="radio" name="activate" value="2"<?php if ($this->cmp_status() == 2) { echo ' checked="checked"'; } ?>> <?php _e('Coming Soon', 'cmp');?>
|
346 |
<p class="info"><?php _e('Returns standard 200 HTTP OK response code to indexing robots. Set this option if you want to use our plugin as "Coming Soon" page.','cmp')?></p>
|
347 |
</label>
|
348 |
</fieldset>
|
@@ -350,9 +333,9 @@ add_thickbox();
|
|
350 |
</tr>
|
351 |
</table>
|
352 |
</div>
|
353 |
-
<div class="table-wrapper
|
354 |
<h3><?php _e('Select Theme', 'cmp');?></h3>
|
355 |
-
<table class="
|
356 |
<tr>
|
357 |
<th><h4><?php _e('Free Themes', 'cmp');?></h4></th>
|
358 |
<td class="theme-selector">
|
@@ -362,9 +345,7 @@ add_thickbox();
|
|
362 |
</legend>
|
363 |
<?php
|
364 |
$i = 0;
|
365 |
-
foreach ( $
|
366 |
-
|
367 |
-
if ( !$this->niteo_in_array_r( $theme, $premium ) ) { ?>
|
368 |
<div class="thumbnail-holder">
|
369 |
<label title="<?php echo esc_attr($theme);?>">
|
370 |
<img src="<?php echo esc_url( plugins_url().'/'.$this->installedFolder.'\/themes/'. $theme . '/img/'. $theme . '_thumbnail.jpg' );?>" alt="<?php echo esc_attr($theme);?>">
|
@@ -372,7 +353,6 @@ add_thickbox();
|
|
372 |
</label>
|
373 |
</div>
|
374 |
<?php
|
375 |
-
}
|
376 |
$i++;
|
377 |
} ?>
|
378 |
</fieldset>
|
@@ -380,7 +360,7 @@ add_thickbox();
|
|
380 |
</tr>
|
381 |
|
382 |
<?php
|
383 |
-
if ( !empty($
|
384 |
<tr>
|
385 |
<th><h4><?php _e('Premium Themes', 'cmp');?></h4></th>
|
386 |
<td class="theme-selector">
|
@@ -390,10 +370,10 @@ add_thickbox();
|
|
390 |
</legend>
|
391 |
<?php
|
392 |
|
393 |
-
foreach ( $
|
394 |
echo '<div class="thumbnail-holder">';
|
395 |
// if not in available themes array, display buy button
|
396 |
-
if ( !in_array( $premium_theme['name'], $theme_array) ) { ?>
|
397 |
|
398 |
<a href="http://cmp.niteo.cz/?cmp_preview=true&theme=<?php echo esc_attr($premium_theme['name']);?>" target="_blank"><img src="<?php echo esc_url( plugins_url().'/'.$this->installedFolder.'\/themes/'. $premium_theme['name']. '_thumbnail.jpg' );?>" alt="<?php echo esc_attr(ucwords($premium_theme['name']));?> Premium Theme"></a>
|
399 |
<a class="button" href="<?php echo esc_url($premium_theme['url']);?>" target="_blank">Buy for <?php echo esc_html($premium_theme['price']);?> USD</a>
|
@@ -417,9 +397,9 @@ add_thickbox();
|
|
417 |
</table>
|
418 |
</div>
|
419 |
|
420 |
-
<div class="table-wrapper
|
421 |
<h3><?php _e('Logo', 'cmp');?></h3>
|
422 |
-
<table class="
|
423 |
<tr>
|
424 |
<th><h4><?php _e('Upload or select Logo', 'cmp');?></h4></th>
|
425 |
<td>
|
@@ -441,9 +421,9 @@ add_thickbox();
|
|
441 |
</table>
|
442 |
</div>
|
443 |
|
444 |
-
<div class="table-wrapper
|
445 |
-
<h3><?php _e('
|
446 |
-
<table class="
|
447 |
<tr>
|
448 |
<th>
|
449 |
<fieldset>
|
@@ -468,11 +448,21 @@ add_thickbox();
|
|
468 |
<input type="radio" name="niteoCS_banner" value="2"<?php if ( $niteoCS_banner == 2) { echo ' checked="checked"'; } ?>> <?php _e('Default Media', 'cmp');?>
|
469 |
</label>
|
470 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
|
472 |
</fieldset>
|
473 |
</th>
|
474 |
|
475 |
-
<td>
|
476 |
|
477 |
<fieldset id="custom_banner">
|
478 |
<input type="hidden" class="widefat" id="niteoCS-banner-id" name="niteoCS_banner_id" type="text" value="<?php echo esc_attr( $banner_id ); ?>" />
|
@@ -541,10 +531,37 @@ add_thickbox();
|
|
541 |
</fieldset>
|
542 |
|
543 |
<fieldset id="default_banner">
|
544 |
-
<div class="banner-wrapper">
|
545 |
<img src="<?php echo esc_url($this->cmp_themeDirPath().$this->cmp_selectedTheme().'/img/'.$this->cmp_selectedTheme().'_banner_large.jpg');?>" alt="Default Media">
|
546 |
</div>
|
547 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
548 |
</fieldset>
|
549 |
</td>
|
550 |
</tr>
|
@@ -558,9 +575,9 @@ add_thickbox();
|
|
558 |
}
|
559 |
?>
|
560 |
|
561 |
-
<div class="table-wrapper
|
562 |
<h3><?php _e('Customize Fonts', 'cmp');?></h3>
|
563 |
-
<table class="
|
564 |
|
565 |
<tr>
|
566 |
<th><h4><?php _e('Headings Font', 'cmp');?></h4></th>
|
@@ -568,25 +585,15 @@ add_thickbox();
|
|
568 |
<fieldset>
|
569 |
<label for="niteoCS_font_headings"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp');?></label></br>
|
570 |
<select name="niteoCS_font_headings">
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
<option value="Libre Franklin" <?php if ( $niteoCS_font_headings == 'Libre Franklin' ) { echo ' selected="selected"'; } ?>>Libre Franklin</option>
|
577 |
-
<option value="Space Mono" <?php if ( $niteoCS_font_headings == 'Space Mono' ) { echo ' selected="selected"'; } ?>>Space Mono</option>
|
578 |
-
<option value="Fira Sans" <?php if ( $niteoCS_font_headings == 'Fira Sans' ) { echo ' selected="selected"'; } ?>>Fira Sans</option>
|
579 |
-
<option value="Eczar" <?php if ( $niteoCS_font_headings == 'Eczar' ) { echo ' selected="selected"'; } ?>>Eczar</option>
|
580 |
-
<option value="Alegreya Sans" <?php if ( $niteoCS_font_headings == 'Alegreya Sans' ) { echo ' selected="selected"'; } ?>>Alegreya Sans</option>
|
581 |
-
<option value="Chivo" <?php if ( $niteoCS_font_headings == 'Chivo' ) { echo ' selected="selected"'; } ?>>Chivo</option>
|
582 |
-
<option value="Lora" <?php if ( $niteoCS_font_headings == 'Lora' ) { echo ' selected="selected"'; } ?>>Lora</option>
|
583 |
-
<option value="Source Sans Pro" <?php if ( $niteoCS_font_headings == 'Source Sans Pro' ) { echo ' selected="selected"'; } ?>>Source Sans Pro</option>
|
584 |
-
<option value="Source Serif Pro" <?php if ( $niteoCS_font_headings == 'Source Serif Pro' ) { echo ' selected="selected"'; } ?>>Source Serif Pro</option>
|
585 |
-
<option value="Roboto Slab" <?php if ( $niteoCS_font_headings == 'Roboto Slab' ) { echo ' selected="selected"'; } ?>>Roboto Slab</option>
|
586 |
-
<option value="Raleway" <?php if ( $niteoCS_font_headings == 'Raleway' ) { echo ' selected="selected"'; } ?>>Raleway</option>
|
587 |
<option value="custom" <?php if ( $niteoCS_font_headings == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom font...', 'cmp');?></option>
|
588 |
</select><br>
|
589 |
</fieldset>
|
|
|
590 |
<fieldset id="custom_headings_font" <?php if ( $niteoCS_font_headings == 'custom' ) { echo 'style="display:block"'; } ?>>
|
591 |
<label for="niteoCS_font_headings_custom"><?php _e('Enter name of ', 'cmp');?><a href="https://fonts.google.com/" target="_blank">Google font</a></label>
|
592 |
<input type="text" name="niteoCS_font_headings_custom" id="niteoCS_font_headings_custom" value="<?php echo esc_attr( $niteoCS_font_headings_custom); ?>" class="regular-text code">
|
@@ -601,23 +608,12 @@ add_thickbox();
|
|
601 |
<fieldset>
|
602 |
<label for="niteoCS_font_content"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp');?></label></br>
|
603 |
<select name="niteoCS_font_content">
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
<option value="
|
610 |
-
<option value="Space Mono" <?php if ( $niteoCS_font_content == 'Space Mono' ) { echo ' selected="selected"'; } ?>>Space Mono</option>
|
611 |
-
<option value="Fira Sans" <?php if ( $niteoCS_font_content == 'Fira Sans' ) { echo ' selected="selected"'; } ?>>Fira Sans</option>
|
612 |
-
<option value="Eczar" <?php if ( $niteoCS_font_content == 'Eczar' ) { echo ' selected="selected"'; } ?>>Eczar</option>
|
613 |
-
<option value="Alegreya Sans" <?php if ( $niteoCS_font_content == 'Alegreya Sans' ) { echo ' selected="selected"'; } ?>>Alegreya Sans</option>
|
614 |
-
<option value="Chivo" <?php if ( $niteoCS_font_content == 'Chivo' ) { echo ' selected="selected"'; } ?>>Chivo</option>
|
615 |
-
<option value="Lora" <?php if ( $niteoCS_font_content == 'Lora' ) { echo ' selected="selected"'; } ?>>Lora</option>
|
616 |
-
<option value="Source Sans Pro" <?php if ( $niteoCS_font_content == 'Source Sans Pro' ) { echo ' selected="selected"'; } ?>>Source Sans Pro</option>
|
617 |
-
<option value="Source Serif Pro" <?php if ( $niteoCS_font_content == 'Source Serif Pro' ) { echo ' selected="selected"'; } ?>>Source Serif Pro</option>
|
618 |
-
<option value="Roboto Slab" <?php if ( $niteoCS_font_content == 'Roboto Slab' ) { echo ' selected="selected"'; } ?>>Roboto Slab</option>
|
619 |
-
<option value="Raleway" <?php if ( $niteoCS_font_content == 'Raleway' ) { echo ' selected="selected"'; } ?>>Raleway</option>
|
620 |
-
<option value="custom" <?php if ( $niteoCS_font_content == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom Font...', 'cmp');?></option>
|
621 |
</select><br>
|
622 |
</fieldset>
|
623 |
|
@@ -638,9 +634,9 @@ add_thickbox();
|
|
638 |
</table>
|
639 |
</div>
|
640 |
|
641 |
-
<div class="table-wrapper
|
642 |
<h3><?php _e('Content', 'cmp');?></h3>
|
643 |
-
<table class="
|
644 |
<tr class="body-title">
|
645 |
<th><h4><?php _e('Body Title', 'cmp');?></h4></th>
|
646 |
<td>
|
@@ -667,9 +663,9 @@ add_thickbox();
|
|
667 |
}
|
668 |
?>
|
669 |
|
670 |
-
<div class="table-wrapper
|
671 |
<h3><?php _e('Subscribe Form', 'cmp');?></h3>
|
672 |
-
<table class="
|
673 |
<tr>
|
674 |
<th>
|
675 |
<fieldset>
|
@@ -741,9 +737,9 @@ add_thickbox();
|
|
741 |
</table>
|
742 |
</div>
|
743 |
|
744 |
-
<div class="table-wrapper
|
745 |
<h3><?php _e('Social Media', 'cmp');?></h3>
|
746 |
-
<table class="
|
747 |
|
748 |
<tr>
|
749 |
<th><h4><?php _e('Social Section Title', 'cmp');?></h4></th>
|
@@ -783,7 +779,7 @@ add_thickbox();
|
|
783 |
}
|
784 |
?>
|
785 |
<li>
|
786 |
-
<i class="fa fa-<?php echo esc_attr($social['name']) . ' '. $social_active;?>" data-name="<?php echo esc_attr($social['name']);?>" aria-hidden="true"></i>
|
787 |
</li>
|
788 |
<?php
|
789 |
} ?>
|
@@ -791,6 +787,7 @@ add_thickbox();
|
|
791 |
|
792 |
<ul class="social-inputs">
|
793 |
<?php
|
|
|
794 |
foreach ( $socialmedia as $social ) {
|
795 |
|
796 |
($social['hidden'] == '0') ? $active = 'active ' : $active = '';
|
@@ -798,6 +795,11 @@ add_thickbox();
|
|
798 |
($social['active'] == '0') ? $disabled = 'disabled ' : $disabled = '';
|
799 |
?>
|
800 |
<li class="<?php echo esc_attr($active).esc_attr($social['name']);?>">
|
|
|
|
|
|
|
|
|
|
|
801 |
<p> <i class="fa fa-sort" aria-hidden="true"></i>
|
802 |
<label for="niteoCS_<?php echo esc_attr($social['name']);?>" class="<?php echo esc_attr($social['name']);?>"><?php echo ($social['name'] == 'envelope-o') ? 'Email address' : esc_html( ucfirst( esc_attr($social['name'] ) )). ' '. __('profile', 'cmp');?></label>
|
803 |
|
@@ -807,6 +809,7 @@ add_thickbox();
|
|
807 |
</p>
|
808 |
</li>
|
809 |
<?php
|
|
|
810 |
} ?>
|
811 |
|
812 |
</ul>
|
@@ -825,9 +828,9 @@ add_thickbox();
|
|
825 |
</table>
|
826 |
</div>
|
827 |
|
828 |
-
<div class="table-wrapper
|
829 |
<h3><?php _e('Footer Content', 'cmp');?></h3>
|
830 |
-
<table class="
|
831 |
|
832 |
<tr>
|
833 |
<th><h4><?php _e('Copyright', 'cmp');?></h4></th>
|
@@ -898,15 +901,15 @@ add_thickbox();
|
|
898 |
<table class="install">
|
899 |
<tr>
|
900 |
<td>
|
901 |
-
<h3><?php _e('Install New Coming Soon Theme', 'cmp');?></h3>
|
902 |
</td>
|
903 |
</tr>
|
904 |
<tr>
|
905 |
<td>
|
906 |
-
Select
|
907 |
<input type="file" name="fileToUpload" id="fileToUpload">
|
908 |
<?php wp_nonce_field('save_options','save_options_field'); ?>
|
909 |
-
<input type="submit" value="Install Theme" name="submit_theme">
|
910 |
</td>
|
911 |
</tr>
|
912 |
</table>
|
@@ -916,6 +919,8 @@ add_thickbox();
|
|
916 |
|
917 |
</div>
|
918 |
|
|
|
|
|
919 |
<script>
|
920 |
// test Unsplash
|
921 |
jQuery(document).ready(function($){
|
@@ -984,5 +989,51 @@ jQuery(document).ready(function($){
|
|
984 |
});
|
985 |
|
986 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
987 |
});
|
988 |
</script>
|
16 |
update_option('niteoCS_banner', sanitize_text_field($_POST['niteoCS_banner']));
|
17 |
}
|
18 |
|
19 |
+
if (isset($_POST['niteoCS_banner_color'])) {
|
20 |
+
update_option('niteoCS_banner_color', sanitize_text_field($_POST['niteoCS_banner_color']));
|
21 |
+
}
|
22 |
+
if (isset($_POST['niteoCS_banner_pattern'])) {
|
23 |
+
update_option('niteoCS_banner_pattern', sanitize_text_field($_POST['niteoCS_banner_pattern']));
|
24 |
+
}
|
25 |
+
|
26 |
+
if (isset($_POST['niteoCS_banner_pattern_custom'])) {
|
27 |
+
update_option('niteoCS_banner_pattern_custom', esc_url_raw($_POST['niteoCS_banner_pattern_custom']));
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
if (isset($_POST['niteoCS_banner_id'])) {
|
32 |
$allnums = true;
|
33 |
|
109 |
update_option('niteoCS_custom_css', $_POST['niteoCS_custom_css']);
|
110 |
}
|
111 |
|
112 |
+
if ( isset($_POST['select_theme']) && in_array($_POST['select_theme'], $this->theme_array)) {
|
113 |
update_option('niteoCS_theme', sanitize_text_field($_POST['select_theme']));
|
114 |
}
|
115 |
|
163 |
update_option('niteoCS_copyright', $this->niteo_sanitize_html( $_POST['niteoCS_copyright']));
|
164 |
}
|
165 |
|
|
|
|
|
166 |
// get saved options
|
167 |
+
$ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
|
168 |
+
$title = stripslashes(get_option('niteoCS_title', get_bloginfo('name').' is coming soon!'));
|
169 |
+
$descr = stripslashes(get_option('niteoCS_descr', 'Just another Coming Soon Page'));
|
170 |
+
$niteoCS_analytics = stripslashes(get_option('niteoCS_analytics', ''));
|
171 |
+
$niteoCS_custom_css = stripslashes(get_option('niteoCS_custom_css', ''));
|
172 |
+
$niteoCS_unsplash_id = get_option('niteoCS_unsplash_id', '');
|
173 |
+
$logo_id = get_option('niteoCS_logo_id');
|
174 |
$niteoCS_banner = get_option('niteoCS_banner', '0');
|
175 |
$banner_id = get_option('niteoCS_banner_id');
|
176 |
+
$unsplash_feed = get_option('niteoCS_unsplash_feed', '3');
|
177 |
$niteoCS_unsplash_0 = get_option('niteoCS_unsplash_0');
|
178 |
$niteoCS_unsplash_2 = get_option('niteoCS_unsplash_2');
|
179 |
$niteoCS_unsplash_3 = get_option('niteoCS_unsplash_3');
|
180 |
$unsplash_category = get_option('niteoCS_unsplash_category', 'buildings');
|
181 |
+
$niteoCS_banner_color = get_option('niteoCS_banner_color', '#bdc3c7');
|
182 |
+
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
|
183 |
+
$niteoCS_banner_pattern_custom = get_option('niteoCS_banner_pattern_custom');
|
184 |
$niteoCS_cat_keyword = get_option('niteoCS_cat_keyword');
|
185 |
$niteoCS_soc_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
|
186 |
$niteoCS_subscribe_type = get_option('niteoCS_subscribe_type', '0');
|
195 |
$niteoCS_body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING!');
|
196 |
$body = get_option('niteoCS_body');
|
197 |
$niteoCS_copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
|
198 |
+
$premium_themes = $this->cmp_plugin_premium();
|
199 |
$niteoCS_socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
|
200 |
|
201 |
|
207 |
}
|
208 |
}
|
209 |
|
210 |
+
// get logo url from id
|
211 |
+
if ( $niteoCS_banner_pattern == 'custom' && $niteoCS_banner_pattern_custom != '' ) {
|
212 |
+
$pattern_url = $niteoCS_banner_pattern_custom;
|
213 |
+
|
214 |
+
} else {
|
215 |
+
$pattern_url = WP_PLUGIN_URL . '/cmp-coming-soon-maintenance/img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png';
|
216 |
+
}
|
217 |
+
|
218 |
+
|
219 |
// count new subscribers
|
220 |
$new_subs = array();
|
221 |
|
230 |
$new_subs = '0';
|
231 |
}
|
232 |
|
233 |
+
// define patterns array
|
234 |
+
$patterns = array('sakura', 'playstation');
|
235 |
+
|
236 |
+
// define fonts array
|
237 |
+
$fonts = array('Fjalla One', 'Average Sans', 'Playfair Display', 'Work Sans', 'Rubik', 'Libre Franklin', 'Space Mono', 'Fira Sans', 'Eczar', 'Alegreya Sans', 'Chivo', 'Lora', 'Source Sans Pro', 'Source Serif Pro', 'Roboto Slab', 'Raleway');
|
238 |
+
|
239 |
// migrade social media to new option after update 1.4.0
|
240 |
if ( !get_option('niteoCS_socialmedia') ) {
|
241 |
$social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
|
256 |
$niteoCS_socialmedia = json_encode($new_socials);
|
257 |
}
|
258 |
|
259 |
+
|
260 |
// Handle ZIP UPLOAD
|
261 |
if( isset($_POST['submit_theme']) ) {
|
262 |
+
$this->cmp_theme_upload($_FILES['fileToUpload']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
}
|
264 |
|
265 |
+
// Hande THeme update
|
266 |
+
if( isset($_GET['action']) && $_GET['action'] == 'update-cmp-theme' && isset($_GET['theme'])) {
|
267 |
+
$slug = sanitize_text_field($_GET['theme']);
|
268 |
+
$type = sanitize_text_field($_GET['type']);
|
269 |
+
$theme_url = $this->remoteServer.'?action=download&slug='.$slug;
|
270 |
+
$update = array(
|
271 |
+
'name' => $slug,
|
272 |
+
'tmp_name' => '',
|
273 |
+
'type' => 'application/x-zip-compressed',
|
274 |
+
'url' => $theme_url,
|
275 |
+
'type' => $type,
|
276 |
+
);
|
277 |
+
|
278 |
+
$this->cmp_theme_update_install($update);
|
279 |
+
}
|
280 |
|
281 |
add_thickbox();
|
282 |
|
295 |
<div id="icon-options-general" class="icon32">
|
296 |
<br />
|
297 |
</div>
|
298 |
+
<form method="post" action="options-general.php?page=cmp-settings&status=settings-saved" id="csoptions">
|
299 |
|
300 |
<h2 class="nav-tab-wrapper">
|
301 |
+
<a class="nav-tab nav-tab-active settings" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="general"><i class="fa fa-cog" aria-hidden="true"></i><?php _e('Settings', 'cmp');?></a>
|
302 |
+
<a class="nav-tab content" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="content"><i class="fa fa-wrench" aria-hidden="true"></i><?php _e('Content', 'cmp');?></a>
|
303 |
<a class="nav-tab seo" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="seo"><i class="fa fa-users" aria-hidden="true"></i><?php _e('SEO', 'cmp');?></a>
|
304 |
<a class="nav-tab custom_css" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="custom_css"><i class="fa fa-code" aria-hidden="true"></i><?php _e('Custom CSS', 'cmp');?></a>
|
305 |
<a class="nav-tab theme-preview" href="<?php echo get_home_url(); ?>?cmp_preview=true" data-tab="theme-preview" target="_blank" ><i class="fa fa-external-link" aria-hidden="true"></i><?php _e('Preview', 'cmp');?></a>
|
306 |
<a class="nav-tab install" href="<?php echo admin_url(); ?>options-general.php?page=cmp-settings" data-tab="install"><i class="fa fa-plus" aria-hidden="true"></i><?php _e('Install New Theme', 'cmp');?></a>
|
307 |
</h2>
|
308 |
|
309 |
+
<div class="table-wrapper general">
|
310 |
<h3><?php _e('General Settings', 'cmp');?></h3>
|
311 |
+
<table class="general">
|
312 |
<tr>
|
313 |
<th><h4><?php _e('Status', 'cmp');?></h4></th>
|
314 |
<td>
|
325 |
<p class="info"><?php _e('Returns 503 HTTP Service unavailable code to indexing robots. Set this option if your site is down due to maintanance and you want to display Maintanance page.','cmp')?></p>
|
326 |
</label><br />
|
327 |
<label title="cmp">
|
328 |
+
<input type="radio" name="activate" value="2"<?php if ($this->cmp_status() == 2) { echo ' checked="checked"'; } ?>> <?php _e('Coming Soon & Landing Page', 'cmp');?>
|
329 |
<p class="info"><?php _e('Returns standard 200 HTTP OK response code to indexing robots. Set this option if you want to use our plugin as "Coming Soon" page.','cmp')?></p>
|
330 |
</label>
|
331 |
</fieldset>
|
333 |
</tr>
|
334 |
</table>
|
335 |
</div>
|
336 |
+
<div class="table-wrapper general">
|
337 |
<h3><?php _e('Select Theme', 'cmp');?></h3>
|
338 |
+
<table class="general">
|
339 |
<tr>
|
340 |
<th><h4><?php _e('Free Themes', 'cmp');?></h4></th>
|
341 |
<td class="theme-selector">
|
345 |
</legend>
|
346 |
<?php
|
347 |
$i = 0;
|
348 |
+
foreach ( $this->themes_standard as $theme ) { ?>
|
|
|
|
|
349 |
<div class="thumbnail-holder">
|
350 |
<label title="<?php echo esc_attr($theme);?>">
|
351 |
<img src="<?php echo esc_url( plugins_url().'/'.$this->installedFolder.'\/themes/'. $theme . '/img/'. $theme . '_thumbnail.jpg' );?>" alt="<?php echo esc_attr($theme);?>">
|
353 |
</label>
|
354 |
</div>
|
355 |
<?php
|
|
|
356 |
$i++;
|
357 |
} ?>
|
358 |
</fieldset>
|
360 |
</tr>
|
361 |
|
362 |
<?php
|
363 |
+
if ( !empty($premium_themes) ) { ?>
|
364 |
<tr>
|
365 |
<th><h4><?php _e('Premium Themes', 'cmp');?></h4></th>
|
366 |
<td class="theme-selector">
|
370 |
</legend>
|
371 |
<?php
|
372 |
|
373 |
+
foreach ( $premium_themes as $premium_theme ) {
|
374 |
echo '<div class="thumbnail-holder">';
|
375 |
// if not in available themes array, display buy button
|
376 |
+
if ( !in_array( $premium_theme['name'], $this->theme_array) ) { ?>
|
377 |
|
378 |
<a href="http://cmp.niteo.cz/?cmp_preview=true&theme=<?php echo esc_attr($premium_theme['name']);?>" target="_blank"><img src="<?php echo esc_url( plugins_url().'/'.$this->installedFolder.'\/themes/'. $premium_theme['name']. '_thumbnail.jpg' );?>" alt="<?php echo esc_attr(ucwords($premium_theme['name']));?> Premium Theme"></a>
|
379 |
<a class="button" href="<?php echo esc_url($premium_theme['url']);?>" target="_blank">Buy for <?php echo esc_html($premium_theme['price']);?> USD</a>
|
397 |
</table>
|
398 |
</div>
|
399 |
|
400 |
+
<div class="table-wrapper content">
|
401 |
<h3><?php _e('Logo', 'cmp');?></h3>
|
402 |
+
<table class="content">
|
403 |
<tr>
|
404 |
<th><h4><?php _e('Upload or select Logo', 'cmp');?></h4></th>
|
405 |
<td>
|
421 |
</table>
|
422 |
</div>
|
423 |
|
424 |
+
<div class="table-wrapper content">
|
425 |
+
<h3><?php _e('Theme Background', 'cmp');?></h3>
|
426 |
+
<table class="content">
|
427 |
<tr>
|
428 |
<th>
|
429 |
<fieldset>
|
448 |
<input type="radio" name="niteoCS_banner" value="2"<?php if ( $niteoCS_banner == 2) { echo ' checked="checked"'; } ?>> <?php _e('Default Media', 'cmp');?>
|
449 |
</label>
|
450 |
</p>
|
451 |
+
<p>
|
452 |
+
<label title="Graphic Pattern">
|
453 |
+
<input type="radio" name="niteoCS_banner" value="3"<?php if ( $niteoCS_banner == 3) { echo ' checked="checked"'; } ?>> <?php _e('Graphic Pattern', 'cmp');?>
|
454 |
+
</label>
|
455 |
+
</p>
|
456 |
+
<p>
|
457 |
+
<label title="Solid Color">
|
458 |
+
<input type="radio" name="niteoCS_banner" value="4"<?php if ( $niteoCS_banner == 4) { echo ' checked="checked"'; } ?>> <?php _e('Solid Color', 'cmp');?>
|
459 |
+
</label>
|
460 |
+
</p>
|
461 |
|
462 |
</fieldset>
|
463 |
</th>
|
464 |
|
465 |
+
<td class="theme_background">
|
466 |
|
467 |
<fieldset id="custom_banner">
|
468 |
<input type="hidden" class="widefat" id="niteoCS-banner-id" name="niteoCS_banner_id" type="text" value="<?php echo esc_attr( $banner_id ); ?>" />
|
531 |
</fieldset>
|
532 |
|
533 |
<fieldset id="default_banner">
|
534 |
+
<div class="banner-wrapper default">
|
535 |
<img src="<?php echo esc_url($this->cmp_themeDirPath().$this->cmp_selectedTheme().'/img/'.$this->cmp_selectedTheme().'_banner_large.jpg');?>" alt="Default Media">
|
536 |
</div>
|
537 |
+
</fieldset>
|
538 |
+
|
539 |
+
<fieldset id="graphic_pattern">
|
540 |
+
<div class="banner-wrapper default">
|
541 |
+
<label for="niteoCS_banner_pattern"><?php _e('Select Pattern', 'cmp');?></label></br>
|
542 |
+
<select name="niteoCS_banner_pattern" data-url="<?php echo esc_url(WP_PLUGIN_URL . '/cmp-coming-soon-maintenance/img/patterns/');?>">
|
543 |
+
<?php
|
544 |
+
foreach ($patterns as $pattern) { ?>
|
545 |
+
<option value="<?php echo esc_attr($pattern);?>" <?php if ( $niteoCS_banner_pattern == $pattern ) { echo ' selected="selected"'; } ?>><?php echo esc_html(ucfirst(str_replace('_', ' ', $pattern)));?></option>
|
546 |
+
<?php
|
547 |
+
} ?>
|
548 |
+
<option value="custom" <?php if ( $niteoCS_banner_pattern == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom Pattern...', 'cmp');?></option>
|
549 |
+
</select><br>
|
550 |
+
|
551 |
+
<input type="hidden" class="widefat" id="niteoCS_banner_pattern_custom" name="niteoCS_banner_pattern_custom" type="text" value="<?php echo esc_attr( $niteoCS_banner_pattern_custom ); ?>" />
|
552 |
+
|
553 |
+
<input id="add-pattern" type="button" class="button" value="Media Library" style="display:<?php echo ($niteoCS_banner_pattern == 'custom') ? 'block' : 'none'?>;"/>
|
554 |
+
|
555 |
+
<div class="pattern-preview" style="background-image: url('<?php echo esc_url($pattern_url);?>');"></div>
|
556 |
+
</div>
|
557 |
+
</fieldset>
|
558 |
+
|
559 |
+
<fieldset id="solid_color">
|
560 |
+
<div class="banner-wrapper default">
|
561 |
+
<label for="niteoCS_banner_color"><?php _e('Select Color', 'cmp');?></label><br>
|
562 |
+
<input type="text" name="niteoCS_banner_color" id="niteoCS_banner_color" value="<?php echo esc_attr( $niteoCS_banner_color); ?>" data-default-color="#bdc3c7" class="regular-text code"><br>
|
563 |
+
<div class="color-preview" style="background-color:<?php echo esc_attr( $niteoCS_banner_color); ?>"></div>
|
564 |
+
</div>
|
565 |
</fieldset>
|
566 |
</td>
|
567 |
</tr>
|
575 |
}
|
576 |
?>
|
577 |
|
578 |
+
<div class="table-wrapper content">
|
579 |
<h3><?php _e('Customize Fonts', 'cmp');?></h3>
|
580 |
+
<table class="content">
|
581 |
|
582 |
<tr>
|
583 |
<th><h4><?php _e('Headings Font', 'cmp');?></h4></th>
|
585 |
<fieldset>
|
586 |
<label for="niteoCS_font_headings"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp');?></label></br>
|
587 |
<select name="niteoCS_font_headings">
|
588 |
+
<?php
|
589 |
+
foreach ($fonts as $font) { ?>
|
590 |
+
<option value="<?php echo esc_attr($font);?>" <?php if ( $niteoCS_font_headings == $font ) { echo ' selected="selected"'; } ?>><?php echo esc_html($font);?></option>
|
591 |
+
<?php
|
592 |
+
} ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
<option value="custom" <?php if ( $niteoCS_font_headings == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom font...', 'cmp');?></option>
|
594 |
</select><br>
|
595 |
</fieldset>
|
596 |
+
|
597 |
<fieldset id="custom_headings_font" <?php if ( $niteoCS_font_headings == 'custom' ) { echo 'style="display:block"'; } ?>>
|
598 |
<label for="niteoCS_font_headings_custom"><?php _e('Enter name of ', 'cmp');?><a href="https://fonts.google.com/" target="_blank">Google font</a></label>
|
599 |
<input type="text" name="niteoCS_font_headings_custom" id="niteoCS_font_headings_custom" value="<?php echo esc_attr( $niteoCS_font_headings_custom); ?>" class="regular-text code">
|
608 |
<fieldset>
|
609 |
<label for="niteoCS_font_content"><?php _e('Select from predefined Google Fonts or insert Custom font', 'cmp');?></label></br>
|
610 |
<select name="niteoCS_font_content">
|
611 |
+
<?php
|
612 |
+
foreach ($fonts as $font) { ?>
|
613 |
+
<option value="<?php echo esc_attr($font);?>" <?php if ( $niteoCS_font_content == $font ) { echo ' selected="selected"'; } ?>><?php echo esc_html($font);?></option>
|
614 |
+
<?php
|
615 |
+
} ?>
|
616 |
+
<option value="custom" <?php if ( $niteoCS_font_content == 'custom' ) { echo ' selected="selected"'; } ?>><?php _e('Custom font...', 'cmp');?></option>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
617 |
</select><br>
|
618 |
</fieldset>
|
619 |
|
634 |
</table>
|
635 |
</div>
|
636 |
|
637 |
+
<div class="table-wrapper content">
|
638 |
<h3><?php _e('Content', 'cmp');?></h3>
|
639 |
+
<table class="content">
|
640 |
<tr class="body-title">
|
641 |
<th><h4><?php _e('Body Title', 'cmp');?></h4></th>
|
642 |
<td>
|
663 |
}
|
664 |
?>
|
665 |
|
666 |
+
<div class="table-wrapper content" id="subscribe-section">
|
667 |
<h3><?php _e('Subscribe Form', 'cmp');?></h3>
|
668 |
+
<table class="content">
|
669 |
<tr>
|
670 |
<th>
|
671 |
<fieldset>
|
737 |
</table>
|
738 |
</div>
|
739 |
|
740 |
+
<div class="table-wrapper content" id="social-section">
|
741 |
<h3><?php _e('Social Media', 'cmp');?></h3>
|
742 |
+
<table class="content">
|
743 |
|
744 |
<tr>
|
745 |
<th><h4><?php _e('Social Section Title', 'cmp');?></h4></th>
|
779 |
}
|
780 |
?>
|
781 |
<li>
|
782 |
+
<i class="fa fa-<?php echo esc_attr($social['name']) . ' '. $social_active;?>" title="<?php echo ($social['name'] == 'envelope-o') ? 'Email address' : esc_html( ucfirst( esc_attr($social['name'] ) )). ' '. __('profile', 'cmp');?>" data-name="<?php echo esc_attr($social['name']);?>" aria-hidden="true"></i>
|
783 |
</li>
|
784 |
<?php
|
785 |
} ?>
|
787 |
|
788 |
<ul class="social-inputs">
|
789 |
<?php
|
790 |
+
$i = 0;
|
791 |
foreach ( $socialmedia as $social ) {
|
792 |
|
793 |
($social['hidden'] == '0') ? $active = 'active ' : $active = '';
|
795 |
($social['active'] == '0') ? $disabled = 'disabled ' : $disabled = '';
|
796 |
?>
|
797 |
<li class="<?php echo esc_attr($active).esc_attr($social['name']);?>">
|
798 |
+
<?php
|
799 |
+
if ($i == 0) {
|
800 |
+
echo '<span class="label">'.__('Position', 'cmp').'</span><span class="label">'.__('Active', 'cmp').'</span><span class="label">'.__('Website URL', 'cmp').'</span>';
|
801 |
+
}
|
802 |
+
?>
|
803 |
<p> <i class="fa fa-sort" aria-hidden="true"></i>
|
804 |
<label for="niteoCS_<?php echo esc_attr($social['name']);?>" class="<?php echo esc_attr($social['name']);?>"><?php echo ($social['name'] == 'envelope-o') ? 'Email address' : esc_html( ucfirst( esc_attr($social['name'] ) )). ' '. __('profile', 'cmp');?></label>
|
805 |
|
809 |
</p>
|
810 |
</li>
|
811 |
<?php
|
812 |
+
$i++;
|
813 |
} ?>
|
814 |
|
815 |
</ul>
|
828 |
</table>
|
829 |
</div>
|
830 |
|
831 |
+
<div class="table-wrapper content" id="copyright-section">
|
832 |
<h3><?php _e('Footer Content', 'cmp');?></h3>
|
833 |
+
<table class="content">
|
834 |
|
835 |
<tr>
|
836 |
<th><h4><?php _e('Copyright', 'cmp');?></h4></th>
|
901 |
<table class="install">
|
902 |
<tr>
|
903 |
<td>
|
904 |
+
<h3><?php _e('Install New CMP Coming Soon & Maintenance Theme', 'cmp');?></h3>
|
905 |
</td>
|
906 |
</tr>
|
907 |
<tr>
|
908 |
<td>
|
909 |
+
<?php _e('Select Theme ZIP file to upload','cmp');?>:
|
910 |
<input type="file" name="fileToUpload" id="fileToUpload">
|
911 |
<?php wp_nonce_field('save_options','save_options_field'); ?>
|
912 |
+
<input id="install-theme" type="submit" value="Install Theme" name="submit_theme">
|
913 |
</td>
|
914 |
</tr>
|
915 |
</table>
|
919 |
|
920 |
</div>
|
921 |
|
922 |
+
|
923 |
+
|
924 |
<script>
|
925 |
// test Unsplash
|
926 |
jQuery(document).ready(function($){
|
989 |
});
|
990 |
|
991 |
});
|
992 |
+
|
993 |
+
|
994 |
+
// ----------------------- AJAX Update Theme -----------------------
|
995 |
+
jQuery('.update-theme').click(function(e) {
|
996 |
+
e.preventDefault();
|
997 |
+
var $this = $(this);
|
998 |
+
var $parent = $this.parents('.notice');
|
999 |
+
var slug = $this.data('slug');
|
1000 |
+
var type = $this.data('type');
|
1001 |
+
var themeName = $parent.find('.theme-name').text();
|
1002 |
+
var remoteUrl = jQuery(this).data('remote_url');
|
1003 |
+
|
1004 |
+
update = {
|
1005 |
+
'name': slug,
|
1006 |
+
'tmp_name': '',
|
1007 |
+
'type': type,
|
1008 |
+
'url': remoteUrl+'?action=download&slug='+slug,
|
1009 |
+
'security': '<?php echo $ajax_nonce; ?>'
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
var data = {
|
1013 |
+
action: 'cmp_theme_update_install',
|
1014 |
+
security: '<?php echo $ajax_nonce; ?>',
|
1015 |
+
file: update
|
1016 |
+
};
|
1017 |
+
|
1018 |
+
$.post(ajaxurl, data, function(response) {
|
1019 |
+
$parent.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>');
|
1020 |
+
|
1021 |
+
if (response == 'success') {
|
1022 |
+
setTimeout(function(){
|
1023 |
+
|
1024 |
+
$parent.removeClass('notice-warning').addClass('notice-success');
|
1025 |
+
$parent.find('.message').html('<span> '+themeName+' Theme was updated sucessfully! </span><i class="fa fa-smile-o" aria-hidden="true"></i>');
|
1026 |
+
}, 1500);
|
1027 |
+
|
1028 |
+
} else {
|
1029 |
+
response = response.slice(0,-1);
|
1030 |
+
var error = $('p', $(response)).text();
|
1031 |
+
$parent.removeClass('notice-warning').addClass('notice-error');
|
1032 |
+
$parent.find('.message').html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+error+'</span>');
|
1033 |
+
}
|
1034 |
+
});
|
1035 |
+
|
1036 |
+
});
|
1037 |
+
|
1038 |
});
|
1039 |
</script>
|
comingsoon.js
CHANGED
@@ -4,10 +4,19 @@ jQuery(document).ready(function($){
|
|
4 |
jQuery('.nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
|
5 |
jQuery('.nav-tab-wrapper .' + tab).addClass('nav-tab-active');
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
jQuery('.table-wrapper:not(.' + tab + ')').css('display', 'none');
|
9 |
-
jQuery('.comingsoon.' + tab).css('display', 'block');
|
10 |
jQuery('.comingsoon:not(.' + tab + ')').css('display', 'none');
|
|
|
11 |
if ( tab == 'install' ) {
|
12 |
jQuery('.submit').css('display', 'none');
|
13 |
} else {
|
@@ -15,17 +24,20 @@ jQuery(document).ready(function($){
|
|
15 |
}
|
16 |
}
|
17 |
|
18 |
-
var tab =
|
19 |
-
|
20 |
-
if (tab) {
|
21 |
navtab(tab);
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
24 |
$('.nav-tab:not(.theme-preview)').click(function(e) {
|
25 |
e.preventDefault();
|
26 |
tab = $(this).data('tab');
|
27 |
-
|
28 |
-
localStorage.setItem('sc_tab', tab );
|
29 |
});
|
30 |
|
31 |
// display selected unsplash feed
|
@@ -38,7 +50,6 @@ jQuery(document).ready(function($){
|
|
38 |
jQuery('#unsplash-feed-' + unsplasfeed).css('display', 'block');
|
39 |
})
|
40 |
|
41 |
-
|
42 |
|
43 |
// script for logo upload
|
44 |
var logoContainer = jQuery('.logo-wrapper');
|
@@ -101,7 +112,7 @@ jQuery(document).ready(function($){
|
|
101 |
}
|
102 |
|
103 |
jQuery('#add-banner').click(function(e) {
|
104 |
-
var bannerContainer = jQuery('.banner-wrapper');
|
105 |
e.preventDefault();
|
106 |
// If the media frame already exists, reopen it.
|
107 |
if ( media_uploader ) {
|
@@ -123,15 +134,13 @@ jQuery(document).ready(function($){
|
|
123 |
var imgURL = '';
|
124 |
|
125 |
if (attachment.length > 0) {
|
126 |
-
|
127 |
-
jQuery('.banner-wrapper').empty();
|
128 |
|
129 |
jQuery(attachment).each(function(i) {
|
130 |
// Send the attachment URL to our custom image input field.
|
131 |
-
bannerContainer.append( '<img src="' + attachment[i].url + '" alt="" style="max-width:588px;"/>' );
|
132 |
// Display Delete Gallery
|
133 |
jQuery('#delete-banner').css( 'display', 'block' );
|
134 |
-
|
135 |
// add image ID and url to comma-separated variable
|
136 |
var comma = i === 0 ? '' : ',';
|
137 |
imgID += ( comma + attachment[i].id );
|
@@ -139,55 +148,115 @@ jQuery(document).ready(function($){
|
|
139 |
// add image ID and url to input val
|
140 |
jQuery('#niteoCS-banner-id').val( imgID );
|
141 |
}
|
142 |
-
|
143 |
})
|
144 |
.open();
|
145 |
});
|
146 |
|
147 |
jQuery('#delete-banner').click(function(e) {
|
148 |
-
jQuery('.banner-wrapper').empty();
|
149 |
jQuery(this).css('display', 'none');
|
150 |
jQuery('#niteoCS-banner-id').val('');
|
151 |
});
|
152 |
|
153 |
-
// hiding banner on load
|
154 |
-
if ( jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() == 0 ) {
|
155 |
-
jQuery('#custom_banner').css('display','block');
|
156 |
-
jQuery('#unsplash_banner').css('display','none');
|
157 |
-
jQuery('#default_banner').css('display','none');
|
158 |
|
159 |
-
} else if ( jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() == 1 ) {
|
160 |
-
jQuery('#custom_banner').css('display','none');
|
161 |
-
jQuery('#default_banner').css('display','none');
|
162 |
-
jQuery('#unsplash_banner').css('display','block');
|
163 |
-
} else {
|
164 |
-
jQuery('#custom_banner').css('display','none');
|
165 |
-
jQuery('#default_banner').css('display','block');
|
166 |
-
jQuery('#unsplash_banner').css('display','none');
|
167 |
-
}
|
168 |
// hiding banner on change
|
169 |
jQuery('#csoptions input[name="niteoCS_banner"]').change(function() {
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
-
} else if ( jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() == 1 ) {
|
177 |
-
jQuery('#custom_banner').css('display','none');
|
178 |
-
jQuery('#default_banner').css('display','none');
|
179 |
-
jQuery('#unsplash_banner').css('display','block');
|
180 |
} else {
|
181 |
-
jQuery('#
|
182 |
-
jQuery('#
|
183 |
-
jQuery('
|
|
|
184 |
}
|
185 |
});
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
// hiding subscribe from on load
|
188 |
if ( jQuery('#niteoCS_subscribe').prop('checked') == true) {
|
189 |
jQuery('.subscribe').css('display','block')
|
190 |
}
|
|
|
191 |
// hiding subscribe from on change
|
192 |
jQuery('#niteoCS_subscribe').change(function() {
|
193 |
|
@@ -198,21 +267,6 @@ jQuery(document).ready(function($){
|
|
198 |
}
|
199 |
});
|
200 |
|
201 |
-
// hiding subscribe on load
|
202 |
-
if ( jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked' ).val() == 0 ) {
|
203 |
-
jQuery('#subscribe-disabled').css('display','block');
|
204 |
-
jQuery('#subscribe-3rdparty').css('display','none');
|
205 |
-
jQuery('#subscribe-niteo').css('display','none');
|
206 |
-
|
207 |
-
} else if ( jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked' ).val() == 1 ) {
|
208 |
-
jQuery('#subscribe-disabled').css('display','none');
|
209 |
-
jQuery('#subscribe-3rdparty').css('display','block');
|
210 |
-
jQuery('#subscribe-niteo').css('display','none');
|
211 |
-
} else {
|
212 |
-
jQuery('#subscribe-disabled').css('display','none');
|
213 |
-
jQuery('#subscribe-3rdparty').css('display','none');
|
214 |
-
jQuery('#subscribe-niteo').css('display','block');
|
215 |
-
}
|
216 |
// hiding banner on change
|
217 |
jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function() {
|
218 |
if ( jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked' ).val() == 0 ) {
|
@@ -230,6 +284,8 @@ jQuery(document).ready(function($){
|
|
230 |
jQuery('#subscribe-niteo').css('display','block');
|
231 |
}
|
232 |
});
|
|
|
|
|
233 |
|
234 |
// export CSV
|
235 |
jQuery('#csv-generate').click(function(e){
|
@@ -264,7 +320,7 @@ jQuery(document).ready(function($){
|
|
264 |
});
|
265 |
}
|
266 |
|
267 |
-
|
268 |
return (str+'').toLowerCase();
|
269 |
}
|
270 |
|
@@ -437,6 +493,20 @@ jQuery(document).ready(function($){
|
|
437 |
}
|
438 |
});
|
439 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
|
441 |
|
442 |
});
|
4 |
jQuery('.nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');
|
5 |
jQuery('.nav-tab-wrapper .' + tab).addClass('nav-tab-active');
|
6 |
|
7 |
+
// if slider exists and background is custom media or unsplash display slider
|
8 |
+
if (jQuery('.table-wrapper.content.slider' ).length && (jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() == 0 || jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() == 1)) {
|
9 |
+
jQuery('.table-wrapper.' + tab).css('display', 'block');
|
10 |
+
jQuery('.comingsoon.' + tab).css('display', 'block');
|
11 |
+
|
12 |
+
} else {
|
13 |
+
jQuery('.table-wrapper.' + tab + ':not(.slider)').css('display', 'block');
|
14 |
+
jQuery('.comingsoon.' + tab + ':not(.slider)').css('display', 'block');
|
15 |
+
}
|
16 |
+
|
17 |
jQuery('.table-wrapper:not(.' + tab + ')').css('display', 'none');
|
|
|
18 |
jQuery('.comingsoon:not(.' + tab + ')').css('display', 'none');
|
19 |
+
|
20 |
if ( tab == 'install' ) {
|
21 |
jQuery('.submit').css('display', 'none');
|
22 |
} else {
|
24 |
}
|
25 |
}
|
26 |
|
27 |
+
var tab = document.location.hash.substring(1);
|
28 |
+
if (tab != '') {
|
|
|
29 |
navtab(tab);
|
30 |
}
|
31 |
|
32 |
+
window.onhashchange = function(){
|
33 |
+
tab = document.location.hash.substring(1);
|
34 |
+
navtab(tab);
|
35 |
+
}
|
36 |
+
|
37 |
$('.nav-tab:not(.theme-preview)').click(function(e) {
|
38 |
e.preventDefault();
|
39 |
tab = $(this).data('tab');
|
40 |
+
document.location.hash = tab;
|
|
|
41 |
});
|
42 |
|
43 |
// display selected unsplash feed
|
50 |
jQuery('#unsplash-feed-' + unsplasfeed).css('display', 'block');
|
51 |
})
|
52 |
|
|
|
53 |
|
54 |
// script for logo upload
|
55 |
var logoContainer = jQuery('.logo-wrapper');
|
112 |
}
|
113 |
|
114 |
jQuery('#add-banner').click(function(e) {
|
115 |
+
var bannerContainer = jQuery('.banner-wrapper:not(.default)');
|
116 |
e.preventDefault();
|
117 |
// If the media frame already exists, reopen it.
|
118 |
if ( media_uploader ) {
|
134 |
var imgURL = '';
|
135 |
|
136 |
if (attachment.length > 0) {
|
137 |
+
bannerContainer.empty();
|
|
|
138 |
|
139 |
jQuery(attachment).each(function(i) {
|
140 |
// Send the attachment URL to our custom image input field.
|
141 |
+
bannerContainer.append( '<img src="' + attachment[i]['sizes']['large'].url + '" alt="" style="max-width:588px;"/>' );
|
142 |
// Display Delete Gallery
|
143 |
jQuery('#delete-banner').css( 'display', 'block' );
|
|
|
144 |
// add image ID and url to comma-separated variable
|
145 |
var comma = i === 0 ? '' : ',';
|
146 |
imgID += ( comma + attachment[i].id );
|
148 |
// add image ID and url to input val
|
149 |
jQuery('#niteoCS-banner-id').val( imgID );
|
150 |
}
|
|
|
151 |
})
|
152 |
.open();
|
153 |
});
|
154 |
|
155 |
jQuery('#delete-banner').click(function(e) {
|
156 |
+
jQuery('.banner-wrapper:not(.default)').empty();
|
157 |
jQuery(this).css('display', 'none');
|
158 |
jQuery('#niteoCS-banner-id').val('');
|
159 |
});
|
160 |
|
|
|
|
|
|
|
|
|
|
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
// hiding banner on change
|
163 |
jQuery('#csoptions input[name="niteoCS_banner"]').change(function() {
|
164 |
|
165 |
+
switch(jQuery('#csoptions input[name="niteoCS_banner"]:checked' ).val() ) {
|
166 |
+
case '0':
|
167 |
+
jQuery('#custom_banner').css('display','block');
|
168 |
+
jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
|
169 |
+
break;
|
170 |
+
case '1':
|
171 |
+
jQuery('#unsplash_banner').css('display','block');
|
172 |
+
jQuery('.theme_background fieldset:not(#unsplash_banner)').css('display','none');
|
173 |
+
break;
|
174 |
+
case '2':
|
175 |
+
jQuery('#default_banner').css('display','block');
|
176 |
+
jQuery('.theme_background fieldset:not(#default_banner)').css('display','none');
|
177 |
+
break;
|
178 |
+
case '3':
|
179 |
+
jQuery('#graphic_pattern').css('display','block');
|
180 |
+
jQuery('.theme_background fieldset:not(#graphic_pattern)').css('display','none');
|
181 |
+
break;
|
182 |
+
case '4':
|
183 |
+
jQuery('#solid_color').css('display','block');
|
184 |
+
jQuery('.theme_background fieldset:not(#solid_color)').css('display','none');
|
185 |
+
break;
|
186 |
+
default:
|
187 |
+
jQuery('#custom_banner').css('display','block');
|
188 |
+
jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');
|
189 |
+
}
|
190 |
+
});
|
191 |
+
|
192 |
+
jQuery('#csoptions input[name="niteoCS_banner"]').trigger('change');
|
193 |
+
|
194 |
+
// banner background colorpicker
|
195 |
+
jQuery('#niteoCS_banner_color').wpColorPicker({
|
196 |
+
change: function(event, ui){
|
197 |
+
jQuery('.color-preview').css('background-color', ui.color.toString());
|
198 |
+
}
|
199 |
+
});
|
200 |
+
|
201 |
+
// banner pattern on change image preview
|
202 |
+
jQuery('select[name="niteoCS_banner_pattern"]').on('change', function() {
|
203 |
+
var pattern = jQuery('select[name="niteoCS_banner_pattern"] option:selected').val();
|
204 |
+
|
205 |
+
if (pattern != 'custom') {
|
206 |
+
var pattern_url = jQuery(this).data('url');
|
207 |
+
jQuery('#add-pattern').css('display', 'none');
|
208 |
+
jQuery('.pattern-preview').css('background-image', 'url(\''+pattern_url+pattern+'.png\')');
|
209 |
|
|
|
|
|
|
|
|
|
210 |
} else {
|
211 |
+
var pattern_url = jQuery('#niteoCS_banner_pattern_custom').val();
|
212 |
+
jQuery('#add-pattern').css('display', 'block');
|
213 |
+
jQuery('.pattern-preview').css('background-image', 'url(\''+pattern_url+'\')');
|
214 |
+
|
215 |
}
|
216 |
});
|
217 |
|
218 |
+
// add custom pattern button
|
219 |
+
jQuery('#add-pattern').click(function(e) {
|
220 |
+
e.preventDefault();
|
221 |
+
// If the media frame already exists, reopen it.
|
222 |
+
if ( media_uploader ) {
|
223 |
+
media_uploader.open();
|
224 |
+
return;
|
225 |
+
}
|
226 |
+
var media_uploader = wp.media({
|
227 |
+
title: 'Select Pattern',
|
228 |
+
button: {
|
229 |
+
text: 'Select Pattern'
|
230 |
+
},
|
231 |
+
multiple: false, // Set this to true to allow multiple files to be selected
|
232 |
+
type : 'image'
|
233 |
+
})
|
234 |
+
.on('select', function() {
|
235 |
+
// Get media attachment details from the frame state
|
236 |
+
var attachment = media_uploader.state().get('selection').first().toJSON();
|
237 |
+
|
238 |
+
jQuery('.pattern-preview').css('background-image', '');
|
239 |
+
|
240 |
+
// Send the attachment URL to our custom image input field.
|
241 |
+
if (attachment['sizes']['large']=== undefined) {
|
242 |
+
var pattern_url = attachment.url;
|
243 |
+
} else {
|
244 |
+
var pattern_url = attachment['sizes']['large'].url;
|
245 |
+
}
|
246 |
+
|
247 |
+
jQuery('.pattern-preview').css('background-image', 'url(\''+pattern_url+'\')');
|
248 |
+
|
249 |
+
jQuery('#niteoCS_banner_pattern_custom').val( attachment.url );
|
250 |
+
|
251 |
+
})
|
252 |
+
.open();
|
253 |
+
});
|
254 |
+
|
255 |
// hiding subscribe from on load
|
256 |
if ( jQuery('#niteoCS_subscribe').prop('checked') == true) {
|
257 |
jQuery('.subscribe').css('display','block')
|
258 |
}
|
259 |
+
|
260 |
// hiding subscribe from on change
|
261 |
jQuery('#niteoCS_subscribe').change(function() {
|
262 |
|
267 |
}
|
268 |
});
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
// hiding banner on change
|
271 |
jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function() {
|
272 |
if ( jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked' ).val() == 0 ) {
|
284 |
jQuery('#subscribe-niteo').css('display','block');
|
285 |
}
|
286 |
});
|
287 |
+
jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger('change');
|
288 |
+
|
289 |
|
290 |
// export CSV
|
291 |
jQuery('#csv-generate').click(function(e){
|
320 |
});
|
321 |
}
|
322 |
|
323 |
+
function strtolower (str) {
|
324 |
return (str+'').toLowerCase();
|
325 |
}
|
326 |
|
493 |
}
|
494 |
});
|
495 |
|
496 |
+
// ----------------------- Theme release notes -----------------------
|
497 |
+
|
498 |
+
jQuery('.view-release').click(function(e) {
|
499 |
+
e.preventDefault();
|
500 |
+
$this = jQuery(this);
|
501 |
+
var release_url = $this.attr('href');
|
502 |
+
jQuery.get(release_url, function( release ) {
|
503 |
+
$this.closest('.notice').find('.release-note .notes').remove();
|
504 |
+
$this.closest('.notice').find('.release-note').append('<div class="notes">'+release+'</div>');
|
505 |
+
}).fail(function() {
|
506 |
+
$this.closest('.notice').find('.release-note p').remove();
|
507 |
+
$this.closest('.notice').find('.release-note').append('<p>There was an error loading release notes. Please try again later.</p>');
|
508 |
+
});
|
509 |
+
});
|
510 |
|
511 |
|
512 |
});
|
comingsoon.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(a){function e(a){return(a+"").replace(/^([a-z])|\s+([a-z])/g,function(a){return a.toUpperCase()})}function f(a){return(a+"").toLowerCase()}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(".table-wrapper:not(."+a+")").css("display","none"),jQuery(".comingsoon."+a).css("display","block"),jQuery(".comingsoon:not(."+a+")").css("display","none"),"install"==a?jQuery(".submit").css("display","none"):jQuery(".submit").css("display","block")};var b=localStorage.getItem("sc_tab");b&&navtab(b),a(".nav-tab:not(.theme-preview)").click(function(c){c.preventDefault(),b=a(this).data("tab"),navtab(b),localStorage.setItem("sc_tab",b)});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")});var d=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(),d.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)}).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-banner-id").val()&&jQuery("#delete-banner").css("display","block"),jQuery("#add-banner").click(function(a){var b=jQuery(".banner-wrapper");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&&(jQuery(".banner-wrapper").empty(),jQuery(a).each(function(c){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))}).open()}),jQuery("#delete-banner").click(function(a){jQuery(".banner-wrapper").empty(),jQuery(this).css("display","none"),jQuery("#niteoCS-banner-id").val("")}),0==jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()?(jQuery("#custom_banner").css("display","block"),jQuery("#unsplash_banner").css("display","none"),jQuery("#default_banner").css("display","none")):1==jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()?(jQuery("#custom_banner").css("display","none"),jQuery("#default_banner").css("display","none"),jQuery("#unsplash_banner").css("display","block")):(jQuery("#custom_banner").css("display","none"),jQuery("#default_banner").css("display","block"),jQuery("#unsplash_banner").css("display","none")),jQuery('#csoptions input[name="niteoCS_banner"]').change(function(){0==jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()?(jQuery("#custom_banner").css("display","block"),jQuery("#unsplash_banner").css("display","none"),jQuery("#default_banner").css("display","none")):1==jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()?(jQuery("#custom_banner").css("display","none"),jQuery("#default_banner").css("display","none"),jQuery("#unsplash_banner").css("display","block")):(jQuery("#custom_banner").css("display","none"),jQuery("#default_banner").css("display","block"),jQuery("#unsplash_banner").css("display","none"))}),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")}),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('#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(b){b.preventDefault(),jQuery("#csv-download").length&&jQuery("#csv-download").remove(),jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"niteo_export_csv"},success:function(b){b=b.slice(0,-1);var c=a("<a />",{id:"csv-download",href:"data:text/plain;charset=UTF-8,"+encodeURIComponent(b),text:"Download CSV",download:"subscriber_list.csv"});jQuery("#subscribe-niteo").append(c)}})});var g="",h="";g="custom"==jQuery('select[name="niteoCS_font_headings"] option:selected').val()?e(f(jQuery("#niteoCS_font_headings_custom").val())):jQuery('select[name="niteoCS_font_headings"] option:selected').val(),h="custom"==jQuery('select[name="niteoCS_font_content"] option:selected').val()?e(f(jQuery("#niteoCS_font_content_custom").val())):jQuery('select[name="niteoCS_font_content"] option:selected').val(),WebFont.load({google:{families:[e(f(g)),e(f(h))]},active:function(){a("#heading-example").css("font-family",g),a("#content-example").css("font-family",h)}}),jQuery('select[name="niteoCS_font_headings"]').on("change",function(){niteoCS_font_headings=jQuery('select[name="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:[e(f(jQuery("#niteoCS_font_headings_custom").val()))]},active:function(){a("#heading-example").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").css("font-family",niteoCS_font_headings||"")}}))}),jQuery('select[name="niteoCS_font_content"]').on("change",function(){niteoCS_font_content=jQuery('select[name="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:[e(f(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 i=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))},j=a(".social-inputs"),k=function(b,c){var d=j.find('input[type="text"]');c.item.index();d.each(function(b,c){var d=a(c).data("name");i(d,"order",b)})};j.sortable({stop:k}),j.on("sortchange",k),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"),i(d,"active",c)})}}(jQuery),jQuery('.social-inputs input[type="text"]').focusout(function(){var a=jQuery(this).data("name"),b=jQuery(this).attr("value");i(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(this).hasClass("active")?i(a,"hidden","0"):i(a,"hidden","1")})});
|
1 |
+
jQuery(document).ready(function(a){function e(a){return(a+"").replace(/^([a-z])|\s+([a-z])/g,function(a){return a.toUpperCase()})}function f(a){return(a+"").toLowerCase()}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.content.slider").length||0!=jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()&&1!=jQuery('#csoptions input[name="niteoCS_banner"]:checked').val()?(jQuery(".table-wrapper."+a+":not(.slider)").css("display","block"),jQuery(".comingsoon."+a+":not(.slider)").css("display","block")):(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(".submit").css("display","block")};var b=document.location.hash.substring(1);""!=b&&navtab(b),window.onhashchange=function(){b=document.location.hash.substring(1),navtab(b)},a(".nav-tab:not(.theme-preview)").click(function(c){c.preventDefault(),b=a(this).data("tab"),document.location.hash=b});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")});var d=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(),d.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)}).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-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){b.append('<img src="'+a[c].sizes.large.url+'" alt="" style="max-width:588px;"/>'),jQuery("#delete-banner").css("display","block"),d+=(0===c?"":",")+a[c].id}),jQuery("#niteoCS-banner-id").val(d))}).open()}),jQuery("#delete-banner").click(function(a){jQuery(".banner-wrapper:not(.default)").empty(),jQuery(this).css("display","none"),jQuery("#niteoCS-banner-id").val("")}),jQuery('#csoptions input[name="niteoCS_banner"]').change(function(){switch(jQuery('#csoptions input[name="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 input[name="niteoCS_banner"]').trigger("change"),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('#csoptions input[name="niteoCS_subscribe_type"]').trigger("change"),jQuery("#csv-generate").click(function(b){b.preventDefault(),jQuery("#csv-download").length&&jQuery("#csv-download").remove(),jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"niteo_export_csv"},success:function(b){b=b.slice(0,-1);var c=a("<a />",{id:"csv-download",href:"data:text/plain;charset=UTF-8,"+encodeURIComponent(b),text:"Download CSV",download:"subscriber_list.csv"});jQuery("#subscribe-niteo").append(c)}})});var g="",h="";g="custom"==jQuery('select[name="niteoCS_font_headings"] option:selected').val()?e(f(jQuery("#niteoCS_font_headings_custom").val())):jQuery('select[name="niteoCS_font_headings"] option:selected').val(),h="custom"==jQuery('select[name="niteoCS_font_content"] option:selected').val()?e(f(jQuery("#niteoCS_font_content_custom").val())):jQuery('select[name="niteoCS_font_content"] option:selected').val(),WebFont.load({google:{families:[e(f(g)),e(f(h))]},active:function(){a("#heading-example").css("font-family",g),a("#content-example").css("font-family",h)}}),jQuery('select[name="niteoCS_font_headings"]').on("change",function(){niteoCS_font_headings=jQuery('select[name="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:[e(f(jQuery("#niteoCS_font_headings_custom").val()))]},active:function(){a("#heading-example").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").css("font-family",niteoCS_font_headings||"")}}))}),jQuery('select[name="niteoCS_font_content"]').on("change",function(){niteoCS_font_content=jQuery('select[name="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:[e(f(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 i=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))},j=a(".social-inputs"),k=function(b,c){var d=j.find('input[type="text"]');c.item.index();d.each(function(b,c){var d=a(c).data("name");i(d,"order",b)})};j.sortable({stop:k}),j.on("sortchange",k),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"),i(d,"active",c)})}}(jQuery),jQuery('.social-inputs input[type="text"]').focusout(function(){var a=jQuery(this).data("name"),b=jQuery(this).attr("value");i(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(this).hasClass("active")?i(a,"hidden","0"):i(a,"hidden","1")}),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>")})})});
|
cs_style.css
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
.padding-bottom {padding-bottom: 10px;}
|
12 |
|
13 |
input[type="text"], textarea{width:100%;}
|
14 |
-
.table-wrapper.
|
15 |
.table-wrapper.install,
|
16 |
.table-wrapper.seo,
|
17 |
.table-wrapper.custom_css {
|
@@ -51,7 +51,22 @@ input[type="text"], textarea{width:100%;}
|
|
51 |
}
|
52 |
#delete-logo,#delete-banner{display:none;}
|
53 |
|
54 |
-
.social-media {margin-top: 0;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
.social-media li {display: inline-block;}
|
56 |
.social-media i {font-size:1.5em;padding:7px;cursor:pointer;}
|
57 |
.social-media i.active {color:#d54e21;}
|
@@ -72,7 +87,14 @@ input[type="text"], textarea{width:100%;}
|
|
72 |
#unsplash_img{display: none;}
|
73 |
#unsplash-media{padding-top: 1em;}
|
74 |
.unsplash-feed{display: none;}
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
|
|
76 |
.info{font-size: 12px;}
|
77 |
.nav-tab i {padding-right:3px}
|
78 |
.table-wrapper h4 {margin:0;}
|
@@ -88,3 +110,4 @@ input[type="text"], textarea{width:100%;}
|
|
88 |
#heading-example {padding-left: 0;border-bottom:none;}
|
89 |
#custom_headings_font,
|
90 |
#custom_content_font {display:none;}
|
|
11 |
.padding-bottom {padding-bottom: 10px;}
|
12 |
|
13 |
input[type="text"], textarea{width:100%;}
|
14 |
+
.table-wrapper.content,
|
15 |
.table-wrapper.install,
|
16 |
.table-wrapper.seo,
|
17 |
.table-wrapper.custom_css {
|
51 |
}
|
52 |
#delete-logo,#delete-banner{display:none;}
|
53 |
|
54 |
+
.social-media {margin-top: 0;margin-bottom: 3em;}
|
55 |
+
.social-inputs li {position: relative;}
|
56 |
+
.social-inputs .label {
|
57 |
+
font-weight: 600;
|
58 |
+
position: absolute;
|
59 |
+
top: -20px;
|
60 |
+
left: -15px;
|
61 |
+
}
|
62 |
+
|
63 |
+
.social-inputs .label:nth-of-type(2) {
|
64 |
+
left: 62px;
|
65 |
+
}
|
66 |
+
.social-inputs .label:nth-of-type(3) {
|
67 |
+
left: 148px;
|
68 |
+
}
|
69 |
+
|
70 |
.social-media li {display: inline-block;}
|
71 |
.social-media i {font-size:1.5em;padding:7px;cursor:pointer;}
|
72 |
.social-media i.active {color:#d54e21;}
|
87 |
#unsplash_img{display: none;}
|
88 |
#unsplash-media{padding-top: 1em;}
|
89 |
.unsplash-feed{display: none;}
|
90 |
+
.pattern-preview,
|
91 |
+
.color-preview {
|
92 |
+
background-repeat: repeat;
|
93 |
+
height: 200px;
|
94 |
+
border: 1px solid #ededed;
|
95 |
+
}
|
96 |
|
97 |
+
#add-pattern {margin-bottom: 1em;}
|
98 |
.info{font-size: 12px;}
|
99 |
.nav-tab i {padding-right:3px}
|
100 |
.table-wrapper h4 {margin:0;}
|
110 |
#heading-example {padding-left: 0;border-bottom:none;}
|
111 |
#custom_headings_font,
|
112 |
#custom_content_font {display:none;}
|
113 |
+
|
img/patterns/playstation.png
ADDED
Binary file
|
img/patterns/sakura.png
ADDED
Binary file
|
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: http://www.niteo.cz
|
9 |
Text Domain: cmp
|
@@ -12,12 +12,29 @@
|
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
13 |
*/
|
14 |
|
|
|
15 |
class niteo_cmp {
|
16 |
var $installedFolder = '';
|
17 |
-
|
|
|
|
|
|
|
18 |
|
19 |
function __construct() {
|
|
|
|
|
20 |
$this->installedFolder = basename(dirname(__FILE__));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
|
23 |
function cmp() {
|
@@ -25,14 +42,14 @@ class niteo_cmp {
|
|
25 |
}
|
26 |
|
27 |
function cmp_adminInit() {
|
28 |
-
wp_register_script('cmp_mainjs', plugins_url().'/'.$this->installedFolder.'/comingsoon.min.js','webfont'
|
29 |
wp_register_style( 'font_awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
|
30 |
-
wp_register_style( 'cmp_style', plugins_url().'/'.$this->installedFolder.'/cs_style.css',''
|
31 |
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js', array(), false, true);
|
32 |
}
|
33 |
|
34 |
function cmp_add_admin_style() {
|
35 |
-
wp_register_style( 'cmp_admin_style', plugins_url().'/'.$this->installedFolder.'/cs_admin.css',''
|
36 |
wp_enqueue_style( 'cmp_admin_style' );
|
37 |
}
|
38 |
|
@@ -46,7 +63,9 @@ class niteo_cmp {
|
|
46 |
wp_enqueue_media();
|
47 |
wp_enqueue_script( 'wp-color-picker');
|
48 |
|
49 |
-
|
|
|
|
|
50 |
}
|
51 |
|
52 |
|
@@ -91,20 +110,12 @@ class niteo_cmp {
|
|
91 |
|
92 |
function cmp_admin_options() {
|
93 |
|
94 |
-
// get all installed themes [folder names under /themes] and put them to array
|
95 |
-
$theme_array = array_map('basename', glob( plugin_dir_path( __FILE__ ) . 'themes/*', GLOB_ONLYDIR));
|
96 |
-
|
97 |
-
// check for installed premium themes
|
98 |
-
if ( file_exists(plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/') ) {
|
99 |
-
$premium_installed = array_map('basename', glob( plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/*', GLOB_ONLYDIR));
|
100 |
-
$theme_array = array_merge($theme_array, $premium_installed);
|
101 |
-
}
|
102 |
-
|
103 |
// include default options page
|
104 |
require ('cmp-options.php');
|
105 |
-
|
106 |
}
|
107 |
|
|
|
|
|
108 |
function cmp_displayPage() {
|
109 |
|
110 |
if ( isset($_GET['cmp_preview']) && $_GET['cmp_preview'] == 'true' ) {
|
@@ -312,6 +323,238 @@ class niteo_cmp {
|
|
312 |
return $premium_themes;
|
313 |
}
|
314 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
// returns list of with countdown
|
316 |
function cmp_plugin_countdown_themes() {
|
317 |
$counter_themes = array('frame');
|
@@ -356,11 +599,20 @@ class niteo_cmp {
|
|
356 |
case '0':
|
357 |
// check if $query contains unsplash.com url
|
358 |
if ( strpos( $url, 'unsplash.com' ) !== false ) {
|
359 |
-
$parts = parse_url( $url );
|
|
|
|
|
360 |
parse_str($parts['query'], $query);
|
361 |
$id = $query['photo'];
|
362 |
-
|
|
|
|
|
|
|
|
|
|
|
363 |
// $query is ID
|
|
|
|
|
364 |
$id = $url;
|
365 |
}
|
366 |
|
@@ -581,19 +833,40 @@ class niteo_cmp {
|
|
581 |
}
|
582 |
}
|
583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
}
|
585 |
|
586 |
|
587 |
$cmpPlugin = new niteo_cmp();
|
588 |
|
|
|
|
|
|
|
589 |
add_action('template_redirect', array($cmpPlugin, 'cmp_displayPage'));
|
590 |
|
591 |
add_action('wp_login', array($cmpPlugin, 'cmp_admin_override'));
|
592 |
|
593 |
add_action( 'wp_ajax_niteo_unsplash', array($cmpPlugin, 'niteo_unsplash') );
|
594 |
add_action( 'wp_ajax_niteo_export_csv', array($cmpPlugin, 'niteo_export_csv') );
|
|
|
595 |
|
596 |
add_action('plugins_loaded', array($cmpPlugin, 'cmp_textDomain') );
|
|
|
597 |
add_action('admin_menu', array($cmpPlugin, 'cmp_adminMenu'), 10);
|
598 |
add_action('admin_init', array($cmpPlugin, 'cmp_adminInit'));
|
599 |
add_action('admin_init', array($cmpPlugin, 'cmp_admin_override'));
|
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.5.0
|
7 |
Author: NiteoThemes
|
8 |
Author URI: http://www.niteo.cz
|
9 |
Text Domain: cmp
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
13 |
*/
|
14 |
|
15 |
+
|
16 |
class niteo_cmp {
|
17 |
var $installedFolder = '';
|
18 |
+
var $version = '';
|
19 |
+
var $remoteServer = '';
|
20 |
+
var $theme_array = array();
|
21 |
+
var $premium_installed = array();
|
22 |
|
23 |
function __construct() {
|
24 |
+
$this->version = '1.5.0';
|
25 |
+
|
26 |
$this->installedFolder = basename(dirname(__FILE__));
|
27 |
+
|
28 |
+
// get all installed themes [folder names under /themes] and put them to array
|
29 |
+
$this->themes_standard = array_map('basename', glob( plugin_dir_path( __FILE__ ) . 'themes/*', GLOB_ONLYDIR));
|
30 |
+
// check for installed premium themes
|
31 |
+
if ( file_exists(plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/') ) {
|
32 |
+
$this->premium_installed = array_map('basename', glob( plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/*', GLOB_ONLYDIR));
|
33 |
+
$this->theme_array = array_merge($this->themes_standard, $this->premium_installed);
|
34 |
+
} else {
|
35 |
+
$this->theme_array = $this->themes_standard;
|
36 |
+
}
|
37 |
+
$this->remoteServer = 'http://niteo.cz/niteo-updates/';
|
38 |
}
|
39 |
|
40 |
function cmp() {
|
42 |
}
|
43 |
|
44 |
function cmp_adminInit() {
|
45 |
+
wp_register_script('cmp_mainjs', plugins_url().'/'.$this->installedFolder.'/comingsoon.min.js','webfont',$this->version);
|
46 |
wp_register_style( 'font_awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' );
|
47 |
+
wp_register_style( 'cmp_style', plugins_url().'/'.$this->installedFolder.'/cs_style.css','',$this->version);
|
48 |
wp_register_script( 'webfont', 'https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js', array(), false, true);
|
49 |
}
|
50 |
|
51 |
function cmp_add_admin_style() {
|
52 |
+
wp_register_style( 'cmp_admin_style', plugins_url().'/'.$this->installedFolder.'/cs_admin.css','',$this->version);
|
53 |
wp_enqueue_style( 'cmp_admin_style' );
|
54 |
}
|
55 |
|
63 |
wp_enqueue_media();
|
64 |
wp_enqueue_script( 'wp-color-picker');
|
65 |
|
66 |
+
// check for them updates, not sure where else this to put
|
67 |
+
$this->cmp_check_update();
|
68 |
+
|
69 |
}
|
70 |
|
71 |
|
110 |
|
111 |
function cmp_admin_options() {
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
// include default options page
|
114 |
require ('cmp-options.php');
|
|
|
115 |
}
|
116 |
|
117 |
+
|
118 |
+
|
119 |
function cmp_displayPage() {
|
120 |
|
121 |
if ( isset($_GET['cmp_preview']) && $_GET['cmp_preview'] == 'true' ) {
|
323 |
return $premium_themes;
|
324 |
}
|
325 |
|
326 |
+
|
327 |
+
// theme updates function
|
328 |
+
function cmp_check_update() {
|
329 |
+
|
330 |
+
// check for current theme version
|
331 |
+
$remote_version = '';
|
332 |
+
$current_version = '';
|
333 |
+
$type = '';
|
334 |
+
$headers = array('Version');
|
335 |
+
|
336 |
+
foreach ( $this->theme_array as $theme_slug) {
|
337 |
+
// if premium theme style.css exists get its version
|
338 |
+
if ( in_array($theme_slug, $this->premium_installed) && file_exists(plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/'.$theme_slug.'/style.css')) {
|
339 |
+
$version = get_file_data( plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/'.$theme_slug.'/style.css', $headers, '');
|
340 |
+
$type = 'premium';
|
341 |
+
}
|
342 |
+
|
343 |
+
// if standard theme style.css exists get its version
|
344 |
+
if ( in_array($theme_slug, $this->themes_standard) && file_exists(plugin_dir_path( __FILE__ ) . 'themes/'.$theme_slug.'/style.css')) {
|
345 |
+
$version = get_file_data( plugin_dir_path( __FILE__ ) . 'themes/'.$theme_slug.'/style.css', $headers, '');
|
346 |
+
$type = 'standard';
|
347 |
+
}
|
348 |
+
|
349 |
+
// if we have local version of theme and not in updating theme
|
350 |
+
if ( isset($version[0]) ) {
|
351 |
+
$current_version = $version[0];
|
352 |
+
|
353 |
+
// get remote version from remote server
|
354 |
+
$request = wp_remote_post($this->remoteServer.'?action=get_metadata&slug='.$theme_slug, array('body' => array('action' => 'version')));
|
355 |
+
|
356 |
+
// if no error, retrivee body
|
357 |
+
if ( !is_wp_error($request) ) {
|
358 |
+
// decode to json
|
359 |
+
$remote_version = json_decode($request['body'], true);
|
360 |
+
|
361 |
+
// get version key
|
362 |
+
if ( isset($remote_version['version']) ) {
|
363 |
+
$remote_version = $remote_version['version'];
|
364 |
+
|
365 |
+
// if remove version is bigger than current, display info about new version
|
366 |
+
if ((float)$remote_version > (float)$current_version) {
|
367 |
+
|
368 |
+
// if admin screen is not in updating theme
|
369 |
+
if (!isset($_GET['theme']) || (isset($_GET['theme']) && $_GET['theme'] != $theme_slug)) {
|
370 |
+
|
371 |
+
echo '<div class="notice notice-warning is-dismissible"><p class="message">'.__('There is a new version of ', 'cmp').'<span class="theme-name">'.esc_attr(ucwords(str_replace('_', ' ', $theme_slug))).'</span> '.__('Theme available.', 'cmp').' <a href="'.esc_url($this->remoteServer).'readme/'.esc_attr($theme_slug).'-readme.html" class="view-release">'.__('View release update notes','cmp').'</a> or <a href="'.admin_url().'options-general.php?page=cmp-settings&action=update-cmp-theme&theme='.esc_attr($theme_slug).'&type='.esc_attr($type).'" class="update-theme" data-type="'.esc_attr($type).'" data-slug="'.esc_attr($theme_slug).'" data-remote_url="'.esc_url($this->remoteServer).'">'.__('Update now.','cmp').'</a></p><div class="release-note"></div></div>';
|
372 |
+
}
|
373 |
+
}
|
374 |
+
|
375 |
+
} else {
|
376 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('There has been error from remote server: ','cmp').wp_remote_retrieve_response_code($request).' '.__('while checking for','cmp').' '.esc_attr(ucwords(str_replace('_', ' ', $theme_slug))).' '.__('Theme update. Please try again later or contact us at info@niteo.cz if this error message keeps appearing.','cmp').'</p></div>';
|
377 |
+
}
|
378 |
+
|
379 |
+
} else {
|
380 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('There has been error: Internal server error:','cmp').' '.$request->get_error_message().' '.__('while checking for Theme update. Please try again later or contact us at info@niteo.cz if this error message keeps appearing.','cmp').'</p></div>';
|
381 |
+
|
382 |
+
}
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
+
return;
|
387 |
+
|
388 |
+
}
|
389 |
+
|
390 |
+
function cmp_theme_upload($zip) {
|
391 |
+
// allow zip file to upload
|
392 |
+
add_filter('upload_mimes', array($this, 'niteo_allow_zip_mime'));
|
393 |
+
|
394 |
+
// load PHP WP FILE
|
395 |
+
if ( ! function_exists( 'wp_handle_upload' ) ) {
|
396 |
+
require realpath('../../../wp-admin/includes/file.php');
|
397 |
+
}
|
398 |
+
|
399 |
+
$uploadedfile = $zip;
|
400 |
+
$filename = $uploadedfile['name'];
|
401 |
+
/* You can use wp_check_filetype() function to check the
|
402 |
+
file type and go on wit the upload or stop it.*/
|
403 |
+
$filetype = wp_check_filetype( $filename );
|
404 |
+
|
405 |
+
if ( $filetype['ext'] == 'zip' ) {
|
406 |
+
|
407 |
+
// Upload file
|
408 |
+
$movefile = wp_handle_upload( $uploadedfile, array('test_form' => FALSE) );
|
409 |
+
|
410 |
+
if ( $movefile && !isset( $movefile['error'] ) ) {
|
411 |
+
|
412 |
+
WP_Filesystem();
|
413 |
+
$source_path = $movefile['file'];
|
414 |
+
$theme_name = str_replace('.zip', '', $filename);
|
415 |
+
$destination_path = plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/';
|
416 |
+
|
417 |
+
// create new theme DIR
|
418 |
+
if ( wp_mkdir_p( $destination_path ) ) {
|
419 |
+
// Unzip FILE into that DIR
|
420 |
+
$unzipfile = unzip_file( $source_path, $destination_path);
|
421 |
+
|
422 |
+
if ( $unzipfile ) {
|
423 |
+
// delete FILE
|
424 |
+
wp_delete_file( $source_path );
|
425 |
+
$this->premium_installed = array_map('basename', glob( $destination_path . '*', GLOB_ONLYDIR));
|
426 |
+
$this->theme_array = array_merge( $this->theme_array, $this->premium_installed );
|
427 |
+
echo '<div class="notice notice-success is-dismissible"><p class="message">'.ucwords(str_replace('_', ' ', $theme_name)).' '.__(' theme was successfully installed!', 'cmp').'</p></div>';
|
428 |
+
return;
|
429 |
+
|
430 |
+
} else {
|
431 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('There was an error unzipping the file!', 'cmp').'</p></div>';
|
432 |
+
return;
|
433 |
+
}
|
434 |
+
|
435 |
+
} else {
|
436 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('Error creating Theme subdirectory!', 'cmp').'</p></div>';
|
437 |
+
return;
|
438 |
+
}
|
439 |
+
|
440 |
+
} else {
|
441 |
+
/**
|
442 |
+
* Error generated by _wp_handle_upload()
|
443 |
+
* @see _wp_handle_upload() in wp-admin/includes/file.php
|
444 |
+
*/
|
445 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.$movefile['error'].'</p></div>';
|
446 |
+
return;
|
447 |
+
}
|
448 |
+
} else {
|
449 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('Unable to upload new Theme file .', 'cmp'). strtoupper($filetype['ext']) .__(' file extension is not supported. Please upload ZIP file containing CMP Theme.', 'cmp').'</p></div>';
|
450 |
+
return;
|
451 |
+
}
|
452 |
+
|
453 |
+
add_filter('upload_mimes', array($this, 'niteo_remove_zip_mime'));
|
454 |
+
return;
|
455 |
+
}
|
456 |
+
|
457 |
+
function cmp_theme_update_install( $file ) {
|
458 |
+
$ajax = false;
|
459 |
+
// check for ajax
|
460 |
+
if ( isset( $_POST['file'] ) ) {
|
461 |
+
// verify nonce
|
462 |
+
check_ajax_referer( 'cmp-coming-soon-ajax-secret', 'security' );
|
463 |
+
// verify user rights
|
464 |
+
if( !current_user_can('publish_pages') ) {
|
465 |
+
die('Sorry, but this request is invalid');
|
466 |
+
}
|
467 |
+
|
468 |
+
// sanitize array
|
469 |
+
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
470 |
+
|
471 |
+
if ( !empty( $_POST['file'] ) ) {
|
472 |
+
$file = $_POST['file'];
|
473 |
+
$ajax = true;
|
474 |
+
}
|
475 |
+
}
|
476 |
+
|
477 |
+
// load PHP WP FILE
|
478 |
+
if ( ! empty( $file ) ) {
|
479 |
+
// Download file to temp location.
|
480 |
+
$file ['tmp_name'] = download_url( $file['url'] );
|
481 |
+
|
482 |
+
// If error storing temporarily, return the error.
|
483 |
+
if ( !is_wp_error( $file['tmp_name'] ) ) {
|
484 |
+
WP_Filesystem();
|
485 |
+
|
486 |
+
$source_path = $file['tmp_name'];
|
487 |
+
$theme_name = $file['name'];
|
488 |
+
|
489 |
+
if ( $file['type'] == 'premium' ) {
|
490 |
+
$destination_path = plugin_dir_path( __DIR__ ) . 'cmp-premium-themes/';
|
491 |
+
}
|
492 |
+
|
493 |
+
if ( $file['type'] == 'standard' ) {
|
494 |
+
$destination_path = plugin_dir_path( __FILE__ ) . 'themes/';
|
495 |
+
}
|
496 |
+
|
497 |
+
// create new theme DIR
|
498 |
+
if ( wp_mkdir_p( $destination_path ) ) {
|
499 |
+
// Unzip FILE into that DIR
|
500 |
+
$unzipfile = unzip_file( $source_path, $destination_path);
|
501 |
+
|
502 |
+
if ( $unzipfile ) {
|
503 |
+
|
504 |
+
// delete FILE
|
505 |
+
wp_delete_file( $source_path );
|
506 |
+
|
507 |
+
// reload premium installed themes
|
508 |
+
$this->premium_installed = array_map('basename', glob( $destination_path . '*', GLOB_ONLYDIR));
|
509 |
+
// add it to all installed themes array
|
510 |
+
$this->theme_array = array_merge( $this->theme_array, $this->premium_installed );
|
511 |
+
// reply response
|
512 |
+
echo $ajax ? 'success' : '<div class="notice notice-success is-dismissible"><p>'.ucwords(str_replace('_', ' ', $theme_name)).' '.__('theme was successfully updated to new version!', 'cmp').'</p></div>';
|
513 |
+
// die
|
514 |
+
if ($ajax === true) {
|
515 |
+
wp_die();
|
516 |
+
} else {
|
517 |
+
return;
|
518 |
+
}
|
519 |
+
|
520 |
+
} else {
|
521 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('There was an error unzipping the file!', 'cmp').'</p></div>';
|
522 |
+
if ($ajax === true) {
|
523 |
+
wp_die();
|
524 |
+
} else {
|
525 |
+
return;
|
526 |
+
}
|
527 |
+
}
|
528 |
+
|
529 |
+
} else {
|
530 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('Error creating Theme subdirectory!', 'cmp').'</p></div>';
|
531 |
+
if ($ajax === true) {
|
532 |
+
wp_die();
|
533 |
+
} else {
|
534 |
+
return;
|
535 |
+
}
|
536 |
+
}
|
537 |
+
|
538 |
+
} else {
|
539 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('Error during updating Theme files:', 'cmp').' '.$file['tmp_name']->get_error_message().'</p></div>';
|
540 |
+
if ($ajax === true) {
|
541 |
+
wp_die();
|
542 |
+
} else {
|
543 |
+
return;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
} else {
|
547 |
+
|
548 |
+
echo '<div class="notice notice-error is-dismissible"><p>'.__('General Error during updating Theme files.', 'cmp').'</p></div>';
|
549 |
+
if ($ajax === true) {
|
550 |
+
wp_die();
|
551 |
+
} else {
|
552 |
+
return;
|
553 |
+
}
|
554 |
+
}
|
555 |
+
|
556 |
+
}
|
557 |
+
|
558 |
// returns list of with countdown
|
559 |
function cmp_plugin_countdown_themes() {
|
560 |
$counter_themes = array('frame');
|
599 |
case '0':
|
600 |
// check if $query contains unsplash.com url
|
601 |
if ( strpos( $url, 'unsplash.com' ) !== false ) {
|
602 |
+
$parts = parse_url( $url, PHP_URL_PATH );
|
603 |
+
|
604 |
+
// check for photo parameter in URL
|
605 |
parse_str($parts['query'], $query);
|
606 |
$id = $query['photo'];
|
607 |
+
// if no ID found, get last part of URL containing ID
|
608 |
+
if ( is_null( $id ) ) {
|
609 |
+
|
610 |
+
$pathFragments = explode('/', $parts);
|
611 |
+
$id = end($pathFragments);
|
612 |
+
}
|
613 |
// $query is ID
|
614 |
+
} else {
|
615 |
+
|
616 |
$id = $url;
|
617 |
}
|
618 |
|
833 |
}
|
834 |
}
|
835 |
|
836 |
+
function cmp_admin_notice () {
|
837 |
+
|
838 |
+
if ( isset($_GET['page']) && $_GET['page'] == 'cmp-settings' ) {
|
839 |
+
if (isset($_GET['status']) && $_GET['status'] == 'settings-saved') {
|
840 |
+
$status = 'success';
|
841 |
+
$message = __('Settings Saved', 'cmp');
|
842 |
+
|
843 |
+
echo '<div class="notice notice-'.$status.' is-dismissible"><p>'.$message.'.</p></div>';
|
844 |
+
}
|
845 |
+
|
846 |
+
|
847 |
+
}
|
848 |
+
|
849 |
+
return;
|
850 |
+
}
|
851 |
+
|
852 |
}
|
853 |
|
854 |
|
855 |
$cmpPlugin = new niteo_cmp();
|
856 |
|
857 |
+
|
858 |
+
add_action( 'admin_notices', array($cmpPlugin, 'cmp_admin_notice'));
|
859 |
+
|
860 |
add_action('template_redirect', array($cmpPlugin, 'cmp_displayPage'));
|
861 |
|
862 |
add_action('wp_login', array($cmpPlugin, 'cmp_admin_override'));
|
863 |
|
864 |
add_action( 'wp_ajax_niteo_unsplash', array($cmpPlugin, 'niteo_unsplash') );
|
865 |
add_action( 'wp_ajax_niteo_export_csv', array($cmpPlugin, 'niteo_export_csv') );
|
866 |
+
add_action( 'wp_ajax_cmp_theme_update_install', array($cmpPlugin, 'cmp_theme_update_install') );
|
867 |
|
868 |
add_action('plugins_loaded', array($cmpPlugin, 'cmp_textDomain') );
|
869 |
+
|
870 |
add_action('admin_menu', array($cmpPlugin, 'cmp_adminMenu'), 10);
|
871 |
add_action('admin_init', array($cmpPlugin, 'cmp_adminInit'));
|
872 |
add_action('admin_init', array($cmpPlugin, 'cmp_admin_override'));
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: NiteoThemes
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JFJ8NCBYLW&lc=US&item_name=NiteoThemes&item_number=comingsoon¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
|
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.7.
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -100,9 +100,18 @@ Free plugin to create and customize your own Coming Soon or Maintenance landing
|
|
100 |
|
101 |
|
102 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
<h4>1.4.1</h4>
|
104 |
<ul>
|
105 |
-
<li>Resolved bug
|
106 |
</ul>
|
107 |
<h4>1.4.0</h4>
|
108 |
<ul>
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JFJ8NCBYLW&lc=US&item_name=NiteoThemes&item_number=comingsoon¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
|
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.7.4
|
7 |
+
Stable tag: 1.5.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
100 |
|
101 |
|
102 |
== Changelog ==
|
103 |
+
<h4>1.5.0</h4>
|
104 |
+
<ul>
|
105 |
+
<li>New auto update feature for all Themes.</li>
|
106 |
+
<li>Added labels description to Social Icons inputs.</li>
|
107 |
+
<li>Added Wordpress notification bar.</li>
|
108 |
+
<li>Unsplash Specific Photo now accepts both URLs formats https://unsplash.com/photos/kBJEJqWNtNY and https://unsplash.com/?photo=kBJEJqWNtNY</li>
|
109 |
+
<li>Many small enhancements in UI settings.</li>
|
110 |
+
<li>Resolved bug: Default Theme Graphic Banner no longer dissappears when Custom Media were uploaded and deleted in CMP Options.</li>
|
111 |
+
</ul>
|
112 |
<h4>1.4.1</h4>
|
113 |
<ul>
|
114 |
+
<li>Resolved bug: Not possible to save Social profiles URLs after release of update 1.4.0.</li>
|
115 |
</ul>
|
116 |
<h4>1.4.0</h4>
|
117 |
<ul>
|
themes/construct/construct-settings.php
CHANGED
@@ -33,9 +33,9 @@ if ( isset($_POST['niteoCS_background_color_construct']) ) {
|
|
33 |
|
34 |
?>
|
35 |
|
36 |
-
<div class="table-wrapper
|
37 |
<h3><?php _e('Customize Colors', 'cmp');?></h3>
|
38 |
-
<table class="
|
39 |
<tr>
|
40 |
<th><h4><?php _e('Active Color', 'cmp');?></h4></th>
|
41 |
<td>
|
33 |
|
34 |
?>
|
35 |
|
36 |
+
<div class="table-wrapper content">
|
37 |
<h3><?php _e('Customize Colors', 'cmp');?></h3>
|
38 |
+
<table class="content">
|
39 |
<tr>
|
40 |
<th><h4><?php _e('Active Color', 'cmp');?></h4></th>
|
41 |
<td>
|
themes/construct/construct-theme.php
CHANGED
@@ -17,6 +17,7 @@
|
|
17 |
|
18 |
<?php
|
19 |
// get saved style options
|
|
|
20 |
$active_color = get_option('niteoCS_active_color[construct]', '#f37004');
|
21 |
$font_color = get_option('niteoCS_font_color[construct]', '#686868');
|
22 |
$background_color = get_option('niteoCS_background_color[construct]', '#ffffff');
|
@@ -93,7 +94,7 @@
|
|
93 |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
94 |
<?php
|
95 |
} ?>
|
96 |
-
<link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'construct/style.css?ver=
|
97 |
|
98 |
<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">
|
99 |
<?php wp_site_icon();?>
|
@@ -155,7 +156,7 @@
|
|
155 |
// custom media
|
156 |
case '0':
|
157 |
$banner_id = get_option('niteoCS_banner_id');
|
158 |
-
|
159 |
if ( $banner_id != '' ) {
|
160 |
$banner_ids = explode(',', $banner_id);
|
161 |
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
@@ -171,6 +172,7 @@
|
|
171 |
|
172 |
case '1':
|
173 |
// unsplash
|
|
|
174 |
switch ( $unplash_feed ) {
|
175 |
// SINGLE IMAGE
|
176 |
case '0':
|
@@ -201,9 +203,30 @@
|
|
201 |
|
202 |
case '2':
|
203 |
// default image
|
|
|
204 |
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'construct/img/construct_banner_'.$size.'.jpg';
|
205 |
break;
|
206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
default:
|
208 |
break;
|
209 |
}
|
@@ -232,7 +255,7 @@
|
|
232 |
<?php
|
233 |
|
234 |
} else { ?>
|
235 |
-
<div class="banner" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
236 |
<?php
|
237 |
}
|
238 |
?>
|
17 |
|
18 |
<?php
|
19 |
// get saved style options
|
20 |
+
$ver = '1.1';
|
21 |
$active_color = get_option('niteoCS_active_color[construct]', '#f37004');
|
22 |
$font_color = get_option('niteoCS_font_color[construct]', '#686868');
|
23 |
$background_color = get_option('niteoCS_background_color[construct]', '#ffffff');
|
94 |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
95 |
<?php
|
96 |
} ?>
|
97 |
+
<link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'construct/style.css?ver='.$ver;?>" type="text/css" media="all"></link>
|
98 |
|
99 |
<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">
|
100 |
<?php wp_site_icon();?>
|
156 |
// custom media
|
157 |
case '0':
|
158 |
$banner_id = get_option('niteoCS_banner_id');
|
159 |
+
$background_class = 'image';
|
160 |
if ( $banner_id != '' ) {
|
161 |
$banner_ids = explode(',', $banner_id);
|
162 |
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
172 |
|
173 |
case '1':
|
174 |
// unsplash
|
175 |
+
$background_class = 'image';
|
176 |
switch ( $unplash_feed ) {
|
177 |
// SINGLE IMAGE
|
178 |
case '0':
|
203 |
|
204 |
case '2':
|
205 |
// default image
|
206 |
+
$background_class = 'image';
|
207 |
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'construct/img/construct_banner_'.$size.'.jpg';
|
208 |
break;
|
209 |
|
210 |
+
case '3':
|
211 |
+
// Pattern
|
212 |
+
$background_class = 'pattern';
|
213 |
+
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
|
214 |
+
|
215 |
+
if ($niteoCS_banner_pattern != 'custom') {
|
216 |
+
$banner_url = str_replace('themes', '', plugin_dir_url( dirname( __FILE__ ) )) . 'img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png';
|
217 |
+
} else {
|
218 |
+
$banner_url = get_option('niteoCS_banner_pattern_custom');
|
219 |
+
}
|
220 |
+
|
221 |
+
break;
|
222 |
+
case '4':
|
223 |
+
// Pattern
|
224 |
+
$background_class = 'color';
|
225 |
+
$banner_url = '';
|
226 |
+
$niteoCS_banner_color = get_option('niteoCS_banner_color', '#bdc3c7');
|
227 |
+
echo '<style>.banner.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
|
228 |
+
break;
|
229 |
+
|
230 |
default:
|
231 |
break;
|
232 |
}
|
255 |
<?php
|
256 |
|
257 |
} else { ?>
|
258 |
+
<div class="banner <?php echo esc_attr($background_class);?>" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
259 |
<?php
|
260 |
}
|
261 |
?>
|
themes/construct/style.css
CHANGED
@@ -1,15 +1,11 @@
|
|
1 |
/*
|
2 |
-
|
3 |
-
|
4 |
-
Author:
|
5 |
Author URI: http://niteo.cz/
|
6 |
Version: 1.1
|
7 |
-
|
8 |
-
|
9 |
-
Tags:one-column, custom-header, custom-menu, featured-images, post-formats, translation-ready
|
10 |
-
|
11 |
-
niteo Portfolio is based on Underscores http://underscores.me/, (C) 2012-2015 Automattic, Inc.
|
12 |
-
Underscores is distributed under the terms of the GNU GPL v2 or later.
|
13 |
|
14 |
Normalizing styles have been helped along thanks to the fine work of
|
15 |
Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normaalize.css/
|
@@ -19,12 +15,14 @@ body{margin:0;}
|
|
19 |
:focus {outline:none;}
|
20 |
h1,h2,h3,h4,h5,h6{font-weight: 400;font-size:2em;}
|
21 |
.section {padding: 50px 2em;text-align: center;position: relative;}
|
22 |
-
.section-logo
|
|
|
23 |
.section-banner{height: 300px;}
|
24 |
.section-body p{width:70%;max-width: 900px;margin:1em auto;}
|
25 |
.section-social{background-color: #f8f8f8;}
|
26 |
.section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;}
|
27 |
.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;}
|
|
|
28 |
.social-list{padding:0;margin-bottom: 0;}
|
29 |
.social-list li{list-style: none;display: inline-block; padding: 0 5px;}
|
30 |
.section-body form{max-width: 400px;margin: 0 auto;margin-top: 70px;margin-bottom: 30px;text-align:left;}
|
1 |
/*
|
2 |
+
Theme Name: Construct
|
3 |
+
Theme URI: http://cmp.niteo.cz/?cmp_preview=true&theme=construct
|
4 |
+
Author: Niteo
|
5 |
Author URI: http://niteo.cz/
|
6 |
Version: 1.1
|
7 |
+
Description: Premium Theme for CMP Coming Soon & Maintenance plugin
|
8 |
+
Text Domain: niteo
|
|
|
|
|
|
|
|
|
9 |
|
10 |
Normalizing styles have been helped along thanks to the fine work of
|
11 |
Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normaalize.css/
|
15 |
:focus {outline:none;}
|
16 |
h1,h2,h3,h4,h5,h6{font-weight: 400;font-size:2em;}
|
17 |
.section {padding: 50px 2em;text-align: center;position: relative;}
|
18 |
+
.section-logo {max-width: 500px; margin: 0 auto;}
|
19 |
+
.section-logo img {max-width: 100%;}
|
20 |
.section-banner{height: 300px;}
|
21 |
.section-body p{width:70%;max-width: 900px;margin:1em auto;}
|
22 |
.section-social{background-color: #f8f8f8;}
|
23 |
.section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;}
|
24 |
.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;}
|
25 |
+
.banner.pattern{background-size: initial; background-repeat: repeat;}
|
26 |
.social-list{padding:0;margin-bottom: 0;}
|
27 |
.social-list li{list-style: none;display: inline-block; padding: 0 5px;}
|
28 |
.section-body form{max-width: 400px;margin: 0 auto;margin-top: 70px;margin-bottom: 30px;text-align:left;}
|
themes/hardwork/hardwork-settings.php
CHANGED
@@ -48,9 +48,9 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
|
|
48 |
#copyright-section {display: none!important;}
|
49 |
</style>
|
50 |
|
51 |
-
<div class="table-wrapper
|
52 |
<h3><?php _e('Customize Colors', 'cmp');?></h3>
|
53 |
-
<table class="
|
54 |
|
55 |
<tr>
|
56 |
<th><h4><?php _e('Font Color', 'cmp');?></h4></th>
|
@@ -64,7 +64,7 @@ if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
|
|
64 |
<th><h4><?php _e('Overlay Color', 'cmp');?></h4></th>
|
65 |
<td>
|
66 |
<fieldset class="padding-bottom">
|
67 |
-
<input type="checkbox" name="niteoCS_overlay_checkbox_hardwork" id="niteoCS_overlay_checkbox" value="1" <?php checked( '1', get_option( 'niteoCS_overlay_checkbox', '1' ) ); ?> class="regular-text code"><label for="niteoCS_overlay_checkbox"><?php _e('Enable Overlay Color', 'cmp');?></label><br>
|
68 |
</fieldset>
|
69 |
|
70 |
<fieldset id="overlay-color">
|
48 |
#copyright-section {display: none!important;}
|
49 |
</style>
|
50 |
|
51 |
+
<div class="table-wrapper content">
|
52 |
<h3><?php _e('Customize Colors', 'cmp');?></h3>
|
53 |
+
<table class="content">
|
54 |
|
55 |
<tr>
|
56 |
<th><h4><?php _e('Font Color', 'cmp');?></h4></th>
|
64 |
<th><h4><?php _e('Overlay Color', 'cmp');?></h4></th>
|
65 |
<td>
|
66 |
<fieldset class="padding-bottom">
|
67 |
+
<input type="checkbox" name="niteoCS_overlay_checkbox_hardwork" id="niteoCS_overlay_checkbox" value="1" <?php checked( '1', get_option( 'niteoCS_overlay_checkbox[hardwork]', '1' ) ); ?> class="regular-text code"><label for="niteoCS_overlay_checkbox"><?php _e('Enable Overlay Color', 'cmp');?></label><br>
|
68 |
</fieldset>
|
69 |
|
70 |
<fieldset id="overlay-color">
|
themes/hardwork/hardwork-theme.php
CHANGED
@@ -11,6 +11,7 @@
|
|
11 |
|
12 |
<?php
|
13 |
// get saved style options
|
|
|
14 |
$font_color = get_option('niteoCS_font_color[hardwork]', '#ffffff');
|
15 |
$background_color = get_option('niteoCS_overlay_color[hardwork]', '#000000');
|
16 |
$background_opa = get_option('niteoCS_overlay_opacity[hardwork]', '0.5');
|
@@ -85,7 +86,7 @@
|
|
85 |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
86 |
<?php
|
87 |
} ?>
|
88 |
-
<link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'hardwork/style.css?ver=
|
89 |
|
90 |
<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">
|
91 |
|
@@ -95,7 +96,7 @@
|
|
95 |
body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
|
96 |
|
97 |
<?php
|
98 |
-
if ( get_option( 'niteoCS_overlay_checkbox', '1' ) == 1 ) { ?>
|
99 |
#background-color {background-color:<?php echo esc_attr( $background_color ); ?>;opacity:<?php echo esc_attr( $background_opa ); ?>;}
|
100 |
.social-list{background-color: <?php echo esc_attr( $background_social ); ?>;}
|
101 |
<?php
|
@@ -158,7 +159,7 @@
|
|
158 |
// custom media
|
159 |
case '0':
|
160 |
$banner_id = get_option('niteoCS_banner_id');
|
161 |
-
|
162 |
if ( $banner_id != '' ) {
|
163 |
$banner_ids = explode(',', $banner_id);
|
164 |
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
@@ -174,6 +175,7 @@
|
|
174 |
|
175 |
case '1':
|
176 |
// unsplash
|
|
|
177 |
switch ( $unplash_feed ) {
|
178 |
// SINGLE IMAGE
|
179 |
case '0':
|
@@ -204,8 +206,29 @@
|
|
204 |
|
205 |
case '2':
|
206 |
// default image
|
|
|
207 |
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'hardwork/img/hardwork_banner_'.$size.'.jpg';
|
208 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
|
210 |
default:
|
211 |
break;
|
@@ -229,7 +252,7 @@
|
|
229 |
|
230 |
} else { ?>
|
231 |
<div id="background-wrapper">
|
232 |
-
<div id="background-image" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
233 |
<div id="background-color"></div>
|
234 |
</div>
|
235 |
<?php
|
@@ -237,16 +260,20 @@
|
|
237 |
?>
|
238 |
|
239 |
<section class="section section-body">
|
240 |
-
|
241 |
-
|
242 |
-
<
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
|
|
250 |
|
251 |
</section>
|
252 |
|
11 |
|
12 |
<?php
|
13 |
// get saved style options
|
14 |
+
$ver = '1.1';
|
15 |
$font_color = get_option('niteoCS_font_color[hardwork]', '#ffffff');
|
16 |
$background_color = get_option('niteoCS_overlay_color[hardwork]', '#000000');
|
17 |
$background_opa = get_option('niteoCS_overlay_opacity[hardwork]', '0.5');
|
86 |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
87 |
<?php
|
88 |
} ?>
|
89 |
+
<link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) . 'hardwork/style.css?ver='.$ver ;?>" type="text/css" media="all"></link>
|
90 |
|
91 |
<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">
|
92 |
|
96 |
body,input {font-family:'<?php echo esc_attr($content_font);?>', 'sans-serif';color:<?php echo esc_attr( $font_color ); ?>;}
|
97 |
|
98 |
<?php
|
99 |
+
if ( get_option( 'niteoCS_overlay_checkbox[hardwork]', '1' ) == 1 ) { ?>
|
100 |
#background-color {background-color:<?php echo esc_attr( $background_color ); ?>;opacity:<?php echo esc_attr( $background_opa ); ?>;}
|
101 |
.social-list{background-color: <?php echo esc_attr( $background_social ); ?>;}
|
102 |
<?php
|
159 |
// custom media
|
160 |
case '0':
|
161 |
$banner_id = get_option('niteoCS_banner_id');
|
162 |
+
$background_class = 'image';
|
163 |
if ( $banner_id != '' ) {
|
164 |
$banner_ids = explode(',', $banner_id);
|
165 |
$banner_url = wp_get_attachment_image_src( $banner_ids[mt_rand(0, count( $banner_ids ) - 1)], $size);
|
175 |
|
176 |
case '1':
|
177 |
// unsplash
|
178 |
+
$background_class = 'image';
|
179 |
switch ( $unplash_feed ) {
|
180 |
// SINGLE IMAGE
|
181 |
case '0':
|
206 |
|
207 |
case '2':
|
208 |
// default image
|
209 |
+
$background_class = 'image';
|
210 |
$banner_url = plugin_dir_url( dirname( __FILE__ ) ) . 'hardwork/img/hardwork_banner_'.$size.'.jpg';
|
211 |
break;
|
212 |
+
|
213 |
+
case '3':
|
214 |
+
// Pattern
|
215 |
+
$background_class = 'pattern';
|
216 |
+
$niteoCS_banner_pattern = get_option('niteoCS_banner_pattern', 'sakura');
|
217 |
+
|
218 |
+
if ($niteoCS_banner_pattern != 'custom') {
|
219 |
+
$banner_url = str_replace('themes', '', plugin_dir_url( dirname( __FILE__ ) )) . 'img/patterns/'.esc_attr($niteoCS_banner_pattern).'.png';
|
220 |
+
} else {
|
221 |
+
$banner_url = get_option('niteoCS_banner_pattern_custom');
|
222 |
+
}
|
223 |
+
|
224 |
+
break;
|
225 |
+
case '4':
|
226 |
+
// Pattern
|
227 |
+
$background_class = 'color';
|
228 |
+
$banner_url = '';
|
229 |
+
$niteoCS_banner_color = get_option('niteoCS_banner_color', '#bdc3c7');
|
230 |
+
echo '<style>#background-image.color{background-color:'.esc_attr($niteoCS_banner_color).';}</style>';
|
231 |
+
break;
|
232 |
|
233 |
default:
|
234 |
break;
|
252 |
|
253 |
} else { ?>
|
254 |
<div id="background-wrapper">
|
255 |
+
<div id="background-image" class="<?php echo esc_attr($background_class);?>" style="background-image:url('<?php echo esc_url( $banner_url ); ?>')"></div>
|
256 |
<div id="background-color"></div>
|
257 |
</div>
|
258 |
<?php
|
260 |
?>
|
261 |
|
262 |
<section class="section section-body">
|
263 |
+
<?php
|
264 |
+
if ( isset($logo_url[0]) ) { ?>
|
265 |
+
<div class="logo-wrapper">
|
266 |
+
<img src="<?php echo esc_url( $logo_url[0] ); ?>" alt="logo">
|
267 |
+
</div>
|
268 |
+
<?php
|
269 |
+
}
|
270 |
+
|
271 |
+
if ( $body_title != '' ) { ?>
|
272 |
+
<h2><?php echo esc_html( $body_title );?></h2>
|
273 |
+
<?php
|
274 |
+
}
|
275 |
+
|
276 |
+
echo apply_filters('the_content', stripslashes($body));?>
|
277 |
|
278 |
</section>
|
279 |
|
themes/hardwork/style.css
CHANGED
@@ -1,15 +1,11 @@
|
|
1 |
/*
|
2 |
-
|
3 |
-
|
4 |
-
Author:
|
5 |
Author URI: http://niteo.cz/
|
6 |
Version: 1.1
|
7 |
-
|
8 |
-
|
9 |
-
Tags:one-column, custom-header, custom-menu, featured-images, post-formats, translation-ready
|
10 |
-
|
11 |
-
niteo Portfolio is based on Underscores http://underscores.me/, (C) 2012-2015 Automattic, Inc.
|
12 |
-
Underscores is distributed under the terms of the GNU GPL v2 or later.
|
13 |
|
14 |
Normalizing styles have been helped along thanks to the fine work of
|
15 |
Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normaalize.css/
|
@@ -55,7 +51,7 @@ h1,h2,h3,h4,h5,h6{
|
|
55 |
|
56 |
.logo-wrapper {
|
57 |
padding: 50px 0;
|
58 |
-
max-width:
|
59 |
margin: 0 auto;
|
60 |
}
|
61 |
|
@@ -91,6 +87,11 @@ h1,h2,h3,h4,h5,h6{
|
|
91 |
background-size: cover;
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
94 |
.social-list {
|
95 |
display: inline-block;
|
96 |
padding:0;
|
1 |
/*
|
2 |
+
Theme Name: Hardwork
|
3 |
+
Theme URI: http://cmp.niteo.cz/?cmp_preview=true&theme=hardwork
|
4 |
+
Author: Niteo
|
5 |
Author URI: http://niteo.cz/
|
6 |
Version: 1.1
|
7 |
+
Description: Premium Theme for CMP Coming Soon & Maintenance plugin
|
8 |
+
Text Domain: niteo
|
|
|
|
|
|
|
|
|
9 |
|
10 |
Normalizing styles have been helped along thanks to the fine work of
|
11 |
Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normaalize.css/
|
51 |
|
52 |
.logo-wrapper {
|
53 |
padding: 50px 0;
|
54 |
+
max-width: 500px;
|
55 |
margin: 0 auto;
|
56 |
}
|
57 |
|
87 |
background-size: cover;
|
88 |
}
|
89 |
|
90 |
+
#background-image.pattern{
|
91 |
+
background-size: initial;
|
92 |
+
background-repeat: repeat;
|
93 |
+
}
|
94 |
+
|
95 |
.social-list {
|
96 |
display: inline-block;
|
97 |
padding:0;
|