CMP – Coming Soon & Maintenance Plugin by NiteoThemes - Version 1.13.0

Version Description

Download this release

Release Info

Developer niteo
Plugin Icon 128x128 CMP – Coming Soon & Maintenance Plugin by NiteoThemes
Version 1.13.0
Comparing to
See all releases

Code changes from version 1.12.0 to 1.13.0

cmp-settings.php CHANGED
@@ -239,7 +239,7 @@ $niteoCS_body_title = get_option('niteoCS_body_title', 'SOMETHING IS HAPPENING
239
  $niteoCS_body = get_option('niteoCS_body');
240
  $niteoCS_copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
241
  $niteoCS_soc_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
242
- $niteoCS_socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
243
  // get subscribe settings
244
  $niteoCS_subscribe_type = get_option('niteoCS_subscribe_type', '2');
245
  $niteoCS_subscribe_code = get_option('niteoCS_subscribe_code');
@@ -290,14 +290,49 @@ $niteoCS_vimeo_url = get_option('niteoCS_vimeo_url['.$themeslug.']');
290
  $niteoCS_video_thumb = get_option('niteoCS_video_thumb['.$themeslug.']');
291
  $niteoCS_video_file_url = get_option('niteoCS_video_file_url['.$themeslug.']');
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  //include theme defaults
294
  if (file_exists($this->cmp_themePath($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php')) {
295
  include ( $this->cmp_themePath($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php' );
296
  }
297
 
298
 
299
-
300
-
301
  // load old settings for a case when theme is not upgraded yet
302
  if (!isset($niteoCS_banner)) $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']');
303
  if (!isset($niteoCS_font_headings)) $niteoCS_font_headings = get_option('niteoCS_font_headings['.$themeslug.']');
@@ -339,25 +374,6 @@ $patterns = array('fabric', 'gray_sand', 'green_dust_scratch', 'mirrored_squares
339
  // define fonts array
340
  $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');
341
 
342
- // migrade social media to new option after update 1.4.0
343
- if ( !get_option('niteoCS_socialmedia') ) {
344
- $social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
345
- $i = 0;
346
- $new_socials = array();
347
- foreach ( $social_media as $social ) {
348
-
349
- $social_field = get_option('niteoCS_'.$social);
350
-
351
- $new_socials[$i]['name'] = $social;
352
- $new_socials[$i]['url'] = $social_field;
353
- $new_socials[$i]['active'] = '1';
354
- $new_socials[$i]['hidden'] = $social_field ? '0' : '1';
355
- $new_socials[$i]['order'] = $i;
356
- $i++;
357
-
358
- }
359
- $niteoCS_socialmedia = json_encode($new_socials);
360
- }
361
 
362
 
363
  // Handle ZIP UPLOAD
@@ -383,8 +399,8 @@ if( isset($_GET['action']) && $_GET['action'] == 'update-cmp-theme' && isset($_G
383
 
384
  add_thickbox();
385
 
386
-
387
  ?>
 
388
  <noscript>
389
  <div class='updated'>
390
  <p class="error"><?php _e('JavaScript appears to be disabled in your browser. For this plugin to work correctly, please enable JavaScript or switch to a more modern browser.', 'cmp-coming-soon-maintenance');?></p>
@@ -433,32 +449,37 @@ add_thickbox();
433
  <td>
434
  <fieldset class="cmp-status">
435
 
436
- <legend class="screen-reader-text">
437
- <span><?php _e('Status', 'cmp-coming-soon-maintenance');?></span>
438
- </legend>
 
 
 
 
 
439
 
440
- <legend title="disabled" <?php echo ($this->cmp_status() == 0) ? 'class="active"' : '';?>>
441
- <input type="radio" name="activate" value="0" <?php echo ($this->cmp_status() == 0) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Disabled', 'cmp-coming-soon-maintenance');?><br>
442
- <span class="info"><?php _e('Disable plugin and display standard WordPress page to all users and indexing engines.','cmp-coming-soon-maintenance')?></span>
443
- </legend><br>
444
 
445
  <legend title="cmp" <?php echo ($this->cmp_status() == 2) ? 'class="active"' : '';?>>
446
- <input type="radio" name="activate" value="2" <?php echo ($this->cmp_status() == 2) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Coming Soon & Landing Page', 'cmp-coming-soon-maintenance');?><br>
447
  <span 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-coming-soon-maintenance')?></span>
448
  </legend><br>
449
 
450
- <legend title="maintanance" <?php echo ($this->cmp_status() == 1) ? 'class="active"' : '';?>>
451
- <input type="radio" name="activate" value="1" <?php echo ($this->cmp_status() == 1) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Maintanance Mode', 'cmp-coming-soon-maintenance');?><br>
452
  <span 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-coming-soon-maintenance')?></span>
453
  </legend><br>
454
 
455
- <legend title="maintanance" <?php echo ($this->cmp_status() == 3) ? 'class="active"' : '';?>>
456
- <input type="radio" name="activate" value="3" <?php echo ($this->cmp_status() == 3) ? 'checked="checked"' : '';?>>&nbsp;<?php _e('Redirect Mode', 'cmp-coming-soon-maintenance');?><br>
457
  <span class="info redirect"><?php _e('Choose Redirect Mode if you want to redirect your website to another URL.','cmp-coming-soon-maintenance')?></span>
458
- <div class="redirect-inputs" <?php echo ($this->cmp_status() == 3) ? 'style="display: block"' : 'style="display: none"';?>>
459
- <input type="text" id="niteoCS_URL_redirect" name="niteoCS_URL_redirect" value="<?php echo esc_url( $niteoCS_URL_redirect); ?>" class="regular-text code"><br>
460
  <label for="niteoCS_redirect_time"><?php _e('Delay Time in Seconds', 'cmp-coming-soon-maintenance');?></label>
461
- <input type="text" id="niteoCS_redirect_time" name="niteoCS_redirect_time" value="<?php echo esc_attr( $niteoCS_redirect_time); ?>" class="regular-text code"><br>
462
  </div>
463
  </legend>
464
 
@@ -497,7 +518,7 @@ add_thickbox();
497
  foreach ( $this->themes_standard as $theme_slug ) {
498
 
499
  // get thumbnail
500
- $thumbnail = plugins_url('/themes/'. $theme_slug . '/img/'. $theme_slug . '_thumbnail.jpg', __FILE__); ?>
501
 
502
  <div class="theme-wrapper<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' active'; } ?>" data-security="<?php echo esc_attr($ajax_nonce);?>" data-type="standard" data-purchased="1" data-slug="<?php echo esc_attr($theme_slug);?>">
503
  <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
@@ -554,7 +575,7 @@ add_thickbox();
554
  // build previews for premium themes
555
  foreach ( $premium_themes as $premium_theme ) {
556
  $theme_slug = $premium_theme['name'];
557
- $thumbnail = plugins_url('/img/thumbnails/'. $theme_slug. '/screenshot1.jpg', __FILE__);
558
  // if premium theme is not in themes array, display buy button
559
  if ( !in_array( $theme_slug, $this->theme_array) ) {
560
  $purchased = 'false';
@@ -573,7 +594,7 @@ add_thickbox();
573
  }
574
  ?>
575
 
576
- <div class="theme-wrapper<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' active'; } ?>" data-security="<?php echo esc_attr($ajax_nonce);?>" data-slug="<?php echo esc_attr($theme_slug);?>" data-type="premium" data-purchased="<?php echo esc_attr($purchased);?>" data-slug="<?php echo esc_attr($theme_slug);?>" data-version="<?php echo esc_html($version);?>" data-remote_url="<?php echo esc_url($this->remoteServer);?>">
577
 
578
  <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
579
 
@@ -700,29 +721,19 @@ add_thickbox();
700
  <p class="social-description"><?php _e('Click on Social Icons below to enable Social Media settings.', 'cmp-coming-soon-maintenance');?></p>
701
  <ul class="social-media">
702
  <?php
703
- $socialmedia = json_decode($niteoCS_socialmedia, true);
704
-
705
- //sort array by hidden, then order key
706
- function sort_social($a, $b){
707
- if ( $a['hidden'] == $b['hidden'] ) {
708
- if( $a['order'] == $b['order'] ) {
709
- return 0;
710
- }
711
- return $a['order'] < $b['order'] ? -1 : 1;
712
- } else {
713
- return $a['hidden'] > $b['hidden'] ? 1 : -1;
714
- }
715
- }
716
- uasort($socialmedia , 'sort_social');
717
 
718
  // render icons
719
  foreach ( $socialmedia as $social ) {
 
 
 
720
  $social_active = '';
721
 
722
  if ($social['hidden'] == '0') {
723
  $social_active = 'active';
724
- }
725
- ?>
726
  <li>
727
  <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-coming-soon-maintenance');?>" data-name="<?php echo esc_attr($social['name']);?>" aria-hidden="true"></i>
728
  </li>
@@ -939,7 +950,7 @@ add_thickbox();
939
  <th><h4><?php _e('Google Analytics Tracking ID', 'cmp-coming-soon-maintenance');?></h4></th>
940
  <td>
941
  <fieldset>
942
- <input type="text" name="niteoCS_analytics" id="niteoCS_analytics" value="<?php echo esc_attr( $niteoCS_analytics); ?>" class="regular-text code">
943
  </fieldset>
944
  </td>
945
  </tr>
239
  $niteoCS_body = get_option('niteoCS_body');
240
  $niteoCS_copyright = get_option('niteoCS_copyright', 'Copyright 2017 NiteoThemes. All rights reserved.');
241
  $niteoCS_soc_title = get_option('niteoCS_soc_title', 'GET SOCIAL WITH US');
242
+
243
  // get subscribe settings
244
  $niteoCS_subscribe_type = get_option('niteoCS_subscribe_type', '2');
245
  $niteoCS_subscribe_code = get_option('niteoCS_subscribe_code');
290
  $niteoCS_video_thumb = get_option('niteoCS_video_thumb['.$themeslug.']');
291
  $niteoCS_video_file_url = get_option('niteoCS_video_file_url['.$themeslug.']');
292
 
293
+ // create default social media if they do not exists
294
+ if ( !get_option('niteoCS_socialmedia') ) {
295
+ $social_icons = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'soundcloud', 'vk','envelope-o');
296
+ $i = 0;
297
+ $socialmedia = array();
298
+ foreach ( $social_icons as $social ) {
299
+
300
+ $social_field = get_option('niteoCS_'.$social);
301
+
302
+ $socialmedia[$i]['name'] = $social;
303
+ $socialmedia[$i]['url'] = $social_field;
304
+ $socialmedia[$i]['active'] = '1';
305
+ $socialmedia[$i]['hidden'] = $social_field ? '0' : '1';
306
+ $socialmedia[$i]['order'] = $i;
307
+ $i++;
308
+ }
309
+
310
+ $niteoCS_socialmedia = json_encode( $socialmedia);
311
+
312
+ } else {
313
+ $niteoCS_socialmedia = stripslashes(get_option('niteoCS_socialmedia'));
314
+ $socialmedia = json_decode( $niteoCS_socialmedia, true );
315
+ }
316
+
317
+ // add soundcloud icon
318
+ if ( !$this->niteo_in_array_r( 'soundcloud', $socialmedia, true ) ) {
319
+ $soundcloud = array(
320
+ 'name' => 'soundcloud',
321
+ 'url' => '',
322
+ 'active' => '1',
323
+ 'hidden' => '1',
324
+ 'order' => '17',
325
+ );
326
+ array_push($socialmedia, $soundcloud);
327
+ }
328
+
329
+
330
  //include theme defaults
331
  if (file_exists($this->cmp_themePath($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php')) {
332
  include ( $this->cmp_themePath($this->cmp_selectedTheme()).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-defaults.php' );
333
  }
334
 
335
 
 
 
336
  // load old settings for a case when theme is not upgraded yet
337
  if (!isset($niteoCS_banner)) $niteoCS_banner = get_option('niteoCS_banner['.$themeslug.']');
338
  if (!isset($niteoCS_font_headings)) $niteoCS_font_headings = get_option('niteoCS_font_headings['.$themeslug.']');
374
  // define fonts array
375
  $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');
376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
 
378
 
379
  // Handle ZIP UPLOAD
399
 
400
  add_thickbox();
401
 
 
402
  ?>
403
+
404
  <noscript>
405
  <div class='updated'>
406
  <p class="error"><?php _e('JavaScript appears to be disabled in your browser. For this plugin to work correctly, please enable JavaScript or switch to a more modern browser.', 'cmp-coming-soon-maintenance');?></p>
449
  <td>
450
  <fieldset class="cmp-status">
451
 
452
+ <div class="toggle-wrapper">
453
+ <input type="checkbox" id="cmp-status" class="toggle-checkbox" <?php checked( '1', get_option('niteoCS_status', false) ); ?> name="cmp_status">
454
+ <label for="cmp-status" class="toggle"><span class="toggle_handler"></span></label>
455
+ </div>
456
+
457
+ </fieldset>
458
+ </td>
459
+ </tr>
460
 
461
+ <tr>
462
+ <th><h4><?php _e('Mode', 'cmp-coming-soon-maintenance');?></h4></th>
463
+ <td>
464
+ <fieldset class="cmp-status">
465
 
466
  <legend title="cmp" <?php echo ($this->cmp_status() == 2) ? 'class="active"' : '';?>>
467
+ <input type="radio" name="activate" value="2" <?php checked( '2', get_option('niteoCS_activation', '2') ); ?> <?php disabled( '', get_option('niteoCS_status', '') ); ?>>&nbsp;<?php _e('Coming Soon & Landing Page', 'cmp-coming-soon-maintenance');?><br>
468
  <span 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-coming-soon-maintenance')?></span>
469
  </legend><br>
470
 
471
+ <legend title="maintanance" <?php echo ( $this->cmp_status() == 1 ) ? 'class="active"' : '';?>>
472
+ <input type="radio" name="activate" value="1" <?php checked( '1', get_option('niteoCS_activation', '2') ); ?> <?php disabled( '', get_option('niteoCS_status', '') ); ?>>&nbsp;<?php _e('Maintanance Mode', 'cmp-coming-soon-maintenance');?><br>
473
  <span 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-coming-soon-maintenance')?></span>
474
  </legend><br>
475
 
476
+ <legend title="maintanance" <?php echo ( $this->cmp_status() == 3 ) ? 'class="active"' : '';?>>
477
+ <input type="radio" name="activate" value="3" <?php checked( '3', get_option('niteoCS_activation', '2') ); ?> <?php disabled( '', get_option('niteoCS_status', '') ); ?>>&nbsp;<?php _e('Redirect Mode', 'cmp-coming-soon-maintenance');?><br>
478
  <span class="info redirect"><?php _e('Choose Redirect Mode if you want to redirect your website to another URL.','cmp-coming-soon-maintenance')?></span>
479
+ <div class="redirect-inputs" <?php echo ( $this->cmp_status() == 3 ) ? 'style="display: block"' : 'style="display: none"';?>>
480
+ <input type="text" id="niteoCS_URL_redirect" name="niteoCS_URL_redirect" value="<?php echo esc_url( $niteoCS_URL_redirect ); ?>" class="regular-text code"><br>
481
  <label for="niteoCS_redirect_time"><?php _e('Delay Time in Seconds', 'cmp-coming-soon-maintenance');?></label>
482
+ <input type="text" id="niteoCS_redirect_time" name="niteoCS_redirect_time" value="<?php echo esc_attr( $niteoCS_redirect_time ); ?>" class="regular-text code"><br>
483
  </div>
484
  </legend>
485
 
518
  foreach ( $this->themes_standard as $theme_slug ) {
519
 
520
  // get thumbnail
521
+ $thumbnail = plugins_url('/img/thumbnails/'. $theme_slug . '_thumbnail.jpg', __FILE__); ?>
522
 
523
  <div class="theme-wrapper<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' active'; } ?>" data-security="<?php echo esc_attr($ajax_nonce);?>" data-type="standard" data-purchased="1" data-slug="<?php echo esc_attr($theme_slug);?>">
524
  <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
575
  // build previews for premium themes
576
  foreach ( $premium_themes as $premium_theme ) {
577
  $theme_slug = $premium_theme['name'];
578
+ $thumbnail = plugins_url('/img/thumbnails/'. $theme_slug . '_thumbnail.jpg', __FILE__);
579
  // if premium theme is not in themes array, display buy button
580
  if ( !in_array( $theme_slug, $this->theme_array) ) {
581
  $purchased = 'false';
594
  }
595
  ?>
596
 
597
+ <div class="theme-wrapper<?php if ( $this->cmp_selectedTheme() == $theme_slug ) { echo ' active'; } ?> premium" data-security="<?php echo esc_attr($ajax_nonce);?>" data-slug="<?php echo esc_attr($theme_slug);?>" data-type="premium" data-purchased="<?php echo esc_attr($purchased);?>" data-slug="<?php echo esc_attr($theme_slug);?>" data-version="<?php echo esc_html($version);?>" data-remote_url="<?php echo esc_url($this->remoteServer);?>">
598
 
599
  <div class="thumbnail-holder theme-details" style="background-image:url('<?php echo esc_url( $thumbnail ); ?>')"></div>
600
 
721
  <p class="social-description"><?php _e('Click on Social Icons below to enable Social Media settings.', 'cmp-coming-soon-maintenance');?></p>
722
  <ul class="social-media">
723
  <?php
724
+ uasort( $socialmedia, array($this,'sort_social') );
 
 
 
 
 
 
 
 
 
 
 
 
 
725
 
726
  // render icons
727
  foreach ( $socialmedia as $social ) {
728
+
729
+ // push soundcloud if missing - pre version 1.13
730
+
731
  $social_active = '';
732
 
733
  if ($social['hidden'] == '0') {
734
  $social_active = 'active';
735
+ } ?>
736
+
737
  <li>
738
  <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-coming-soon-maintenance');?>" data-name="<?php echo esc_attr($social['name']);?>" aria-hidden="true"></i>
739
  </li>
950
  <th><h4><?php _e('Google Analytics Tracking ID', 'cmp-coming-soon-maintenance');?></h4></th>
951
  <td>
952
  <fieldset>
953
+ <input type="text" name="niteoCS_analytics" id="niteoCS_analytics" value="<?php echo esc_attr( $niteoCS_analytics); ?>" class="regular-text code" placeholder="UA-xxxxxx-xx">
954
  </fieldset>
955
  </td>
956
  </tr>
cmp-sidebar.php CHANGED
@@ -19,8 +19,8 @@
19
  <div class="donate widget">
20
 
21
 
22
- <h4><a href="https://niteothemes.com" target="_blank">NiteoThemes</a> <?php _e('team', 'cmp-coming-soon-maintenance');?>:</h4>
23
- <p>
24
  <img src="<?php echo plugins_url('/img/alex.jpg', __FILE__);?>" alt="Alex, NiteoThemes">
25
  <img src="<?php echo plugins_url('/img/paul.jpg', __FILE__);?>" alt="Paul, NiteoThemes">
26
  </p>
19
  <div class="donate widget">
20
 
21
 
22
+ <a href="https://niteothemes.com" target="_blank"><img src="<?php echo plugins_url('/img/niteo.png', __FILE__);?>" alt="Niteo Logo" class="niteo-logo"></a>
23
+ <p style="margin-top:0">
24
  <img src="<?php echo plugins_url('/img/alex.jpg', __FILE__);?>" alt="Alex, NiteoThemes">
25
  <img src="<?php echo plugins_url('/img/paul.jpg', __FILE__);?>" alt="Paul, NiteoThemes">
26
  </p>
css/cmp-admin-head.css CHANGED
@@ -1,13 +1,99 @@
1
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.maintenance{background:#e74c3c;}
2
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.maintenance a:hover{background:#c0392b;color:#ffffff;}
3
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon{background:#46b450;}
4
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon a:hover{background:#59dc64;color:#ffffff;}
5
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.redirect{background:#d88910;}
6
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.redirect a:hover{background:#ea9410;color:#ffffff;}
7
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.coming-soon a,
8
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.maintenance a,
9
- #wpadminbar ul li#wp-admin-bar-cs-admin-notice.redirect a {color:#ffffff;}
10
  #toplevel_page_cmp-settings img {
11
  max-width: 20px;
12
  padding-top: 6px!important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
1
+ #wpadminbar ul li#wp-admin-bar-cmp-admin-notice{background:#2c3e50;}
2
+
 
 
 
 
 
 
 
3
  #toplevel_page_cmp-settings img {
4
  max-width: 20px;
5
  padding-top: 6px!important;
6
+ }
7
+
8
+ #wpadminbar .cmp-logo {
9
+ position: absolute;
10
+ display: inline-block;
11
+ height: 20px;
12
+ padding-right: 5px;
13
+ top: 6px;
14
+ left: 7px;
15
+ }
16
+
17
+ #wpadminbar #wp-admin-bar-cmp-admin-notice a {
18
+ padding-left: 30px;
19
+ }
20
+
21
+ #wpadminbar .toggle-wrapper {
22
+ display: inline-block;
23
+ }
24
+ #wpadminbar .toggle {
25
+ cursor: pointer;
26
+ display: inline-block;
27
+ position: relative;
28
+ width: 88px;
29
+ height: 32px;
30
+ margin-top: -2px;
31
+ font-weight: 600;
32
+ background: transparent;
33
+ -webkit-transition: all 200ms ease-in-out;
34
+ transition: all 200ms ease-in-out;
35
+ border: none;
36
+ }
37
+
38
+ #wpadminbar .toggle:before, #wpadminbar .toggle:after {
39
+ position: absolute;
40
+ line-height: 32px;
41
+ font-size: 11px;
42
+ z-index: 2;
43
+ -webkit-transition: all 200ms ease-in-out;
44
+ transition: all 200ms ease-in-out;
45
+ }
46
+
47
+ #wpadminbar input[type=checkbox].toggle-checkbox {
48
+ display: none;
49
+ }
50
+
51
+ #wpadminbar .toggle_handler {
52
+ display: inline-block;
53
+ position: relative;
54
+ z-index: 1;
55
+ background: #c0392b;
56
+ width: 40px;
57
+ height: 20px;
58
+ top: 5px;
59
+ left: 5px;
60
+ -webkit-transition: all 200ms ease-in-out;
61
+ transition: all 200ms ease-in-out;
62
+ -webkit-transform: translateX(0px);
63
+ transform: translateX(0px);
64
+ }
65
+
66
+ #wpadminbar .toggle-checkbox:checked + .toggle .toggle_handler {
67
+ -webkit-transform: translateX(40px);
68
+ transform: translateX(40px);
69
+ background: #27ae60;
70
+ }
71
+
72
+ #wpadminbar .toggle-wrapper:hover .toggle_handler {
73
+ background: #e74c3c;
74
+ }
75
+
76
+ #wpadminbar .toggle-wrapper:hover .toggle-checkbox:checked + .toggle .toggle_handler {
77
+ background: #2ecc71;
78
+ }
79
+
80
+
81
+ #wpadminbar .toggle:before {
82
+ content: "OFF";
83
+ left: 15px;
84
+ color: #ffffff;
85
+ }
86
+
87
+ #wpadminbar .toggle:after {
88
+ content: "ON";
89
+ right: 16px;
90
+ color: #ffffff;
91
+ }
92
+
93
+ #wpadminbar .toggle-checkbox:checked + .toggle:before {
94
+ color: #ffffff;
95
+ }
96
+
97
+ #wpadminbar .toggle-checkbox:checked + .toggle:after {
98
+ color: #ffffff;
99
  }
css/cmp-settings-style.css CHANGED
@@ -44,10 +44,11 @@ input[type="text"], textarea{width:100%;}
44
  .cmp-status legend {
45
  width: 95%;
46
  padding: 10px;
 
47
  }
48
 
49
  .cmp-status .active {
50
- background-color: #effffc;
51
  }
52
 
53
  .redirect {
@@ -93,7 +94,7 @@ input[type="text"], textarea{width:100%;}
93
  text-align: left;
94
  }
95
 
96
- .table-wrapper h3:not(.no-icon):not(.notice-title)::after {
97
  font-family: fontAwesome;
98
  content: "\f147";
99
  position: absolute;
@@ -244,14 +245,18 @@ th label {font-weight: 600;}
244
  display: inline-block;
245
  padding: 0.5em;
246
  margin: 2em 2em 2em 0;
247
- width: calc(33.33% - 3em - 5px);
248
  text-align: center;
249
  border: 1px solid #efefef;
250
  border-radius: 6px;
251
  }
252
 
 
 
 
 
253
  .theme-wrapper.active {
254
- background-color: #effffc;
255
  }
256
 
257
  .thumbnail-holder {
@@ -347,12 +352,12 @@ th label {font-weight: 600;}
347
  .theme-wrapper .theme-select,
348
  .theme-wrapper .theme-select {
349
  float: left;
350
- background-color: #16a085;
351
  }
352
 
353
  .theme-wrapper .theme-select:hover,
354
  .theme-wrapper .theme-select:focus {
355
- background-color: #1abc9c;
356
  }
357
 
358
  .theme-wrapper .theme-details.button {
@@ -490,6 +495,101 @@ p.cmp-submit {
490
  .wp-list-table .column-id { width: 5%; }
491
 
492
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  /* SIDEBAR */
494
 
495
  .cmp-sidebar-wrapper {
@@ -515,6 +615,10 @@ p.cmp-submit {
515
  max-width: 50px;
516
  }
517
 
 
 
 
 
518
  .cmp-rate-us a,
519
  .cmp-rate-us .button {display: block;
520
  text-align:center;
@@ -539,13 +643,15 @@ p.cmp-submit {
539
  @media screen and (max-width: 1450px) {
540
  .cmp-inputs-wrapper {min-width: 70%;}
541
  .cmp-sidebar-wrapper {width: calc(30% - 2em + 7px);}
542
- .theme-wrapper { width: calc(50% - 3em - 5px);}
 
543
 
544
  }
545
 
546
 
547
  @media screen and (max-width: 1110px) {
548
- .theme-wrapper { margin-right:0;width: calc(100% - 5px);}
 
549
  .table-wrapper th {display: block;}
550
  .cmp-sidebar-wrapper .widget {padding: 1em;}
551
 
@@ -568,4 +674,5 @@ p.cmp-submit {
568
  .theme-overlay .theme-info {width:100%;float:none;}
569
 
570
  }
 
571
 
44
  .cmp-status legend {
45
  width: 95%;
46
  padding: 10px;
47
+ cursor: pointer;
48
  }
49
 
50
  .cmp-status .active {
51
+ background-color: #ddd;
52
  }
53
 
54
  .redirect {
94
  text-align: left;
95
  }
96
 
97
+ .table-wrapper h3:not(.no-icon):not(.notice-title):not(#heading-example)::after {
98
  font-family: fontAwesome;
99
  content: "\f147";
100
  position: absolute;
245
  display: inline-block;
246
  padding: 0.5em;
247
  margin: 2em 2em 2em 0;
248
+ width: calc(25% - 3em - 5px);
249
  text-align: center;
250
  border: 1px solid #efefef;
251
  border-radius: 6px;
252
  }
253
 
254
+ .theme-wrapper.premium {
255
+ width: calc(33.33% - 3em - 5px);
256
+ }
257
+
258
  .theme-wrapper.active {
259
+ background-color: #ddd;
260
  }
261
 
262
  .thumbnail-holder {
352
  .theme-wrapper .theme-select,
353
  .theme-wrapper .theme-select {
354
  float: left;
355
+ background-color: #27ae60;
356
  }
357
 
358
  .theme-wrapper .theme-select:hover,
359
  .theme-wrapper .theme-select:focus {
360
+ background-color: #2ecc71;
361
  }
362
 
363
  .theme-wrapper .theme-details.button {
495
  .wp-list-table .column-id { width: 5%; }
496
 
497
 
498
+ .cmp-status {
499
+ margin-bottom: 3em;
500
+ }
501
+ /* switch */
502
+ .toggle-wrapper {
503
+ display: inline-block;
504
+ }
505
+ .toggle {
506
+ cursor: pointer;
507
+ display: inline-block;
508
+ position: relative;
509
+ width: 200px;
510
+ height: 30px;
511
+ font-weight: 600;
512
+ background: transparent;
513
+ border: 2px solid #f1f1f1;
514
+ -webkit-transition: all 200ms ease-in-out;
515
+ transition: all 200ms ease-in-out;
516
+ border-radius: 15px;
517
+ }
518
+
519
+ .toggle:before, .toggle:after {
520
+ position: absolute;
521
+ line-height: 30px;
522
+ font-size: 14px;
523
+ z-index: 2;
524
+ -webkit-transition: all 200ms ease-in-out;
525
+ transition: all 200ms ease-in-out;
526
+ }
527
+
528
+ input[type=checkbox].toggle-checkbox {
529
+ display: none;
530
+ }
531
+
532
+ .toggle_handler {
533
+ display: inline-block;
534
+ position: relative;
535
+ z-index: 1;
536
+ background: #c0392b;
537
+ width: 90px;
538
+ height: 24px;
539
+ top: 3px;
540
+ left: 5px;
541
+ -webkit-transition: all 200ms ease-in-out;
542
+ transition: all 200ms ease-in-out;
543
+ -webkit-transform: translateX(0px);
544
+ transform: translateX(0px);
545
+ border-top-right-radius: 0;
546
+ border-bottom-right-radius: 0;
547
+ border-top-left-radius: 10px;
548
+ border-bottom-left-radius: 10px;
549
+ }
550
+
551
+ .toggle-checkbox:checked + .toggle .toggle_handler {
552
+ width: 90px;
553
+ -webkit-transform: translateX(100px);
554
+ transform: translateX(100px);
555
+ background: #27ae60;
556
+ border-top-right-radius: 10px;
557
+ border-bottom-right-radius: 10px;
558
+ border-top-left-radius: 0px;
559
+ border-bottom-left-radius: 0px;
560
+ }
561
+
562
+ .toggle-wrapper:hover .toggle_handler {
563
+ background: #e74c3c;
564
+ }
565
+
566
+ .toggle-wrapper:hover .toggle-checkbox:checked + .toggle .toggle_handler {
567
+ background: #2ecc71;
568
+ }
569
+
570
+
571
+ .toggle:before {
572
+ content: "Disabled";
573
+ left: 22px;
574
+ color: #ffffff;
575
+ }
576
+
577
+ .toggle:after {
578
+ content: "Enabled";
579
+ right: 26px;
580
+ color: #23282d;
581
+ }
582
+
583
+ .toggle-checkbox:checked + .toggle:before {
584
+ color: #23282d;
585
+ }
586
+
587
+ .toggle-checkbox:checked + .toggle:after {
588
+ color: #fff;
589
+ }
590
+
591
+
592
+
593
  /* SIDEBAR */
594
 
595
  .cmp-sidebar-wrapper {
615
  max-width: 50px;
616
  }
617
 
618
+ .widget.donate img.niteo-logo {
619
+ max-width: 120px;
620
+ }
621
+
622
  .cmp-rate-us a,
623
  .cmp-rate-us .button {display: block;
624
  text-align:center;
643
  @media screen and (max-width: 1450px) {
644
  .cmp-inputs-wrapper {min-width: 70%;}
645
  .cmp-sidebar-wrapper {width: calc(30% - 2em + 7px);}
646
+ .theme-wrapper,
647
+ .theme-wrapper.premium { width: calc(50% - 3em - 5px);}
648
 
649
  }
650
 
651
 
652
  @media screen and (max-width: 1110px) {
653
+ .theme-wrapper,
654
+ .theme-wrapper.premium { margin-right:0;width: calc(100% - 5px);}
655
  .table-wrapper th {display: block;}
656
  .cmp-sidebar-wrapper .widget {padding: 1em;}
657
 
674
  .theme-overlay .theme-info {width:100%;float:none;}
675
 
676
  }
677
+ }
678
 
css/preview-iframe.css ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html, body {
2
+ height: 100%;
3
+ margin: 0; /* Reset default margin on the body element */
4
+ font-family: 'Open Sans', 'Times New Roman', Georgia, Serif;
5
+ }
6
+
7
+ iframe {
8
+ display: block; /* iframes are inline by default */
9
+ border: none; /* Reset default border */
10
+ width: 100%;
11
+ height: 100vh;
12
+ min-height: 100%;
13
+ background-color: rgba(0, 0, 0, 0.5);
14
+ opacity: 0;
15
+ -webkit-transition: opacity 300ms ease-in-out;
16
+ transition: opacity 300ms ease-in-out;
17
+ }
18
+
19
+ iframe.loaded {
20
+ opacity: 1;
21
+ }
22
+
23
+ h3 {
24
+ text-transform: uppercase;
25
+ font-size: 0.8em;
26
+ margin-bottom: 0.5em;
27
+ }
28
+
29
+ /* scrollbar */
30
+ ::-webkit-scrollbar {
31
+ width:9px;
32
+ }
33
+ ::-webkit-scrollbar-thumb {
34
+ background:rgba(0,0,0,0.8);
35
+ border:none;
36
+ border-bottom-left-radius:0;
37
+ border-bottom-right-radius:0;
38
+ border-top-left-radius:0;
39
+ border-top-right-radius:0;
40
+ }
41
+ ::-webkit-scrollbar-track {
42
+ background:rgba(170,170,170,0.8);
43
+ }
44
+
45
+ .background-wrap {
46
+ position: fixed;
47
+ top: 0;
48
+ right: 0;
49
+ bottom: 0;
50
+ left: 0;
51
+ -webkit-animation: fadeOut 600ms forwards;
52
+ animation: fadeOut 600ms forwards;
53
+ }
54
+
55
+ .open .background-wrap {
56
+ -webkit-animation: fadeIn 600ms forwards;
57
+ animation: fadeIn 600ms forwards;
58
+ }
59
+
60
+
61
+
62
+
63
+ #preview-customize {
64
+ position: fixed;
65
+ z-index: 11000;
66
+ width: 300px;
67
+ height: 100%;
68
+ left: 100%;
69
+ top: 0;
70
+ background-color: #fff;
71
+ -webkit-transform: translate3d(0,0,0);
72
+ transform: translate3d(0,0,0);
73
+ -webkit-transition: -webkit-transform .6s;
74
+ transition: -webkit-transform .6s;
75
+ transition: transform .6s;
76
+ transition: transform .6s, -webkit-transform .6s;
77
+ }
78
+
79
+ .open #preview-customize {
80
+ -webkit-transform: translate3d(-300px,0,0);
81
+ transform: translate3d(-300px,0,0);
82
+ }
83
+
84
+ .customize-content {
85
+ padding: 20px;
86
+ padding-right: 0;
87
+ overflow-y: auto;
88
+ height: calc(100vh - 40px);
89
+ }
90
+
91
+ .thumbnail {
92
+ padding: 5px;
93
+ border: 1px solid #e0e0e0;
94
+ border-radius: 5px;
95
+ display: inline-block;
96
+ width: calc(50% - 35px);
97
+ margin-right: 20px;
98
+ margin-bottom: 20px;
99
+ text-align: center;
100
+ text-transform: uppercase;
101
+ font-weight: 600;
102
+ }
103
+
104
+ .customize-content img {
105
+ max-width: 100%;
106
+ border-radius: 5px;
107
+ vertical-align: top;
108
+ }
109
+
110
+ .panel-wrapper {
111
+ position: absolute;
112
+ top: 135px;
113
+ padding: 10px;
114
+ cursor: pointer;
115
+ background: white;
116
+ -webkit-box-shadow: -10px 0px 25px -1px rgba(0, 0, 0, 0.05);
117
+ box-shadow: -10px 0px 25px -1px rgba(0, 0, 0, 0.05);
118
+ border-top-left-radius: 3px;
119
+ border-bottom-left-radius: 3px;
120
+ -webkit-transition: -webkit-opacity .2s;
121
+ -webkit-transition: opacity .2s;
122
+ transition: opacity .2s;
123
+ }
124
+
125
+ .loaded .panel-wrapper {
126
+ -webkit-animation-name: slide-panel;
127
+ animation-name: slide-panel;
128
+ -webkit-animation-duration: 500ms;
129
+ animation-duration: 500ms;
130
+ -webkit-animation-delay: 500ms;
131
+ animation-delay: 500ms;
132
+ -webkit-animation-fill-mode: forwards;
133
+ animation-fill-mode: forwards;
134
+ }
135
+
136
+ .panel {
137
+ position: relative;
138
+ width: 50px;
139
+ height: 50px;
140
+ }
141
+
142
+
143
+
144
+ .panel:not(:last-of-type) {
145
+ border-bottom: 1px solid #f7f7f7;
146
+ }
147
+
148
+
149
+ .panel i {
150
+ position: relative;
151
+ top: 8px;
152
+ left: 13px;
153
+ color: #777;
154
+ font-size: 2em;
155
+ -webkit-transition: color 400ms ease-out;
156
+ transition: color 400ms ease-out;
157
+ }
158
+
159
+ .panel span {
160
+ font-size: 13px;
161
+ padding: 6px 14px 6px 14px;
162
+ position: absolute;
163
+ margin-right: 16px;
164
+ color: #777;
165
+ background-color: #fff;
166
+ display: inline-block;
167
+ right: 100%;
168
+ top: 0px;
169
+ border-radius: 3px;
170
+ font-weight: 600;
171
+ opacity: 0;
172
+ -webkit-transform-origin: 100% 50%;
173
+ -moz-transform-origin: 100% 50%;
174
+ -ms-transform-origin: 100% 50%;
175
+ -o-transform-origin: 100% 50%;
176
+ -webkit-transform: scale(0.5);
177
+ transform: scale(0.5);
178
+ -webkit-transition: all 100ms ease-out;
179
+ transition: all 100ms ease-out;
180
+ -webkit-box-shadow: -10px 0px 25px -1px rgba(0, 0, 0, 0.05);
181
+ box-shadow: -10px 0px 25px -1px rgba(0, 0, 0, 0.05);
182
+ }
183
+
184
+ .panel span:after {
185
+ content: "";
186
+ position: absolute;
187
+ width: 0;
188
+ height: 0;
189
+ border-color: transparent;
190
+ border-style: solid;
191
+ top: 50%;
192
+ right: -4px;
193
+ margin-top: -5px;
194
+ border-width: 5px 0 5px 5px;
195
+ border-left-color: #fff;
196
+ color: #fff;
197
+ }
198
+
199
+ .panel:hover span {
200
+ opacity: 1;
201
+ -webkit-transform: scale(1);
202
+ transform: scale(1);
203
+ }
204
+
205
+ .panel:hover i {
206
+ color: #999;
207
+ }
208
+
209
+
210
+ .purchase.free {
211
+ display: none;
212
+ }
213
+
214
+ .background-selector a,
215
+ .background-selector a:visited {
216
+ color: #777;
217
+ text-decoration: none;
218
+ }
219
+
220
+ .background-selector a:hover,
221
+ .background-selector .selected {
222
+ background: black;
223
+ color: #fff;
224
+ }
225
+
226
+ .background-selector i {
227
+ display: block;
228
+ font-size: 4em;
229
+ }
230
+
231
+ @-webkit-keyframes slide-panel{
232
+ from{left:0px}to{left:-70px}
233
+ }
234
+
235
+ @keyframes slide-panel{
236
+ from{left:0px}to{left:-70px}
237
+ }
238
+
239
+ @-webkit-keyframes fadeOut {
240
+ 0% {
241
+ background-color: rgba(0,0,0,0.4);
242
+ z-index: 1;
243
+ }
244
+ 99% {
245
+ background-color: rgba(0,0,0,0);
246
+ z-index: 1;
247
+ }
248
+ 100% {
249
+ background-color: rgba(0,0,0,0);
250
+ z-index: -1;
251
+ }
252
+ }
253
+
254
+
255
+ @keyframes fadeOut {
256
+ 0% {
257
+ background-color: rgba(0,0,0,0.4);
258
+ z-index: 1;
259
+ }
260
+ 99% {
261
+ background-color: rgba(0,0,0,0);
262
+ z-index: 1;
263
+ }
264
+ 100% {
265
+ background-color: rgba(0,0,0,0);
266
+ z-index: -1;
267
+ }
268
+ }
269
+
270
+
271
+ @-webkit-keyframes fadeIn {
272
+ 0% {
273
+ background-color: rgba(0,0,0,0);
274
+ z-index: 1;
275
+ }
276
+ 99% {
277
+ background-color: rgba(0,0,0,0.4);
278
+ z-index: 1;
279
+ }
280
+ 100% {
281
+ background-color: rgba(0,0,0,0.4);
282
+ z-index: 1;
283
+ }
284
+ }
285
+
286
+
287
+ @keyframes fadeIn {
288
+ 0% {
289
+ background-color: rgba(0,0,0,0);
290
+ z-index: 1;
291
+ }
292
+ 99% {
293
+ background-color: rgba(0,0,0,0.4);
294
+ z-index: 1;
295
+ }
296
+ 100% {
297
+ background-color: rgba(0,0,0,0.4);
298
+ z-index: 1;
299
+ }
300
+ }
img/niteo.png ADDED
Binary file
img/thumbnails/construct_thumbnail.jpg ADDED
Binary file
img/thumbnails/countdown/screenshot1.jpg CHANGED
Binary file
img/thumbnails/countdown_thumbnail.jpg ADDED
Binary file
img/thumbnails/fifty_thumbnail.jpg ADDED
Binary file
img/thumbnails/frame_thumbnail.jpg ADDED
Binary file
img/thumbnails/hardwork_premium_thumbnail.jpg ADDED
Binary file
img/thumbnails/hardwork_thumbnail.jpg ADDED
Binary file
img/thumbnails/postery_thumbnail.jpg ADDED
Binary file
inc/class-cmp-render_html.php CHANGED
@@ -9,7 +9,12 @@ class cmp_render_html extends niteo_cmp {
9
  // Render Background
10
  public function cmp_background( $niteoCS_banner, $themeslug ) {
11
  $size = $this->isMobile() ? 'large' : 'full';
12
-
 
 
 
 
 
13
  switch ( $niteoCS_banner ) {
14
  // custom media
15
  case '0':
@@ -29,6 +34,7 @@ class cmp_render_html extends niteo_cmp {
29
  $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
30
 
31
  return $html;
 
32
 
33
  case '1':
34
  // unsplash
@@ -39,21 +45,25 @@ class cmp_render_html extends niteo_cmp {
39
  case '0':
40
  $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
41
  $banner_url = $this->niteo_unsplash( $params );
 
42
 
43
  // category random
44
  case '1':
45
  $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
46
  $banner_url = $this->niteo_unsplash( $params );
 
47
 
48
  // collection
49
  case '2':
50
  $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
51
  $banner_url = $this->niteo_unsplash( $params );
 
52
 
53
  // random photo
54
  case '3':
55
  $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
56
  $banner_url = $this->niteo_unsplash( $params );
 
57
  default:
58
  break;
59
  }
@@ -63,7 +73,7 @@ class cmp_render_html extends niteo_cmp {
63
  var screenHeight = screenWidth / 1.77777;
64
  screenHeight = screenHeight.toFixed(0);
65
 
66
- var banner = \'<div id="background-image" style="background-image:url(\\\''.esc_url( $banner_url ).'\\\')"></div>\';
67
  banner = banner.replace("WIDTHxHEIGHT", screenWidth + "x" + screenHeight);
68
  var container = document.getElementById("background-wrapper");
69
 
@@ -76,6 +86,7 @@ class cmp_render_html extends niteo_cmp {
76
  </script>';
77
 
78
  return $html;
 
79
 
80
  case '2':
81
  // default image
@@ -83,6 +94,7 @@ class cmp_render_html extends niteo_cmp {
83
  $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
84
 
85
  return $html;
 
86
 
87
  case '3':
88
  // Pattern
@@ -101,6 +113,7 @@ class cmp_render_html extends niteo_cmp {
101
  $html = '<div id="background-image" class="pattern" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
102
 
103
  return $html;
 
104
 
105
  case '4':
106
  // Color
@@ -108,11 +121,13 @@ class cmp_render_html extends niteo_cmp {
108
  $html ='<div id="background-image" class="color" style="background-color:'.esc_url( $color ).'"></div>';
109
 
110
  return $html;
 
111
 
112
  case '5':
113
  $html = '<div id="player" class="video-banner"></div>';
114
 
115
  return $html;
 
116
 
117
  case '6':
118
  // Gradient
@@ -131,6 +146,7 @@ class cmp_render_html extends niteo_cmp {
131
  $html = '<div id="background-image" class="gradient" style="background:-moz-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:-webkit-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:linear-gradient(135deg,'.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%)"></div>';
132
 
133
  return $html;
 
134
 
135
  default:
136
  break;
@@ -139,6 +155,16 @@ class cmp_render_html extends niteo_cmp {
139
 
140
  // render slider
141
  public function cmp_slider( $themeslug ) {
 
 
 
 
 
 
 
 
 
 
142
  $size = $this->isMobile() ? 'large' : 'full'; ?>
143
  <div id="slider-wrapper">
144
  <div id="slider">
@@ -147,7 +173,9 @@ class cmp_render_html extends niteo_cmp {
147
  $slider_count = get_option('niteoCS_slider_count['.$themeslug.']', '3');
148
  $slider_fade = get_option('niteoCS_slider_effect['.$themeslug.']', 'false');
149
  $slider_auto = get_option('niteoCS_slider_auto['.$themeslug.']', '1');
 
150
  switch ( $niteoCS_banner ) {
 
151
  // custom media
152
  case '0':
153
  $banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
@@ -174,22 +202,24 @@ class cmp_render_html extends niteo_cmp {
174
  case '1':
175
  // unsplash feed
176
  $unplash_feed = get_option('niteoCS_unsplash_feed['.$themeslug.']', '0');
 
177
  switch ( $unplash_feed ) {
178
  // SINGLE IMAGE
179
  case '0':
180
  $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
181
-
182
  // category random
183
  case '1':
184
  $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
185
-
186
  // collection
187
  case '2':
188
  $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
189
-
190
  // random photo
191
  case '3':
192
  $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
 
193
  default:
194
  break;
195
  } ?>
@@ -252,58 +282,40 @@ class cmp_render_html extends niteo_cmp {
252
  // render Social Icons
253
  public function cmp_social_icons( ) {
254
  // migrade social media to new option after update 1.4.0
255
- if ( !get_option('niteoCS_socialmedia') ) {
256
- $social_media = array('facebook', 'google-plus', 'twitter', 'instagram', 'skype', '500px', 'deviantart', 'behance', 'dribbble', 'pinterest', 'linkedin', 'tumblr', 'youtube', 'vimeo', 'flickr', 'vk','envelope-o');
257
- $i = 0;
258
- $new_socials = array();
259
- foreach ( $social_media as $social ) {
260
-
261
- $social_field = get_option('niteoCS_'.$social);
262
 
263
- $new_socials[$i]['name'] = $social;
264
- $new_socials[$i]['url'] = $social_field;
265
- $new_socials[$i]['active'] = '1';
266
- $new_socials[$i]['hidden'] = $social_field ? '0' : '1';
267
- $new_socials[$i]['order'] = $i;
268
- $i++;
269
-
270
- }
271
-
272
- $socialmedia = $new_socials;
273
-
274
- } else {
275
  $socialmedia = stripslashes( get_option('niteoCS_socialmedia') );
276
  $socialmedia = json_decode( $socialmedia, true );
277
- }
 
278
 
279
- //sort social icons array by hidden, then order key
280
- uasort( $socialmedia , array($this,'sort_social') );
281
 
282
- $html = '<ul class="social-list">';
283
 
284
- ob_start();
285
 
286
- foreach ( $socialmedia as $social ) {
 
 
 
287
 
288
- if ( $social['hidden'] == '0' && $social['active'] == '1') {
289
-
290
- if ( $social['name'] == 'envelope-o' ) {
291
- echo '<li><a href="mailto:'.antispambot(esc_html($social['url'])).'" target="_blank"><i class="fa fa-'.$social['name'].'" aria-hidden="true"></i></a></li>';
292
-
293
- } else {
294
- echo '<li><a href="'.esc_url($social['url']).'" target="top"><i class="fa fa-'.$social['name'].'" aria-hidden="true"></i></a></li>';
295
  }
296
- }
297
- }
298
 
299
- $social_list = ob_get_clean();
300
 
301
- if ( $social_list != '' ) {
302
- return $html.$social_list.'</ul>';
303
 
304
- } else {
305
- return;
306
- }
 
 
307
  }
308
 
309
  // Render Logo
@@ -338,7 +350,9 @@ class cmp_render_html extends niteo_cmp {
338
 
339
  // Render Javascripts
340
  public function cmp_javascripts( $background, $themeslug ) {
341
-
 
 
342
  // if video background ini vidim background player
343
  if ( $background == 5 ) { ?>
344
 
9
  // Render Background
10
  public function cmp_background( $niteoCS_banner, $themeslug ) {
11
  $size = $this->isMobile() ? 'large' : 'full';
12
+
13
+ // change background if preview background is set
14
+ if ( isset($_GET['background']) && is_numeric($_GET['background']) ) {
15
+ $niteoCS_banner = esc_attr($_GET['background']);
16
+ }
17
+
18
  switch ( $niteoCS_banner ) {
19
  // custom media
20
  case '0':
34
  $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
35
 
36
  return $html;
37
+ break;
38
 
39
  case '1':
40
  // unsplash
45
  case '0':
46
  $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
47
  $banner_url = $this->niteo_unsplash( $params );
48
+ break;
49
 
50
  // category random
51
  case '1':
52
  $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
53
  $banner_url = $this->niteo_unsplash( $params );
54
+ break;
55
 
56
  // collection
57
  case '2':
58
  $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
59
  $banner_url = $this->niteo_unsplash( $params );
60
+ break;
61
 
62
  // random photo
63
  case '3':
64
  $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
65
  $banner_url = $this->niteo_unsplash( $params );
66
+ break;
67
  default:
68
  break;
69
  }
73
  var screenHeight = screenWidth / 1.77777;
74
  screenHeight = screenHeight.toFixed(0);
75
 
76
+ var banner = \'<div id="background-image" class="image" style="background-image:url(\\\''.esc_url( $banner_url ).'\\\')"></div>\';
77
  banner = banner.replace("WIDTHxHEIGHT", screenWidth + "x" + screenHeight);
78
  var container = document.getElementById("background-wrapper");
79
 
86
  </script>';
87
 
88
  return $html;
89
+ break;
90
 
91
  case '2':
92
  // default image
94
  $html = '<div id="background-image" class="image" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
95
 
96
  return $html;
97
+ break;
98
 
99
  case '3':
100
  // Pattern
113
  $html = '<div id="background-image" class="pattern" style="background-image:url(\''.esc_url( $banner_url ).'\')"></div>';
114
 
115
  return $html;
116
+ break;
117
 
118
  case '4':
119
  // Color
121
  $html ='<div id="background-image" class="color" style="background-color:'.esc_url( $color ).'"></div>';
122
 
123
  return $html;
124
+ break;
125
 
126
  case '5':
127
  $html = '<div id="player" class="video-banner"></div>';
128
 
129
  return $html;
130
+ break;
131
 
132
  case '6':
133
  // Gradient
146
  $html = '<div id="background-image" class="gradient" style="background:-moz-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:-webkit-linear-gradient(-45deg, '.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%);background:linear-gradient(135deg,'.esc_attr( $niteoCS_gradient_one ).' 0%, '.esc_attr( $niteoCS_gradient_two ).' 100%)"></div>';
147
 
148
  return $html;
149
+ break;
150
 
151
  default:
152
  break;
155
 
156
  // render slider
157
  public function cmp_slider( $themeslug ) {
158
+
159
+ // change background if preview background is set
160
+ if ( isset($_GET['background']) && is_numeric($_GET['background']) ) {
161
+ if ( $_GET['background'] != 1 ) {
162
+ $this->cmp_background($_GET['background'], $themeslug);
163
+ return;
164
+ }
165
+
166
+ }
167
+
168
  $size = $this->isMobile() ? 'large' : 'full'; ?>
169
  <div id="slider-wrapper">
170
  <div id="slider">
173
  $slider_count = get_option('niteoCS_slider_count['.$themeslug.']', '3');
174
  $slider_fade = get_option('niteoCS_slider_effect['.$themeslug.']', 'false');
175
  $slider_auto = get_option('niteoCS_slider_auto['.$themeslug.']', '1');
176
+
177
  switch ( $niteoCS_banner ) {
178
+
179
  // custom media
180
  case '0':
181
  $banner_id = get_option('niteoCS_banner_id['.$themeslug.']');
202
  case '1':
203
  // unsplash feed
204
  $unplash_feed = get_option('niteoCS_unsplash_feed['.$themeslug.']', '0');
205
+
206
  switch ( $unplash_feed ) {
207
  // SINGLE IMAGE
208
  case '0':
209
  $params = array('feed' => '0', 'url' => get_option('niteoCS_unsplash_0['.$themeslug.']', '') );
210
+ break;
211
  // category random
212
  case '1':
213
  $params = array('feed' => '1', 'cat' => get_option('niteoCS_unsplash_category['.$themeslug.']'), 'custom_str' => get_option('niteoCS_cat_keyword['.$themeslug.']', '') );
214
+ break;
215
  // collection
216
  case '2':
217
  $params = array('feed' => '2', 'url' => get_option('niteoCS_unsplash_2['.$themeslug.']', '') );
218
+ break;
219
  // random photo
220
  case '3':
221
  $params = array('feed' => '3', 'url' => get_option('niteoCS_unsplash_3['.$themeslug.']', ''), 'cat' => get_option('niteoCS_unsplash_feat['.$themeslug.']', '0') );
222
+ break;
223
  default:
224
  break;
225
  } ?>
282
  // render Social Icons
283
  public function cmp_social_icons( ) {
284
  // migrade social media to new option after update 1.4.0
285
+ if ( get_option('niteoCS_socialmedia') ) {
 
 
 
 
 
 
286
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  $socialmedia = stripslashes( get_option('niteoCS_socialmedia') );
288
  $socialmedia = json_decode( $socialmedia, true );
289
+ //sort social icons array by hidden, then order key
290
+ uasort( $socialmedia , array($this,'sort_social') );
291
 
292
+ $html = '<ul class="social-list">';
 
293
 
294
+ ob_start();
295
 
296
+ foreach ( $socialmedia as $social ) {
297
 
298
+ if ( $social['hidden'] == '0' && $social['active'] == '1') {
299
+
300
+ if ( $social['name'] == 'envelope-o' ) {
301
+ echo '<li><a href="mailto:'.antispambot(esc_html($social['url'])).'" target="_blank"><i class="fa fa-'.$social['name'].'" aria-hidden="true"></i></a></li>';
302
 
303
+ } else {
304
+ echo '<li><a href="'.esc_url($social['url']).'" target="top"><i class="fa fa-'.$social['name'].'" aria-hidden="true"></i></a></li>';
305
+ }
 
 
 
 
306
  }
307
+ }
 
308
 
309
+ $social_list = ob_get_clean();
310
 
311
+ if ( $social_list != '' ) {
312
+ return $html.$social_list.'</ul>';
313
 
314
+ }
315
+ }
316
+
317
+ return;
318
+
319
  }
320
 
321
  // Render Logo
350
 
351
  // Render Javascripts
352
  public function cmp_javascripts( $background, $themeslug ) {
353
+ if ( isset($_GET['background']) && is_numeric($_GET['background']) ) {
354
+ $background = esc_attr($_GET['background']);
355
+ }
356
  // if video background ini vidim background player
357
  if ( $background == 5 ) { ?>
358
 
inc/preview-iframe.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+
3
+ <html <?php language_attributes(); ?>>
4
+ <head>
5
+ <meta charset="<?php bloginfo( 'charset' ); ?>">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+
8
+ <?php
9
+ $background = '';
10
+ $theme_name = '';
11
+ $theme_slug = '';
12
+ $buy = false;
13
+ $buy_url = '#free';
14
+ $premium_themes = $this->cmp_plugin_premium();
15
+
16
+ if ( isset($_GET['theme']) ) {
17
+ $theme_slug = esc_attr($_GET['theme']);
18
+ $theme_name = str_replace('_', ' ', ucwords($theme_slug));
19
+ $theme_var = '&theme='.esc_attr($_GET['theme']);
20
+ } else {
21
+
22
+ $theme_slug = 'hardwork';
23
+ $theme_name = 'Hardwork';
24
+ $theme_var = '&theme=hardwork';
25
+ }
26
+
27
+
28
+
29
+ if ( isset($_GET['background']) && is_numeric($_GET['background'])) {
30
+ $background = $_GET['background'];
31
+ $background_attr = '&background='.esc_attr($_GET['background']);
32
+ }
33
+
34
+ // get buy URL if premium Theme
35
+ if ( $this->niteo_in_array_r($theme_slug, $premium_themes) ) {
36
+ $buy = true;
37
+ foreach ($premium_themes as $premium) {
38
+
39
+ if ( $premium['name'] == $theme_slug ) {
40
+ $buy_url = $premium['url'];
41
+ break;
42
+ }
43
+ }
44
+ } ?>
45
+ <!-- SEO -->
46
+ <meta name="description" content="">
47
+ <title><?php echo esc_html( $theme_name ) .' '. __('Preview', 'cmp-coming-soon-maintenance');?></title>
48
+
49
+ <?php wp_site_icon(); ?>
50
+
51
+
52
+ <link rel="stylesheet" href="<?php echo plugin_dir_url( dirname( __FILE__ ) ) .'/css/preview-iframe.css?ver='.esc_attr( $this->version ) ;?>" type="text/css" media="all">
53
+
54
+ <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
55
+
56
+ <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet">
57
+ <script>
58
+
59
+ </script>
60
+ </head>
61
+
62
+
63
+ <body id="body">
64
+
65
+ <div class="background-wrap"></div>
66
+
67
+ <div id="preview-customize">
68
+ <div class="panel-wrapper">
69
+ <div class="panel open">
70
+ <a href="#">
71
+ <i class="ion ion-levels" aria-hidden="true"></i>
72
+ <span><?php _e('Quick Options', 'cmp-coming-soon-maintenance');?></span>
73
+ </a>
74
+ </div>
75
+
76
+ <div class="panel contact">
77
+ <a href="mailto:<?php echo antispambot('info@niteothemes.com');?>">
78
+ <i class="ion ion-ios-email" aria-hidden="true"></i>
79
+ <span><?php _e('Ask Question', 'cmp-coming-soon-maintenance');?></span>
80
+ </a>
81
+ </div>
82
+
83
+ <div class="panel support">
84
+ <a href="https://wordpress.org/support/plugin/cmp-coming-soon-maintenance" target="_blank">
85
+ <i class="ion ion-help-buoy" aria-hidden="true"></i>
86
+ <span><?php _e('Get Support', 'cmp-coming-soon-maintenance');?></span>
87
+ </a>
88
+ </div>
89
+
90
+ <div class="panel purchase <?php echo ($buy == true) ? 'premium' : 'free';?>">
91
+ <a href="<?php echo esc_url($buy_url);?>" target="_blank">
92
+ <i class="ion ion-ios-cart" aria-hidden="true"></i>
93
+ <span><?php _e('Purchase Theme', 'cmp-coming-soon-maintenance');?></span>
94
+ </a>
95
+ </div>
96
+
97
+ <div class="panel homepage">
98
+ <a href="https://niteothemes.com" target="_blank">
99
+ <i class="ion ion-ios-home" aria-hidden="true"></i>
100
+ <span><?php _e('Visit NiteoThemes', 'cmp-coming-soon-maintenance');?></span>
101
+ </a>
102
+ </div>
103
+ </div>
104
+
105
+ <div class="customize-content">
106
+
107
+ <div class="background-selector">
108
+ <h3><?php _e('Background', 'cmp-coming-soon-maintenance');?></h3>
109
+
110
+ <a href="<?php echo esc_url( get_site_url() ) . '/?cmp_preview=true&selector=true&theme='.esc_attr( $theme_slug );?>&background=1" class="thumbnail" data-background="1"><i class="ion ion-image" aria-hidden="true"></i><?php _e('Image', 'cmp-coming-soon-maintenance');?></a>
111
+
112
+ <a href="<?php echo esc_url( get_site_url() ) . '/?cmp_preview=true&selector=true&theme='.esc_attr( $theme_slug );?>&background=5" class="thumbnail" data-background="5"><i class="ion ion-film-marker" aria-hidden="true"></i><?php _e('Video', 'cmp-coming-soon-maintenance');?></a>
113
+
114
+ <a href="<?php echo esc_url( get_site_url() ) . '/?cmp_preview=true&selector=true&theme='.esc_attr( $theme_slug );?>&background=3" class="thumbnail" data-background="3"><i class="ion ion-grid" aria-hidden="true"></i><?php _e('Pattern', 'cmp-coming-soon-maintenance');?></a>
115
+
116
+ <a href="<?php echo esc_url( get_site_url() ) . '/?cmp_preview=true&selector=true&theme='.esc_attr( $theme_slug );?>&background=6" class="thumbnail" data-background="6"><i class="ion ion-android-color-palette" aria-hidden="true"></i><?php _e('Gradient', 'cmp-coming-soon-maintenance');?></a>
117
+
118
+ <a href="<?php echo esc_url( get_site_url() ) . '/?cmp_preview=true&selector=true&theme='.esc_attr( $theme_slug );?>&background=4" class="thumbnail" data-background="4"><i class="ion ion-paintbucket" aria-hidden="true"></i><?php _e('Color', 'cmp-coming-soon-maintenance');?></a>
119
+
120
+ </div>
121
+ <div class="theme-selector">
122
+ <h3><?php _e('Theme', 'cmp-coming-soon-maintenance');?><span class="theme-name"></span></h3>
123
+ <?php
124
+ foreach ( $this->theme_array as $slug ) {
125
+ $title = str_replace('_', ' ', ucwords($slug));
126
+ echo '<a href="'.esc_url( get_site_url() ) . '/?cmp_preview=true&selector=true&theme='.esc_attr( $slug ).esc_attr( $background_attr ).'" class="thumbnail" data-name="'.$title.'" data-slug="'.$slug.'">';
127
+ echo '<img src="'.plugin_dir_url( dirname( __FILE__ ) ) .'img/thumbnails/'.$slug.'_thumbnail.jpg" alt="CMP '.$title.'">';
128
+ echo '</a>';
129
+ } ?>
130
+ </div>
131
+ </div>
132
+ </div>
133
+
134
+ <iframe src="<?php echo esc_url( get_site_url() ) . '/?cmp_preview=true'.esc_attr( $theme_var ).esc_attr( $background_attr );?>" id="theme-preview" frameborder="0" data-slug="<?php echo esc_attr($theme_slug);?>" data-background="<?php echo esc_attr($background);?>" data-premium='<?php echo json_encode($premium_themes);?>'></iframe>
135
+
136
+ </body>
137
+
138
+ <script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js'></script>
139
+ <script type="text/javascript" src="<?php echo plugin_dir_url( dirname( __FILE__ ) ) .'/js/preview-iframe.js?ver='.esc_attr( $this->version ) ;?>"></script>
140
+ </html>
js/cmp-admin-head.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){
2
+
3
+ // toggle cmp activation via menu bar ajax
4
+ jQuery('#cmp-status-menubar').click(function() {
5
+ var security = jQuery(this).data('security');
6
+ var data = {
7
+ action: 'cmp_toggle_activation',
8
+ security: security,
9
+ payload: 'toggle_cmp_status'
10
+ };
11
+
12
+
13
+ $.post(ajaxurl, data, function(response) {
14
+ if (response == 'success') {
15
+ jQuery('.cmp-status input[type=radio]').prop("disabled", (_, val) => !val);
16
+ jQuery('#cmp-status').prop("checked", (_, val) => !val);
17
+
18
+ }
19
+ });
20
+
21
+ });
22
+ });
js/preview-iframe.js ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ $( document ).ready(function() {
3
+ var timeout;
4
+ var slug;
5
+ var premium = $('#theme-preview').data('premium');
6
+
7
+ $('iframe').one('load', function() {
8
+ $('body').addClass('loaded');
9
+ });
10
+
11
+ $('iframe').on('load', function() {
12
+ // resizeIframe(this);
13
+ $(this).addClass('loaded');
14
+ });
15
+
16
+ $('.panel.open').click(function(e){
17
+ e.preventDefault();
18
+ $('body').toggleClass('open');
19
+ });
20
+
21
+ $('.background-wrap').click(function(e){
22
+ $('body').removeClass('open');
23
+ });
24
+
25
+ $('.theme-selector .thumbnail').click(function(e){
26
+ e.preventDefault();
27
+ new_url = $(this).attr('href');
28
+ iframe_url = new_url.replace('&selector=true', '');
29
+ orig_slug = $('#theme-preview').data('slug');
30
+ slug = $(this).data('slug');
31
+ name = $(this).data('name');
32
+ $('body').removeClass('open');
33
+
34
+ $('#theme-preview').removeClass('loaded');
35
+ // reload iframe
36
+ $('#theme-preview').attr('src', iframe_url);
37
+ ChangeUrl(new_url, new_url);
38
+ // process premium / free themes
39
+ $('.purchase').removeClass('premium').addClass('free');
40
+
41
+ for (var i = 0, len = premium.length; i < len; i++) {
42
+
43
+ if ( premium[i].name == slug ) {
44
+ $('.purchase').removeClass('free').addClass('premium');
45
+ $('.purchase a').attr('href', premium[i].url);
46
+ break;
47
+ }
48
+ }
49
+ // change href src to new theme
50
+ $('#theme-preview').data('slug', slug);
51
+
52
+ $('.background-selector a').each(function(){
53
+ href = $(this).attr('href');
54
+ href = href.replace('theme='+orig_slug, 'theme='+slug);
55
+ $(this).attr('href', href).removeClass('selected');
56
+ });
57
+
58
+ $('.background-selector a').first().addClass('selected');
59
+
60
+ // change browser url
61
+ $(document).prop('title', name + ' Preview');
62
+
63
+
64
+
65
+ });
66
+
67
+ $('.background-selector a').click(function(e){
68
+ e.preventDefault();
69
+ new_url = $(this).attr('href');
70
+ iframe_url = new_url.replace('&selector=true', '');
71
+ orig_background = $('#theme-preview').data('background');
72
+ new_background = $(this).data('background');
73
+ $('#theme-preview').removeClass('loaded');
74
+ $('body').removeClass('open');
75
+ $('.background-selector a').removeClass('selected');
76
+ $(this).addClass('selected');
77
+
78
+ // reload iframe
79
+ $('#theme-preview').attr('src', iframe_url);
80
+ ChangeUrl(new_url, new_url);
81
+
82
+ // change href src to new background
83
+ $('#theme-preview').data('background', new_background);
84
+ $('.theme-selector a').each(function(){
85
+ href = $(this).attr('href');
86
+ if ( orig_background != '' ) {
87
+ href = href.replace('background='+orig_background, 'background='+new_background);
88
+ } else {
89
+ href = href + '&background=' + new_background;
90
+ }
91
+
92
+ $(this).attr('href', href).removeClass('selected');
93
+ });
94
+
95
+ });
96
+
97
+
98
+ $('.theme-selector .thumbnail').on( "mouseenter", function() {
99
+ clearTimeout(timeout);
100
+ $('.theme-name').text(': ' + $(this).data('name'));
101
+ })
102
+ .on( "mouseleave", function() {
103
+ timeout = setTimeout(function(){
104
+ $('.theme-name').text('');
105
+ },100);
106
+
107
+ });
108
+
109
+ function resizeIframe(obj) {
110
+ obj.style.height = 0;
111
+ obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
112
+ }
113
+
114
+ function ChangeUrl(page, url) {
115
+ if (typeof (window.parent.history.pushState) != "undefined") {
116
+ var obj = { Page: page, Url: url };
117
+ window.parent.history.pushState(obj, obj.Page, obj.Url);
118
+ } else {
119
+ return;
120
+ }
121
+ }
122
+
123
+ });
124
+
125
+
js/settings.js CHANGED
@@ -40,20 +40,38 @@ jQuery(document).ready(function($){
40
  document.location.hash = tab;
41
  });
42
 
43
- // Make clickable status radio buttons
44
- jQuery('.cmp-status legend').click(function(){
45
- var $children = jQuery(this).children('input');
46
- $children.prop("checked", true);
47
- jQuery('.cmp-status legend').removeClass('active');
48
- jQuery(this).addClass('active');
49
- $children.trigger('change');
50
- if ( $children.val() == '3' ) {
51
- jQuery('.redirect-inputs').fadeIn('fast');
52
- } else {
53
- jQuery('.redirect-inputs').fadeOut('fast');
54
- }
55
  });
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  // expandable tabs
58
  jQuery('.table-wrapper h3').click(function(){
59
  jQuery(this).parent().toggleClass('closed');
@@ -939,7 +957,6 @@ jQuery(document).ready(function($){
939
 
940
  }
941
  // update hidden input with media id and trigger change
942
- console.log(imgID);
943
  jQuery('#niteoCS-'+name+'-id').val( imgID).trigger('change');
944
 
945
  })
40
  document.location.hash = tab;
41
  });
42
 
43
+
44
+ jQuery('#cmp-status').click(function(){
45
+ jQuery('.cmp-status input[type=radio]').prop("disabled", (_, val) => !val);
46
+ jQuery('#cmp-status-menubar').prop("checked", (_, val) => !val);
 
 
 
 
 
 
 
 
47
  });
48
 
49
+
50
+ cmp_status_inputs();
51
+
52
+ function cmp_status_inputs() {
53
+
54
+ // Make clickable status radio buttons
55
+ jQuery('.cmp-status legend:not(.disabled)').click(function(){
56
+ if ( jQuery('#cmp-status').prop('checked') == false ) {
57
+ return;
58
+ }
59
+ var $children = jQuery(this).children('input');
60
+ $children.prop("checked", true);
61
+ jQuery('.cmp-status legend').removeClass('active');
62
+ jQuery(this).addClass('active');
63
+
64
+ $children.trigger('change');
65
+
66
+ if ( $children.val() == '3' ) {
67
+ jQuery('.redirect-inputs').fadeIn('fast');
68
+ } else {
69
+ jQuery('.redirect-inputs').fadeOut('fast');
70
+ }
71
+ });
72
+ }
73
+
74
+
75
  // expandable tabs
76
  jQuery('.table-wrapper h3').click(function(){
77
  jQuery(this).parent().toggleClass('closed');
957
 
958
  }
959
  // update hidden input with media id and trigger change
 
960
  jQuery('#niteoCS-'+name+'-id').val( imgID).trigger('change');
961
 
962
  })
js/settings.min.js CHANGED
@@ -1 +1,35 @@
1
- jQuery(document).ready(function(e){function t(e){return(e+"").replace(/^([a-z])|\s+([a-z])/g,function(e){return e.toUpperCase()})}function a(e){return(e+"").toLowerCase()}function s(e,t,a){var s,n=jQuery("."+e+"-wrapper"),i=jQuery("#add-"+e),o=jQuery("#delete-"+e),r="",c=e.replace("-"," ");c=c[0].toUpperCase()+c.slice(1),""!=jQuery("#niteoCS-"+e+"-id").val()&&o.css("display","block"),i.click(function(i){if(i.preventDefault(),u)u.open();else{var u=wp.media({title:"Select "+c,button:{text:"Insert "+c},multiple:t,library:{type:[a]}}).on("select",function(){var t=u.state().get("selection").toJSON();t.length>0&&(n.empty(),jQuery(t).each(function(a){s=t[a].sizes&&t[a].sizes.large?t[a].sizes.large.url:t[a].url,r+=(0===a?"":",")+t[a].id,"pattern"==e?n.css("background-image","url('"+s+"')"):"video"==e?n.append('<video width="600" height="400" controls><source src="'+s+'" type="video/mp4">Your browser does not support the video tag.</video>'):n.append('<img src="'+s+'" alt="" style="max-width:588px"/>')}),o.css("display","block")),console.log(r),jQuery("#niteoCS-"+e+"-id").val(r).trigger("change")}).open();"pattern"==e&&n.css("background-image","url('"+s+"')")}}),o.click(function(t){jQuery(this).css("display","none"),n.empty(),jQuery("#niteoCS-"+e+"-id").val(""),jQuery("#niteoCS-"+e+"-id").trigger("change")})}var n=document.location.hash.substring(1),i=jQuery("#csoptions").attr("action");navtab=function(e){jQuery(".nav-tab-wrapper .nav-tab").removeClass("nav-tab-active"),jQuery(".nav-tab-wrapper ."+e).addClass("nav-tab-active"),jQuery(".table-wrapper."+e).css("display","block"),jQuery(".comingsoon."+e).css("display","block"),jQuery(".table-wrapper:not(."+e+")").css("display","none"),jQuery(".comingsoon:not(."+e+")").css("display","none"),"install"==e?(jQuery(".submit").css("display","none"),jQuery("#csoptions").attr("action",i)):(jQuery(".submit").css("display","block"),jQuery("#csoptions").attr("action",i+"#"+e))},""!=n&&navtab(n),window.onhashchange=function(){n=document.location.hash.substring(1),navtab(n)},e(".nav-tab:not(.theme-preview)").click(function(t){t.preventDefault(),n=e(this).data("tab"),document.location.hash=n}),jQuery(".cmp-status legend").click(function(){var e=jQuery(this).children("input");e.prop("checked",!0),jQuery(".cmp-status legend").removeClass("active"),jQuery(this).addClass("active"),e.trigger("change"),"3"==e.val()?jQuery(".redirect-inputs").fadeIn("fast"):jQuery(".redirect-inputs").fadeOut("fast")}),jQuery(".table-wrapper h3").click(function(){jQuery(this).parent().toggleClass("closed")}),jQuery(".niteoCS-logo-type").change(function(){"text"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","block"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","none")):"graphic"==jQuery(".niteoCS-logo-type:checked").val()?(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","block"),jQuery(".disabled-logo").css("display","none")):"disabled"==jQuery(".niteoCS-logo-type:checked").val()&&(jQuery(".text-logo").css("display","none"),jQuery(".graphic-logo").css("display","none"),jQuery(".disabled-logo").css("display","block"))}),jQuery("#test-unsplash").click(function(t){t.preventDefault();var a=jQuery("#unsplash-media"),s=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),n="",i="",o="",r=jQuery(this).data("security");switch(s){case"0":n=jQuery("#niteoCS-unsplash-0").val();break;case"1":n=jQuery("#niteoCS-unsplash-1").val(),i=jQuery('#unsplash_banner select[name^="unsplash_category"] option:selected').val(),o=jQuery("#niteoCS-category-keyword").val();break;case"2":n=jQuery("#niteoCS-unsplash-2").val();break;case"3":n=jQuery("#niteoCS-unsplash-3").val(),i=jQuery("#niteoCS_unsplash_feat").is(":checked")?"1":"0"}var c={feed:s,url:n,cat:i,custom_str:o};jQuery(this).prop("disabled",!0),jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>'),a.html("");var u={action:"niteo_unsplash",security:r,params:c};e.post(ajaxurl,u,function(e){jQuery("#unsplash_img").remove(),img_url=e.replace("WIDTHxHEIGHT","588x330");var t=setTimeout(function(){jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Test Again"),jQuery("#unsplash-media").html('<p>It seems <a href="http://source.unsplash.com" target="_blank">source.unsplash.com</a> is not responding. Please try again later.')},5e3);jQuery("<img />",{src:img_url,id:"unsplash_img"}).one("load",function(){jQuery(this).appendTo(a),jQuery(this).fadeIn(),jQuery("#test-unsplash").prop("disabled",!1),jQuery("#test-unsplash").text("Test Unsplash"),clearTimeout(t)})})}),videoPreview=function(){var t=e(".banner-video-source").val();if(e(".video-wrapper").css("padding-top","0"),"YouTube"==t){var a=e("#niteoCS-youtube-url").val();if(a.match(/(youtube.com)/))var s="v=",n=1;if(a.match(/(youtu.be)/)||a.match(/(vimeo.com\/)+[0-9]/))var s="/",n=3;if("vimeo"==t&&(a=e("#niteoCS-vimeo-url").val()).match(/(vimeo.com\/)+[a-zA-Z]/))var s="/",n=5;if(a){var i=a.split(s)[n];if(void 0!=i){var o=i.replace(/(&)+(.*)/,"");if("banner_youtube"==t&&a.match(/(youtu.be)/)||a.match(/(youtube.com)/))r="https://www.youtube.com/embed/"+o+"?autoplay=0";if("banner_vimeo"==t&&a.match(/(vimeo.com\/)+[0-9]/)||a.match(/(vimeo.com\/)+[a-zA-Z]/))var r="https://player.vimeo.com/video/"+o+"?autoplay=0";var c=e('<iframe src="'+r+'" allowfullscreen></iframe>');e(".video-wrapper").html(c);var u=c.height()/c.width()*100;c.css("position","absolute"),c.css("top","0"),c.css("left","0"),c.css("width","100%"),c.css("height","100%"),e(".video-wrapper").css("padding-top",u+"%"),e("#niteoCS-vimeo-url").css("border","1px solid #ddd"),e("#niteoCS-youtube-url").css("border","1px solid #ddd")}else e(".video-wrapper").text("Please enter correct "+t+" URL.").css("padding-top","0"),e("#niteoCS-vimeo-url").css("border","1px solid #d60000"),e("#niteoCS-youtube-url").css("border","1px solid #d60000")}else e(".video-wrapper").text("Please enter "+t+" URL.").css("padding-top","0"),e("#niteoCS-vimeo-url").css("border","1px solid #d60000"),e("#niteoCS-youtube-url").css("border","1px solid #d60000")}if("video/mp4"==t){var l=jQuery("#niteoCS-video-id").data("url");""!=l&&e(".video-wrapper").html('<video width="600" height="400" controls><source src="'+l+'" type="video/mp4">Your browser does not support the video tag.</video>')}},jQuery("#niteoCS-youtube-url").keyup(function(){videoPreview()}),jQuery("#csoptions .banner-video-source").change(function(){switch(jQuery("#csoptions .banner-video-source").val()){case"YouTube":jQuery(".youtube-source-input").css("display","block"),jQuery(".vimeo-source-input").css("display","none"),jQuery(".file-source-input").css("display","none");break;case"vimeo":jQuery(".youtube-source-input").css("display","none"),jQuery(".vimeo-source-input").css("display","block"),jQuery(".file-source-input").css("display","none");break;case"video/mp4":jQuery(".youtube-source-input").css("display","none"),jQuery(".vimeo-source-input").css("display","none"),jQuery(".file-source-input").css("display","block");break;default:jQuery(".file-source-input").css("display","block"),jQuery(".youtube-source-input").css("display","none"),jQuery(".vimeo-source-input").css("display","none")}videoPreview()}),jQuery("#csoptions .banner-video-source").trigger("change"),jQuery("#csoptions .niteoCS_banner").change(function(){switch(jQuery("#csoptions .niteoCS_banner:checked").val()){case"0":jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none");break;case"1":jQuery("#unsplash_banner").css("display","block"),jQuery(".theme_background fieldset:not(#unsplash_banner)").css("display","none");break;case"2":jQuery("#default_banner").css("display","block"),jQuery(".theme_background fieldset:not(#default_banner)").css("display","none");break;case"3":jQuery("#graphic_pattern").css("display","block"),jQuery(".theme_background fieldset:not(#graphic_pattern)").css("display","none");break;case"4":jQuery("#solid_color").css("display","block"),jQuery(".theme_background fieldset:not(#solid_color)").css("display","none");break;case"5":jQuery("#video_banner").css("display","block"),jQuery(".theme_background fieldset:not(#video_banner)").css("display","none"),videoPreview();break;case"6":jQuery("#gradient_background").css("display","block"),jQuery(".theme_background fieldset:not(#gradient_background)").css("display","none");break;default:jQuery("#custom_banner").css("display","block"),jQuery(".theme_background fieldset:not(#custom_banner)").css("display","none")}}),jQuery("#csoptions .niteoCS_banner").trigger("change");var o=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();jQuery("#unsplash-feed-"+o).css("display","block"),jQuery('#unsplash_banner select[name^="unsplash_feed"]').on("change",function(){o=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),jQuery(".unsplash-feed").css("display","none"),jQuery("#unsplash-feed-"+o).css("display","block")}),jQuery("select.background-gradient").on("change",function(){var e=jQuery("select.background-gradient option:selected").val();"custom"==e?(jQuery(".custom-gradient").css("display","block"),jQuery(".gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"linear-gradient(135deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)"})):(colors=e.split(":"),jQuery(".custom-gradient").css("display","none"),jQuery(".gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+colors[0]+" 0%, "+colors[1]+" 100%)",background:"-webkit-linear-gradient(-45deg, "+colors[0]+" 0%, "+colors[1]+" 100%)",background:"linear-gradient(135deg, "+colors[0]+" 0%, "+colors[1]+" 100%)"}))}),jQuery("#niteoCS_banner_color").wpColorPicker({change:function(e,t){jQuery(".color-preview").css("background-color",t.color.toString())}}),jQuery("#niteoCS_gradient_one").wpColorPicker({change:function(e,t){jQuery(".gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+t.color.toString()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+t.color.toString()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)",background:"linear-gradient(135deg, "+t.color.toString()+" 0%, "+jQuery("#niteoCS_gradient_two").val()+" 100%)"})}}),jQuery("#niteoCS_gradient_two").wpColorPicker({change:function(e,t){jQuery(".gradient-preview").css({background:"-moz-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+t.color.toString()+" 100%)",background:"-webkit-linear-gradient(-45deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+t.color.toString()+" 100%)",background:"linear-gradient(135deg, "+jQuery("#niteoCS_gradient_one").val()+" 0%, "+t.color.toString()+" 100%)"})}}),jQuery('select[name^="niteoCS_banner_pattern"]').on("change",function(){var e=jQuery('select[name^="niteoCS_banner_pattern"] option:selected').val();if("custom"!=e){t=jQuery(this).data("url");jQuery("#add-pattern").css("display","none"),jQuery(".pattern-wrapper").css("background-image","url('"+t+e+".png')")}else{var t=jQuery("#niteoCS_banner_pattern_custom").val();jQuery("#add-pattern").css("display","block"),jQuery(".pattern-wrapper").css("background-image","url('"+t+"')")}}),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"))});var r="",c="";r="custom"==jQuery(".niteoCS_font_headings option:selected").val()?t(a(jQuery("#niteoCS_font_headings_custom").val())):jQuery(".niteoCS_font_headings option:selected").val(),c="custom"==jQuery(".niteoCS_font_content option:selected").val()?t(a(jQuery("#niteoCS_font_content_custom").val())):jQuery(".niteoCS_font_contentoption:selected").val(),WebFont.load({google:{families:[t(a(r)),t(a(c))]},active:function(){e("#heading-example, #niteoCS-text-logo").css("font-family",r),e("#content-example").css("font-family",c)}}),jQuery(".niteoCS_font_headings").on("change",function(){niteoCS_font_headings=jQuery(".niteoCS_font_headings option:selected").val(),"custom"==niteoCS_font_headings?(jQuery("#custom_headings_font").css("display","block"),jQuery("#custom_headings_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[t(a(jQuery("#niteoCS_font_headings_custom").val()))]},active:function(){e("#heading-example, #niteoCS-text-logo").css("font-family",jQuery("#niteoCS_font_headings_custom").val())}})},1e3))})):(jQuery("#custom_headings_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_headings]},active:function(){e("#heading-example, #niteoCS-text-logo").css("font-family",niteoCS_font_headings||"")}}))}),jQuery(".niteoCS_font_content").on("change",function(){niteoCS_font_content=jQuery(".niteoCS_font_content option:selected").val(),"custom"==niteoCS_font_content?(jQuery("#custom_content_font").css("display","block"),jQuery("#custom_content_font").data("timeout",null).keyup(function(){clearTimeout(jQuery(this).data("timeout")),jQuery(this).data("timeout",setTimeout(function(){WebFont.load({google:{families:[t(a(jQuery("#niteoCS_font_content_custom").val()))]},active:function(){e("#content-example").css("font-family",jQuery("#niteoCS_font_content_custom").val())}})},1e3))})):(jQuery("#custom_content_font").css("display","none"),WebFont.load({google:{families:[niteoCS_font_content]},active:function(){e("#content-example").css("font-family",niteoCS_font_content||"")}}))});var u=function(t,a,s){var n=e("#niteoCS_socialmedia").attr("value");n=e.parseJSON(n),e.each(n,function(e,n){n.name==t&&(n[a]=s)}),e("#niteoCS_socialmedia").attr("value",JSON.stringify(n))},l=e(".social-inputs"),d=function(t,a){var s=l.find('input[type="text"]');a.item.index();s.each(function(t,a){var s=e(a).data("name");u(s,"order",t)})};l.sortable({stop:d}),l.on("sortchange",d),function(e){e.fn.toggleDisabled=function(){return this.each(function(){var t,a=e(this),s=a.data("name");a.attr("disabled")?(a.prop("disabled",!1),t="1"):(a.prop("disabled",!0),t="0"),u(s,"active",t)})}}(jQuery),jQuery('.social-inputs input[type="text"]').focusout(function(){var e=jQuery(this).data("name"),t=jQuery(this).attr("value");u(e,"url",t)}),jQuery('.social-inputs input[type="checkbox"]').click(function(t){e(this).siblings('input[type="text"]').toggleDisabled()}),jQuery(".social-media i").click(function(){var e=jQuery(this).data("name");jQuery(this).toggleClass("active"),jQuery(".social-inputs li."+e).toggleClass("active"),jQuery(".social-inputs li."+e+" input").trigger("change"),jQuery(this).hasClass("active")?u(e,"hidden","0"):u(e,"hidden","1"),jQuery(".social-media i.active").length?jQuery(".social-inputs .label").css("display","block"):jQuery(".social-inputs .label").css("display","none")}),jQuery(".social-media i.active").length&&jQuery(".social-inputs .label").css("display","block"),jQuery(".view-release").click(function(e){e.preventDefault(),$this=jQuery(this);var t=$this.attr("href");jQuery.get(t,function(e){$this.closest(".notice").find(".release-note .notes").remove(),$this.closest(".notice").find(".release-note").append('<div class="notes">'+e+"</div>")}).fail(function(){$this.closest(".notice").find(".release-note p").remove(),$this.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".update-theme").click(function(t){t.preventDefault();var a=e(this),s=a.parents(".notice"),n=a.data("security"),i=a.data("slug"),o=a.data("type"),r=s.find(".theme-name").text(),c=jQuery(this).data("remote_url");update={name:i,tmp_name:"",type:o,url:c+"?action=download&slug="+i};var u={action:"cmp_theme_update_install",security:n,file:update};s.find(".message").html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span class="sr-only">Updating heme...</span><span> working hard on updating Theme...</span>'),e.post(ajaxurl,u,function(t){if("success"==t)setTimeout(function(){s.removeClass("notice-warning").addClass("notice-success"),s.find(".message").html("<span> "+r+' Theme was updated sucessfully! </span><i class="fa fa-smile-o" aria-hidden="true"></i>')},1500);else{t=t.slice(0,-1);var a=e("p",e(t)).text();s.removeClass("notice-warning").addClass("notice-error"),s.find(".message").html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+a+"</span>")}})}),jQuery(".theme-select").click(function(){jQuery(this).parent().find('input[name="select_theme"]').prop("checked",!0).trigger("change"),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().find(".theme-select").addClass("selected")}),jQuery(".theme-update.button").one("click",function(t){t.preventDefault();var a=e(this),s=a.closest(".theme-wrapper"),n=s.data("security"),i=s.data("slug"),o={action:"cmp_theme_update_install",security:n,file:{name:i,tmp_name:"",type:s.data("type"),url:s.data("remote_url")+"?action=download&slug="+i}};a.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>'),e.post(ajaxurl,o,function(e){"success"==e?setTimeout(function(){a.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>'),setTimeout(function(){a.fadeOut()},1500)},1500):(e=e.slice(0,-1),a.html('<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>'))})}),jQuery(".theme-details").click(function(){var t=e(this),a=t.closest(".theme-wrapper"),s=a.data("slug"),n=a.data("version"),i=a.data("remote_url"),o=a.data("type"),r=a.data("purchased"),c=jQuery(".update-theme").data("security"),u=0,l={action:"niteo_themeinfo",security:jQuery(".theme-wrapper").data("security"),theme_slug:jQuery(this).parents(".theme-wrapper").data("slug")};e.post(ajaxurl,l,function(l){var d="",p="",y="",h="";if("true"==(l=jQuery.parseJSON(l)).result){if(jQuery("body").addClass("modal-open"),"1"==r&&"premium"==o)if(y='<span class="theme-version">Version: '+n+"</span>",jQuery(".update-theme").length){var m=jQuery(".update-theme").data("new_ver");h='<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+l.name+' theme available. <a href="'+i+"readme/"+s+'-readme.php" class="view-release">View update '+m+' notes</a> or <a href="'+window.location.href+"&action=update-cmp-theme&theme="+s+"&type="+o+'" class="update-theme" data-type="'+o+'" data-security="'+c+'" data-slug="'+s+'" data-remote_url="'+i+'">Update now.</a></strong></p><div class="release-note"></div></div>'}else h='<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>';if("1"!=r&&"premium"==o)var d="disabled ",p='<button type="button" class="theme-purchase button hide"><a href="'+a.find("a").attr("href")+'" target="_blank"><i class="fa fa-cart-arrow-down" aria-hidden="true"></i>Buy</a></button>';var g=l.screenshots,v="";Object.keys(g).length>1&&(v='<div class="screenshots-nav"><div class="left"><i class="fa fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fa fa-chevron-right" aria-hidden="true"></i></div></div>');var f=e(['<div class="theme-backdrop">','\t<div class="theme-wrap">','\t\t<div class="theme-header">','\t\t\t<button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',"\t\t</div>",'\t\t<div class="theme-about">','\t\t\t<div class="theme-screenshots">','\t\t\t\t<div class="screenshot" style="background-image:url(\''+g[0]+"')\">"+v+"</div>","\t\t\t</div>",'\t\t\t<div class="theme-info">','\t\t\t\t<h2 class="theme-name">'+l.name+y+"</h2>",'\t\t\t\t<p class="theme-author">By <a href="'+l.author_homepage+'" target="_blank">'+l.author+"</a></p>",h,'\t\t\t\t<div class="theme-description">'+l.description+"</div>",p,"\t\t\t</div>","\t\t</div>",'\t\t<div class="theme-actions">','\t\t\t<button type="submit" '+d+'class="button activate" name="Submit" aria-label="Select '+l.name+'">Activate</button>','\t\t\t<a href="http://cmp.niteothemes.com/?cmp_preview=true&theme='+s+"&utm_source=cmp&utm_medium=referral&utm_campaign="+s+'" class="button cmp-preview" target="_blank" aria-label="Preview '+l.name+'">Live Preview</a>',"\t\t</div>","\t</div>","</div>"].join("\n"));jQuery(".theme-overlay.cmp").append(f),jQuery(".theme-overlay.cmp .view-release").click(function(e){e.preventDefault();var a=(t=jQuery(this)).attr("href");jQuery.get(a,function(e){t.closest(".notice").find(".release-note .notes").remove(),t.closest(".notice").find(".release-note").append('<div class="notes">'+e+"</div>")}).fail(function(){t.closest(".notice").find(".release-note p").remove(),t.closest(".notice").find(".release-note").append("<p>There was an error loading release notes. Please try again later.</p>")})}),jQuery(".theme-overlay.cmp .close").click(function(e){e.preventDefault(),jQuery("body").removeClass("modal-open"),jQuery(".theme-overlay.cmp .theme-backdrop").fadeOut("fast")}),jQuery(".theme-overlay.cmp .activate").click(function(e){e.preventDefault(),jQuery('input[name="select_theme"]').each(function(){jQuery(this).val()==s&&(jQuery(this).prop("checked",!0),jQuery(".theme-select").removeClass("selected"),jQuery(this).parent().addClass("selected"))}),jQuery("#csoptions").submit()}),jQuery(".screenshots-nav .right").click(function(){++u==Object.keys(g).length&&(u=0),u in g&&jQuery(".screenshot").css("background-image","url('"+g[u]+"')")}),jQuery(".screenshots-nav .left").click(function(){--u<0&&(u=Object.keys(g).length-1),u in g&&jQuery(".screenshot").css("background-image","url('"+g[u]+"')")})}})}),jQuery('#csoptions input[name="niteoCS_banner"]').trigger("change"),jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger("change"),s("logo",!1,"image"),s("favicon",!1,"image"),s("banner",!0,"image"),s("pattern",!1,"image"),s("video-thumb",!1,"image"),s("video",!1,"video")});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($){var formChanged=!1;var tab=document.location.hash.substring(1);var action=jQuery('#csoptions').attr('action');navtab=function(tab){jQuery('.nav-tab-wrapper .nav-tab').removeClass('nav-tab-active');jQuery('.nav-tab-wrapper .'+tab).addClass('nav-tab-active');jQuery('.table-wrapper.'+tab).css('display','block');jQuery('.comingsoon.'+tab).css('display','block');jQuery('.table-wrapper:not(.'+tab+')').css('display','none');jQuery('.comingsoon:not(.'+tab+')').css('display','none');if(tab=='install'){jQuery('.submit').css('display','none');jQuery('#csoptions').attr('action',action)}else{jQuery('.submit').css('display','block');jQuery('#csoptions').attr('action',action+'#'+tab)}}
2
+ if(tab!=''){navtab(tab)}
3
+ window.onhashchange=function(){tab=document.location.hash.substring(1);navtab(tab)}
4
+ $('.nav-tab:not(.theme-preview)').click(function(e){e.preventDefault();tab=$(this).data('tab');document.location.hash=tab});jQuery('#cmp-status').click(function(){jQuery('.cmp-status input[type=radio]').prop("disabled",(_,val)=>!val);jQuery('#cmp-status-menubar').prop("checked",(_,val)=>!val)});cmp_status_inputs();function cmp_status_inputs(){jQuery('.cmp-status legend:not(.disabled)').click(function(){if(jQuery('#cmp-status').prop('checked')==!1){return}
5
+ var $children=jQuery(this).children('input');$children.prop("checked",!0);jQuery('.cmp-status legend').removeClass('active');jQuery(this).addClass('active');$children.trigger('change');if($children.val()=='3'){jQuery('.redirect-inputs').fadeIn('fast')}else{jQuery('.redirect-inputs').fadeOut('fast')}})}
6
+ jQuery('.table-wrapper h3').click(function(){jQuery(this).parent().toggleClass('closed')});jQuery('.niteoCS-logo-type').change(function(){if(jQuery('.niteoCS-logo-type:checked').val()=='text'){jQuery('.text-logo').css('display','block');jQuery('.graphic-logo').css('display','none');jQuery('.disabled-logo').css('display','none')}else if(jQuery('.niteoCS-logo-type:checked').val()=='graphic'){jQuery('.text-logo').css('display','none');jQuery('.graphic-logo').css('display','block');jQuery('.disabled-logo').css('display','none')}else if(jQuery('.niteoCS-logo-type:checked').val()=='disabled'){jQuery('.text-logo').css('display','none');jQuery('.graphic-logo').css('display','none');jQuery('.disabled-logo').css('display','block')}});jQuery('#test-unsplash').click(function(e){e.preventDefault();var media_wrapper=jQuery('#unsplash-media'),unsplash_feed=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val(),unsp_url='',cat='',custom_str='',security=jQuery(this).data('security');switch(unsplash_feed){case '0':unsp_url=jQuery('#niteoCS-unsplash-0').val();break;case '1':unsp_url=jQuery('#niteoCS-unsplash-1').val();cat=jQuery('#unsplash_banner select[name^="unsplash_category"] option:selected').val();custom_str=jQuery('#niteoCS-category-keyword').val();break;case '2':unsp_url=jQuery('#niteoCS-unsplash-2').val();break;case '3':unsp_url=jQuery('#niteoCS-unsplash-3').val();if(jQuery('#niteoCS_unsplash_feat').is(':checked')){cat='1'}else{cat='0'}
7
+ break;default:}
8
+ var params={feed:unsplash_feed,url:unsp_url,cat:cat,custom_str:custom_str};jQuery(this).prop('disabled',!0);jQuery(this).html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span> loading..</span>');media_wrapper.html('');var data={action:'niteo_unsplash',security:security,params:params};$.post(ajaxurl,data,function(response){jQuery('#unsplash_img').remove();img_url=response.replace('WIDTHxHEIGHT','588x330');var loadingTimeout=setTimeout(function(){jQuery('#test-unsplash').prop('disabled',!1);jQuery('#test-unsplash').text('Test Again');jQuery('#unsplash-media').html('<p>It seems <a href="http://source.unsplash.com" target="_blank">source.unsplash.com</a> is not responding. Please try again later.')},5000);jQuery('<img />',{src:img_url,id:'unsplash_img'}).one('load',function(){jQuery(this).appendTo(media_wrapper);jQuery(this).fadeIn();jQuery('#test-unsplash').prop('disabled',!1);jQuery('#test-unsplash').text('Test Unsplash');clearTimeout(loadingTimeout)})})});videoPreview=function(){var source=$('.banner-video-source').val();$('.video-wrapper').css('padding-top','0');if(source=='YouTube'){var youtubeLink=$('#niteoCS-youtube-url').val();if(youtubeLink.match(/(youtube.com)/)){var split_c='v=';var split_n=1}
9
+ if(youtubeLink.match(/(youtu.be)/)||youtubeLink.match(/(vimeo.com\/)+[0-9]/)){var split_c='/';var split_n=3}
10
+ if(source=='vimeo'){var youtubeLink=$('#niteoCS-vimeo-url').val();if(youtubeLink.match(/(vimeo.com\/)+[a-zA-Z]/)){var split_c='/';var split_n=5}}
11
+ if(youtubeLink){var getYouTubeVideoID=youtubeLink.split(split_c)[split_n];if(getYouTubeVideoID!=undefined){var cleanVideoID=getYouTubeVideoID.replace(/(&)+(.*)/,'');if(source=='banner_youtube'&&youtubeLink.match(/(youtu.be)/)||youtubeLink.match(/(youtube.com)/)){var videoEmbedLink='https://www.youtube.com/embed/'+cleanVideoID+'?autoplay=0'}
12
+ if(source=='banner_vimeo'&&youtubeLink.match(/(vimeo.com\/)+[0-9]/)||youtubeLink.match(/(vimeo.com\/)+[a-zA-Z]/)){var videoEmbedLink='https://player.vimeo.com/video/'+cleanVideoID+'?autoplay=0'}
13
+ var $iframe=$('<iframe src="'+videoEmbedLink+'" allowfullscreen></iframe>');$('.video-wrapper').html($iframe);var videoRatio=($iframe.height()/$iframe.width())*100;$iframe.css('position','absolute');$iframe.css('top','0');$iframe.css('left','0');$iframe.css('width','100%');$iframe.css('height','100%');$('.video-wrapper').css('padding-top',videoRatio+'%');$('#niteoCS-vimeo-url').css('border','1px solid #ddd');$('#niteoCS-youtube-url').css('border','1px solid #ddd')}else{$('.video-wrapper').text('Please enter correct '+source+' URL.').css('padding-top','0');$('#niteoCS-vimeo-url').css('border','1px solid #d60000');$('#niteoCS-youtube-url').css('border','1px solid #d60000')}}else{$('.video-wrapper').text('Please enter '+source+' URL.').css('padding-top','0');$('#niteoCS-vimeo-url').css('border','1px solid #d60000');$('#niteoCS-youtube-url').css('border','1px solid #d60000')}}
14
+ if(source=='video/mp4'){var videoURL=jQuery('#niteoCS-video-id').data('url');if(videoURL!=''){$('.video-wrapper').html('<video width="600" height="400" controls><source src="'+videoURL+'" type="video/mp4">Your browser does not support the video tag.</video>')}}};jQuery('#niteoCS-youtube-url').keyup(function(){videoPreview()});jQuery('#csoptions .banner-video-source').change(function(){switch(jQuery('#csoptions .banner-video-source').val()){case 'YouTube':jQuery('.youtube-source-input').css('display','block');jQuery('.vimeo-source-input').css('display','none');jQuery('.file-source-input').css('display','none');break;case 'vimeo':jQuery('.youtube-source-input').css('display','none');jQuery('.vimeo-source-input').css('display','block');jQuery('.file-source-input').css('display','none');break;case 'video/mp4':jQuery('.youtube-source-input').css('display','none');jQuery('.vimeo-source-input').css('display','none');jQuery('.file-source-input').css('display','block');break;default:jQuery('.file-source-input').css('display','block');jQuery('.youtube-source-input').css('display','none');jQuery('.vimeo-source-input').css('display','none')}
15
+ videoPreview()});jQuery('#csoptions .banner-video-source').trigger('change');jQuery('#csoptions .niteoCS_banner').change(function(){switch(jQuery('#csoptions .niteoCS_banner:checked').val()){case '0':jQuery('#custom_banner').css('display','block');jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none');break;case '1':jQuery('#unsplash_banner').css('display','block');jQuery('.theme_background fieldset:not(#unsplash_banner)').css('display','none');break;case '2':jQuery('#default_banner').css('display','block');jQuery('.theme_background fieldset:not(#default_banner)').css('display','none');break;case '3':jQuery('#graphic_pattern').css('display','block');jQuery('.theme_background fieldset:not(#graphic_pattern)').css('display','none');break;case '4':jQuery('#solid_color').css('display','block');jQuery('.theme_background fieldset:not(#solid_color)').css('display','none');break;case '5':jQuery('#video_banner').css('display','block');jQuery('.theme_background fieldset:not(#video_banner)').css('display','none');videoPreview();break;case '6':jQuery('#gradient_background').css('display','block');jQuery('.theme_background fieldset:not(#gradient_background)').css('display','none');break;default:jQuery('#custom_banner').css('display','block');jQuery('.theme_background fieldset:not(#custom_banner)').css('display','none')}});jQuery('#csoptions .niteoCS_banner').trigger('change');var unsplasfeed=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();jQuery('#unsplash-feed-'+unsplasfeed).css('display','block');jQuery('#unsplash_banner select[name^="unsplash_feed"]').on('change',function(){unsplasfeed=jQuery('#unsplash_banner select[name^="unsplash_feed"] option:selected').val();jQuery('.unsplash-feed').css('display','none');jQuery('#unsplash-feed-'+unsplasfeed).css('display','block')})
16
+ jQuery('select.background-gradient').on('change',function(){var gradient=jQuery('select.background-gradient option:selected').val();if(gradient=='custom'){jQuery('.custom-gradient').css('display','block');jQuery('.gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)','background':'-webkit-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)','background':'linear-gradient(135deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)'})}else{colors=gradient.split(':');jQuery('.custom-gradient').css('display','none');jQuery('.gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+colors[0]+' 0%, '+colors[1]+' 100%)','background':'-webkit-linear-gradient(-45deg, '+colors[0]+' 0%, '+colors[1]+' 100%)','background':'linear-gradient(135deg, '+colors[0]+' 0%, '+colors[1]+' 100%)'})}});jQuery('#niteoCS_banner_color').wpColorPicker({change:function(event,ui){jQuery('.color-preview').css('background-color',ui.color.toString())}});jQuery('#niteoCS_gradient_one').wpColorPicker({change:function(event,ui){jQuery('.gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)','background':'-webkit-linear-gradient(-45deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)','background':'linear-gradient(135deg, '+ui.color.toString()+' 0%, '+jQuery('#niteoCS_gradient_two').val()+' 100%)'})}});jQuery('#niteoCS_gradient_two').wpColorPicker({change:function(event,ui){jQuery('.gradient-preview').css({'background':'-moz-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)','background':'-webkit-linear-gradient(-45deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)','background':'linear-gradient(135deg, '+jQuery('#niteoCS_gradient_one').val()+' 0%, '+ui.color.toString()+' 100%)'})}});jQuery('select[name^="niteoCS_banner_pattern"]').on('change',function(){var pattern=jQuery('select[name^="niteoCS_banner_pattern"] option:selected').val();if(pattern!='custom'){var pattern_url=jQuery(this).data('url');jQuery('#add-pattern').css('display','none');jQuery('.pattern-wrapper').css('background-image','url(\''+pattern_url+pattern+'.png\')')}else{var pattern_url=jQuery('#niteoCS_banner_pattern_custom').val();jQuery('#add-pattern').css('display','block');jQuery('.pattern-wrapper').css('background-image','url(\''+pattern_url+'\')')}});if(jQuery('#niteoCS_subscribe').prop('checked')==!0){jQuery('.subscribe').css('display','block')}
17
+ jQuery('#niteoCS_subscribe').change(function(){if(jQuery(this)[0].checked){jQuery('.subscribe').css('display','block')}else{jQuery('.subscribe').css('display','none')}});jQuery('#csoptions input[name="niteoCS_subscribe_type"]').change(function(){if(jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()==0){jQuery('#subscribe-disabled').css('display','block');jQuery('#subscribe-3rdparty').css('display','none');jQuery('#subscribe-niteo').css('display','none')}else if(jQuery('#csoptions input[name="niteoCS_subscribe_type"]:checked').val()==1){jQuery('#subscribe-disabled').css('display','none');jQuery('#subscribe-3rdparty').css('display','block');jQuery('#subscribe-niteo').css('display','none')}else{jQuery('#subscribe-disabled').css('display','none');jQuery('#subscribe-3rdparty').css('display','none');jQuery('#subscribe-niteo').css('display','block')}});var heading_family='';var content_family='';if(jQuery('.niteoCS_font_headings option:selected').val()=='custom'){heading_family=ucwords(strtolower(jQuery('#niteoCS_font_headings_custom').val()))}else{heading_family=jQuery('.niteoCS_font_headings option:selected').val()}
18
+ if(jQuery('.niteoCS_font_content option:selected').val()=='custom'){content_family=ucwords(strtolower(jQuery('#niteoCS_font_content_custom').val()))}else{content_family=jQuery('.niteoCS_font_contentoption:selected').val()}
19
+ WebFont.load({google:{families:[ucwords(strtolower(heading_family)),ucwords(strtolower(content_family))]},active:function(){$('#heading-example, #niteoCS-text-logo').css('font-family',heading_family);$('#content-example').css('font-family',content_family)},});jQuery('.niteoCS_font_headings').on('change',function(){niteoCS_font_headings=jQuery('.niteoCS_font_headings option:selected').val();if(niteoCS_font_headings=='custom'){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:[ucwords(strtolower(jQuery('#niteoCS_font_headings_custom').val()))]},active:function(){$('#heading-example, #niteoCS-text-logo').css('font-family',jQuery('#niteoCS_font_headings_custom').val())},})},1000))})}else{jQuery('#custom_headings_font').css('display','none');WebFont.load({google:{families:[niteoCS_font_headings]},active:function(){$('#heading-example, #niteoCS-text-logo').css('font-family',niteoCS_font_headings?niteoCS_font_headings:'')},})}});jQuery('.niteoCS_font_content').on('change',function(){niteoCS_font_content=jQuery('.niteoCS_font_content option:selected').val();if(niteoCS_font_content=='custom'){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:[ucwords(strtolower(jQuery('#niteoCS_font_content_custom').val()))]},active:function(){$('#content-example').css('font-family',jQuery('#niteoCS_font_content_custom').val())},})},1000))})}else{jQuery('#custom_content_font').css('display','none');WebFont.load({google:{families:[niteoCS_font_content]},active:function(){$('#content-example').css('font-family',niteoCS_font_content?niteoCS_font_content:'')},})}});var update_social=function(name,key,val){var socialmedia=$('#niteoCS_socialmedia').attr('value');socialmedia=$.parseJSON(socialmedia);$.each(socialmedia,function(i,ele){if(ele.name==name){ele[key]=val}});$('#niteoCS_socialmedia').attr('value',JSON.stringify(socialmedia))};var $sortableList=$('.social-inputs');var sortEventHandler=function(event,ui){var inputs=$sortableList.find('input[type="text"]');var order=ui.item.index();inputs.each(function(i,ele){var name=$(ele).data('name');update_social(name,'order',i)})};$sortableList.sortable({stop:sortEventHandler});$sortableList.on('sortchange',sortEventHandler);(function($){$.fn.toggleDisabled=function(){return this.each(function(){var $this=$(this);var active;var name=$this.data('name');if($this.attr('disabled')){$this.prop('disabled',!1);active='1'}else{$this.prop('disabled',!0);active='0'}
20
+ update_social(name,'active',active)})}})(jQuery);jQuery('.social-inputs input[type="text"]').focusout(function(){var name=jQuery(this).data('name');var socialurl=jQuery(this).attr('value');update_social(name,'url',socialurl)});jQuery('.social-inputs input[type="checkbox"]').click(function(e){var $this=$(this).siblings('input[type="text"]');$this.toggleDisabled()});jQuery('.social-media i').click(function(){var name=jQuery(this).data('name');jQuery(this).toggleClass('active');jQuery('.social-inputs li.'+name).toggleClass('active');jQuery('.social-inputs li.'+name+' input').trigger('change');if(jQuery(this).hasClass('active')){update_social(name,'hidden','0')}else{update_social(name,'hidden','1')}
21
+ if(jQuery('.social-media i.active').length){jQuery('.social-inputs .label').css('display','block')}else{jQuery('.social-inputs .label').css('display','none')}});if(jQuery('.social-media i.active').length){jQuery('.social-inputs .label').css('display','block')}
22
+ jQuery('.view-release').click(function(e){e.preventDefault();$this=jQuery(this);var release_url=$this.attr('href');jQuery.get(release_url,function(release){$this.closest('.notice').find('.release-note .notes').remove();$this.closest('.notice').find('.release-note').append('<div class="notes">'+release+'</div>')}).fail(function(){$this.closest('.notice').find('.release-note p').remove();$this.closest('.notice').find('.release-note').append('<p>There was an error loading release notes. Please try again later.</p>')})});jQuery('.update-theme').click(function(e){e.preventDefault();var $this=$(this),$parent=$this.parents('.notice'),security=$this.data('security'),slug=$this.data('slug'),type=$this.data('type'),themeName=$parent.find('.theme-name').text(),remoteUrl=jQuery(this).data('remote_url');update={'name':slug,'tmp_name':'','type':type,'url':remoteUrl+'?action=download&slug='+slug,}
23
+ var data={action:'cmp_theme_update_install',security:security,file:update};$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>');$.post(ajaxurl,data,function(response){if(response=='success'){setTimeout(function(){$parent.removeClass('notice-warning').addClass('notice-success');$parent.find('.message').html('<span> '+themeName+' Theme was updated sucessfully! </span><i class="fa fa-smile-o" aria-hidden="true"></i>')},1500)}else{response=response.slice(0,-1);var error=$('p',$(response)).text();$parent.removeClass('notice-warning').addClass('notice-error');$parent.find('.message').html('<i class="fa fa-frown-o" aria-hidden="true"></i><span> '+error+'</span>')}})});jQuery('.theme-select').click(function(){jQuery(this).parent().find('input[name="select_theme"]').prop("checked",!0).trigger('change');jQuery('.theme-select').removeClass('selected');jQuery(this).parent().find('.theme-select').addClass('selected')});jQuery('.theme-update.button').one('click',function(e){e.preventDefault();var $this=$(this),$wrapper=$this.closest('.theme-wrapper'),security=$wrapper.data('security'),slug=$wrapper.data('slug'),type=$wrapper.data('type'),remoteUrl=$wrapper.data('remote_url');var update={'name':slug,'tmp_name':'','type':type,'url':remoteUrl+'?action=download&slug='+slug,}
24
+ var data={action:'cmp_theme_update_install',security:security,file:update};$this.html('<i class="fa fa-cog fa-spin fa-1x fa-fw"></i><span>Updating..</span>');$.post(ajaxurl,data,function(response){if(response=='success'){setTimeout(function(){$this.html('<i class="fa fa-smile-o" aria-hidden="true"></i><span>Updated!</span>');setTimeout(function(){$this.fadeOut()},1500)},1500)}else{response=response.slice(0,-1);$this.html('<i class="fa fa-frown-o" aria-hidden="true"></i><span>Update Failed!</span>')}})});jQuery('.theme-details').click(function(){var $this=$(this),$wrapper=$this.closest('.theme-wrapper'),slug=$wrapper.data('slug'),version=$wrapper.data('version'),remoteUrl=$wrapper.data('remote_url'),type=$wrapper.data('type'),purchased=$wrapper.data('purchased'),noticeHtml='',security=jQuery('.update-theme').data('security'),i=0;var data={action:'niteo_themeinfo',security:jQuery('.theme-wrapper').data('security'),theme_slug:jQuery(this).parents('.theme-wrapper').data('slug'),};$.post(ajaxurl,data,function(response){var buttonDisabled='';var buyButton='';var versionInfo='';var noticeHtml='';response=jQuery.parseJSON(response);if(response.result=='true'){jQuery('body').addClass('modal-open');if(purchased=='1'&&type=='premium'){versionInfo='<span class="theme-version">Version: '+version+'</span>';if(jQuery('.update-theme').length){var newVer=jQuery('.update-theme').data('new_ver');noticeHtml='<div class="notice notice-warning notice-alt notice-large"><h3 class="notice-title">Update Available</h3><p class="message"><strong>There is a new version of '+response.name+' theme available. <a href="'+remoteUrl+'readme/'+slug+'-readme.php" class="view-release">View update '+newVer+' notes</a> or <a href="'+window.location.href+'&action=update-cmp-theme&theme='+slug+'&type='+type+'" class="update-theme" data-type="'+type+'" data-security="'+security+'" data-slug="'+slug+'" data-remote_url="'+remoteUrl+'">Update now.</a></strong></p><div class="release-note"></div></div>'}else{noticeHtml='<div class="notice notice-success notice-alt notice-large"><p>Theme is up to date.</p></div>'}}
25
+ if(purchased!='1'&&type=='premium'){var buttonDisabled='disabled ';var buyURL=$wrapper.find('a').attr('href');var buyButton='<button type="button" class="theme-purchase button hide"><a href="'+buyURL+'" target="_blank"><i class="fa fa-cart-arrow-down" aria-hidden="true"></i>Buy</a></button>'}
26
+ var screenshots=response.screenshots;var arrows='';if(Object.keys(screenshots).length>1){arrows='<div class="screenshots-nav"><div class="left"><i class="fa fa-chevron-left" aria-hidden="true"></i></div><div class="right"><i class="fa fa-chevron-right" aria-hidden="true"></i></div></div>'}
27
+ var html=$(['<div class="theme-backdrop">',' <div class="theme-wrap">',' <div class="theme-header">',' <button class="close dashicons dashicons-no"><span class="screen-reader-text">Close details dialog</span></button>',' </div>',' <div class="theme-about">',' <div class="theme-screenshots">',' <div class="screenshot" style="background-image:url(\''+screenshots['0']+'\')">'+arrows+'</div>',' </div>',' <div class="theme-info">',' <h2 class="theme-name">'+response.name+versionInfo+'</h2>',' <p class="theme-author">By <a href="'+response.author_homepage+'" target="_blank">'+response.author+'</a></p>',noticeHtml,' <div class="theme-description">'+response.description+'</div>',buyButton,' </div>',' </div>',' <div class="theme-actions">',' <button type="submit" '+buttonDisabled+'class="button activate" name="Submit" aria-label="Select '+response.name+'">Activate</button>',' <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme='+slug+'&utm_source=cmp&utm_medium=referral&utm_campaign='+slug+'" class="button cmp-preview" target="_blank" aria-label="Preview '+response.name+'">Live Preview</a>',' </div>',' </div>','</div>',].join("\n"));jQuery('.theme-overlay.cmp').append(html);jQuery('.theme-overlay.cmp .view-release').click(function(e){e.preventDefault();$this=jQuery(this);var release_url=$this.attr('href');jQuery.get(release_url,function(release){$this.closest('.notice').find('.release-note .notes').remove();$this.closest('.notice').find('.release-note').append('<div class="notes">'+release+'</div>')}).fail(function(){$this.closest('.notice').find('.release-note p').remove();$this.closest('.notice').find('.release-note').append('<p>There was an error loading release notes. Please try again later.</p>')})});jQuery('.theme-overlay.cmp .close').click(function(e){e.preventDefault();jQuery('body').removeClass('modal-open');jQuery('.theme-overlay.cmp .theme-backdrop').fadeOut('fast')});jQuery('.theme-overlay.cmp .activate').click(function(e){e.preventDefault();jQuery('input[name="select_theme"]').each(function(){if(jQuery(this).val()==slug){jQuery(this).prop('checked',!0);jQuery('.theme-select').removeClass('selected');jQuery(this).parent().addClass('selected')}});jQuery('#csoptions').submit()});jQuery('.screenshots-nav .right').click(function(){i++;if(i==Object.keys(screenshots).length){i=0}
28
+ if((i in screenshots)){jQuery('.screenshot').css('background-image','url(\''+screenshots[i]+'\')')}});jQuery('.screenshots-nav .left').click(function(){i--;if(i<0){i=Object.keys(screenshots).length-1}
29
+ if((i in screenshots)){jQuery('.screenshot').css('background-image','url(\''+screenshots[i]+'\')')}})}})});jQuery('#csoptions input[name="niteoCS_banner"]').trigger('change');jQuery('#csoptions input[name="niteoCS_subscribe_type"]').trigger('change');media_upload_button('logo',!1,'image');media_upload_button('favicon',!1,'image');media_upload_button('banner',!0,'image');media_upload_button('pattern',!1,'image');media_upload_button('video-thumb',!1,'image');media_upload_button('video',!1,'video');function ucwords(str){return(str+'').replace(/^([a-z])|\s+([a-z])/g,function($1){return $1.toUpperCase()})}
30
+ function strtolower(str){return(str+'').toLowerCase()}
31
+ function media_upload_button(name,multiple,type){var $container=jQuery('.'+name+'-wrapper');var $add_button=jQuery('#add-'+name);var $delete_button=jQuery('#delete-'+name);var image;var imgID='';var title=name.replace('-',' ');title=title[0].toUpperCase()+title.slice(1);if(jQuery('#niteoCS-'+name+'-id').val()!=''){$delete_button.css('display','block')}
32
+ $add_button.click(function(e){e.preventDefault();if(media_uploader){media_uploader.open();return}
33
+ var media_uploader=wp.media({title:'Select '+title,button:{text:'Insert '+title},multiple:multiple,library:{type:[type]},}).on('select',function(){var attachment=media_uploader.state().get('selection').toJSON();if(attachment.length>0){$container.empty();jQuery(attachment).each(function(i){if(attachment[i].sizes&&attachment[i].sizes.large){image=attachment[i].sizes.large.url}else{image=attachment[i].url}
34
+ var comma=i===0?'':',';imgID+=(comma+attachment[i].id);if(name=='pattern'){$container.css('background-image','url(\''+image+'\')')}else if(name=='video'){$container.append('<video width="600" height="400" controls><source src="'+image+'" type="video/mp4">Your browser does not support the video tag.</video>')}else{$container.append('<img src="'+image+'" alt="" style="max-width:588px"/>')}});$delete_button.css('display','block')}
35
+ jQuery('#niteoCS-'+name+'-id').val(imgID).trigger('change')}).open();if(name=='pattern'){$container.css('background-image','url(\''+image+'\')')}});$delete_button.click(function(e){jQuery(this).css('display','none');$container.empty();jQuery('#niteoCS-'+name+'-id').val('');jQuery('#niteoCS-'+name+'-id').trigger('change')})}})
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.12.0
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
@@ -17,7 +17,7 @@ class niteo_cmp {
17
  public function __construct() {
18
  $this->author = 'NiteoThemes';
19
  $this->author_homepage = 'https://niteothemes.com';
20
- $this->version = '1.12.0';
21
  $this->dev = false;
22
  $this->installedFolder = basename(dirname(__FILE__));
23
  $this->plugins_dir_path = plugin_dir_path( __DIR__ );
@@ -42,6 +42,9 @@ class niteo_cmp {
42
  // set remote server URL for updates
43
  $this->remoteServer = ($this->dev == true) ? 'https://niteothemes.com/updates-test/' : 'https://niteothemes.com/updates/';
44
  $this->minified = ($this->dev == true) ? '.js' : '.min.js';
 
 
 
45
  }
46
 
47
 
@@ -62,9 +65,16 @@ class niteo_cmp {
62
  // wp_register_style( 'fastselect_css', plugins_url('/css/fastselect.min.css', __FILE__) );
63
  }
64
 
 
65
  public function cmp_add_admin_style() {
66
- wp_register_style( 'cmp_admin_style', plugins_url('/css/cmp-admin-head.css', __FILE__),'',$this->version);
67
- wp_enqueue_style( 'cmp_admin_style' );
 
 
 
 
 
 
68
  }
69
 
70
  public function enqueue_admin_js($hook) {
@@ -109,21 +119,6 @@ class niteo_cmp {
109
  /* Using registered $page handle to hook script load */
110
  add_action('admin_print_scripts-'.$page, array($this, 'cmp_enqueueScripts'));
111
 
112
- // check onces and wordpress rights, else DIE
113
- if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
114
-
115
- if ( isset($_POST['activate']) && is_numeric($_POST['activate']) ) {
116
- //verify nonce and user rights
117
- if ( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
118
- die('Sorry, but this request is invalid');
119
- }
120
- update_option('niteoCS_activation', sanitize_text_field($_POST['activate']));
121
- }
122
- }
123
-
124
- if ( $this->cmp_status() == '1' || $this->cmp_status() == '2' || $this->cmp_status() == '3') {
125
- add_action('admin_bar_menu',array( $this, 'cmp_admin_bar' ), 1000 );
126
- }
127
  }
128
 
129
 
@@ -133,6 +128,7 @@ class niteo_cmp {
133
  // check for them updates, not sure where else this to put
134
  $this->cmp_check_update( $this->cmp_selectedTheme() );
135
  require_once ('cmp-settings.php');
 
136
  }
137
 
138
  public function cmp_subs_page() {
@@ -168,17 +164,25 @@ class niteo_cmp {
168
 
169
  if ( isset($_GET['cmp_preview']) && $_GET['cmp_preview'] == 'true' ) {
170
 
 
 
 
 
 
 
 
 
171
  // for themes preview demos
172
  if ( isset($_GET['theme']) && !empty($_GET['theme']) ) {
173
  $theme_preview = $_GET['theme'];
174
 
175
- // if premium
176
- if ( $this->niteo_in_array_r( $theme_preview, $this->cmp_plugin_premium() ) ) {
177
  if ( file_exists($this->plugins_dir_path . 'cmp-premium-themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
178
  require_once ($this->plugins_dir_path . 'cmp-premium-themes/'.$theme_preview.'/'.$theme_preview.'-theme.php');
179
  die();
180
  }
181
-
182
  } else {
183
  if ( file_exists(dirname(__FILE__) . '/themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
184
  require_once (dirname(__FILE__) . '/themes/'.$theme_preview.'/'.$theme_preview.'-theme.php');
@@ -189,6 +193,7 @@ class niteo_cmp {
189
 
190
  }
191
 
 
192
  // for admin: render CMP Theme when preview is set
193
  if ( file_exists( $this->cmp_themePath( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php') ) {
194
  require_once ( $this->cmp_themePath( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php' );
@@ -271,16 +276,44 @@ class niteo_cmp {
271
  }
272
  }
273
 
274
- // check plugin status
275
  public function cmp_status() {
276
 
277
- if ( !get_option('niteoCS_activation') || get_option('niteoCS_activation') == 0 ) {
 
 
278
  return '0';
 
279
  } else {
280
- return get_option('niteoCS_activation');
281
  }
282
  }
283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  // check selected theme
285
  public function cmp_selectedTheme() {
286
  if ( !get_option('niteoCS_theme') ) { //if it's not set yet
@@ -292,10 +325,10 @@ class niteo_cmp {
292
 
293
  // return installed theme path
294
  public function cmp_themePath( $slug ) {
295
- if ( $this->niteo_in_array_r( $slug, $this->cmp_plugin_premium() ) ) {
296
  return $this->plugins_dir_path . 'cmp-premium-themes/';
297
- } else {
298
 
 
299
  return dirname(__FILE__) . '/themes/';
300
  }
301
 
@@ -303,8 +336,9 @@ class niteo_cmp {
303
 
304
  // return installed theme dir
305
  public function cmp_themeURL( $themeslug ) {
306
- if ( $this->niteo_in_array_r( $themeslug, $this->cmp_plugin_premium() ) ) {
307
  return plugins_url( '/cmp-premium-themes/');
 
308
  } else {
309
  return plugins_url( '/themes/', __FILE__ );
310
 
@@ -314,8 +348,9 @@ class niteo_cmp {
314
  // older version of cmp_themeURL public function - migration after 1.9 version.
315
  //can be deleted in future...
316
  public function cmp_themeDirPath() {
317
- if ( $this->niteo_in_array_r( $this->cmp_selectedTheme(), $this->cmp_plugin_premium() ) ) {
318
  return plugins_url( '/cmp-premium-themes/');
 
319
  } else {
320
  return plugins_url( '/themes/', __FILE__ );
321
 
@@ -324,30 +359,84 @@ class niteo_cmp {
324
 
325
  // display admin notice
326
  public function cmp_admin_bar(){
327
- global $wp_admin_bar;
328
 
329
- $status = $this->cmp_status();
 
 
 
 
330
  $class = '';
331
  $msg= '';
332
- if ( $status == '1' ){
333
- $msg = __('Maintenance Mode Active','cmp-coming-soon-maintenance');
334
- $class = ' maintenance';
335
- } elseif( $status == '2' ){
336
- $msg = __('Coming Soon Mode Active','cmp-coming-soon-maintenance');
337
- $class = ' coming-soon';
338
- }
339
- elseif( $status == '3' ){
340
- $msg = __('Redirect Mode Active','cmp-coming-soon-maintenance');
341
- $class = ' redirect';
342
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
343
  //Add the main siteadmin menu item
344
  $wp_admin_bar->add_menu( array(
345
- 'id' => 'cs-admin-notice',
346
- 'href' => admin_url().'options-general.php?page=cmp-settings',
347
  'parent' => 'top-secondary',
348
  'title' => $msg,
349
  'meta' => array( 'class' => 'coming-soon-notice'.$class ),
350
  ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  }
352
 
353
  public function cmp_activate() {
@@ -397,9 +486,9 @@ class niteo_cmp {
397
  // returns list of premium themes => manually defined
398
  public function cmp_plugin_premium() {
399
  $premium_themes = array();
400
- array_push( $premium_themes, array('name' => 'frame', 'url' => 'https://creativemarket.com/NiteoThemes/1373921-CMP-Frame-Coming-Soon-WP-Theme', 'price' => '10') );
401
- array_push( $premium_themes, array('name' => 'hardwork_premium', 'url' => 'https://creativemarket.com/NiteoThemes/1385251-CMP-Hardwork-Premium-Maintenance', 'price' => '10') );
402
- array_push( $premium_themes, array('name' => 'fifty', 'url' => 'https://creativemarket.com/NiteoThemes/1395745-CMP-Fifty-Maintenance-Landing-Page', 'price' => '10') );
403
  return $premium_themes;
404
  }
405
 
@@ -792,7 +881,7 @@ class niteo_cmp {
792
 
793
  } else {
794
  // check if email don`t already exists
795
- if ( !$this->niteo_in_array_r( $email, $subscribe_list ) ) {
796
  $count = count($subscribe_list);
797
  $new_email = array('id' => $count, 'timestamp' => $timestamp, 'email' => $email, 'ip_address' => $ip_address);
798
  array_push( $subscribe_list, $new_email );
@@ -1064,11 +1153,15 @@ add_action( 'admin_notices', array($cmpPlugin, 'cmp_admin_notice'));
1064
  add_action('template_redirect', array($cmpPlugin, 'cmp_displayPage'));
1065
 
1066
  add_action('wp_login', array($cmpPlugin, 'cmp_admin_override'));
 
1067
 
1068
  add_action( 'wp_ajax_niteo_themeinfo', array($cmpPlugin, 'niteo_themeinfo') );
1069
  add_action( 'wp_ajax_niteo_unsplash', array($cmpPlugin, 'niteo_unsplash') );
1070
  add_action( 'wp_ajax_niteo_export_csv', array($cmpPlugin, 'niteo_export_csv') );
1071
  add_action( 'wp_ajax_cmp_theme_update_install', array($cmpPlugin, 'cmp_theme_update_install') );
 
 
 
1072
 
1073
  add_action('plugins_loaded', array($cmpPlugin, 'cmp_textDomain') );
1074
 
@@ -1076,6 +1169,8 @@ add_action('admin_menu', array($cmpPlugin, 'cmp_adminMenu'), 10);
1076
  add_action('admin_init', array($cmpPlugin, 'cmp_adminInit'));
1077
  add_action('admin_init', array($cmpPlugin, 'cmp_admin_override'));
1078
  add_action( 'admin_enqueue_scripts', array($cmpPlugin,'cmp_add_admin_style') );
 
 
1079
  add_action( 'admin_enqueue_scripts', array($cmpPlugin, 'enqueue_admin_js' ) );
1080
  register_activation_hook(__FILE__, array($cmpPlugin, 'cmp_activate'));
1081
  register_deactivation_hook(__FILE__, array($cmpPlugin, 'cmp_deactivate'));
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.13.0
7
  Author: NiteoThemes
8
  Author URI: https://www.niteothemes.com
9
  Text Domain: cmp-coming-soon-maintenance
17
  public function __construct() {
18
  $this->author = 'NiteoThemes';
19
  $this->author_homepage = 'https://niteothemes.com';
20
+ $this->version = '1.13.0';
21
  $this->dev = false;
22
  $this->installedFolder = basename(dirname(__FILE__));
23
  $this->plugins_dir_path = plugin_dir_path( __DIR__ );
42
  // set remote server URL for updates
43
  $this->remoteServer = ($this->dev == true) ? 'https://niteothemes.com/updates-test/' : 'https://niteothemes.com/updates/';
44
  $this->minified = ($this->dev == true) ? '.js' : '.min.js';
45
+
46
+
47
+
48
  }
49
 
50
 
65
  // wp_register_style( 'fastselect_css', plugins_url('/css/fastselect.min.css', __FILE__) );
66
  }
67
 
68
+ // enqueue admin css and scripts only if admin is logged in
69
  public function cmp_add_admin_style() {
70
+ $current_user = wp_get_current_user();
71
+ if ( user_can( $current_user, 'administrator' ) ) {
72
+ wp_register_style( 'cmp_admin_style', plugins_url('/css/cmp-admin-head.css', __FILE__), '', $this->version);
73
+ wp_enqueue_style( 'cmp_admin_style' );
74
+ wp_register_script( 'cmp_admin_script', plugins_url('/js/cmp-admin-head.js', __FILE__), array('jquery'), $this->version);
75
+ wp_enqueue_script( 'cmp_admin_script' );
76
+ }
77
+
78
  }
79
 
80
  public function enqueue_admin_js($hook) {
119
  /* Using registered $page handle to hook script load */
120
  add_action('admin_print_scripts-'.$page, array($this, 'cmp_enqueueScripts'));
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  }
123
 
124
 
128
  // check for them updates, not sure where else this to put
129
  $this->cmp_check_update( $this->cmp_selectedTheme() );
130
  require_once ('cmp-settings.php');
131
+
132
  }
133
 
134
  public function cmp_subs_page() {
164
 
165
  if ( isset($_GET['cmp_preview']) && $_GET['cmp_preview'] == 'true' ) {
166
 
167
+ // iframe preview with sidebar controls
168
+ if ( isset($_GET['selector']) && $_GET['selector'] == 'true' ) {
169
+ if ( file_exists(dirname(__FILE__) . '/inc/preview-iframe.php') ) {
170
+ require_once (dirname(__FILE__) . '/inc/preview-iframe.php');
171
+ die();
172
+ }
173
+ }
174
+
175
  // for themes preview demos
176
  if ( isset($_GET['theme']) && !empty($_GET['theme']) ) {
177
  $theme_preview = $_GET['theme'];
178
 
179
+ // premium themes location
180
+ if ( $this->niteo_in_array_r( $theme_preview, $this->cmp_plugin_premium(), true ) ) {
181
  if ( file_exists($this->plugins_dir_path . 'cmp-premium-themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
182
  require_once ($this->plugins_dir_path . 'cmp-premium-themes/'.$theme_preview.'/'.$theme_preview.'-theme.php');
183
  die();
184
  }
185
+ // standard themes location
186
  } else {
187
  if ( file_exists(dirname(__FILE__) . '/themes/'.$theme_preview.'/'.$theme_preview.'-theme.php') ) {
188
  require_once (dirname(__FILE__) . '/themes/'.$theme_preview.'/'.$theme_preview.'-theme.php');
193
 
194
  }
195
 
196
+
197
  // for admin: render CMP Theme when preview is set
198
  if ( file_exists( $this->cmp_themePath( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php') ) {
199
  require_once ( $this->cmp_themePath( $this->cmp_selectedTheme() ).$this->cmp_selectedTheme().'/'.$this->cmp_selectedTheme().'-theme.php' );
276
  }
277
  }
278
 
279
+ // return CMP activation status and it`s states
280
  public function cmp_status() {
281
 
282
+ if ( !get_option('niteoCS_status') ||
283
+ get_option('niteoCS_status') == '' ||
284
+ get_option('niteoCS_status') == false ) {
285
  return '0';
286
+
287
  } else {
288
+ return get_option( 'niteoCS_activation', '2' );
289
  }
290
  }
291
 
292
+ // function to toggle CMP activation for admin menu icon
293
+ public function cmp_toggle_activation () {
294
+ // check for ajax
295
+ if ( isset( $_POST['payload'] ) ) {
296
+ // verify nonce
297
+ check_ajax_referer( 'cmp-coming-soon-ajax-secret', 'security' );
298
+ // verify user rights
299
+ if( !current_user_can('publish_pages') ) {
300
+ die('Sorry, but this request is invalid');
301
+ }
302
+
303
+ if ( get_option('niteoCS_status', '') == '' ) {
304
+ update_option('niteoCS_status', '1');
305
+ } else {
306
+ update_option('niteoCS_status', '');
307
+ }
308
+
309
+ echo 'success';
310
+ wp_die();
311
+ return;
312
+
313
+ }
314
+
315
+ }
316
+
317
  // check selected theme
318
  public function cmp_selectedTheme() {
319
  if ( !get_option('niteoCS_theme') ) { //if it's not set yet
325
 
326
  // return installed theme path
327
  public function cmp_themePath( $slug ) {
328
+ if ( $this->niteo_in_array_r( $slug, $this->cmp_plugin_premium(), true ) ) {
329
  return $this->plugins_dir_path . 'cmp-premium-themes/';
 
330
 
331
+ } else {
332
  return dirname(__FILE__) . '/themes/';
333
  }
334
 
336
 
337
  // return installed theme dir
338
  public function cmp_themeURL( $themeslug ) {
339
+ if ( $this->niteo_in_array_r( $themeslug, $this->cmp_plugin_premium(), true ) ) {
340
  return plugins_url( '/cmp-premium-themes/');
341
+
342
  } else {
343
  return plugins_url( '/themes/', __FILE__ );
344
 
348
  // older version of cmp_themeURL public function - migration after 1.9 version.
349
  //can be deleted in future...
350
  public function cmp_themeDirPath() {
351
+ if ( $this->niteo_in_array_r( $this->cmp_selectedTheme(), $this->cmp_plugin_premium(), true ) ) {
352
  return plugins_url( '/cmp-premium-themes/');
353
+
354
  } else {
355
  return plugins_url( '/themes/', __FILE__ );
356
 
359
 
360
  // display admin notice
361
  public function cmp_admin_bar(){
362
+ $current_user = wp_get_current_user();
363
 
364
+ if (!user_can( $current_user, 'administrator' )) {
365
+ return;
366
+ }
367
+
368
+ global $wp_admin_bar;
369
  $class = '';
370
  $msg= '';
371
+
372
+ // check onces and wordpress rights, else DIE
373
+ if ( $_SERVER['REQUEST_METHOD'] == 'POST' && get_current_screen()->id == 'toplevel_page_cmp-settings' ) {
374
+ //verify nonce and user rights
375
+ if ( !wp_verify_nonce($_POST['save_options_field'], 'save_options') || !current_user_can('publish_pages') ) {
376
+ die('Sorry, but this request is invalid');
377
+ }
378
+
379
+ if ( isset($_POST['activate']) && is_numeric($_POST['activate']) ) {
380
+ update_option('niteoCS_activation', sanitize_text_field($_POST['activate']));
381
+ }
382
+
383
+ if ( isset($_POST['cmp_status']) ) {
384
+ update_option('niteoCS_status', $this->sanitize_checkbox($_POST['cmp_status']) );
385
+ } else {
386
+ update_option('niteoCS_status', false);
387
+ }
388
+
389
+
390
+ }
391
+
392
+ switch ( get_option( 'niteoCS_activation', '2' ) ) {
393
+
394
+ case '1':
395
+ $msg = __('Maintenance Mode:','cmp-coming-soon-maintenance');
396
+ $class = ' maintenance';
397
+ break;
398
+ case '2':
399
+ $msg = __('Coming Soon Mode:','cmp-coming-soon-maintenance');
400
+ $class = ' coming-soon';
401
+ break;
402
+ case '3':
403
+ $msg = __('Redirect Mode:','cmp-coming-soon-maintenance');
404
+ $class = ' redirect';
405
+ break;
406
+ default:
407
+ break;
408
+ }
409
+
410
+ $ajax_nonce = wp_create_nonce( 'cmp-coming-soon-ajax-secret' );
411
+
412
+ $msg = '<img src="'.plugins_url('/img/cmp.png', __FILE__).'" alt="CMP Logo" class="cmp-logo">'.$msg;
413
+ $msg .='<div class="toggle-wrapper">
414
+ <input type="checkbox" id="cmp-status-menubar" class="toggle-checkbox"'.checked( '1', get_option('niteoCS_status', false), false ).' name="cmp_status_menu" data-security="'. esc_attr($ajax_nonce).'">
415
+ <label for="cmp-status-menubar" class="toggle"><span class="toggle_handler"></span></label>
416
+ </div>';
417
+
418
  //Add the main siteadmin menu item
419
  $wp_admin_bar->add_menu( array(
420
+ 'id' => 'cmp-admin-notice',
421
+ 'href' => admin_url().'admin.php?page=cmp-settings',
422
  'parent' => 'top-secondary',
423
  'title' => $msg,
424
  'meta' => array( 'class' => 'coming-soon-notice'.$class ),
425
  ) );
426
+ $wp_admin_bar->add_node( array(
427
+ 'id' => 'cmp-settings',
428
+ 'title' => __('CMP Settings', 'cmp-coming-soon-maintenancee'),
429
+ 'href' => admin_url('admin.php?page=cmp-settings'),
430
+ 'parent' => 'cmp-admin-notice'
431
+ ));
432
+ $wp_admin_bar->add_node( array(
433
+ 'id' => 'cmp-preview',
434
+ 'title' => __('CMP Preview', 'cmp-coming-soon-maintenancee'),
435
+ 'href' => get_site_url().'/?cmp_preview=true',
436
+ 'parent'=> 'cmp-admin-notice',
437
+ 'meta' => array('target' => '_blank' )
438
+ ));
439
+
440
  }
441
 
442
  public function cmp_activate() {
486
  // returns list of premium themes => manually defined
487
  public function cmp_plugin_premium() {
488
  $premium_themes = array();
489
+ array_push( $premium_themes, array('name' => 'frame', 'url' => 'https://creativemarket.com/NiteoThemes/1373921-CMP-Frame-Coming-Soon-WP-Theme?u=NiteoThemes', 'price' => '10') );
490
+ array_push( $premium_themes, array('name' => 'hardwork_premium', 'url' => 'https://creativemarket.com/NiteoThemes/1385251-CMP-Hardwork-Premium-Maintenance?u=NiteoThemes', 'price' => '10') );
491
+ array_push( $premium_themes, array('name' => 'fifty', 'url' => 'https://creativemarket.com/NiteoThemes/1395745-CMP-Fifty-Maintenance-Landing-Page?u=NiteoThemes', 'price' => '10') );
492
  return $premium_themes;
493
  }
494
 
881
 
882
  } else {
883
  // check if email don`t already exists
884
+ if ( !$this->niteo_in_array_r( $email, $subscribe_list, true ) ) {
885
  $count = count($subscribe_list);
886
  $new_email = array('id' => $count, 'timestamp' => $timestamp, 'email' => $email, 'ip_address' => $ip_address);
887
  array_push( $subscribe_list, $new_email );
1153
  add_action('template_redirect', array($cmpPlugin, 'cmp_displayPage'));
1154
 
1155
  add_action('wp_login', array($cmpPlugin, 'cmp_admin_override'));
1156
+ add_action('wp_before_admin_bar_render',array( $cmpPlugin, 'cmp_admin_bar' ));
1157
 
1158
  add_action( 'wp_ajax_niteo_themeinfo', array($cmpPlugin, 'niteo_themeinfo') );
1159
  add_action( 'wp_ajax_niteo_unsplash', array($cmpPlugin, 'niteo_unsplash') );
1160
  add_action( 'wp_ajax_niteo_export_csv', array($cmpPlugin, 'niteo_export_csv') );
1161
  add_action( 'wp_ajax_cmp_theme_update_install', array($cmpPlugin, 'cmp_theme_update_install') );
1162
+ add_action( 'wp_ajax_cmp_toggle_activation', array($cmpPlugin, 'cmp_toggle_activation') );
1163
+
1164
+
1165
 
1166
  add_action('plugins_loaded', array($cmpPlugin, 'cmp_textDomain') );
1167
 
1169
  add_action('admin_init', array($cmpPlugin, 'cmp_adminInit'));
1170
  add_action('admin_init', array($cmpPlugin, 'cmp_admin_override'));
1171
  add_action( 'admin_enqueue_scripts', array($cmpPlugin,'cmp_add_admin_style') );
1172
+ add_action( 'wp_enqueue_scripts', array($cmpPlugin,'cmp_add_admin_style') );
1173
+
1174
  add_action( 'admin_enqueue_scripts', array($cmpPlugin, 'enqueue_admin_js' ) );
1175
  register_activation_hook(__FILE__, array($cmpPlugin, 'cmp_activate'));
1176
  register_deactivation_hook(__FILE__, array($cmpPlugin, 'cmp_deactivate'));
readme.txt CHANGED
@@ -4,11 +4,11 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KV2JF
4
  Tags: under construction, construction page, maintenance mode, landing page, launch page, launching, security, coming soon, customizable, offline, offline page, unavailable, free, unsplash, subscribe form
5
  Requires at least: 3.0
6
  Tested up to: 4.8
7
- Stable tag: 1.12.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Select Theme, select your images/videos and insert custom content (including custom logo, social icons, subscribe forms, and many more).
12
 
13
 
14
  == Description ==
@@ -16,14 +16,9 @@ Select Theme, select your images/videos and insert custom content (including cus
16
  CMP brings premium features for free, no PRO versions! It is very user friendly plugin to create and customize your own Coming Soon, Maintenance or landing page. Select a Theme from our predefined templates, setup custom logo, background graphics (including videos), custom content, subscribe forms, your social networks icons, fonts and colors, SEO, and many more.
17
 
18
  <h3>Live Preview</h3>
19
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork&video=true&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Hardwork Theme with video background>></a>
20
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=countdown&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Countdown Theme >></a>
21
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=construct&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Construct Theme >></a>
22
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Hardwork Theme >></a>
23
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=postery&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Postery Theme >></a>
24
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=hardwork_premium&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Hardwork Premium Theme >></a>
25
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=frame&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Frame Theme >></a>
26
- <a href="http://cmp.niteothemes.com/?cmp_preview=true&theme=fifty&utm_source=wp&utm_medium=referral" target="_blank">Click for preview of Fifty Theme >></a>
27
 
28
  == Screenshots ==
29
  1. CMP - Coming Soon Plugin
@@ -47,17 +42,17 @@ CMP brings premium features for free, no PRO versions! It is very user friendly
47
  <li>Fully responsive and Retina ready</li>
48
  <li>Customize Logo, Fonts and Colors</li>
49
  <li>Setup custom Social Icons</li>
50
- <li>Subscribe form works with any 3rd party plugin(Mailchimp, CF7, etc)</li>
51
- <li>Custom Subscribe form to store emails in custom database with export to csv</li>
52
- <li>Select and Display random beautiful images from <a href="http://unsplash.com" target="_blank">Unsplash source</a> with built-in search API or use custom photos</li>
53
- <li>Video background options: Youtube or Vimeo</li>
54
- <li>Customize SEO meta tags to search engines</li>
55
- <li>Set response code to search engines</li>
56
  <li>Insert Google Analytics Code</li>
57
  <li>Insert Custom CSS</li>
58
  <li>Uses HTML5 & CSS3</li>
59
  <li>Extandable by downloadable Themes.</li>
60
- <li>Translation Ready</li>
61
  </ul>
62
 
63
  == Installation ==
@@ -68,7 +63,7 @@ CMP brings premium features for free, no PRO versions! It is very user friendly
68
  <li>Search for 'CMP NiteoThemes'</li>
69
  <li>Click 'Install Now'</li>
70
  <li>Activate the plugin on the Plugin dashboard</li>
71
- <li>To Setup click Settings->CMP Settings and change the settings there</li>
72
  </ul>
73
 
74
  <h3>Upload in WordPress Plugin Dashboard</h3>
@@ -78,23 +73,21 @@ CMP brings premium features for free, no PRO versions! It is very user friendly
78
  <li>Download <code>cmp-coming-soon-maintenance.zip</code> and select <code>cmp-coming-soon-maintenance.zip</code> from your directory</li>
79
  <li>Click 'Install Now'</li>
80
  <li>Activate the plugin in the Plugin dashboard</li>
81
- <li>To Setup click Settings->CMP Settings and change the settings there</li>
82
  </ul>
83
 
84
  <h3>FTP Upload</h3>
85
  <ul>
86
- <li>Navigate to the 'Add New' in the plugins dashboard</li>
87
- <li>Navigate to the 'Upload' area</li>
88
  <li>Download <code>cmp-coming-soon-maintenance.zip</code> and extract the <code>cmp-coming-soon-maintenance.zip</code> zip file to your computer</li>
89
  <li>Upload the extracted <code>cmp-coming-soon-maintenance</code> directory to the <code>/wp-content/plugins/</code> directory</li>
90
  <li>Activate the plugin in the Plugin dashboard</li>
91
- <li>To Setup click Settings->CMP Settings and change the settings there</li>
92
  </ul>
93
 
94
 
95
  == Frequently Asked Questions ==
96
- <h4>I can't see the landing page I`ve just created!</h4>
97
- <p>As long as you're logged in as admin, you cannot see it. That`s what this plugin does! It displays Maintenance or Landing page only to non-logged or non-admin logged visitors of your page. By this way you can work on your real website and display different page to your visitors. You can preview the page by clicking on "preview" tab, loggout from Wordpress or access your website from different browser.</p>
98
 
99
  <h4>503 or 200 HTTP codes, huh?</h4>
100
  <p>OK, it`s easy - if you want to display Coming Soon page you usually wants to search and crawling engines (like Google) to be able to index your website. In that case you need to response with 200 HTTP "OK" - set Coming Soon mode.</p>
@@ -108,11 +101,21 @@ CMP brings premium features for free, no PRO versions! It is very user friendly
108
 
109
 
110
  <h4>I really like your plugin and I want to support it!</h4>
111
- <p>Everyone loves supports and great feedback! If you find our plugin helpful, you can go to wordpress.org and rate it! Also you can buy us a beer if you want via donate link (beer in Prague is pretty cheap tho!:) )</p>
112
 
113
 
114
 
115
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
116
  <h4>1.12.0</h4>
117
  <h3>**IMPORTANT NOTICE**</h3>
118
  <p>Once you update to new CMP version 1.12.0 you must also update your Premium themes (if you have any) due to compatibility issues!</p>
4
  Tags: under construction, construction page, maintenance mode, landing page, launch page, launching, security, coming soon, customizable, offline, offline page, unavailable, free, unsplash, subscribe form
5
  Requires at least: 3.0
6
  Tested up to: 4.8
7
+ Stable tag: 1.13.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ The only coming soon plugin with premium features for free. No PRO versions. Select design from predefined themes, fullscreen background, insert any custom content (including logo, social icons, subscribe forms, and many more).
12
 
13
 
14
  == Description ==
16
  CMP brings premium features for free, no PRO versions! It is very user friendly plugin to create and customize your own Coming Soon, Maintenance or landing page. Select a Theme from our predefined templates, setup custom logo, background graphics (including videos), custom content, subscribe forms, your social networks icons, fonts and colors, SEO, and many more.
17
 
18
  <h3>Live Preview</h3>
19
+ <a href="http://cmp.niteothemes.com/?cmp_preview=true&selector=true&utm_source=wp&utm_medium=referral" target="_blank">Click for CMP preview>></a>
20
+
21
+ <p>TIP! You can change to different theme or change the theme`s background in expanding right sidebar by clicking "settings icon".</p>
 
 
 
 
 
22
 
23
  == Screenshots ==
24
  1. CMP - Coming Soon Plugin
42
  <li>Fully responsive and Retina ready</li>
43
  <li>Customize Logo, Fonts and Colors</li>
44
  <li>Setup custom Social Icons</li>
45
+ <li>Predefined subscribe form to store emails in custom database with export to CSV or you can use any 3rd party plugin(Mailchimp, CF7, etc)</li>
46
+ <li>Select and display random beautiful images from <a href="http://unsplash.com" target="_blank">Unsplash source</a> with built-in search API or use custom photos</li>
47
+ <li>Fullscreen background options includes videos (YouTube, custom file video), images (Unsplash library, custom images), Patterns, color Gradients or solid Colors</li>
48
+ <li>Customize SEO meta tags to search engines and editable favicon</li>
49
+ <li>Set response code to search engines (200, 503)</li>
50
+ <li>Redirect Mode to redirect your website to another with predefined timer</li>
51
  <li>Insert Google Analytics Code</li>
52
  <li>Insert Custom CSS</li>
53
  <li>Uses HTML5 & CSS3</li>
54
  <li>Extandable by downloadable Themes.</li>
55
+ <li>Fully translatable</li>
56
  </ul>
57
 
58
  == Installation ==
63
  <li>Search for 'CMP NiteoThemes'</li>
64
  <li>Click 'Install Now'</li>
65
  <li>Activate the plugin on the Plugin dashboard</li>
66
+ <li>To Setup click CMP Settings and change the settings there</li>
67
  </ul>
68
 
69
  <h3>Upload in WordPress Plugin Dashboard</h3>
73
  <li>Download <code>cmp-coming-soon-maintenance.zip</code> and select <code>cmp-coming-soon-maintenance.zip</code> from your directory</li>
74
  <li>Click 'Install Now'</li>
75
  <li>Activate the plugin in the Plugin dashboard</li>
76
+ <li>To Setup click CMP Settings and change the settings there</li>
77
  </ul>
78
 
79
  <h3>FTP Upload</h3>
80
  <ul>
 
 
81
  <li>Download <code>cmp-coming-soon-maintenance.zip</code> and extract the <code>cmp-coming-soon-maintenance.zip</code> zip file to your computer</li>
82
  <li>Upload the extracted <code>cmp-coming-soon-maintenance</code> directory to the <code>/wp-content/plugins/</code> directory</li>
83
  <li>Activate the plugin in the Plugin dashboard</li>
84
+ <li>To Setup click CMP Settings and change the settings there</li>
85
  </ul>
86
 
87
 
88
  == Frequently Asked Questions ==
89
+ <h4>I can't see the landing page I`ve just activated!</h4>
90
+ <p>As long as you're logged in as admin, you cannot see it. That`s the purpose of our plugin - it displays Maintenance or Landing page only to non-logged or non-admin logged visitors of your page. By this way you can work on your real website and display different page to your visitors. You can preview the page by clicking on "preview" tab, loggout from Wordpress or access your website from different browser.</p>
91
 
92
  <h4>503 or 200 HTTP codes, huh?</h4>
93
  <p>OK, it`s easy - if you want to display Coming Soon page you usually wants to search and crawling engines (like Google) to be able to index your website. In that case you need to response with 200 HTTP "OK" - set Coming Soon mode.</p>
101
 
102
 
103
  <h4>I really like your plugin and I want to support it!</h4>
104
+ <p>Everyone loves supports and great feedback! If you find our plugin helpful, you can go to wordpress.org and rate it! alternatively you can click on Donate button :)</p>
105
 
106
 
107
 
108
  == Changelog ==
109
+ <h4>1.13.0</h4>
110
+ <ul>
111
+ <li>New Feature: CMP predefined mode (Coming Soon, Maintenance or Redirect) can be activated / deactivated via quick icon in Admin menu bar (even when visiting your site if you are logged in!).</li>
112
+ <li>Fixed issue: Contruct Theme parallax scrolling did not work correctly after last update.</li>
113
+ <li>Fixed issues: Revisited all themes CSSs - some of them had rendering issues in FF (especially Construct Theme). Thanks @samuele81 for addressing the issue!</li>
114
+ <li>Added SoundCloud to social icon list as requested by @samuele81.</li>
115
+ <li>Theme enhancement: revisited Countdown Theme for more modern design.</li>
116
+ <li>Few minor graphic changes in CMP UI Settings.</li>
117
+ </ul>
118
+
119
  <h4>1.12.0</h4>
120
  <h3>**IMPORTANT NOTICE**</h3>
121
  <p>Once you update to new CMP version 1.12.0 you must also update your Premium themes (if you have any) due to compatibility issues!</p>
themes/construct/paraxify.min.js CHANGED
@@ -1,3 +1,146 @@
1
- (function(){!function(e,t){"use strict";var i;i=function(i,o){var s,n,h,r,f,g,c;return g=0,c=0,h=0,r={},f=[],n=0,s=function(t,i){this.options={speed:1,boost:0};for(h in i)this.options[h]=i[h];if((this.options.speed<0||this.options.speed>1)&&(this.options.speed=1),t||(t="paraxify"),e.getElementsByClassName(t.replace(".","")))this.photos=e.getElementsByClassName(t.replace(".",""));else{if(e.querySelector(t)===!1)throw new Error("The elements you're trying to select don't exist.");this.photos=querySelector(t)}r=this.options,f=this.photos,this._init(this)},s.prototype={update:function(){for(c=t.innerHeight,h=0;h<f.length;)f[h].style.backgroundPosition="center center",f[h].url=t.getComputedStyle(f[h],!1).backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi,"$2").split(",")[0],f[h].img||(f[h].img=new Image),f[h].url!==f[h].img.src&&(this._check(h),f[h].img.src=f[h].url),h++;this._animate()},_init:function(){this.update(),t.onscroll=function(){this._animate()}.bind(this),t.onresize=function(){this.update()}.bind(this)},_imgReady:function(e){var i;if(i=c,""===e.bgSize||"auto"===e.bgSize){if(this.height<e.offsetHeight)throw e.ok=!1,new Error("The image "+e.url+" ("+this.height+"px) is too short for that container ("+e.offsetHeight+"px).");i=this.height,this.height<c&&(i+=(c-e.offsetHeight)*r.speed)}else if("cover"===e.bgSize){if(c<e.offsetHeight)throw e.ok=!1,new Error("The container ("+e.offsetHeight+"px) can't be bigger than the image ("+c+"px).")}else"cover"===t.getComputedStyle(e,!1).backgroundSize,this._check(h);e.diff=-(i-e.offsetHeight)*r.speed,e.diff=e.diff-e.offsetHeight*r.boost},_check:function(e){var i,o;o=f[e],o.ok=!0,o.bgSize=t.getComputedStyle(o,!1).backgroundSize,i=c,f[e].img.complete?this._imgReady(o):f[e].img.onload=this._imgReady(o)},_visible:function(e){return g+c>f[e].offsetTop&&g<f[e].offsetTop+f[e].offsetHeight?!0:!1},_animate:function(){var i,o;for(g=void 0!==t.pageYOffset?t.pageYOffset:(e.documentElement||e.body.parentNode||e.body).scrollTop,h=0;h<f.length;)this._check(h),f[h].ok&&"fixed"===t.getComputedStyle(f[h],!1).backgroundAttachment&&this._visible(h)?(i=(g-f[h].offsetTop+c)/(f[h].offsetHeight+c),o=f[h].diff*(i-.5),"cover"!==f[h].bgSize&&(o+=(c-f[h].img.height)/2),o=Math.round(100*o)/100):o="center",f[h].style.backgroundPosition="center "+o+"px",h++}},new s(i,o)},t.paraxify=i}(document,window,0)}).call(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  // run paraxify
3
- myParaxify = paraxify('.banner');
 
 
 
1
+ // Generated by CoffeeScript 1.7.1
2
+
3
+ /*
4
+ Paraxify.js - v0.1
5
+ @author Jaime Caballero
6
+ MIT license
7
+ */
8
+ (function(document, window, index) {
9
+ "use strict";
10
+ var paraxify;
11
+ paraxify = function(el, options) {
12
+ var Paraxify, contador, i, opt, pho, posY, screenY;
13
+ posY = 0;
14
+ screenY = 0;
15
+ i = 0;
16
+ opt = {};
17
+ pho = [];
18
+ contador = 0;
19
+ Paraxify = function(el, options) {
20
+ this.options = {
21
+ speed: 1,
22
+ boost: 0
23
+ };
24
+ for (i in options) {
25
+ this.options[i] = options[i];
26
+ }
27
+ if (this.options.speed < 0 || this.options.speed > 1) {
28
+ this.options.speed = 1;
29
+ }
30
+ if (!el) {
31
+ el = 'paraxify';
32
+ }
33
+ if (document.getElementsByClassName(el.replace('.', ''))) {
34
+ this.photos = document.getElementsByClassName(el.replace('.', ''));
35
+ } else if (document.querySelector(el) !== false) {
36
+ this.photos = querySelector(el);
37
+ } else {
38
+ throw new Error("The elements you're trying to select don't exist.");
39
+ }
40
+ opt = this.options;
41
+ pho = this.photos;
42
+ this._init(this);
43
+ };
44
+ Paraxify.prototype = {
45
+ update: function() {
46
+ screenY = window.innerHeight;
47
+ i = 0;
48
+ while (i < pho.length) {
49
+ pho[i].style.backgroundPosition = "center center";
50
+ pho[i].url = window.getComputedStyle(pho[i], false).backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi, '$2').split(',')[0];
51
+ if (!pho[i].img) {
52
+ pho[i].img = new Image();
53
+ }
54
+ if (pho[i].url !== pho[i].img.src) {
55
+ this._check(i);
56
+ pho[i].img.src = pho[i].url;
57
+ }
58
+ i++;
59
+ }
60
+ this._animate();
61
+ },
62
+ _init: function() {
63
+ this.update();
64
+ console.log(window);
65
+ window.onscroll = (function() {
66
+ this._animate();
67
+
68
+ }).bind(this);
69
+ window.onresize = (function() {
70
+ this.update();
71
+ }).bind(this);
72
+ },
73
+ _check: function(i) {
74
+ var actualHeight, main;
75
+ main = pho[i];
76
+ main.ok = true;
77
+ main.bgSize = window.getComputedStyle(main, false).backgroundSize;
78
+ actualHeight = screenY;
79
+ pho[i].img.onload = function() {
80
+ if (main.bgSize === '' || main.bgSize === 'auto') {
81
+ if (this.height < main.offsetHeight) {
82
+ main.ok = false;
83
+ throw new Error("The image " + main.url + " (" + this.height + "px) is too short for that container (" + main.offsetHeight + "px).");
84
+ } else {
85
+ actualHeight = this.height;
86
+ if (this.height < screenY) {
87
+ actualHeight = actualHeight + ((screenY - main.offsetHeight) * opt.speed);
88
+ }
89
+ }
90
+ } else if (main.bgSize === 'cover') {
91
+ if (screenY < main.offsetHeight) {
92
+ main.ok = false;
93
+ throw new Error("The container (" + main.offsetHeight + "px) can't be bigger than the image (" + screenY + "px).");
94
+ }
95
+ } else {
96
+ window.getComputedStyle(main, false).backgroundSize === 'cover';
97
+ this._check(i);
98
+ }
99
+ main.diff = -(actualHeight - main.offsetHeight) * opt.speed;
100
+ main.diff = main.diff - (main.offsetHeight * opt.boost);
101
+ };
102
+ },
103
+ _visible: function(i) {
104
+ if (((posY + screenY) > pho[i].offsetTop) && (posY < pho[i].offsetTop + pho[i].offsetHeight)) {
105
+ return true;
106
+ }
107
+ return false;
108
+ },
109
+ _animate: function() {
110
+ var per, position;
111
+ if (window.pageYOffset !== void 0) {
112
+ posY = window.pageYOffset;
113
+ } else {
114
+ posY = (document.documentElement || document.body.parentNode || document.body).scrollTop;
115
+ }
116
+
117
+ i = 0;
118
+ while (i < pho.length) {
119
+ this._check(i);
120
+ if (pho[i].ok && window.getComputedStyle(pho[i], false).backgroundAttachment === "fixed" && this._visible(i)) {
121
+ per = (posY - pho[i].offsetTop + screenY) / (pho[i].offsetHeight + screenY);
122
+ position = pho[i].diff * (per - 0.5);
123
+ if (pho[i].bgSize !== 'cover') {
124
+ position = position + ((screenY - pho[i].img.height) / 2);
125
+ }
126
+ position = Math.round(position * 100) / 100;
127
+ } else {
128
+ position = "center";
129
+ }
130
+ pho[i].style.backgroundPosition = "center " + position + "px";
131
+ i++;
132
+ }
133
+ }
134
+ };
135
+ return new Paraxify(el, options);
136
+ };
137
+ window.paraxify = paraxify;
138
+ })(document, window, 0);
139
+
140
+ console.log();
141
+
142
  // run paraxify
143
+ myParaxify = paraxify('.image', {
144
+ speed: 1,
145
+ boost: 0.5
146
+ });
themes/construct/style.css CHANGED
@@ -48,7 +48,7 @@ h1,h2,h3,h4,h5,h6{font-weight: 400;font-size:2em;}
48
  .section-logo {width: 500px;max-width:100%; margin: 0 auto;}
49
  .section-logo img {max-width: 100%;max-height: 300px;}
50
  .section-logo h1 {font-size: 2.5em; text-transform: uppercase;}
51
- .section-banner{padding-top: 30%;height: 0;}
52
  .section-body p{width:70%;max-width: 900px;margin:1em auto;}
53
  .section-social{background-color: #f8f8f8;}
54
  .section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;}
@@ -104,15 +104,24 @@ input[type="text"] {width: calc(100% - 2px);border-radius:5px;}
104
  transition: opacity 1500ms;
105
  }
106
 
107
- @media only screen and (min-width : 1920px) {
108
  .section-banner {
109
- padding-top: 20%;
 
 
 
 
 
 
110
  }
111
  }
112
 
113
 
114
  @media only screen and (max-width : 480px) {
115
  .section:not(.section-banner) {padding: 20px 10px;}
 
 
 
116
  input[type="email"],
117
  input[type="submit"] {line-height: 3em;height: 3em;}
118
  input[type="email"] {width: 70%;}
48
  .section-logo {width: 500px;max-width:100%; margin: 0 auto;}
49
  .section-logo img {max-width: 100%;max-height: 300px;}
50
  .section-logo h1 {font-size: 2.5em; text-transform: uppercase;}
51
+ .section-banner{height: 700px;}
52
  .section-body p{width:70%;max-width: 900px;margin:1em auto;}
53
  .section-social{background-color: #f8f8f8;}
54
  .section-footer{background-color: #2a2829;color:#a3a1a2;padding: 1em;}
104
  transition: opacity 1500ms;
105
  }
106
 
107
+ @media only screen and (max-width : 1920px) {
108
  .section-banner {
109
+ height: 500px;
110
+ }
111
+ }
112
+
113
+ @media only screen and (max-width : 680px) {
114
+ .section-banner {
115
+ height: 400px;
116
  }
117
  }
118
 
119
 
120
  @media only screen and (max-width : 480px) {
121
  .section:not(.section-banner) {padding: 20px 10px;}
122
+ .section-banner {
123
+ height: 250px;
124
+ }
125
  input[type="email"],
126
  input[type="submit"] {line-height: 3em;height: 3em;}
127
  input[type="email"] {width: 70%;}
themes/countdown/style.css CHANGED
@@ -392,12 +392,12 @@ footer {
392
  }
393
 
394
  .logo-wrapper {
395
- padding: 30px 0;
396
  }
397
 
398
  .logo-wrapper img {
399
  max-width: 700px;
400
- max-height: 500px;
401
  }
402
 
403
  .text-logo {
392
  }
393
 
394
  .logo-wrapper {
395
+ padding-top: 30px;
396
  }
397
 
398
  .logo-wrapper img {
399
  max-width: 700px;
400
+ max-height: 270px;
401
  }
402
 
403
  .text-logo {